view.dart 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. import 'package:flutter/material.dart';
  2. import 'package:flyinsono/architecture/define.dart';
  3. import 'package:flyinsono/lab/color/lab_colors.dart';
  4. import 'package:flyinsono/lab/components/clock/clock.dart';
  5. import 'package:flyinsono/lab/components/memory_monitor.dart';
  6. import 'package:flyinsono/lab/manager/page_manager.dart';
  7. import 'package:flyinsono/lab/router/lab_route_names.dart';
  8. import 'package:flyinsono/pages/schedule/schedule_notification/global_notification_layer.dart';
  9. import 'package:get/get.dart';
  10. import 'index.dart';
  11. import 'widgets/widgets.dart';
  12. class LabMainPage extends GetView<LabMainController> {
  13. const LabMainPage({Key? key}) : super(key: key);
  14. // 主视图
  15. Widget _buildView() {
  16. return Column(
  17. children: [
  18. MainPageHeader(),
  19. Expanded(
  20. child: GetBuilder<LabMainController>(
  21. id: LabMainController.tabViewId,
  22. builder: (controller) => IndexedStack(
  23. index: PageManager.ins.activeTabIndex,
  24. children: PageManager.ins.tabViews.entries
  25. .map((entry) => entry.value)
  26. .toList(),
  27. ),
  28. ),
  29. ),
  30. Container(
  31. height: 40,
  32. padding: EdgeInsets.symmetric(horizontal: 10).copyWith(left: 0),
  33. color: LabColors.mainPageHeaderColor,
  34. child: Row(
  35. children: [
  36. Container(
  37. height: 40,
  38. width: 150,
  39. // color: Colors.amber,
  40. // alignment: Alignment.centerLeft,
  41. child: TaskListButton(
  42. onClick: () {
  43. PageManager.ins.openNewTab(
  44. LabRouteNames.TaskList,
  45. '任务列表',
  46. multiple: false,
  47. );
  48. },
  49. ),
  50. ),
  51. Container(
  52. width: 150,
  53. ),
  54. Obx(
  55. () => Container(
  56. height: 40,
  57. width: 300,
  58. alignment: Alignment.centerLeft,
  59. child: Text(
  60. controller.state.bottomCustomText,
  61. style: TextStyle(
  62. color: LabColors.text300,
  63. ),
  64. ),
  65. ),
  66. ),
  67. // Expanded(
  68. // child: RepaintBoundary(
  69. // child: const MemoryMonitor(),
  70. // ),
  71. // ),
  72. // const SizedBox(width: 10),
  73. // Container(
  74. // width: 1,
  75. // height: 20,
  76. // color: LabColors.base500,
  77. // ),
  78. // const SizedBox(width: 10),
  79. Expanded(child: const SizedBox()),
  80. const CustomClock(
  81. textStyle:
  82. TextStyle(color: LabColors.text300, wordSpacing: 1.2),
  83. ),
  84. const SizedBox(width: 10),
  85. ],
  86. ),
  87. ),
  88. ],
  89. );
  90. }
  91. @override
  92. Widget build(BuildContext context) {
  93. return GetBuilder<LabMainController>(
  94. builder: (_) {
  95. return Scaffold(
  96. backgroundColor: LabColors.base300,
  97. body: SafeArea(
  98. child: FGlobalNotificationLayer(
  99. child: QuickFWidget(_buildView()),
  100. ),
  101. ),
  102. );
  103. },
  104. );
  105. }
  106. }