|
@@ -58,6 +58,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { |
|
@@ -58,6 +58,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { |
|
58
|
int xgCount = 1; //注册信鸽次数,最多5次
|
58
|
int xgCount = 1; //注册信鸽次数,最多5次
|
|
59
|
|
59
|
|
|
60
|
DateTime lastBack;
|
60
|
DateTime lastBack;
|
|
|
|
61
|
+ PageController _pageController;
|
|
61
|
|
62
|
|
|
62
|
@override
|
63
|
@override
|
|
63
|
void initState() {
|
64
|
void initState() {
|
|
@@ -66,6 +67,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { |
|
@@ -66,6 +67,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { |
|
66
|
LogUtil.v("home_initState");
|
67
|
LogUtil.v("home_initState");
|
|
67
|
WidgetsBinding.instance.addObserver(this);
|
68
|
WidgetsBinding.instance.addObserver(this);
|
|
68
|
_currIndex = widget.initialIndex;
|
69
|
_currIndex = widget.initialIndex;
|
|
|
|
70
|
+ _pageController = PageController(initialPage: _currIndex);
|
|
69
|
pages
|
71
|
pages
|
|
70
|
..add(ChangeNotifierProvider<HomeEnterModel>(
|
72
|
..add(ChangeNotifierProvider<HomeEnterModel>(
|
|
71
|
create: (_) => HomeEnterModel(),
|
73
|
create: (_) => HomeEnterModel(),
|
|
@@ -73,9 +75,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { |
|
@@ -73,9 +75,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { |
|
73
|
create: (_) => RemarkManagerModel(),
|
75
|
create: (_) => RemarkManagerModel(),
|
|
74
|
child: SafeArea(child: HomeEnterPage()),
|
76
|
child: SafeArea(child: HomeEnterPage()),
|
|
75
|
)))
|
77
|
)))
|
|
76
|
- ..add(ChangeNotifierProvider<MessageModel>(
|
|
|
|
77
|
- create: (_) => MessageModel(),
|
|
|
|
78
|
- child: SafeArea(child: MessagePage()),
|
78
|
+ ..add(SafeArea(
|
|
|
|
79
|
+ child: MessagePage(),
|
|
79
|
))
|
80
|
))
|
|
80
|
// ..add(ChangeNotifierProvider<EnterModel>(
|
81
|
// ..add(ChangeNotifierProvider<EnterModel>(
|
|
81
|
// create: (_) => EnterModel(),
|
82
|
// create: (_) => EnterModel(),
|
|
@@ -442,6 +443,20 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { |
|
@@ -442,6 +443,20 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { |
|
442
|
});
|
443
|
});
|
|
443
|
}
|
444
|
}
|
|
444
|
|
445
|
|
|
|
|
446
|
+//获取未处理消息数目
|
|
|
|
447
|
+ bool _getUnMsgNum() {
|
|
|
|
448
|
+ MessageModel messageModel =
|
|
|
|
449
|
+ Provider.of<MessageModel>(context, listen: true);
|
|
|
|
450
|
+ if (
|
|
|
|
451
|
+ messageModel.onlineTotal +
|
|
|
|
452
|
+ messageModel.orderTotal +
|
|
|
|
453
|
+ messageModel.checkTotal >
|
|
|
|
454
|
+ 0) {
|
|
|
|
455
|
+ return true;
|
|
|
|
456
|
+ }
|
|
|
|
457
|
+ return false;
|
|
|
|
458
|
+ }
|
|
|
|
459
|
+
|
|
445
|
// 系统窗口相关改变回调
|
460
|
// 系统窗口相关改变回调
|
|
446
|
void didChangeMetrics() {
|
461
|
void didChangeMetrics() {
|
|
447
|
super.didChangeMetrics();
|
462
|
super.didChangeMetrics();
|
|
@@ -463,50 +478,87 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { |
|
@@ -463,50 +478,87 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { |
|
463
|
@override
|
478
|
@override
|
|
464
|
Widget build(BuildContext context) {
|
479
|
Widget build(BuildContext context) {
|
|
465
|
// TODO: implement build
|
480
|
// TODO: implement build
|
|
|
|
481
|
+
|
|
466
|
return new WillPopScope(
|
482
|
return new WillPopScope(
|
|
467
|
child: Scaffold(
|
483
|
child: Scaffold(
|
|
468
|
- bottomNavigationBar: BottomNavigationBar(
|
|
|
|
469
|
- iconSize: ScreenUtil().setWidth(48),
|
|
|
|
470
|
- unselectedFontSize: ScreenUtil().setSp(22),
|
|
|
|
471
|
- selectedFontSize: ScreenUtil().setSp(22),
|
|
|
|
472
|
- backgroundColor: MyColours.color_ffffff,
|
|
|
|
473
|
- items: [
|
|
|
|
474
|
- BottomNavigationBarItem(
|
|
|
|
475
|
- icon: Image(
|
|
|
|
476
|
- image: AssetImage("assets/enter_order_n.png"),
|
|
|
|
477
|
- width: ScreenUtil().setWidth(48),
|
|
|
|
478
|
- height: ScreenUtil().setWidth(48),
|
|
|
|
479
|
- ),
|
|
|
|
480
|
- activeIcon: Image(
|
|
|
|
481
|
- image: AssetImage("assets/enter_order_s.png"),
|
|
|
|
482
|
- width: ScreenUtil().setWidth(48),
|
|
|
|
483
|
- height: ScreenUtil().setWidth(48),
|
484
|
+ bottomNavigationBar: BottomNavigationBar(
|
|
|
|
485
|
+ iconSize: ScreenUtil().setWidth(48),
|
|
|
|
486
|
+ unselectedFontSize: ScreenUtil().setSp(22),
|
|
|
|
487
|
+ selectedFontSize: ScreenUtil().setSp(22),
|
|
|
|
488
|
+ backgroundColor: MyColours.color_ffffff,
|
|
|
|
489
|
+ items: [
|
|
|
|
490
|
+ BottomNavigationBarItem(
|
|
|
|
491
|
+ icon: Image(
|
|
|
|
492
|
+ image: AssetImage("assets/enter_order_n.png"),
|
|
|
|
493
|
+ width: ScreenUtil().setWidth(48),
|
|
|
|
494
|
+ height: ScreenUtil().setWidth(48),
|
|
|
|
495
|
+ ),
|
|
|
|
496
|
+ activeIcon: Image(
|
|
|
|
497
|
+ image: AssetImage("assets/enter_order_s.png"),
|
|
|
|
498
|
+ width: ScreenUtil().setWidth(48),
|
|
|
|
499
|
+ height: ScreenUtil().setWidth(48),
|
|
|
|
500
|
+ ),
|
|
|
|
501
|
+ title: Text(
|
|
|
|
502
|
+ "录入预订",
|
|
|
|
503
|
+ style: TextStyle(
|
|
|
|
504
|
+ color: _currIndex == 0 ? _activeColor : _defaultColor,
|
|
|
|
505
|
+ fontSize: ScreenUtil().setSp(22)),
|
|
|
|
506
|
+ ),
|
|
484
|
),
|
507
|
),
|
|
485
|
- title: Text(
|
|
|
|
486
|
- "录入预订",
|
|
|
|
487
|
- style: TextStyle(
|
|
|
|
488
|
- color: _currIndex == 0 ? _activeColor : _defaultColor,
|
|
|
|
489
|
- fontSize: ScreenUtil().setSp(22)),
|
508
|
+ BottomNavigationBarItem(
|
|
|
|
509
|
+ icon: Stack(
|
|
|
|
510
|
+ children: [
|
|
|
|
511
|
+ Image(
|
|
|
|
512
|
+ image: AssetImage("assets/message_default.png"),
|
|
|
|
513
|
+ width: ScreenUtil().setWidth(48),
|
|
|
|
514
|
+ height: ScreenUtil().setWidth(48),
|
|
|
|
515
|
+ ),
|
|
|
|
516
|
+ Positioned(
|
|
|
|
517
|
+ top: 0,
|
|
|
|
518
|
+ right: 0,
|
|
|
|
519
|
+ child: Container(
|
|
|
|
520
|
+ width: ScreenUtil().setWidth(16),
|
|
|
|
521
|
+ height: ScreenUtil().setWidth(16),
|
|
|
|
522
|
+ decoration: BoxDecoration(
|
|
|
|
523
|
+ borderRadius: BorderRadius.circular(
|
|
|
|
524
|
+ ScreenUtil().setWidth(16)),
|
|
|
|
525
|
+ color: _getUnMsgNum()
|
|
|
|
526
|
+ ? MyColours.color_fa5151
|
|
|
|
527
|
+ : Colors.transparent),
|
|
|
|
528
|
+ ),
|
|
|
|
529
|
+ )
|
|
|
|
530
|
+ ],
|
|
|
|
531
|
+ ),
|
|
|
|
532
|
+ activeIcon: Stack(
|
|
|
|
533
|
+ children: [
|
|
|
|
534
|
+ Image(
|
|
|
|
535
|
+ image: AssetImage("assets/message_selected.png"),
|
|
|
|
536
|
+ width: ScreenUtil().setWidth(48),
|
|
|
|
537
|
+ height: ScreenUtil().setWidth(48),
|
|
|
|
538
|
+ ),
|
|
|
|
539
|
+ Positioned(
|
|
|
|
540
|
+ top: 0,
|
|
|
|
541
|
+ right: 0,
|
|
|
|
542
|
+ child: Container(
|
|
|
|
543
|
+ width: ScreenUtil().setWidth(16),
|
|
|
|
544
|
+ height: ScreenUtil().setWidth(16),
|
|
|
|
545
|
+ decoration: BoxDecoration(
|
|
|
|
546
|
+ borderRadius: BorderRadius.circular(
|
|
|
|
547
|
+ ScreenUtil().setWidth(16)),
|
|
|
|
548
|
+ color: _getUnMsgNum()
|
|
|
|
549
|
+ ? MyColours.color_fa5151
|
|
|
|
550
|
+ : Colors.transparent),
|
|
|
|
551
|
+ ),
|
|
|
|
552
|
+ )
|
|
|
|
553
|
+ ],
|
|
|
|
554
|
+ ),
|
|
|
|
555
|
+ title: Text(
|
|
|
|
556
|
+ "消息中心",
|
|
|
|
557
|
+ style: TextStyle(
|
|
|
|
558
|
+ color: _currIndex == 1 ? _activeColor : _defaultColor,
|
|
|
|
559
|
+ fontSize: ScreenUtil().setSp(22)),
|
|
|
|
560
|
+ ),
|
|
490
|
),
|
561
|
),
|
|
491
|
- ),
|
|
|
|
492
|
- BottomNavigationBarItem(
|
|
|
|
493
|
- icon: Image(
|
|
|
|
494
|
- image: AssetImage("assets/message_default.png"),
|
|
|
|
495
|
- width: ScreenUtil().setWidth(48),
|
|
|
|
496
|
- height: ScreenUtil().setWidth(48),
|
|
|
|
497
|
- ),
|
|
|
|
498
|
- activeIcon: Image(
|
|
|
|
499
|
- image: AssetImage("assets/message_selected.png"),
|
|
|
|
500
|
- width: ScreenUtil().setWidth(48),
|
|
|
|
501
|
- height: ScreenUtil().setWidth(48),
|
|
|
|
502
|
- ),
|
|
|
|
503
|
- title: Text(
|
|
|
|
504
|
- "消息中心",
|
|
|
|
505
|
- style: TextStyle(
|
|
|
|
506
|
- color: _currIndex == 1 ? _activeColor : _defaultColor,
|
|
|
|
507
|
- fontSize: ScreenUtil().setSp(22)),
|
|
|
|
508
|
- ),
|
|
|
|
509
|
- ),
|
|
|
|
510
|
// BottomNavigationBarItem(
|
562
|
// BottomNavigationBarItem(
|
|
511
|
// icon: Image(
|
563
|
// icon: Image(
|
|
512
|
// image: AssetImage("assets/message_default.png"),
|
564
|
// image: AssetImage("assets/message_default.png"),
|
|
@@ -525,151 +577,161 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { |
|
@@ -525,151 +577,161 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { |
|
525
|
// fontSize: ScreenUtil().setSp(22)),
|
577
|
// fontSize: ScreenUtil().setSp(22)),
|
|
526
|
// ),
|
578
|
// ),
|
|
527
|
// ),
|
579
|
// ),
|
|
528
|
- BottomNavigationBarItem(
|
|
|
|
529
|
- icon: Image(
|
|
|
|
530
|
- image: AssetImage("assets/notebook_default.png"),
|
|
|
|
531
|
- width: ScreenUtil().setWidth(48),
|
|
|
|
532
|
- height: ScreenUtil().setWidth(48),
|
|
|
|
533
|
- ),
|
|
|
|
534
|
- activeIcon: Image(
|
|
|
|
535
|
- image: AssetImage("assets/notebook_selected.png"),
|
|
|
|
536
|
- width: ScreenUtil().setWidth(48),
|
|
|
|
537
|
- height: ScreenUtil().setWidth(48),
|
580
|
+ BottomNavigationBarItem(
|
|
|
|
581
|
+ icon: Image(
|
|
|
|
582
|
+ image: AssetImage("assets/notebook_default.png"),
|
|
|
|
583
|
+ width: ScreenUtil().setWidth(48),
|
|
|
|
584
|
+ height: ScreenUtil().setWidth(48),
|
|
|
|
585
|
+ ),
|
|
|
|
586
|
+ activeIcon: Image(
|
|
|
|
587
|
+ image: AssetImage("assets/notebook_selected.png"),
|
|
|
|
588
|
+ width: ScreenUtil().setWidth(48),
|
|
|
|
589
|
+ height: ScreenUtil().setWidth(48),
|
|
|
|
590
|
+ ),
|
|
|
|
591
|
+ title: Text(
|
|
|
|
592
|
+ "已预订",
|
|
|
|
593
|
+ style: TextStyle(
|
|
|
|
594
|
+ color: _currIndex == 2 ? _activeColor : _defaultColor,
|
|
|
|
595
|
+ fontSize: ScreenUtil().setSp(22)),
|
|
|
|
596
|
+ ),
|
|
538
|
),
|
597
|
),
|
|
539
|
- title: Text(
|
|
|
|
540
|
- "已预订",
|
|
|
|
541
|
- style: TextStyle(
|
|
|
|
542
|
- color: _currIndex == 2 ? _activeColor : _defaultColor,
|
|
|
|
543
|
- fontSize: ScreenUtil().setSp(22)),
|
598
|
+ BottomNavigationBarItem(
|
|
|
|
599
|
+ icon: Image(
|
|
|
|
600
|
+ image: AssetImage("assets/tablemanage_default.png"),
|
|
|
|
601
|
+ width: ScreenUtil().setWidth(48),
|
|
|
|
602
|
+ height: ScreenUtil().setWidth(48),
|
|
|
|
603
|
+ ),
|
|
|
|
604
|
+ activeIcon: Image(
|
|
|
|
605
|
+ image: AssetImage("assets/tablemanage_selected.png"),
|
|
|
|
606
|
+ width: ScreenUtil().setWidth(48),
|
|
|
|
607
|
+ height: ScreenUtil().setWidth(48),
|
|
|
|
608
|
+ ),
|
|
|
|
609
|
+ title: Text(
|
|
|
|
610
|
+ "桌位",
|
|
|
|
611
|
+ style: TextStyle(
|
|
|
|
612
|
+ color: _currIndex == 3 ? _activeColor : _defaultColor,
|
|
|
|
613
|
+ fontSize: ScreenUtil().setSp(22)),
|
|
|
|
614
|
+ ),
|
|
544
|
),
|
615
|
),
|
|
545
|
- ),
|
|
|
|
546
|
- BottomNavigationBarItem(
|
|
|
|
547
|
- icon: Image(
|
|
|
|
548
|
- image: AssetImage("assets/tablemanage_default.png"),
|
|
|
|
549
|
- width: ScreenUtil().setWidth(48),
|
|
|
|
550
|
- height: ScreenUtil().setWidth(48),
|
616
|
+ BottomNavigationBarItem(
|
|
|
|
617
|
+ icon: Image(
|
|
|
|
618
|
+ image: AssetImage("assets/my_default.png"),
|
|
|
|
619
|
+ width: ScreenUtil().setWidth(48),
|
|
|
|
620
|
+ height: ScreenUtil().setWidth(48),
|
|
|
|
621
|
+ ),
|
|
|
|
622
|
+ activeIcon: Image(
|
|
|
|
623
|
+ image: AssetImage("assets/my_selected.png"),
|
|
|
|
624
|
+ width: ScreenUtil().setWidth(48),
|
|
|
|
625
|
+ height: ScreenUtil().setWidth(48),
|
|
|
|
626
|
+ ),
|
|
|
|
627
|
+ title: Text(
|
|
|
|
628
|
+ "我的",
|
|
|
|
629
|
+ style: TextStyle(
|
|
|
|
630
|
+ color: _currIndex == 4 ? _activeColor : _defaultColor,
|
|
|
|
631
|
+ fontSize: ScreenUtil().setSp(22)),
|
|
|
|
632
|
+ ),
|
|
551
|
),
|
633
|
),
|
|
552
|
- activeIcon: Image(
|
|
|
|
553
|
- image: AssetImage("assets/tablemanage_selected.png"),
|
|
|
|
554
|
- width: ScreenUtil().setWidth(48),
|
|
|
|
555
|
- height: ScreenUtil().setWidth(48),
|
|
|
|
556
|
- ),
|
|
|
|
557
|
- title: Text(
|
|
|
|
558
|
- "桌位",
|
|
|
|
559
|
- style: TextStyle(
|
|
|
|
560
|
- color: _currIndex == 3 ? _activeColor : _defaultColor,
|
|
|
|
561
|
- fontSize: ScreenUtil().setSp(22)),
|
|
|
|
562
|
- ),
|
|
|
|
563
|
- ),
|
|
|
|
564
|
- BottomNavigationBarItem(
|
|
|
|
565
|
- icon: Image(
|
|
|
|
566
|
- image: AssetImage("assets/my_default.png"),
|
|
|
|
567
|
- width: ScreenUtil().setWidth(48),
|
|
|
|
568
|
- height: ScreenUtil().setWidth(48),
|
|
|
|
569
|
- ),
|
|
|
|
570
|
- activeIcon: Image(
|
|
|
|
571
|
- image: AssetImage("assets/my_selected.png"),
|
|
|
|
572
|
- width: ScreenUtil().setWidth(48),
|
|
|
|
573
|
- height: ScreenUtil().setWidth(48),
|
|
|
|
574
|
- ),
|
|
|
|
575
|
- title: Text(
|
|
|
|
576
|
- "我的",
|
|
|
|
577
|
- style: TextStyle(
|
|
|
|
578
|
- color: _currIndex == 4 ? _activeColor : _defaultColor,
|
|
|
|
579
|
- fontSize: ScreenUtil().setSp(22)),
|
|
|
|
580
|
- ),
|
|
|
|
581
|
- ),
|
|
|
|
582
|
- ],
|
|
|
|
583
|
- type: BottomNavigationBarType.fixed,
|
|
|
|
584
|
- currentIndex: _currIndex,
|
|
|
|
585
|
- onTap: (int index) {
|
|
|
|
586
|
- if (_currIndex != index) {
|
634
|
+ ],
|
|
|
|
635
|
+ type: BottomNavigationBarType.fixed,
|
|
|
|
636
|
+ currentIndex: _currIndex,
|
|
|
|
637
|
+ onTap: (int index) {
|
|
|
|
638
|
+ if (_currIndex != index) {
|
|
|
|
639
|
+ setState(() {
|
|
|
|
640
|
+ _currIndex = index;
|
|
|
|
641
|
+ _pageController.jumpToPage(index);
|
|
|
|
642
|
+ });
|
|
|
|
643
|
+ if (_currIndex == 5) {
|
|
|
|
644
|
+ Utils.changeStatusColor(color: MyColours.color_199095);
|
|
|
|
645
|
+ } else {
|
|
|
|
646
|
+ Utils.changeStatusColor(color: Colors.white);
|
|
|
|
647
|
+ }
|
|
|
|
648
|
+ }
|
|
|
|
649
|
+ },
|
|
|
|
650
|
+ ),
|
|
|
|
651
|
+ // bottomNavigationBar: BottomAppBar(
|
|
|
|
652
|
+ // shape: CircularNotchedRectangle(),
|
|
|
|
653
|
+ // child: Container(
|
|
|
|
654
|
+ // height: ScreenUtil().setWidth(98),
|
|
|
|
655
|
+ // // padding: EdgeInsets.fromLTRB(0, 12, 0, 8),
|
|
|
|
656
|
+ // child: Row(
|
|
|
|
657
|
+ // mainAxisSize: MainAxisSize.max,
|
|
|
|
658
|
+ // mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
|
|
659
|
+ // crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
660
|
+ // children: <Widget>[
|
|
|
|
661
|
+ // GestureDetector(
|
|
|
|
662
|
+ // onTap: () {
|
|
|
|
663
|
+ // // onTap(0);
|
|
|
|
664
|
+ // },
|
|
|
|
665
|
+ // child: Column(
|
|
|
|
666
|
+ // mainAxisSize: MainAxisSize.min,
|
|
|
|
667
|
+ // children: <Widget>[
|
|
|
|
668
|
+ // Image(
|
|
|
|
669
|
+ // image: AssetImage("assets/my_selected.png"),
|
|
|
|
670
|
+ // width: ScreenUtil().setWidth(44),
|
|
|
|
671
|
+ // height: ScreenUtil().setWidth(44),
|
|
|
|
672
|
+ // ),
|
|
|
|
673
|
+ // Text(
|
|
|
|
674
|
+ // "我的",
|
|
|
|
675
|
+ // style: TextStyle(
|
|
|
|
676
|
+ // color: _currIndex == 2
|
|
|
|
677
|
+ // ? _activeColor
|
|
|
|
678
|
+ // : _defaultColor,
|
|
|
|
679
|
+ // fontSize: ScreenUtil().setSp(22)),
|
|
|
|
680
|
+ // )
|
|
|
|
681
|
+ // ],
|
|
|
|
682
|
+ // )),
|
|
|
|
683
|
+ // GestureDetector(
|
|
|
|
684
|
+ // onTap: () {
|
|
|
|
685
|
+ // // onTap(1);
|
|
|
|
686
|
+ // },
|
|
|
|
687
|
+ // child: Column(
|
|
|
|
688
|
+ // mainAxisSize: MainAxisSize.min,
|
|
|
|
689
|
+ // children: <Widget>[
|
|
|
|
690
|
+ // Image(
|
|
|
|
691
|
+ // image: AssetImage("assets/my_selected.png"),
|
|
|
|
692
|
+ // width: ScreenUtil().setWidth(44),
|
|
|
|
693
|
+ // height: ScreenUtil().setWidth(44),
|
|
|
|
694
|
+ // ),
|
|
|
|
695
|
+ // Text(
|
|
|
|
696
|
+ // "我的",
|
|
|
|
697
|
+ // style: TextStyle(
|
|
|
|
698
|
+ // color: _currIndex == 2
|
|
|
|
699
|
+ // ? _activeColor
|
|
|
|
700
|
+ // : _defaultColor,
|
|
|
|
701
|
+ // fontSize: ScreenUtil().setSp(22)),
|
|
|
|
702
|
+ // )
|
|
|
|
703
|
+ // ],
|
|
|
|
704
|
+ // )),
|
|
|
|
705
|
+ // Column(
|
|
|
|
706
|
+ // mainAxisSize: MainAxisSize.min,
|
|
|
|
707
|
+ // children: <Widget>[
|
|
|
|
708
|
+ // Image(
|
|
|
|
709
|
+ // image: AssetImage("assets/my_selected.png"),
|
|
|
|
710
|
+ // width: ScreenUtil().setWidth(44),
|
|
|
|
711
|
+ // height: ScreenUtil().setWidth(44),
|
|
|
|
712
|
+ // ),
|
|
|
|
713
|
+ // Text(
|
|
|
|
714
|
+ // "我的",
|
|
|
|
715
|
+ // style: TextStyle(
|
|
|
|
716
|
+ // color:
|
|
|
|
717
|
+ // _currIndex == 2 ? _activeColor : _defaultColor,
|
|
|
|
718
|
+ // fontSize: ScreenUtil().setSp(22)),
|
|
|
|
719
|
+ // )
|
|
|
|
720
|
+ // ],
|
|
|
|
721
|
+ // )
|
|
|
|
722
|
+ // ])),
|
|
|
|
723
|
+ // ),
|
|
|
|
724
|
+ // body: pages[_currIndex],
|
|
|
|
725
|
+ body: PageView(
|
|
|
|
726
|
+ controller: _pageController,
|
|
|
|
727
|
+ children: pages,
|
|
|
|
728
|
+ onPageChanged: (index) {
|
|
587
|
setState(() {
|
729
|
setState(() {
|
|
588
|
_currIndex = index;
|
730
|
_currIndex = index;
|
|
589
|
});
|
731
|
});
|
|
590
|
- if (_currIndex == 5) {
|
|
|
|
591
|
- Utils.changeStatusColor(color: MyColours.color_199095);
|
|
|
|
592
|
- } else {
|
|
|
|
593
|
- Utils.changeStatusColor(color: Colors.white);
|
|
|
|
594
|
- }
|
|
|
|
595
|
- }
|
|
|
|
596
|
- },
|
|
|
|
597
|
- ),
|
|
|
|
598
|
- // bottomNavigationBar: BottomAppBar(
|
|
|
|
599
|
- // shape: CircularNotchedRectangle(),
|
|
|
|
600
|
- // child: Container(
|
|
|
|
601
|
- // height: ScreenUtil().setWidth(98),
|
|
|
|
602
|
- // // padding: EdgeInsets.fromLTRB(0, 12, 0, 8),
|
|
|
|
603
|
- // child: Row(
|
|
|
|
604
|
- // mainAxisSize: MainAxisSize.max,
|
|
|
|
605
|
- // mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
|
|
606
|
- // crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
607
|
- // children: <Widget>[
|
|
|
|
608
|
- // GestureDetector(
|
|
|
|
609
|
- // onTap: () {
|
|
|
|
610
|
- // // onTap(0);
|
|
|
|
611
|
- // },
|
|
|
|
612
|
- // child: Column(
|
|
|
|
613
|
- // mainAxisSize: MainAxisSize.min,
|
|
|
|
614
|
- // children: <Widget>[
|
|
|
|
615
|
- // Image(
|
|
|
|
616
|
- // image: AssetImage("assets/my_selected.png"),
|
|
|
|
617
|
- // width: ScreenUtil().setWidth(44),
|
|
|
|
618
|
- // height: ScreenUtil().setWidth(44),
|
|
|
|
619
|
- // ),
|
|
|
|
620
|
- // Text(
|
|
|
|
621
|
- // "我的",
|
|
|
|
622
|
- // style: TextStyle(
|
|
|
|
623
|
- // color: _currIndex == 2
|
|
|
|
624
|
- // ? _activeColor
|
|
|
|
625
|
- // : _defaultColor,
|
|
|
|
626
|
- // fontSize: ScreenUtil().setSp(22)),
|
|
|
|
627
|
- // )
|
|
|
|
628
|
- // ],
|
|
|
|
629
|
- // )),
|
|
|
|
630
|
- // GestureDetector(
|
|
|
|
631
|
- // onTap: () {
|
|
|
|
632
|
- // // onTap(1);
|
|
|
|
633
|
- // },
|
|
|
|
634
|
- // child: Column(
|
|
|
|
635
|
- // mainAxisSize: MainAxisSize.min,
|
|
|
|
636
|
- // children: <Widget>[
|
|
|
|
637
|
- // Image(
|
|
|
|
638
|
- // image: AssetImage("assets/my_selected.png"),
|
|
|
|
639
|
- // width: ScreenUtil().setWidth(44),
|
|
|
|
640
|
- // height: ScreenUtil().setWidth(44),
|
|
|
|
641
|
- // ),
|
|
|
|
642
|
- // Text(
|
|
|
|
643
|
- // "我的",
|
|
|
|
644
|
- // style: TextStyle(
|
|
|
|
645
|
- // color: _currIndex == 2
|
|
|
|
646
|
- // ? _activeColor
|
|
|
|
647
|
- // : _defaultColor,
|
|
|
|
648
|
- // fontSize: ScreenUtil().setSp(22)),
|
|
|
|
649
|
- // )
|
|
|
|
650
|
- // ],
|
|
|
|
651
|
- // )),
|
|
|
|
652
|
- // Column(
|
|
|
|
653
|
- // mainAxisSize: MainAxisSize.min,
|
|
|
|
654
|
- // children: <Widget>[
|
|
|
|
655
|
- // Image(
|
|
|
|
656
|
- // image: AssetImage("assets/my_selected.png"),
|
|
|
|
657
|
- // width: ScreenUtil().setWidth(44),
|
|
|
|
658
|
- // height: ScreenUtil().setWidth(44),
|
|
|
|
659
|
- // ),
|
|
|
|
660
|
- // Text(
|
|
|
|
661
|
- // "我的",
|
|
|
|
662
|
- // style: TextStyle(
|
|
|
|
663
|
- // color:
|
|
|
|
664
|
- // _currIndex == 2 ? _activeColor : _defaultColor,
|
|
|
|
665
|
- // fontSize: ScreenUtil().setSp(22)),
|
|
|
|
666
|
- // )
|
|
|
|
667
|
- // ],
|
|
|
|
668
|
- // )
|
|
|
|
669
|
- // ])),
|
|
|
|
670
|
- // ),
|
|
|
|
671
|
- body: pages[_currIndex],
|
|
|
|
672
|
- ),
|
732
|
+ },
|
|
|
|
733
|
+ physics: NeverScrollableScrollPhysics(), //禁止底部滑动
|
|
|
|
734
|
+ )),
|
|
673
|
onWillPop: () async {
|
735
|
onWillPop: () async {
|
|
674
|
if (lastBack != null &&
|
736
|
if (lastBack != null &&
|
|
675
|
DateTime.now().millisecondsSinceEpoch -
|
737
|
DateTime.now().millisecondsSinceEpoch -
|