Browse Source

modify test page

melon.yin 2 years ago
parent
commit
10749b634c
2 changed files with 21 additions and 4 deletions
  1. 1 0
      lib/main.dart
  2. 20 4
      lib/measure_page_test.dart

+ 1 - 0
lib/main.dart

@@ -18,6 +18,7 @@ class MyApp extends StatelessWidget {
   @override
   Widget build(BuildContext context) {
     return MaterialApp(
+      debugShowCheckedModeBanner: false,
       title: 'Flutter Demo',
       theme: ThemeData(
         // This is the theme of your application.

+ 20 - 4
lib/measure_page_test.dart

@@ -93,15 +93,31 @@ class _MeasureTestPageState extends State<MeasureTestPage> {
         actions: [
           TextButton(
             onPressed: () {
-              Get.find<IMeasureController>().examInfo.selectedImageIndex = 0;
+              if (controller.examInfo.selectedImageIndex == 0) return;
+              controller.examInfo.selectedImageIndex = 0;
             },
-            child: const Text('0', style: TextStyle(color: Colors.white)),
+            child: Text(
+              '线阵',
+              style: TextStyle(
+                color: controller.examInfo.selectedImageIndex == 0
+                    ? Colors.amber
+                    : Colors.white,
+              ),
+            ),
           ),
           TextButton(
             onPressed: () {
-              Get.find<IMeasureController>().examInfo.selectedImageIndex = 1;
+              if (controller.examInfo.selectedImageIndex == 1) return;
+              controller.examInfo.selectedImageIndex = 1;
             },
-            child: const Text('1', style: TextStyle(color: Colors.white)),
+            child: Text(
+              '扇阵',
+              style: TextStyle(
+                color: controller.examInfo.selectedImageIndex == 1
+                    ? Colors.amber
+                    : Colors.white,
+              ),
+            ),
           ),
         ],
         leading: IconButton(