Browse Source

loading更改

new_revision_app
wurong 1 year ago
parent
commit
b483be8dfc
  1. 118
      lib/main.dart
  2. 11
      lib/main_page.dart

118
lib/main.dart

@ -49,6 +49,7 @@ import 'package:huixiang/setting/about_page.dart';
import 'package:huixiang/setting/account_security_page.dart';
import 'package:huixiang/setting/binding_phone_page.dart';
import 'package:huixiang/setting/help_feedback_page.dart';
import 'package:huixiang/setting/loading_page.dart';
import 'package:huixiang/setting/logout_ing.dart';
import 'package:huixiang/setting/logout_page.dart';
import 'package:huixiang/setting/permission_setting_page.dart';
@ -154,11 +155,10 @@ void main() async {
// final XgFlutterPlugin xgFlutterPlugin = XgFlutterPlugin();
EventBus eventBus = EventBus(sync: true);
Route lastRoutePage;
class MyApp extends StatelessWidget {
final Locale appLocale;
final bool isFirst;
@ -167,6 +167,18 @@ class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
EasyLoading.instance
..indicatorWidget = Image.asset(
"assets/gif/loading_logo.gif",
width: 150,
height: 150,
)
..loadingStyle = EasyLoadingStyle.custom
..progressColor = Colors.black
..backgroundColor = Colors.transparent
..indicatorColor = Colors.black
..textColor = Colors.black
..boxShadow = [];
return MediaQuery(
data: const MediaQueryData(
size: Size(375, 812),
@ -175,7 +187,9 @@ class MyApp extends StatelessWidget {
designSize: Size(375, 812),
builder: () => MaterialApp(
debugShowCheckedModeBanner: false,
title: Platform.isAndroid ? (ExamineInstance.instance.isExamine?"一心回乡":""):"",
title: Platform.isAndroid
? (ExamineInstance.instance.isExamine ? "一心回乡" : "")
: "",
theme: ThemeData(
primarySwatch: Colors.blue,
// fontFamily: 'JDZhengHT',
@ -201,11 +215,14 @@ class MyApp extends StatelessWidget {
print("locale: ${locales[0]}");
Locale locale;
if (locales[0].countryCode == "TW") {
locale = Locale.fromSubtags(languageCode: 'zh', countryCode: 'TW');
locale =
Locale.fromSubtags(languageCode: 'zh', countryCode: 'TW');
} else if (locales[0].countryCode == "US") {
locale = Locale.fromSubtags(languageCode: 'en', countryCode: 'US');
locale =
Locale.fromSubtags(languageCode: 'en', countryCode: 'US');
} else {
locale = Locale.fromSubtags(languageCode: 'zh', countryCode: 'CH');
locale =
Locale.fromSubtags(languageCode: 'zh', countryCode: 'CH');
}
return appLocale ?? locale;
},
@ -226,10 +243,9 @@ class MyApp extends StatelessWidget {
onGenerateRoute: (settings) {
final String name = settings.name;
if (lastRoutePage?.settings?.name == name) {
if(lastRoutePage?.settings?.name == "/router/personal_page"
&& lastRoutePage.navigator != null)
if (lastRoutePage?.settings?.name == "/router/personal_page" &&
lastRoutePage.navigator != null)
lastRoutePage.navigator.pop();
}
final Function pageContentBuilder = routers[name];
if (pageContentBuilder != null) {
@ -323,15 +339,20 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
'/router/new_login_page': (context, {arguments}) =>
NewLoginPage(arguments: arguments),
'/router/edit_name': (context, {arguments}) => EditName(arguments: arguments),
'/router/edit_signature': (context, {arguments}) => EditSignature(arguments: arguments),
'/router/edit_signature': (context, {arguments}) =>
EditSignature(arguments: arguments),
'/router/mine_card_invalid': (context, {arguments}) => MineCardInvalidPage(),
'/router/store_selector_page': (context, {arguments}) => StoreSelectorPage(arguments: arguments,),
'/router/store_selector_page': (context, {arguments}) => StoreSelectorPage(
arguments: arguments,
),
'/router/web_page': (context, {arguments}) => WebPage(arguments: arguments),
'/router/web_turntable_activity': (context, {arguments}) => WebTurntableActivity(),
'/router/web_turntable_activity': (context, {arguments}) =>
WebTurntableActivity(),
'/router/help_feedback_page': (context, {arguments}) => HelpFeedbackPage(),
'/router/founder_story_page': (context, {arguments}) => FounderStoryPage(),
'/router/system_msg_page': (context, {arguments}) => SystemMessagePage(),
'/router/edit_remarks_page': (context, {arguments}) => EditRemarksPage(arguments: arguments),
'/router/edit_remarks_page': (context, {arguments}) =>
EditRemarksPage(arguments: arguments),
// '/router/hot_article_page': (context, {arguments}) => HotArticlePage(),
'/router/address_map_page': (context, {arguments}) => AddressMapPage(),
'/router/roll_center_page': (context, {arguments}) => RollCenterPage(),
@ -357,7 +378,8 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
'/router/main_page': (context, {arguments}) => MainPage(arguments: arguments),
'/router/start_page': (context, {arguments}) => StartPage(),
'/router/test_page': (context, {arguments}) => TestPage(),
'/router/communityFollow': (context, {arguments}) => CommunityFollow(arguments:arguments),
'/router/communityFollow': (context, {arguments}) =>
CommunityFollow(arguments: arguments),
'/router/releasePage': (context, {arguments}) => ReleasePage(),
'/router/activity_list': (context, {arguments}) => ActivityList(),
'/router/class_details': (context, {arguments}) =>
@ -376,40 +398,29 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
PhotoViewGalleryScreen(),
'/router/system_details': (context, {arguments}) =>
SystemDetails(arguments: arguments),
'/router/invitation_record': (context, {arguments}) =>
InvitationRecord(),
'/router/invitation_record': (context, {arguments}) => InvitationRecord(),
'/router/personal_page': (context, {arguments}) =>
PersonalPage(arguments: arguments),
'/router/report_page': (context, {arguments}) =>
ReportPage(arguments: arguments),
'/router/report_notice': (context, {arguments}) =>
ReportNotice(),
'/router/report_success': (context, {arguments}) =>
ReportSuccess(),
'/router/logout_page': (context, {arguments}) =>
LogoutPage(),
'/router/logout_ing': (context, {arguments}) =>
LogoutIng(),
'/router/user_service_page': (context, {arguments}) =>
UserServicePage(),
'/router/welfare_page': (context, {arguments}) =>
WelfarePage(),
'/router/invite_friends': (context, {arguments}) =>
InviteFriends(),
'/router/report_assess': (context, {arguments}) =>
ReportAssess(),
'/router/shop_details_page': (context, {arguments}) =>
ShopDetailsPage(arguments: arguments,),
'/router/mine_greenery': (context, {arguments}) =>
MineGreenery(),
'/router/mine_shop_page': (context, {arguments}) =>
MineShopPage(),
'/router/mine_shop_details': (context, {arguments}) =>
MineShopDetails(arguments:arguments,),
'/router/coupon_page': (context, {arguments}) =>
CouponPage(),
'/router/welfare_exchange': (context, {arguments}) =>
WelfareExchange(),
'/router/report_notice': (context, {arguments}) => ReportNotice(),
'/router/report_success': (context, {arguments}) => ReportSuccess(),
'/router/logout_page': (context, {arguments}) => LogoutPage(),
'/router/logout_ing': (context, {arguments}) => LogoutIng(),
'/router/user_service_page': (context, {arguments}) => UserServicePage(),
'/router/welfare_page': (context, {arguments}) => WelfarePage(),
'/router/invite_friends': (context, {arguments}) => InviteFriends(),
'/router/report_assess': (context, {arguments}) => ReportAssess(),
'/router/shop_details_page': (context, {arguments}) => ShopDetailsPage(
arguments: arguments,
),
'/router/mine_greenery': (context, {arguments}) => MineGreenery(),
'/router/mine_shop_page': (context, {arguments}) => MineShopPage(),
'/router/mine_shop_details': (context, {arguments}) => MineShopDetails(
arguments: arguments,
),
'/router/coupon_page': (context, {arguments}) => CouponPage(),
'/router/welfare_exchange': (context, {arguments}) => WelfareExchange(),
'/router/account_security_page': (context, {arguments}) =>
AccountSecurityPage(),
'/router/platform_code_page': (context, {arguments}) =>
@ -418,26 +429,21 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
PlatformPayCode(arguments: arguments),
'/router/platform_pay_code_success': (context, {arguments}) =>
PlatformPayCodeSuccess(arguments: arguments),
'/router/phone_address_page': (context, {arguments}) =>
PhoneAddressPage(),
'/router/phone_address_page': (context, {arguments}) => PhoneAddressPage(),
'/router/product_meals_sku': (context, {arguments}) =>
ProductMealsSku(arguments: arguments),
'/router/user_vip_service_page': (context, {arguments}) =>
UserVipServicePage(),
'/router/help_farmers_page': (context, {arguments}) =>
HelpFarmersPage(),
'/router/scan_web': (context, {arguments}) =>
ScanWeb(arguments:arguments),
'/router/vip_pay_code': (context, {arguments}) =>
VipPayCode(),
'/router/system_notice': (context, {arguments}) =>
SystemNotice(),
'/router/help_farmers_page': (context, {arguments}) => HelpFarmersPage(),
'/router/scan_web': (context, {arguments}) => ScanWeb(arguments: arguments),
'/router/vip_pay_code': (context, {arguments}) => VipPayCode(),
'/router/system_notice': (context, {arguments}) => SystemNotice(),
'/router/store_html': (context, {arguments}) =>
StoreHtml(arguments: arguments),
'/router/login_store_select': (context, {arguments}) =>
LoginStoreSelect(arguments: arguments),
'/router/binding_phone_page': (context, {arguments}) =>
BindingPhonePage(arguments: arguments),
'/router/trading_card_page': (context, {arguments}) =>
TradingCardPage(),
'/router/trading_card_page': (context, {arguments}) => TradingCardPage(),
'/router/loading_page': (context, {arguments}) => LoadingPage(),
};

11
lib/main_page.dart

@ -101,17 +101,6 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
if (widget.arguments != null && widget.arguments["index"] != null)
clickIndex = widget.arguments["index"];
WidgetsBinding.instance.addObserver(this);
EasyLoading.instance
..indicatorType = EasyLoadingIndicatorType.circle
// ..indicatorType = EasyLoadingIndicatorType.wave
// ..indicatorType = EasyLoadingIndicatorType.threeBounce
..loadingStyle = EasyLoadingStyle.dark
..indicatorSize = 35.0
..backgroundColor = Colors.white
..progressColor = Colors.green
..progressWidth = 3.0
..userInteractions = false
..dismissOnTap = false;
initSdk();
UmengCommonSdk.initCommon('6491509087568a379b5a1345', '6491509087568a379b5a1345', 'Umeng');

Loading…
Cancel
Save