|
|
@ -1,3 +1,4 @@
|
|
|
|
|
|
|
|
import 'package:aku_new_community/ui/home/application/all_application_new.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:bot_toast/bot_toast.dart';
|
|
|
|
import 'package:bot_toast/bot_toast.dart';
|
|
|
@ -142,13 +143,14 @@ class _TabNavigatorState extends State<TabNavigator>
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
child: GestureDetector(
|
|
|
|
child: GestureDetector(
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
if (UserTool.userProvider.isLogin == false) {
|
|
|
|
Get.to(() => AllApplicationNewPage());
|
|
|
|
//暂时隐去一键登录页
|
|
|
|
// if (UserTool.userProvider.isLogin == false) {
|
|
|
|
Get.offAll(() => OtherLoginPage());
|
|
|
|
// //暂时隐去一键登录页
|
|
|
|
} else {}
|
|
|
|
// Get.offAll(() => OtherLoginPage());
|
|
|
|
_tabController!.animateTo(2, curve: Curves.easeInOutCubic);
|
|
|
|
// } else {}
|
|
|
|
_currentIndex = 2;
|
|
|
|
// _tabController!.animateTo(2, curve: Curves.easeInOutCubic);
|
|
|
|
setState(() {});
|
|
|
|
// _currentIndex = 2;
|
|
|
|
|
|
|
|
// setState(() {});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: Material(
|
|
|
|
child: Material(
|
|
|
|
color: Colors.transparent,
|
|
|
|
color: Colors.transparent,
|
|
|
@ -181,42 +183,41 @@ class _TabNavigatorState extends State<TabNavigator>
|
|
|
|
4,
|
|
|
|
4,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
];
|
|
|
|
];
|
|
|
|
return
|
|
|
|
return BeeScaffold(
|
|
|
|
BeeScaffold(
|
|
|
|
body: WillPopScope(
|
|
|
|
body: WillPopScope(
|
|
|
|
onWillPop: () async {
|
|
|
|
onWillPop: () async {
|
|
|
|
if (_lastPressed == null ||
|
|
|
|
if (_lastPressed == null ||
|
|
|
|
DateTime.now().difference(_lastPressed!) > Duration(seconds: 1)) {
|
|
|
|
DateTime.now().difference(_lastPressed!) > Duration(seconds: 1)) {
|
|
|
|
//两次点击间隔超过1秒重新计算
|
|
|
|
//两次点击间隔超过1秒重新计算
|
|
|
|
_lastPressed = DateTime.now();
|
|
|
|
_lastPressed = DateTime.now();
|
|
|
|
BotToast.showText(text: '再点击一次返回退出');
|
|
|
|
BotToast.showText(text: '再点击一次返回退出');
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//否则关闭app
|
|
|
|
//否则关闭app
|
|
|
|
WebSocketUtil().closeWebSocket();
|
|
|
|
WebSocketUtil().closeWebSocket();
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: TabBarView(
|
|
|
|
child: TabBarView(
|
|
|
|
children: _pages,
|
|
|
|
children: _pages,
|
|
|
|
controller: _tabController,
|
|
|
|
controller: _tabController,
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
bottomNavi: ConstrainedBox(
|
|
|
|
bottomNavi: ConstrainedBox(
|
|
|
|
constraints: BoxConstraints(maxWidth: 750.w, maxHeight: 146.w),
|
|
|
|
constraints: BoxConstraints(maxWidth: 750.w, maxHeight: 146.w),
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
margin:
|
|
|
|
margin:
|
|
|
|
|
|
|
|
EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
|
|
|
|
EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
image: DecorationImage(
|
|
|
|
image: DecorationImage(
|
|
|
|
image: Assets.home.imgTabdi, fit: BoxFit.fitWidth),
|
|
|
|
image: Assets.home.imgTabdi, fit: BoxFit.fitWidth),
|
|
|
|
color: Colors.transparent),
|
|
|
|
color: Colors.transparent),
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: _bottomNav.cast<Widget>().toList(),
|
|
|
|
children: _bottomNav.cast<Widget>().toList(),
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|