Browse Source

loading更改;

接口加载更改,还有部分待优化;
new_revision_app
wurong 1 year ago
parent
commit
d82c837282
  1. BIN
      assets/gif/loading_logo.gif
  2. 2
      lib/login/new_login_page.dart
  3. 3
      lib/mine/mine_page.dart
  4. 5
      lib/mine/mine_shop_details.dart
  5. 6
      lib/retrofit/retrofit_api.dart
  6. 2
      lib/setting/account_security_page.dart
  7. 72
      lib/setting/loading_page.dart
  8. 8
      lib/store/store_order.dart
  9. 6
      lib/union/union_page.dart
  10. 1
      lib/vip/vip_page.dart
  11. 3
      pubspec.yaml

BIN
assets/gif/loading_logo.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 KiB

2
lib/login/new_login_page.dart

@ -241,7 +241,7 @@ class _NewLoginPage extends State<NewLoginPage> {
"areaCode": area,
"regChannel":channelName ?? ""
};
EasyLoading.show(status: S.of(context).zhengzaijiazai);
EasyLoading.show();
BaseData value = await apiService.memberLogin(param).catchError((error) {
print(error.message);
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),

3
lib/mine/mine_page.dart

@ -449,7 +449,8 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
return GestureDetector(
onTap: (){
if(position == 0){
Navigator.of(context).pushNamed('/router/invite_friends');
Navigator.of(context).pushNamed('/router/loading_page');
// Navigator.of(context).pushNamed('/router/invite_friends');
}else if(position == 1){
Navigator.of(context).pushNamed('/router/trading_card_page');
}

5
lib/mine/mine_shop_details.dart

@ -511,13 +511,14 @@ class _MineShopDetails extends State<MineShopDetails> {
),
),
),
if(S.of(context).mi(((store.distance ?? 0) * 100).toInt() / 100.0) != "0.0米")
Text(
(store.distance ?? 0) > 1000
((store.distance ?? 0) > 1000
? S.of(context).gongli(
((store.distance ?? 0) / 1000 * 100).toInt() / 100.0)
: S
.of(context)
.mi(((store.distance ?? 0) * 100).toInt() / 100.0),
.mi(((store.distance ?? 0) * 100).toInt() / 100.0)),
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,

6
lib/retrofit/retrofit_api.dart

@ -99,7 +99,11 @@ abstract class ApiService {
debugPrint("headers = ${options.headers}");
if (showLoading && !EasyLoading.isShow) {
//loading
EasyLoading.show(status: S.of(context).zhengzaijiazai);
EasyLoading.show(indicator:Image.asset(
"assets/gif/loading_logo.gif",
width: 150,
height: 150,
));
}
if (options.data is FormData) {
debugPrint("params data = FormData");

2
lib/setting/account_security_page.dart

@ -26,7 +26,7 @@ class _AccountSecurityPage extends State<AccountSecurityPage> {
@override
void initState() {
super.initState();
EasyLoading.show(status: S.current.zhengzaijiazai);
EasyLoading.show();
SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(),
context: context, token: value.getString("token"),),

72
lib/setting/loading_page.dart

@ -0,0 +1,72 @@
import 'dart:convert';
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/user_info.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shared_preferences/shared_preferences.dart';
class LoadingPage extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _LoadingPage();
}
}
class _LoadingPage extends State<LoadingPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
body: Container(
width: double.infinity,
margin: EdgeInsets.only(top: 100,left: 10),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
GestureDetector(
onTap: (){
EasyLoading.show(indicator:Image.asset(
"assets/gif/loading_logo.gif",
width: 250,
height: 250,
));
Future.delayed(Duration(seconds: 10), () {
EasyLoading.dismiss();
});
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10),
color: Colors.blue,
child: Text("纯图"),
),
),
GestureDetector(
onTap: (){
EasyLoading.show();
Future.delayed(Duration(seconds: 10), () {
EasyLoading.dismiss();
});
},
child: Container(
margin: EdgeInsets.only(top:20),
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10),
color: Colors.blue,
child: Text("图文"),
),
)
],
),
),
);
}
}

8
lib/store/store_order.dart

@ -97,12 +97,12 @@ class _StoreOrderPage extends State<StoreOrderPage>
///
minLogin(SharedPreferences shared) async {
EasyLoading.show(status: S.of(context).zhengzaijiazai);
EasyLoading.show();
apiService = ApiService(
Dio(),
context: context,
token: shared.getString('token'),
showLoading: true,
// showLoading: true,
);
apiService.minLogin(storeId).catchError((onError) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type),
@ -128,7 +128,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
storeId: storeId,
);
EasyLoading.dismiss();
// EasyLoading.dismiss();
queryMemberInfo();
@ -207,7 +207,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
setState(() {});
}
}
EasyLoading.dismiss();
// EasyLoading.dismiss();
}
RefreshController refreshController;

6
lib/union/union_page.dart

@ -133,7 +133,7 @@ class UnionPageState extends State<UnionPage>
}
startLocation(bool isOnRefresh) async {
if (!isOnRefresh) EasyLoading.show(status: S.current.zhengzaijiazai);
if (!isOnRefresh) EasyLoading.show();
Location.getInstance().startLocation(context, (BaiduLocation result) {
if (result != null &&
result.latitude != null &&
@ -171,7 +171,7 @@ class UnionPageState extends State<UnionPage>
}
}).then((value) {
if (!value) {
EasyLoading.dismiss();
// EasyLoading.dismiss();
tabRefresh().refreshCompleted();
}
});
@ -289,8 +289,8 @@ class UnionPageState extends State<UnionPage>
} else {
if (index == -1) tabRefresh().refreshFailed();
}
EasyLoading.dismiss();
setState(() {});
EasyLoading.dismiss();
}
TabController tabController;

1
lib/vip/vip_page.dart

@ -88,7 +88,6 @@ class _VipPageState extends State<VipPage> with AutomaticKeepAliveClientMixin {
Dio(),
context: context,
token: value.getString("token"),
showLoading: true
);
}
BaseData<VipCardHome> baseData =

3
pubspec.yaml

@ -88,7 +88,7 @@ dependencies:
sharesdk_plugin: ^1.3.4
flutter_spinkit: ^5.0.0
flutter_easyloading: ^3.0.0
flutter_easyloading: ^3.0.5
rive: ^0.6.8
flare_flutter: ^3.0.2
@ -128,6 +128,7 @@ flutter:
- assets/map_style/
- assets/riv/
- assets/svg/
- assets/gif/
# - assets/fonts/
fonts:

Loading…
Cancel
Save