Browse Source

1、update measure VidPlayerControlBoard

bakamaka.guan 2 years ago
parent
commit
583862d3bb

+ 60 - 37
lib/view/main/desktop.dart

@@ -1,10 +1,8 @@
-import 'dart:math' as math;
 import 'package:fis_measure/interfaces/date_types/int_size.dart';
 import 'package:fis_measure/interfaces/process/player/play_controller.dart';
 import 'package:fis_measure/interfaces/process/workspace/application.dart';
 import 'package:fis_measure/values/colors.dart';
-import 'package:fis_measure/view/player/enums.dart';
-import 'package:fis_vid/data_host/data_host.dart';
+import 'package:fis_measure/view/player/control_board/control_board.dart';
 import 'package:flutter/material.dart';
 import 'package:get/get.dart';
 
@@ -12,7 +10,6 @@ import '../canvas/active_canvas.dart';
 import '../canvas/records_canvas.dart';
 import '../gesture/mouse_gesture.dart';
 import '../player/controller.dart';
-import '../player/events.dart';
 import '../player/player.dart';
 import '../result/results_panel.dart';
 
@@ -62,42 +59,68 @@ class _MeasureMainViewState extends State<MeasureMainView> {
     }
   }
 
+  Widget vidPlayerBoard() {
+    if ((playerController as VidPlayerController).totalFramesCount > 1) {
+      return Container(
+        margin: const EdgeInsets.symmetric(
+          horizontal: 160,
+        ),
+        key: UniqueKey(),
+        height: 100,
+        child: VidPlayerControlBoard(
+          playerController as VidPlayerController,
+        ),
+      );
+    } else {
+      return Container();
+    }
+  }
+
   @override
   Widget build(BuildContext context) {
-    return Container(
-      color: MeasureColors.Background,
-      child: CustomMultiChildLayout(
-        delegate: _LayerLayoutDelegate(imageSize: frameSize),
-        children: [
-          LayoutId(
-            id: _LayerLayoutIds.player,
-            child: Container(
-              // decoration: BoxDecoration(
-              //   border: Border.all(color: Colors.white),
-              // ),
-              child: VidPlayer(playerController as VidPlayerController),
-            ),
+    return Stack(
+      children: [
+        Container(
+          color: MeasureColors.Background,
+          child: CustomMultiChildLayout(
+            delegate: _LayerLayoutDelegate(imageSize: frameSize),
+            children: [
+              LayoutId(
+                id: _LayerLayoutIds.player,
+                child: Container(
+                  child: VidPlayer(playerController as VidPlayerController),
+                ),
+              ),
+              if (canMeasure) ...[
+                LayoutId(
+                  id: _LayerLayoutIds.recordsCanvas,
+                  child: const MeasureRecordsCanvasPanel(),
+                ),
+                LayoutId(
+                  id: _LayerLayoutIds.activeCanvas,
+                  child: const MeasureActiveCanvasPanel(),
+                ),
+                LayoutId(
+                  id: _LayerLayoutIds.gesture,
+                  child: const MeasureMouseGesturePanel(),
+                ),
+                LayoutId(
+                  id: _LayerLayoutIds.result,
+                  child: const MeasureResultPanel(),
+                ),
+              ],
+            ],
+          ),
+        ),
+        Align(
+          alignment: Alignment.bottomCenter,
+          child: Positioned(
+            height: 100,
+            bottom: 50,
+            child: vidPlayerBoard(),
           ),
-          if (canMeasure) ...[
-            LayoutId(
-              id: _LayerLayoutIds.recordsCanvas,
-              child: const MeasureRecordsCanvasPanel(),
-            ),
-            LayoutId(
-              id: _LayerLayoutIds.activeCanvas,
-              child: const MeasureActiveCanvasPanel(),
-            ),
-            LayoutId(
-              id: _LayerLayoutIds.gesture,
-              child: const MeasureMouseGesturePanel(),
-            ),
-            LayoutId(
-              id: _LayerLayoutIds.result,
-              child: const MeasureResultPanel(),
-            ),
-          ],
-        ],
-      ),
+        ),
+      ],
     );
   }
 }

+ 4 - 1
lib/view/player/control_board/next_btn.dart

@@ -10,7 +10,10 @@ class _NextButton extends StatelessWidget {
       onPressed: () {
         playerController.gotoNextFrame();
       },
-      icon: const Icon(Icons.arrow_circle_right_outlined),
+      icon: const Icon(
+        Icons.arrow_circle_right_outlined,
+        color: Colors.white,
+      ),
     );
   }
 }

+ 10 - 2
lib/view/player/control_board/play_btn.dart

@@ -39,8 +39,16 @@ class _PlayButtonState extends State<_PlayButton> {
         }
       },
       icon: playing
-          ? const Icon(Icons.stop_circle_outlined, size: iconSize)
-          : const Icon(Icons.play_circle_outline, size: iconSize),
+          ? const Icon(
+              Icons.stop_circle_outlined,
+              size: iconSize,
+              color: Colors.white,
+            )
+          : const Icon(
+              Icons.play_circle_outline,
+              size: iconSize,
+              color: Colors.white,
+            ),
     );
   }
 

+ 4 - 1
lib/view/player/control_board/prev_btn.dart

@@ -10,7 +10,10 @@ class _PrevButton extends StatelessWidget {
       onPressed: () {
         playerController.gotoPrevFrame();
       },
-      icon: const Icon(Icons.arrow_circle_left_outlined),
+      icon: const Icon(
+        Icons.arrow_circle_left_outlined,
+        color: Colors.white,
+      ),
     );
   }
 }