MatchPage.dart 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter/material.dart' as prefix0;
  3. import 'package:flutter/painting.dart';
  4. import 'package:flutter_swiper/flutter_swiper.dart';
  5. import 'package:shared_preferences/shared_preferences.dart';
  6. import 'package:flutter/cupertino.dart';
  7. import '../styles/totast.dart';
  8. import '../net/HttpManager.dart';
  9. import '../net/Result.dart';
  10. import 'TipList.dart';
  11. import 'package:flutter_redux/flutter_redux.dart';
  12. import '../redux/AppState.dart';
  13. import '../widget/LinearButton.dart';
  14. import '../model/BannerInfo.dart';
  15. import '../widget/HouseItem.dart';
  16. import '../model/HouseInfo.dart';
  17. import 'package:flutter_picker/flutter_picker.dart';
  18. import 'CompetitionInformation.dart';
  19. import '../model/GameInfo.dart';
  20. import 'dart:async';
  21. import 'dart:convert';
  22. import 'dart:ui';
  23. import 'dart:math';
  24. import 'SelectRoom.dart';
  25. import 'PhotoView.dart';
  26. import '../model/PhoneInfo.dart';
  27. class MatchPage extends StatefulWidget {
  28. @override
  29. _MatchPageState createState() => _MatchPageState();
  30. }
  31. class _MatchPageState extends State<MatchPage> with WidgetsBindingObserver {
  32. List<HouseInfo> houseList = [];
  33. int currentPage = 0;
  34. bool showBadge = false;
  35. int gameId = 0;
  36. String searchKey = '';
  37. bool scrollFlag = false;
  38. List<BannerInfo> bannerList = [];
  39. ScrollController _controller;
  40. List<GameInfo> gameList = [];
  41. String gameName = '全部游戏';
  42. FocusNode _focusNode = new FocusNode();
  43. List<PhoneInfo> phoneList = [];
  44. int tipNum = 0;
  45. bool showMoreRoom = false;
  46. bool isFinish = false;
  47. Future<void> getUnreadMsg() async {
  48. Result res = await HttpManager.get('systemNotice/unread', data: {'userId': StoreProvider.of<AppState>(context).state.userInfo.id, 'statusFlag': 0});
  49. if (res.success && res.data != null) {
  50. setState(() {
  51. tipNum = res.data;
  52. });
  53. if (res.data > 0) {
  54. setState(() {
  55. showBadge = true;
  56. });
  57. } else {
  58. setState(() {
  59. showBadge = false;
  60. });
  61. }
  62. }
  63. }
  64. //展示通知
  65. void showNotice() {
  66. Navigator.of(context).push(PageRouteBuilder(
  67. opaque: false,
  68. transitionDuration: Duration(milliseconds: 300),
  69. transitionsBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) {
  70. return FadeTransition(
  71. opacity: CurvedAnimation(parent: animation, curve: Curves.linear),
  72. child: child,
  73. );
  74. },
  75. pageBuilder: (BuildContext context, _, __) {
  76. return CompetitionInformation();
  77. }));
  78. }
  79. void showPicker(BuildContext context) {
  80. List<String> _list = [];
  81. for (var item in gameList) {
  82. _list.add(item.gameName);
  83. }
  84. String PickerData = json.encode(_list);
  85. Picker(
  86. confirmText: '确定',
  87. cancelText: '取消',
  88. adapter: PickerDataAdapter<String>(pickerdata: JsonDecoder().convert(PickerData)),
  89. changeToFirst: true,
  90. textAlign: TextAlign.left,
  91. columnPadding: const EdgeInsets.all(8.0),
  92. onConfirm: (Picker picker, List value) {
  93. setState(() {
  94. gameId = gameList[value[0]].id;
  95. gameName = gameList[value[0]].gameName;
  96. });
  97. }).showModal(this.context);
  98. }
  99. Future<void> getGame() async {
  100. // Toast.show(context, '加载中', -1, 'loading');
  101. Result res = await HttpManager.get('gameInfo/all');
  102. // Toast.hide();
  103. if (res.success) {
  104. List<GameInfo> _list = [];
  105. for (var item in res.data) {
  106. _list.add(GameInfo.fromJson(item));
  107. }
  108. setState(() {
  109. gameList = _list;
  110. });
  111. } else {}
  112. }
  113. Future<void> getRoomInfo() async {
  114. print('获取房间');
  115. Map<String, dynamic> data = {
  116. 'currentPage': currentPage,
  117. 'pageNumber': 20,
  118. 'statusStr': '0,2',
  119. 'myUserId': StoreProvider.of<AppState>(context).state.userInfo.id
  120. };
  121. data['advancedQuery'] = '';
  122. if (gameId != 0) {
  123. data['gameId'] = gameId;
  124. }
  125. data['searchKey'] = searchKey;
  126. List<HouseInfo> _allList = houseList;
  127. if (currentPage == 1) {
  128. _allList = [];
  129. }
  130. if (StoreProvider.of<AppState>(context).state.userInfo.recommender != null) {
  131. data['recommender'] = StoreProvider.of<AppState>(context).state.userInfo.recommender;
  132. }
  133. Result res = await HttpManager.get('houseInfo/page', data: data);
  134. if (res.success && res.data['pp'] != null) {
  135. for (var item in res.data['pp']) {
  136. HouseInfo _temHouse = HouseInfo.fromJson(item);
  137. _allList.add(_temHouse);
  138. }
  139. if (res.data['page']['currentPage'] < res.data['page']['totalPage']) {
  140. scrollFlag = true;
  141. } else {
  142. setState(() {
  143. isFinish = true;
  144. });
  145. scrollFlag = false;
  146. }
  147. } else {}
  148. setState(() {
  149. houseList = _allList;
  150. });
  151. }
  152. Future<void> search(String text) async {
  153. if (text != searchKey) {
  154. currentPage = 1;
  155. searchKey = text;
  156. getRoomInfo();
  157. }
  158. }
  159. Future<void> getBannerInfo() async {
  160. List<BannerInfo> _bannerList = [];
  161. Toast.show(context, '加载中', -1, 'loading');
  162. Result res = await HttpManager.get('bannerInfo/all');
  163. Toast.hide();
  164. if (res.success && res.data != null) {
  165. for (var item in res.data) {
  166. BannerInfo banner = BannerInfo.fromJson(item);
  167. _bannerList.add(banner);
  168. }
  169. setState(() {
  170. bannerList = _bannerList;
  171. });
  172. }
  173. }
  174. Future<void> getPhoneInfo() async {
  175. List<PhoneInfo> _phoneList = [];
  176. Result res = await HttpManager.get('phoneInfo/all');
  177. if (res.success && res.data != null) {
  178. for (var item in res.data) {
  179. PhoneInfo phone = PhoneInfo.fromJson(item);
  180. _phoneList.add(phone);
  181. }
  182. setState(() {
  183. phoneList = _phoneList;
  184. });
  185. }
  186. final prefs = await SharedPreferences.getInstance();
  187. var now = new DateTime.now();
  188. var timeStr = now.year.toString() + '/' + now.month.toString() + '/' + now.day.toString();
  189. prefs.setString('showPhoneInfo', timeStr);
  190. Navigator.of(context).push(
  191. PageRouteBuilder(
  192. opaque: false,
  193. transitionDuration: Duration(milliseconds: 300),
  194. transitionsBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) {
  195. return FadeTransition(
  196. opacity: CurvedAnimation(parent: animation, curve: Curves.linear),
  197. child: child,
  198. );
  199. },
  200. pageBuilder: (BuildContext context, _, __) {
  201. return LoadingDialog(
  202. // text: '部分手机自动设置了省电策略,会将我们的app在游戏进程中从后台停掉,为了你的正常比赛,请点击你的手机型号查看具体设置',
  203. phoneList: phoneList,
  204. );
  205. },
  206. ),
  207. );
  208. }
  209. @override
  210. void initState() {
  211. super.initState();
  212. bannerList = [];
  213. _controller = ScrollController();
  214. // gameList.add(GameInfo.fromJson({"id": 0, "gameName": '全部游戏'}));
  215. _controller.addListener(() {
  216. if (_controller.position.pixels == _controller.position.maxScrollExtent) {
  217. print('底部。。。');
  218. setState(() {
  219. showMoreRoom = true;
  220. });
  221. if (scrollFlag) {
  222. setState(() {
  223. currentPage++;
  224. });
  225. getRoomInfo();
  226. } else {
  227. Future.delayed(Duration(seconds: 2), () async {
  228. setState(() {
  229. showMoreRoom = false;
  230. });
  231. });
  232. }
  233. }
  234. });
  235. Future.delayed(Duration.zero, () async {
  236. getUnreadMsg();
  237. getBannerInfo();
  238. getGame();
  239. getRoomInfo();
  240. final prefs = await SharedPreferences.getInstance();
  241. var now = new DateTime.now();
  242. var timeStr = now.year.toString() + '/' + now.month.toString() + '/' + now.day.toString();
  243. if (prefs.getString('showPhoneInfo') != timeStr) {
  244. getPhoneInfo();
  245. }
  246. });
  247. }
  248. @override
  249. void didChangeAppLifecycleState(AppLifecycleState state) {
  250. if (state == AppLifecycleState.resumed) {
  251. getUnreadMsg();
  252. }
  253. }
  254. @override
  255. void dispose() {
  256. super.dispose();
  257. }
  258. @override
  259. Widget build(BuildContext context) {
  260. return GestureDetector(
  261. behavior: HitTestBehavior.translucent,
  262. child: Scaffold(
  263. appBar: AppBar(
  264. title: Text('赛事'),
  265. centerTitle: true,
  266. leading: Material(
  267. color: Colors.transparent,
  268. child: Builder(
  269. builder: (context) => InkWell(
  270. onTap: () async {
  271. bool result = await Navigator.push(context, CupertinoPageRoute(builder: (context) => TipList()));
  272. if (result) {
  273. getUnreadMsg();
  274. }
  275. },
  276. child: Container(
  277. width: 30,
  278. height: 30,
  279. child: Stack(
  280. children: <Widget>[
  281. Center(
  282. child: Image.asset('images/home_icon_xiaoxi.png'),
  283. ),
  284. showBadge
  285. ? Positioned(
  286. right: 10,
  287. top: 12,
  288. child: Container(
  289. padding: EdgeInsets.all(1),
  290. decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(100))),
  291. child: Center(
  292. child: Container(
  293. padding: EdgeInsets.symmetric(horizontal: 3),
  294. height: 12,
  295. decoration: BoxDecoration(color: Color(0xFFD4504B), borderRadius: BorderRadius.all(Radius.circular(12))),
  296. child: Center(
  297. child: Text('${tipNum}', style: TextStyle(color: Colors.white, fontSize: 10)),
  298. ),
  299. ),
  300. ),
  301. ),
  302. )
  303. : Container()
  304. ],
  305. ),
  306. ),
  307. ),
  308. ),
  309. ),
  310. actions: <Widget>[
  311. Container(
  312. width: 102,
  313. padding: EdgeInsets.all(15),
  314. child: LinearButton(
  315. btntext: '配置帮助',
  316. textColor: Color(0xFF2E3049),
  317. btnHeight: 26.0,
  318. colorList: [Color(0xFFFFB726), Color(0xFFFFB726)],
  319. textSize: 12.0,
  320. onTapHomeMenu: () {
  321. // showNotice();
  322. getPhoneInfo();
  323. },
  324. ),
  325. )
  326. ],
  327. ),
  328. body: Container(
  329. color: Color(0xFF2E3049),
  330. height: double.infinity,
  331. width: double.infinity,
  332. child: RefreshIndicator(
  333. color: Theme.of(context).primaryColor,
  334. backgroundColor: Colors.white,
  335. displacement: 10,
  336. onRefresh: () async {
  337. await Future.delayed(const Duration(seconds: 1));
  338. gameId = 0;
  339. currentPage = 1;
  340. searchKey = '';
  341. getRoomInfo();
  342. // getBannerInfo();
  343. getGame();
  344. },
  345. child: CustomScrollView(
  346. physics: AlwaysScrollableScrollPhysics(),
  347. controller: _controller,
  348. slivers: <Widget>[
  349. SliverToBoxAdapter(
  350. child: Container(
  351. width: double.infinity,
  352. height: 200,
  353. child: new Swiper(
  354. itemBuilder: (BuildContext context, int index) {
  355. return Image.network(
  356. bannerList[index].imageUrl,
  357. fit: BoxFit.fill,
  358. );
  359. },
  360. itemCount: bannerList.length,
  361. loop: false,
  362. autoplay: true,
  363. autoplayDelay: 5000,
  364. pagination: SwiperCustomPagination(builder: (BuildContext context, SwiperPluginConfig config) {
  365. Color activeColor = Color(0xFFD4504B);
  366. Color color = Colors.white;
  367. List<Widget> list = [];
  368. int itemCount = config.itemCount;
  369. int activeIndex = config.activeIndex;
  370. for (int i = 0; i < itemCount; ++i) {
  371. bool active = i == activeIndex;
  372. list.add(
  373. Container(
  374. key: Key("pagination_$i"),
  375. margin: EdgeInsets.symmetric(vertical: 3, horizontal: 2),
  376. child: Container(
  377. width: active ? 8 : 3,
  378. height: 3,
  379. decoration: BoxDecoration(color: active ? activeColor : color, borderRadius: BorderRadius.all(Radius.circular(3))),
  380. )),
  381. );
  382. }
  383. return Container(
  384. margin: EdgeInsets.only(top: 186),
  385. child: Row(
  386. mainAxisAlignment: MainAxisAlignment.center,
  387. children: list,
  388. ),
  389. );
  390. })),
  391. ),
  392. ),
  393. SliverPersistentHeader(
  394. pinned: true, //是否固定在顶部
  395. floating: true,
  396. delegate: _SliverAppBarDelegate(
  397. minHeight: 60, //收起的高度
  398. maxHeight: 60, //展开的最大高度
  399. child: InkWell(
  400. onTap: () {
  401. Navigator.push(context, CupertinoPageRoute(builder: (context) => SelectRoom()));
  402. },
  403. child: Container(
  404. color: Color(0xFF2E3049),
  405. height: 60,
  406. padding: EdgeInsets.symmetric(vertical: 10, horizontal: 15),
  407. child: Container(
  408. decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(4))),
  409. child: Row(
  410. children: <Widget>[
  411. Container(
  412. width: 10,
  413. ),
  414. ImageIcon(
  415. AssetImage('images/home_icon_sousuo.png'),
  416. color: Color(0xFF727785),
  417. ),
  418. Expanded(
  419. flex: 1,
  420. child: Container(
  421. decoration: BoxDecoration(
  422. color: Colors.white,
  423. borderRadius: BorderRadius.all(Radius.circular(100)),
  424. ),
  425. child: Text('搜索竞赛房间', style: TextStyle(color: Color(0xFF9BA0AE), fontSize: 13)),
  426. ),
  427. ),
  428. Container(
  429. width: 1,
  430. height: 10,
  431. color: Color(0xFFB1B5C0),
  432. ),
  433. Container(
  434. width: 99,
  435. child: Row(
  436. mainAxisAlignment: MainAxisAlignment.center,
  437. children: <Widget>[
  438. Expanded(
  439. flex: 1,
  440. child: Container(
  441. padding: EdgeInsets.only(left: 5),
  442. alignment: Alignment.center,
  443. child: Text(
  444. gameName,
  445. style: TextStyle(color: Color(0xFFB1B5C0)),
  446. overflow: TextOverflow.ellipsis,
  447. ),
  448. ),
  449. ),
  450. Image.asset('images/icon_zhankai_huise.png'),
  451. Container(
  452. width: 5,
  453. )
  454. ],
  455. ))
  456. ],
  457. ),
  458. ),
  459. ))),
  460. ),
  461. SliverFixedExtentList(
  462. itemExtent: houseList.isEmpty ? 300 : 90,
  463. delegate: SliverChildBuilderDelegate((BuildContext context, int index) {
  464. if (houseList.isEmpty) {
  465. return InkWell(
  466. child: Container(
  467. padding: EdgeInsets.only(top: 105),
  468. child: Column(
  469. children: <Widget>[
  470. Image.asset('images/icon_kong.png'),
  471. Text('暂时没有此房间哦~', style: TextStyle(fontSize: 14, color: Theme.of(context).primaryColor.withOpacity(0.3)))
  472. ],
  473. ),
  474. ),
  475. onTap: () {
  476. _focusNode.unfocus();
  477. },
  478. );
  479. } else if (index == houseList.length) {
  480. return Text(isFinish ? '更多房间敬请期待...' : '加载中...',
  481. style: TextStyle(color: Colors.grey, fontSize: 13, height: 3), textAlign: TextAlign.center);
  482. }
  483. return HouseItem(
  484. houseList[index],
  485. houseList[index].gameInfo,
  486. isNext: !_focusNode.hasFocus,
  487. onTapHomeMenu: () {
  488. setState(() {
  489. _focusNode.unfocus();
  490. });
  491. },
  492. );
  493. }, childCount: (houseList.length != 0 && (houseList.length < 5 || !showMoreRoom)) ? houseList.length : houseList.length + 1),
  494. ),
  495. SliverToBoxAdapter(
  496. child: Container(
  497. height: 30,
  498. ),
  499. )
  500. ],
  501. ),
  502. ),
  503. )),
  504. onTap: () {
  505. _focusNode.unfocus();
  506. },
  507. );
  508. }
  509. List<Widget> _houseList(houselist) {
  510. List<Widget> list = [];
  511. for (var i = 0; i < houselist.length; i++) {
  512. list.add(HouseItem(houselist[i], houselist[i].gameInfo));
  513. }
  514. return list;
  515. }
  516. }
  517. class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate {
  518. _SliverAppBarDelegate({
  519. @required this.minHeight,
  520. @required this.maxHeight,
  521. @required this.child,
  522. });
  523. final double minHeight;
  524. final double maxHeight;
  525. final Widget child;
  526. @override
  527. double get minExtent => minHeight;
  528. @override
  529. double get maxExtent => max(maxHeight, minHeight);
  530. @override
  531. Widget build(BuildContext context, double shrinkOffset, bool overlapsContent) {
  532. return new SizedBox.expand(child: child);
  533. }
  534. @override
  535. bool shouldRebuild(_SliverAppBarDelegate oldDelegate) {
  536. return maxHeight != oldDelegate.maxHeight || minHeight != oldDelegate.minHeight || child != oldDelegate.child;
  537. }
  538. }
  539. typedef OnTapHomeMenu = void Function();
  540. class LoadingDialog extends Dialog {
  541. final List<PhoneInfo> phoneList;
  542. LoadingDialog({Key key, this.phoneList = const []}) : super(key: key);
  543. @override
  544. Widget build(BuildContext context) {
  545. return WillPopScope(
  546. child: Scaffold(
  547. backgroundColor: Color(0xCC000000),
  548. body: Container(
  549. child: SizedBox.expand(
  550. child: UnconstrainedBox(
  551. child: Container(
  552. width: 320,
  553. // padding: EdgeInsets.symmetric(horizontal: 20, vertical: 25),
  554. height: 380,
  555. decoration: BoxDecoration(color: Color(0xFF15151D), border: Border.all(width: 1, color: Theme.of(context).primaryColor)),
  556. child: Stack(
  557. children: <Widget>[
  558. Padding(
  559. padding: EdgeInsets.symmetric(horizontal: 20, vertical: 25),
  560. child: Column(
  561. mainAxisAlignment: MainAxisAlignment.center,
  562. children: <Widget>[
  563. Text.rich(TextSpan(style: TextStyle(color: Colors.white, fontSize: 14), children: [
  564. TextSpan(text: '欢迎来到杀戮的世界!您的手机可能设置了'),
  565. TextSpan(text: '“省电策略”', style: TextStyle(color: Color(0xFFFFB726), fontWeight: FontWeight.w600)),
  566. TextSpan(text: ',为了不影响您的游戏体验,请在游戏前,先选择您的手机品牌,跟着说明正确的配置手机')
  567. ])),
  568. // Container(
  569. // height: 30,
  570. // ),
  571. Container(
  572. width: double.infinity,
  573. height: 180,
  574. margin: EdgeInsets.fromLTRB(0, 0, 0, 20),
  575. child: GridView.builder(
  576. gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
  577. crossAxisCount: 2, //每行三列
  578. childAspectRatio: 3.0 //显示区域宽高相等
  579. ),
  580. itemCount: phoneList.length,
  581. itemBuilder: (context, index) {
  582. //如果显示到最后一个并且Icon总数小于200时继续获取数据
  583. return InkWell(
  584. child: Container(
  585. margin: EdgeInsets.all(5),
  586. color: Colors.white,
  587. child: Row(
  588. mainAxisAlignment: MainAxisAlignment.center,
  589. children: <Widget>[
  590. Image.network(
  591. phoneList[index].icon,
  592. width: 20,
  593. ),
  594. Container(
  595. width: 5,
  596. ),
  597. Text(phoneList[index].phone)
  598. ],
  599. ),
  600. ),
  601. onTap: () async {
  602. var list = phoneList[index].image.split(',');
  603. final bool res = await Navigator.of(context).push(
  604. PageRouteBuilder(
  605. opaque: false,
  606. transitionDuration: Duration(milliseconds: 300),
  607. transitionsBuilder:
  608. (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) {
  609. return FadeTransition(
  610. opacity: CurvedAnimation(parent: animation, curve: Curves.linear),
  611. child: child,
  612. );
  613. },
  614. pageBuilder: (BuildContext context, _, __) {
  615. return PhotoView(imageList: list);
  616. },
  617. ),
  618. );
  619. if (res != null && res) {
  620. Navigator.of(context).pop();
  621. }
  622. },
  623. );
  624. })),
  625. Container(
  626. child: LinearButton(
  627. btntext: '关闭',
  628. btnHeight: 36.0,
  629. colorList: [Color(0xFF271A21), Color(0xFF271A21)],
  630. textColor: Color(0xFFD4504B),
  631. textWeight: FontWeight.w400,
  632. onTapHomeMenu: () {
  633. Navigator.of(context).pop();
  634. },
  635. ),
  636. ),
  637. // Container(
  638. // height: 5,
  639. // )
  640. ],
  641. ),
  642. ),
  643. Positioned(
  644. top: 0,
  645. left: 0,
  646. child: Image.asset(
  647. 'images/tancuang_shang.png',
  648. // width: 131,
  649. ),
  650. ),
  651. Positioned(
  652. bottom: 0,
  653. right: 4,
  654. child: Image.asset(
  655. 'images/tancuang_xia.png',
  656. // width: 148,
  657. ),
  658. ),
  659. ],
  660. ),
  661. ),
  662. ),
  663. ),
  664. ),
  665. ),
  666. onWillPop: () {
  667. return Future.value(false);
  668. },
  669. );
  670. }
  671. }