|
@@ -1,9 +1,9 @@
|
|
|
-import 'package:fis_common/env/env.dart';
|
|
|
+import 'package:fis_common/index.dart';
|
|
|
import 'package:fis_measure/interfaces/process/player/play_controller.dart';
|
|
|
import 'package:fis_vid/processors/index.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
|
import 'package:get/get.dart';
|
|
|
-
|
|
|
+import 'package:fis_i18n/i18n.dart';
|
|
|
import '../controller.dart';
|
|
|
import '../events.dart';
|
|
|
|
|
@@ -13,24 +13,29 @@ part 'next_btn.dart';
|
|
|
part 'progress_bar.dart';
|
|
|
part 'tone_bar.dart';
|
|
|
|
|
|
-class VidPlayerControlBoard extends StatelessWidget {
|
|
|
+class VidPlayerControlBoard extends StatefulWidget {
|
|
|
const VidPlayerControlBoard(this.controller, {Key? key}) : super(key: key);
|
|
|
|
|
|
final VidPlayerController controller;
|
|
|
|
|
|
+ @override
|
|
|
+ State<VidPlayerControlBoard> createState() => _VidPlayerControlBoardState();
|
|
|
+}
|
|
|
+
|
|
|
+class _VidPlayerControlBoardState extends State<VidPlayerControlBoard> {
|
|
|
+ String selectStuta = '';
|
|
|
+
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
|
return _SharedWidget(
|
|
|
- controller: controller,
|
|
|
+ controller: widget.controller,
|
|
|
child: Container(
|
|
|
- padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 18),
|
|
|
+ padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
|
|
child: Column(
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
children: [
|
|
|
- if (!FPlatform.isPureWeb) ...[
|
|
|
- _BrightnessToneBar(),
|
|
|
- _ContrastToneBar(),
|
|
|
- ],
|
|
|
+ _buildPlayOperateBar(),
|
|
|
+ _buildOperateBar(),
|
|
|
_buildPlayStatusBar(),
|
|
|
],
|
|
|
),
|
|
@@ -55,6 +60,96 @@ class VidPlayerControlBoard extends StatelessWidget {
|
|
|
),
|
|
|
);
|
|
|
}
|
|
|
+
|
|
|
+ Widget _buildPlayOperateBar() {
|
|
|
+ return Center(
|
|
|
+ child: Row(
|
|
|
+ mainAxisSize: MainAxisSize.min,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ children: [
|
|
|
+ _buildOperateButton(
|
|
|
+ Icons.call_made_outlined, i18nBook.measure.arrow.t),
|
|
|
+ if (!FPlatform.isPureWeb) ...[
|
|
|
+ _buildOperateButton(Icons.wb_sunny, i18nBook.measure.brightness.t),
|
|
|
+ _buildOperateButton(Icons.contrast, i18nBook.measure.contrast.t),
|
|
|
+ ],
|
|
|
+ _buildOperateButton(Icons.undo_rounded, i18nBook.common.revoke.t),
|
|
|
+ _buildOperateButton(
|
|
|
+ Icons.cleaning_services_rounded, i18nBook.measure.clear.t),
|
|
|
+ _buildOperateButton(Icons.fullscreen, i18nBook.measure.fullScreen.t),
|
|
|
+ _buildOperateButton(Icons.save_outlined, i18nBook.common.save.t),
|
|
|
+ _buildOperateButton(Icons.share, i18nBook.remedical.share.t, true),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ Widget _buildOperateButton(IconData icons, String text,
|
|
|
+ [bool isLast = false]) {
|
|
|
+ const BorderSide borderSide = BorderSide(
|
|
|
+ color: Color.fromRGBO(
|
|
|
+ 155,
|
|
|
+ 155,
|
|
|
+ 155,
|
|
|
+ 1,
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ return InkWell(
|
|
|
+ onTap: () {
|
|
|
+ selectStuta = text;
|
|
|
+ setState(() {});
|
|
|
+ },
|
|
|
+ child: Container(
|
|
|
+ padding: const EdgeInsets.all(8.0),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: selectStuta == text ? Colors.blue : Colors.white,
|
|
|
+ border: Border(
|
|
|
+ top: borderSide,
|
|
|
+ bottom: borderSide,
|
|
|
+ left: borderSide,
|
|
|
+ right: isLast
|
|
|
+ ? borderSide
|
|
|
+ : const BorderSide(color: Colors.transparent),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ if (selectStuta == text) ...[
|
|
|
+ Icon(
|
|
|
+ icons,
|
|
|
+ color: Colors.white,
|
|
|
+ ),
|
|
|
+ Text(
|
|
|
+ text,
|
|
|
+ style: const TextStyle(
|
|
|
+ color: Colors.white,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ] else ...[
|
|
|
+ Icon(icons),
|
|
|
+ Text(text),
|
|
|
+ ]
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ Widget _buildOperateBar() {
|
|
|
+ return Container(
|
|
|
+ margin: const EdgeInsets.only(
|
|
|
+ top: 15,
|
|
|
+ ),
|
|
|
+ child: Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
+ children: [
|
|
|
+ if (selectStuta == i18nBook.measure.brightness.t)
|
|
|
+ _BrightnessToneBar(),
|
|
|
+ if (selectStuta == i18nBook.measure.contrast.t) _ContrastToneBar(),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
class _SharedWidget extends InheritedWidget {
|