|
|
@ -55,6 +55,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver { |
|
|
|
final GlobalKey minePageKey = GlobalKey(); |
|
|
|
final GlobalKey minePageKey = GlobalKey(); |
|
|
|
final GlobalKey unionPageKey = GlobalKey(); |
|
|
|
final GlobalKey unionPageKey = GlobalKey(); |
|
|
|
final GlobalKey vipPageKey = GlobalKey(); |
|
|
|
final GlobalKey vipPageKey = GlobalKey(); |
|
|
|
|
|
|
|
|
|
|
|
// List<String> iconn; |
|
|
|
// List<String> iconn; |
|
|
|
ApiService apiService; |
|
|
|
ApiService apiService; |
|
|
|
int lastTime = DateTime.now().millisecondsSinceEpoch; |
|
|
|
int lastTime = DateTime.now().millisecondsSinceEpoch; |
|
|
@ -73,11 +74,11 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver { |
|
|
|
break; |
|
|
|
break; |
|
|
|
case AppLifecycleState.resumed: //从后台切换前台,界面可见 |
|
|
|
case AppLifecycleState.resumed: //从后台切换前台,界面可见 |
|
|
|
pushRoute(); |
|
|
|
pushRoute(); |
|
|
|
if(DateTime.now().millisecondsSinceEpoch - lastTime > 420000) |
|
|
|
if (DateTime.now().millisecondsSinceEpoch - lastTime > 420000) |
|
|
|
Navigator.of(context).popAndPushNamed('/router/start_page'); |
|
|
|
Navigator.of(context).popAndPushNamed('/router/start_page'); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case AppLifecycleState.paused: // 界面不可见,后台 |
|
|
|
case AppLifecycleState.paused: // 界面不可见,后台 |
|
|
|
lastTime = DateTime.now().millisecondsSinceEpoch; |
|
|
|
lastTime = DateTime.now().millisecondsSinceEpoch; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case AppLifecycleState.detached: // APP结束时调用 |
|
|
|
case AppLifecycleState.detached: // APP结束时调用 |
|
|
|
break; |
|
|
|
break; |
|
|
@ -87,8 +88,12 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver { |
|
|
|
@override |
|
|
|
@override |
|
|
|
void initState() { |
|
|
|
void initState() { |
|
|
|
super.initState(); |
|
|
|
super.initState(); |
|
|
|
pageController = PageController(initialPage: widget.arguments != null && widget.arguments["index"] != null ? widget.arguments["index"]:0); |
|
|
|
pageController = PageController( |
|
|
|
if(widget.arguments != null && widget.arguments["index"] != null) |
|
|
|
initialPage: |
|
|
|
|
|
|
|
widget.arguments != null && widget.arguments["index"] != null |
|
|
|
|
|
|
|
? widget.arguments["index"] |
|
|
|
|
|
|
|
: 0); |
|
|
|
|
|
|
|
if (widget.arguments != null && widget.arguments["index"] != null) |
|
|
|
clickIndex = widget.arguments["index"]; |
|
|
|
clickIndex = widget.arguments["index"]; |
|
|
|
WidgetsBinding.instance.addObserver(this); |
|
|
|
WidgetsBinding.instance.addObserver(this); |
|
|
|
EasyLoading.instance |
|
|
|
EasyLoading.instance |
|
|
@ -103,7 +108,6 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver { |
|
|
|
..userInteractions = false |
|
|
|
..userInteractions = false |
|
|
|
..dismissOnTap = false; |
|
|
|
..dismissOnTap = false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
initSdk(); |
|
|
|
initSdk(); |
|
|
|
|
|
|
|
|
|
|
|
pushRoute(); |
|
|
|
pushRoute(); |
|
|
@ -112,32 +116,43 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver { |
|
|
|
var interviewCouponList; |
|
|
|
var interviewCouponList; |
|
|
|
var firstLoginCouponList; |
|
|
|
var firstLoginCouponList; |
|
|
|
|
|
|
|
|
|
|
|
if(widget.arguments != null && (widget.arguments["invite"]??"") != "" |
|
|
|
if (widget.arguments != null && |
|
|
|
&& widget.arguments["interviewCouponList"] != null ){ |
|
|
|
(widget.arguments["invite"] ?? "") != "" && |
|
|
|
|
|
|
|
widget.arguments["interviewCouponList"] != null) { |
|
|
|
invite = widget.arguments["invite"]; |
|
|
|
invite = widget.arguments["invite"]; |
|
|
|
interviewCouponList = widget.arguments["interviewCouponList"]; |
|
|
|
interviewCouponList = widget.arguments["interviewCouponList"]; |
|
|
|
} |
|
|
|
} |
|
|
|
if(widget.arguments != null && widget.arguments["firstLoginCouponList"] != null ){ |
|
|
|
if (widget.arguments != null && |
|
|
|
|
|
|
|
widget.arguments["firstLoginCouponList"] != null) { |
|
|
|
firstLoginCouponList = widget.arguments["firstLoginCouponList"]; |
|
|
|
firstLoginCouponList = widget.arguments["firstLoginCouponList"]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
_widgetOptions = <Widget>[ |
|
|
|
_widgetOptions = <Widget>[ |
|
|
|
// BrandPage(), |
|
|
|
// BrandPage(), |
|
|
|
HomePage(homePageKey,(index,jpIndex) { |
|
|
|
HomePage( |
|
|
|
if(index == 1){ |
|
|
|
homePageKey, |
|
|
|
if(unionPageKey?.currentState != null) { |
|
|
|
(index, jpIndex) { |
|
|
|
UnionPageState state = unionPageKey.currentState; |
|
|
|
if (index == 1) { |
|
|
|
state.jumpIndex(jpIndex); |
|
|
|
if (unionPageKey?.currentState != null) { |
|
|
|
}else _widgetOptions[1] = UnionPage(unionPageKey,jpIndex); |
|
|
|
UnionPageState state = unionPageKey.currentState; |
|
|
|
} |
|
|
|
state.jumpIndex(jpIndex); |
|
|
|
setState(() { |
|
|
|
} else |
|
|
|
pageController.jumpToPage(index); |
|
|
|
_widgetOptions[1] = UnionPage(unionPageKey, jpIndex); |
|
|
|
}); |
|
|
|
} |
|
|
|
},invite:invite,interviewCouponList:interviewCouponList,firstLoginCouponList:firstLoginCouponList,), |
|
|
|
setState(() { |
|
|
|
|
|
|
|
pageController.jumpToPage(index); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
invite: invite, |
|
|
|
|
|
|
|
interviewCouponList: interviewCouponList, |
|
|
|
|
|
|
|
firstLoginCouponList: firstLoginCouponList, |
|
|
|
|
|
|
|
), |
|
|
|
// MainHomePage(), |
|
|
|
// MainHomePage(), |
|
|
|
UnionPage(unionPageKey,0), |
|
|
|
UnionPage(unionPageKey, 0), |
|
|
|
VipPage(vipPageKey), |
|
|
|
VipPage(vipPageKey), |
|
|
|
Platform.isAndroid ? (ExamineInstance.instance.isExamine?OrderPage():CommunityPage()) :CommunityPage(), |
|
|
|
Platform.isAndroid |
|
|
|
|
|
|
|
? (ExamineInstance.instance.isExamine ? OrderPage() : CommunityPage()) |
|
|
|
|
|
|
|
: CommunityPage(), |
|
|
|
// CommunityPage(), |
|
|
|
// CommunityPage(), |
|
|
|
MinePage(minePageKey), |
|
|
|
MinePage(minePageKey), |
|
|
|
]; |
|
|
|
]; |
|
|
@ -167,9 +182,12 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver { |
|
|
|
///App自动更新 |
|
|
|
///App自动更新 |
|
|
|
appAutoUpdate(); |
|
|
|
appAutoUpdate(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
final XgFlutterPlugin xgFlutterPlugin = XgFlutterPlugin(); |
|
|
|
final XgFlutterPlugin xgFlutterPlugin = XgFlutterPlugin(); |
|
|
|
|
|
|
|
|
|
|
|
initSdk() async { |
|
|
|
initSdk() async { |
|
|
|
xgFlutterPlugin.stopXg(); |
|
|
|
xgFlutterPlugin.stopXg(); |
|
|
|
|
|
|
|
|
|
|
|
///ios 调用startXg前需要调用此方法 |
|
|
|
///ios 调用startXg前需要调用此方法 |
|
|
|
xgFlutterPlugin.configureClusterDomainName("tpns.sh.tencent.com"); |
|
|
|
xgFlutterPlugin.configureClusterDomainName("tpns.sh.tencent.com"); |
|
|
|
xgFlutterPlugin.setEnableDebug(true); |
|
|
|
xgFlutterPlugin.setEnableDebug(true); |
|
|
@ -217,7 +235,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver { |
|
|
|
if (Platform.isAndroid) { |
|
|
|
if (Platform.isAndroid) { |
|
|
|
xgFlutterPlugin.getXgAndroidApi().addNativeEventHandler( |
|
|
|
xgFlutterPlugin.getXgAndroidApi().addNativeEventHandler( |
|
|
|
MyNativeEventHandler( |
|
|
|
MyNativeEventHandler( |
|
|
|
(String title, String message, String customContent, int type) { |
|
|
|
(String title, String message, String customContent, int type) { |
|
|
|
print("xgPushClickAction2: $customContent"); |
|
|
|
print("xgPushClickAction2: $customContent"); |
|
|
|
SharedPreferences.getInstance().then((value) { |
|
|
|
SharedPreferences.getInstance().then((value) { |
|
|
|
value.setString("pushData", customContent); |
|
|
|
value.setString("pushData", customContent); |
|
|
@ -234,7 +252,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver { |
|
|
|
if (Platform.isAndroid |
|
|
|
if (Platform.isAndroid |
|
|
|
? (event["actionType"] == 0) |
|
|
|
? (event["actionType"] == 0) |
|
|
|
: (event["xg"]["msgtype"] == 1) && |
|
|
|
: (event["xg"]["msgtype"] == 1) && |
|
|
|
event[Platform.isAndroid ? "customMessage" : "custom"] != null) { |
|
|
|
event[Platform.isAndroid ? "customMessage" : "custom"] != null) { |
|
|
|
SharedPreferences.getInstance().then((value) { |
|
|
|
SharedPreferences.getInstance().then((value) { |
|
|
|
value.setString("pushData", |
|
|
|
value.setString("pushData", |
|
|
|
event[Platform.isAndroid ? "customMessage" : "custom"]); |
|
|
|
event[Platform.isAndroid ? "customMessage" : "custom"]); |
|
|
@ -249,15 +267,15 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver { |
|
|
|
} |
|
|
|
} |
|
|
|
return event; |
|
|
|
return event; |
|
|
|
}, onReceiveNotificationResponse: (event) async { |
|
|
|
}, onReceiveNotificationResponse: (event) async { |
|
|
|
try{ |
|
|
|
try { |
|
|
|
if(jsonDecode(event["customMessage"])["typed"] == 6){ |
|
|
|
if (jsonDecode(event["customMessage"])["typed"] == 6) { |
|
|
|
// HomePageState state = homePageKey.currentState; |
|
|
|
// HomePageState state = homePageKey.currentState; |
|
|
|
// state.queryMsgStats(); |
|
|
|
// state.queryMsgStats(); |
|
|
|
|
|
|
|
|
|
|
|
MinePageState state = minePageKey.currentState; |
|
|
|
MinePageState state = minePageKey.currentState; |
|
|
|
state.queryMsgStats(); |
|
|
|
state.queryMsgStats(); |
|
|
|
} |
|
|
|
} |
|
|
|
}catch(ex){} |
|
|
|
} catch (ex) {} |
|
|
|
print("onReceiveNotificationResponse: ${event.toString()}"); |
|
|
|
print("onReceiveNotificationResponse: ${event.toString()}"); |
|
|
|
return event; |
|
|
|
return event; |
|
|
|
}, onReceiveMessage: (event) async { |
|
|
|
}, onReceiveMessage: (event) async { |
|
|
@ -277,7 +295,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver { |
|
|
|
if (sharedPreferences.getString("token") == null || |
|
|
|
if (sharedPreferences.getString("token") == null || |
|
|
|
sharedPreferences.getString("token") == "") return; |
|
|
|
sharedPreferences.getString("token") == "") return; |
|
|
|
String startIntent; |
|
|
|
String startIntent; |
|
|
|
if(Platform.isAndroid) startIntent= await Bridge.getStartIntent(); |
|
|
|
if (Platform.isAndroid) startIntent = await Bridge.getStartIntent(); |
|
|
|
print("intent:$startIntent"); |
|
|
|
print("intent:$startIntent"); |
|
|
|
String pushData = ""; |
|
|
|
String pushData = ""; |
|
|
|
if (startIntent != null && startIntent != "") { |
|
|
|
if (startIntent != null && startIntent != "") { |
|
|
@ -292,37 +310,45 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver { |
|
|
|
String routeName = ""; |
|
|
|
String routeName = ""; |
|
|
|
Map<String, dynamic> params = {}; |
|
|
|
Map<String, dynamic> params = {}; |
|
|
|
switch (pushMap["typed"].toString()) { |
|
|
|
switch (pushMap["typed"].toString()) { |
|
|
|
case "1":case "ARTICLE": |
|
|
|
case "1": |
|
|
|
|
|
|
|
case "ARTICLE": |
|
|
|
routeName = "/router/web_page"; |
|
|
|
routeName = "/router/web_page"; |
|
|
|
params["articleId"] = pushMap["info"]; |
|
|
|
params["articleId"] = pushMap["info"]; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case "2":case "ACTIVITY": |
|
|
|
case "2": |
|
|
|
|
|
|
|
case "ACTIVITY": |
|
|
|
routeName = "/router/web_page"; |
|
|
|
routeName = "/router/web_page"; |
|
|
|
params["activityId"] = pushMap["info"]; |
|
|
|
params["activityId"] = pushMap["info"]; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case "3":case "SHOP": |
|
|
|
case "3": |
|
|
|
|
|
|
|
case "SHOP": |
|
|
|
routeName = "/router/store_order"; |
|
|
|
routeName = "/router/store_order"; |
|
|
|
params["id"] = pushMap["info"]; |
|
|
|
params["id"] = pushMap["info"]; |
|
|
|
params["tenant"] = pushMap["tenant"]; |
|
|
|
params["tenant"] = pushMap["tenant"]; |
|
|
|
params["storeName"] = pushMap["storeName"]; |
|
|
|
params["storeName"] = pushMap["storeName"]; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case "4":case "CREDIT_GOODS": |
|
|
|
case "4": |
|
|
|
|
|
|
|
case "CREDIT_GOODS": |
|
|
|
routeName = "/router/integral_store_page"; |
|
|
|
routeName = "/router/integral_store_page"; |
|
|
|
params["goodsId"] = pushMap["info"]; |
|
|
|
params["goodsId"] = pushMap["info"]; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case "5":case "ORDER": |
|
|
|
case "5": |
|
|
|
|
|
|
|
case "ORDER": |
|
|
|
routeName = "/router/order_details"; |
|
|
|
routeName = "/router/order_details"; |
|
|
|
params["id"] = pushMap["info"]; |
|
|
|
params["id"] = pushMap["info"]; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case "6":case "MEMBER": |
|
|
|
case "6": |
|
|
|
|
|
|
|
case "MEMBER": |
|
|
|
routeName = "/router/community_details"; |
|
|
|
routeName = "/router/community_details"; |
|
|
|
params["businessId"] = pushMap["info"]; |
|
|
|
params["businessId"] = pushMap["info"]; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case "8":case "WALLET": |
|
|
|
case "8": |
|
|
|
|
|
|
|
case "WALLET": |
|
|
|
routeName = "/router/mine_wallet"; |
|
|
|
routeName = "/router/mine_wallet"; |
|
|
|
params["id"] = pushMap["info"]; |
|
|
|
params["id"] = pushMap["info"]; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case "9":case "WELFARE": |
|
|
|
case "9": |
|
|
|
|
|
|
|
case "WELFARE": |
|
|
|
routeName = "/router/welfare_page"; |
|
|
|
routeName = "/router/welfare_page"; |
|
|
|
params["id"] = pushMap["info"]; |
|
|
|
params["id"] = pushMap["info"]; |
|
|
|
break; |
|
|
|
break; |
|
|
@ -366,35 +392,37 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver { |
|
|
|
SharedPreferences value = await SharedPreferences.getInstance(); |
|
|
|
SharedPreferences value = await SharedPreferences.getInstance(); |
|
|
|
if (apiService == null) { |
|
|
|
if (apiService == null) { |
|
|
|
apiService = ApiService( |
|
|
|
apiService = ApiService( |
|
|
|
Dio(), |
|
|
|
Dio(), |
|
|
|
context: context, |
|
|
|
context: context, |
|
|
|
token: value.getString("token"), |
|
|
|
token: value.getString("token"), |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
PackageInfo packageInfo = await PackageInfo.fromPlatform(); |
|
|
|
PackageInfo packageInfo = await PackageInfo.fromPlatform(); |
|
|
|
BaseData<AppUpdate> baseData = await apiService.appVersion().catchError((onError) {}); |
|
|
|
BaseData<AppUpdate> baseData = |
|
|
|
|
|
|
|
await apiService.appVersion().catchError((onError) {}); |
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
// baseData.data.appLastVersion = "2.0.17"; |
|
|
|
// baseData.data.appLastVersion = "2.0.17"; |
|
|
|
// baseData.data.appLastVersionUp = "1.0.1"; |
|
|
|
// baseData.data.appLastVersionUp = "1.0.1"; |
|
|
|
if(AppUtils.versionCompare(packageInfo.version,baseData.data?.appLastVersion) |
|
|
|
if (AppUtils.versionCompare( |
|
|
|
&& AppUtils.versionCompare(value.getString("appLastVersion")??"1.0.0",baseData.data?.appLastVersion)){ |
|
|
|
packageInfo.version, baseData.data?.appLastVersion) && |
|
|
|
|
|
|
|
AppUtils.versionCompare(value.getString("appLastVersion") ?? "1.0.0", |
|
|
|
|
|
|
|
baseData.data?.appLastVersion)) { |
|
|
|
showDialog( |
|
|
|
showDialog( |
|
|
|
context: context, |
|
|
|
context: context, |
|
|
|
barrierDismissible: false, |
|
|
|
barrierDismissible: false, |
|
|
|
builder: (BuildContext context) { |
|
|
|
builder: (BuildContext context) { |
|
|
|
return WillPopScope( |
|
|
|
return WillPopScope( |
|
|
|
child:UpdateDialog(packageInfo.version,baseData.data), |
|
|
|
child: UpdateDialog(packageInfo.version, baseData.data), |
|
|
|
onWillPop: () async { |
|
|
|
onWillPop: () async { |
|
|
|
return Future.value(false); |
|
|
|
return Future.value(false); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
); |
|
|
|
); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
SmartDialog.showToast(baseData.msg, |
|
|
|
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); |
|
|
|
alignment: Alignment.center); |
|
|
|
|
|
|
|
Navigator.of(context).pop(); |
|
|
|
Navigator.of(context).pop(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -443,7 +471,13 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver { |
|
|
|
bottomNavigationItem(S.of(context).main_menu2, 1), |
|
|
|
bottomNavigationItem(S.of(context).main_menu2, 1), |
|
|
|
// bottomNavigationItem(S.of(context).main_menu3 , 2), |
|
|
|
// bottomNavigationItem(S.of(context).main_menu3 , 2), |
|
|
|
bottomNavigationItem(S.of(context).main_menu5, 2), |
|
|
|
bottomNavigationItem(S.of(context).main_menu5, 2), |
|
|
|
bottomNavigationItem(Platform.isAndroid ? (ExamineInstance.instance.isExamine?"订单":S.of(context).main_menu3) :S.of(context).main_menu3, 3), |
|
|
|
bottomNavigationItem( |
|
|
|
|
|
|
|
Platform.isAndroid |
|
|
|
|
|
|
|
? (ExamineInstance.instance.isExamine |
|
|
|
|
|
|
|
? "订单" |
|
|
|
|
|
|
|
: S.of(context).main_menu3) |
|
|
|
|
|
|
|
: S.of(context).main_menu3, |
|
|
|
|
|
|
|
3), |
|
|
|
bottomNavigationItem(S.of(context).main_menu4, 4), |
|
|
|
bottomNavigationItem(S.of(context).main_menu4, 4), |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
@ -525,72 +559,72 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver { |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Widget bottomNavigationBigItem(text, index) { |
|
|
|
// Widget bottomNavigationBigItem(text, index) { |
|
|
|
// var isSelected = index == clickIndex; |
|
|
|
// var isSelected = index == clickIndex; |
|
|
|
// return Expanded( |
|
|
|
// return Expanded( |
|
|
|
// child: InkWell( |
|
|
|
// child: InkWell( |
|
|
|
// onTap: () { |
|
|
|
// onTap: () { |
|
|
|
// setState(() { |
|
|
|
// setState(() { |
|
|
|
// clickIndex = index; |
|
|
|
// clickIndex = index; |
|
|
|
// pageController.jumpToPage(clickIndex); |
|
|
|
// pageController.jumpToPage(clickIndex); |
|
|
|
// }); |
|
|
|
// }); |
|
|
|
// }, |
|
|
|
// }, |
|
|
|
// child: Container( |
|
|
|
// child: Container( |
|
|
|
// width: 45.w, |
|
|
|
// width: 45.w, |
|
|
|
// alignment: Alignment.center, |
|
|
|
// alignment: Alignment.center, |
|
|
|
// child: AnimatedCrossFade( |
|
|
|
// child: AnimatedCrossFade( |
|
|
|
// firstCurve: Curves.easeIn, |
|
|
|
// firstCurve: Curves.easeIn, |
|
|
|
// secondCurve: Curves.ease, |
|
|
|
// secondCurve: Curves.ease, |
|
|
|
// sizeCurve: Curves.easeInOut, |
|
|
|
// sizeCurve: Curves.easeInOut, |
|
|
|
// duration: Duration(milliseconds: 50), |
|
|
|
// duration: Duration(milliseconds: 50), |
|
|
|
// firstChild: Container( |
|
|
|
// firstChild: Container( |
|
|
|
// padding: EdgeInsets.all(4), |
|
|
|
// padding: EdgeInsets.all(4), |
|
|
|
// height: 82.h, |
|
|
|
// height: 82.h, |
|
|
|
// alignment: |
|
|
|
// alignment: |
|
|
|
// Platform.isAndroid ? Alignment.center : Alignment.topCenter, |
|
|
|
// Platform.isAndroid ? Alignment.center : Alignment.topCenter, |
|
|
|
// child: Image.asset( |
|
|
|
// child: Image.asset( |
|
|
|
// icons[index], |
|
|
|
// icons[index], |
|
|
|
// width: 45, |
|
|
|
// width: 45, |
|
|
|
// height: 45, |
|
|
|
// height: 45, |
|
|
|
// fit: BoxFit.contain, |
|
|
|
// fit: BoxFit.contain, |
|
|
|
// ), |
|
|
|
// ), |
|
|
|
// ), |
|
|
|
// ), |
|
|
|
// secondChild: Column( |
|
|
|
// secondChild: Column( |
|
|
|
// mainAxisAlignment: Platform.isAndroid |
|
|
|
// mainAxisAlignment: Platform.isAndroid |
|
|
|
// ? MainAxisAlignment.center |
|
|
|
// ? MainAxisAlignment.center |
|
|
|
// : MainAxisAlignment.start, |
|
|
|
// : MainAxisAlignment.start, |
|
|
|
// crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
// crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
// children: [ |
|
|
|
// children: [ |
|
|
|
// if (Platform.isIOS) |
|
|
|
// if (Platform.isIOS) |
|
|
|
// SizedBox( |
|
|
|
// SizedBox( |
|
|
|
// height: 4.h, |
|
|
|
// height: 4.h, |
|
|
|
// ), |
|
|
|
// ), |
|
|
|
// Image.asset( |
|
|
|
// Image.asset( |
|
|
|
// iconn[index], |
|
|
|
// iconn[index], |
|
|
|
// width: 30, |
|
|
|
// width: 30, |
|
|
|
// height: 30, |
|
|
|
// height: 30, |
|
|
|
// fit: BoxFit.contain, |
|
|
|
// fit: BoxFit.contain, |
|
|
|
// ), |
|
|
|
// ), |
|
|
|
// SizedBox( |
|
|
|
// SizedBox( |
|
|
|
// height: 1.h, |
|
|
|
// height: 1.h, |
|
|
|
// ), |
|
|
|
// ), |
|
|
|
// Text( |
|
|
|
// Text( |
|
|
|
// text, |
|
|
|
// text, |
|
|
|
// style: TextStyle( |
|
|
|
// style: TextStyle( |
|
|
|
// fontSize: 10.sp, |
|
|
|
// fontSize: 10.sp, |
|
|
|
// fontWeight: MyFontWeight.semi_bold, |
|
|
|
// fontWeight: MyFontWeight.semi_bold, |
|
|
|
// color: Color(isSelected ? 0xFF4C4C4C : 0xFFA29E9E), |
|
|
|
// color: Color(isSelected ? 0xFF4C4C4C : 0xFFA29E9E), |
|
|
|
// ), |
|
|
|
// ), |
|
|
|
// ), |
|
|
|
// ), |
|
|
|
// ], |
|
|
|
// ], |
|
|
|
// ), |
|
|
|
// ), |
|
|
|
// crossFadeState: isSelected |
|
|
|
// crossFadeState: isSelected |
|
|
|
// ? CrossFadeState.showFirst |
|
|
|
// ? CrossFadeState.showFirst |
|
|
|
// : CrossFadeState.showSecond, |
|
|
|
// : CrossFadeState.showSecond, |
|
|
|
// ), |
|
|
|
// ), |
|
|
|
// ), |
|
|
|
// ), |
|
|
|
// ), |
|
|
|
// ), |
|
|
|
// flex: 1, |
|
|
|
// flex: 1, |
|
|
|
// ); |
|
|
|
// ); |
|
|
|
// } |
|
|
|
// } |
|
|
|
} |
|
|
|
} |
|
|
|