|
|
|
@ -1,14 +1,13 @@
|
|
|
|
|
import 'package:aku_community/base/base_style.dart';
|
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
import 'package:bot_toast/bot_toast.dart';
|
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
|
|
|
|
|
|
import 'package:aku_community/const/resource.dart';
|
|
|
|
|
import 'package:aku_community/ui/community/community_views/community_page.dart';
|
|
|
|
|
import 'package:aku_community/ui/market/market_page.dart';
|
|
|
|
|
import 'package:aku_community/widget/bee_scaffold.dart';
|
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
|
import 'home/home_page.dart';
|
|
|
|
|
import 'personal/personal_page.dart';
|
|
|
|
|
import 'property/property_index.dart';
|
|
|
|
@ -99,59 +98,15 @@ class _TabNavigatorState extends State<TabNavigator>
|
|
|
|
|
return BeeScaffold(
|
|
|
|
|
body: WillPopScope(
|
|
|
|
|
onWillPop: () async {
|
|
|
|
|
// if (_lastPressed == null ||
|
|
|
|
|
// DateTime.now().difference(_lastPressed!) > Duration(seconds: 1)) {
|
|
|
|
|
// //两次点击间隔超过1秒重新计算
|
|
|
|
|
// _lastPressed = DateTime.now();
|
|
|
|
|
// BotToast.showText(text: '再点击一次返回退出');
|
|
|
|
|
// return false;
|
|
|
|
|
// }
|
|
|
|
|
if (_lastPressed == null ||
|
|
|
|
|
DateTime.now().difference(_lastPressed!) > Duration(seconds: 1)) {
|
|
|
|
|
//两次点击间隔超过1秒重新计算
|
|
|
|
|
_lastPressed = DateTime.now();
|
|
|
|
|
BotToast.showText(text: '再点击一次返回退出');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
//否则关闭app
|
|
|
|
|
bool _reslut = true;
|
|
|
|
|
showCupertinoDialog(
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (context) {
|
|
|
|
|
return CupertinoAlertDialog(
|
|
|
|
|
title: Text(
|
|
|
|
|
'确认退出?',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontSize: 40.sp,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
actions: [
|
|
|
|
|
CupertinoActionSheetAction(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Get.back();
|
|
|
|
|
},
|
|
|
|
|
child: Text(
|
|
|
|
|
'确认',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontSize: 32.sp,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
CupertinoActionSheetAction(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Get.back();
|
|
|
|
|
_reslut = false;
|
|
|
|
|
},
|
|
|
|
|
child: Text(
|
|
|
|
|
'取消',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: kPrimaryColor,
|
|
|
|
|
fontSize: 32.sp,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
return _reslut;
|
|
|
|
|
return true;
|
|
|
|
|
},
|
|
|
|
|
child: TabBarView(
|
|
|
|
|
children: _pages,
|
|
|
|
|