替换跳转方式

hmxc
张萌 4 years ago
parent 664afd6781
commit 7fabd5db14

@ -57,11 +57,11 @@ class _HomePageState extends State<HomePage> {
final userProvider =
Provider.of<UserProvider>(context, listen: false);
if (userProvider.isLogin) {
Get.to(page);
Get.to(() => page);
if (text != '全部应用')
appProvider.addRecentApp(AppApplication(text, assetPath, page));
} else
Get.to(LoginPage());
Get.to(() => LoginPage());
},
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
@ -206,7 +206,7 @@ class _HomePageState extends State<HomePage> {
//
color: Color(0xFFFFFFFF),
onPressed: () {
Get.to(SearchWorkOrderPage());
Get.to(() => SearchWorkOrderPage());
},
radius: 8.w,
child: Row(children: [
@ -242,7 +242,7 @@ class _HomePageState extends State<HomePage> {
minWidth: 78.w,
padding: EdgeInsets.zero,
onPressed: () {
Get.to(ScanPage());
Get.to(() => ScanPage());
},
child: Column(children: [
Image.asset(
@ -269,9 +269,9 @@ class _HomePageState extends State<HomePage> {
height: double.infinity,
onPressed: () {
if (userProvider.isLogin)
Get.to(Message());
Get.to(() => Message());
else
Get.to(LoginPage());
Get.to(() => LoginPage());
},
child: Column(children: [
Image.asset(
@ -296,9 +296,9 @@ class _HomePageState extends State<HomePage> {
GestureDetector(
onTap: () {
if (!userProvider.isLogin)
Get.to(LoginPage());
Get.to(() => LoginPage());
else
Get.to(UserInfoPage());
Get.to(() => UserInfoPage());
},
child: Container(
margin: EdgeInsets.only(
@ -372,7 +372,7 @@ class _HomePageState extends State<HomePage> {
AkuButton(
//
onPressed: () {
Get.to(AllAnouncement());
Get.to(() => AllAnouncement());
},
child: Row(
children: [

@ -162,7 +162,7 @@ class _MessageState extends State<Message> {
'你有一条新的报事报修待处理',
_messageCount,
onpressed: () {
Get.to(SystemMessage());
Get.to(() => SystemMessage());
},
),
Divider(
@ -175,7 +175,7 @@ class _MessageState extends State<Message> {
'你有一条新的评论回复',
_commentCount,
onpressed: () {
Get.to(CommentMessage());
Get.to(() => CommentMessage());
},
),
],

@ -67,8 +67,8 @@ class _PersonalDrawState extends State<PersonalDraw> {
InkWell(
onTap: () {
userProvider.isLogin
? Get.to(UserInfoPage())
: Get.to(LoginPage());
? Get.to(() => UserInfoPage())
: Get.to(() => LoginPage());
},
child: Container(
margin: EdgeInsets.only(bottom: 80.w, top: 40.w),
@ -122,13 +122,13 @@ class _PersonalDrawState extends State<PersonalDraw> {
'个人信息',
onPressed: () {
userProvider.isLogin
? Get.to(UserInfoPage())
: Get.to(LoginPage());
? Get.to(() => UserInfoPage())
: Get.to(() => LoginPage());
},
),
_myListTile(R.ASSETS_USER_IC_KEFU_PNG, '联系客服'),
_myListTile(R.ASSETS_USER_IC_SETUP_PNG, '设置', onPressed: () {
Get.to(SettingsPage());
Get.to(() => SettingsPage());
}),
],
),

@ -156,7 +156,7 @@ class _LoginPageState extends State<LoginPage> {
ExtendedWidgetSpan(
child: GestureDetector(
onTap: () {
Get.to(AgreementPage());
Get.to(() => AgreementPage());
},
child: Text(
'《服务协议》',
@ -173,7 +173,7 @@ class _LoginPageState extends State<LoginPage> {
ExtendedWidgetSpan(
child: GestureDetector(
onTap: () {
Get.to(PrivacyPage());
Get.to(() => PrivacyPage());
},
child: Text(
'《隐私政策》',

@ -60,7 +60,7 @@ class _SettingsPageState extends State<SettingsPage> {
AkuTile(
title: Text('意见反馈'),
arrow: true,
onTap: () => Get.to(SettingFeedBackPage()),
onTap: () => Get.to(() => SettingFeedBackPage()),
),
Divider(height: 1.w),
AkuTile(
@ -72,13 +72,13 @@ class _SettingsPageState extends State<SettingsPage> {
AkuTile(
title: Text('隐私政策'),
arrow: true,
onTap: () => Get.to(PrivacyPage()),
onTap: () => Get.to(() => PrivacyPage()),
),
Divider(height: 1.w),
AkuTile(
title: Text('用户协议'),
arrow: true,
onTap: () => Get.to(AgreementPage()),
onTap: () => Get.to(() => AgreementPage()),
),
AkuBox.h(320),
userProvider.isLogin

@ -33,7 +33,7 @@ class _AllBorrowGoodsState extends State<AllBorrowGoods> {
// ? AkuMaterialButton(
// minWidth: 120.w,
// onPressed: () {
// Get.to(AddBorrowObjectPage());
// Get.to(()=>AddBorrowObjectPage());
// },
// child: Text(
// '新增',

@ -60,7 +60,7 @@ class _BorrowManagerPageState extends State<BorrowManagerPage>
AkuMaterialButton(
minWidth: 178.w,
onPressed: () {
Get.to(AllBorrowGoods());
Get.to(() => AllBorrowGoods());
},
child: Text(
'全部物品',

@ -37,7 +37,7 @@ class _WarningPageState extends State<WarningPage> {
AkuMaterialButton(
padding: EdgeInsets.symmetric(horizontal: 32.w),
onPressed: () {
Get.to(WarningDetailPage());
Get.to(() => WarningDetailPage());
},
child: Text(
'功能说明',
@ -163,7 +163,7 @@ class _WarningPageState extends State<WarningPage> {
minWidth: 0,
onPressed: () {
launch('tel:110');
// Get.to(WarningSubPage());
// Get.to(()=>WarningSubPage());
},
child: Container(
height: 172.w,

@ -41,7 +41,7 @@ class _WarningSubPageState extends State<WarningSubPage> {
actions: [
AkuMaterialButton(
onPressed: () {
Get.to(WarningDetailPage());
Get.to(() => WarningDetailPage());
},
padding: EdgeInsets.symmetric(horizontal: 32.w),
child: Text('功能说明'),

@ -36,7 +36,7 @@ class _WarningSuccessState extends State<WarningSuccess> {
actions: [
AkuMaterialButton(
onPressed: () {
Get.to(WarningDetailPage());
Get.to(() => WarningDetailPage());
},
padding: EdgeInsets.symmetric(horizontal: 32.w),
child: Text('功能说明'),

Loading…
Cancel
Save