|
|
@ -1,13 +1,14 @@
|
|
|
|
|
|
|
|
import 'package:aku_community/base/base_style.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:bot_toast/bot_toast.dart';
|
|
|
|
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:aku_community/const/resource.dart';
|
|
|
|
import 'package:aku_community/const/resource.dart';
|
|
|
|
import 'package:aku_community/ui/community/community_views/community_page.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/ui/market/market_page.dart';
|
|
|
|
import 'package:aku_community/widget/bee_scaffold.dart';
|
|
|
|
import 'package:aku_community/widget/bee_scaffold.dart';
|
|
|
|
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
import 'home/home_page.dart';
|
|
|
|
import 'home/home_page.dart';
|
|
|
|
import 'personal/personal_page.dart';
|
|
|
|
import 'personal/personal_page.dart';
|
|
|
|
import 'property/property_index.dart';
|
|
|
|
import 'property/property_index.dart';
|
|
|
@ -98,15 +99,59 @@ class _TabNavigatorState extends State<TabNavigator>
|
|
|
|
return BeeScaffold(
|
|
|
|
return 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
|
|
|
|
return true;
|
|
|
|
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;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: TabBarView(
|
|
|
|
child: TabBarView(
|
|
|
|
children: _pages,
|
|
|
|
children: _pages,
|
|
|
|