main.dart 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. import 'dart:ui';
  2. import 'package:fis_common/index.dart';
  3. import 'package:fis_common/logger/logger.dart';
  4. import 'package:fis_jsonrpc/rpc.dart';
  5. import 'package:fis_measure/measure_page_test.dart';
  6. import 'package:fis_measure/process/layout/configuration.dart';
  7. import 'package:fis_measure/view/measure/measure_view.dart';
  8. import 'package:fis_vid/index.dart';
  9. import 'package:flutter/material.dart';
  10. import 'package:get/get.dart';
  11. import 'package:fis_i18n/i18n.dart';
  12. import 'item_create_test.dart';
  13. import 'third_vid_test.dart';
  14. void main() async {
  15. WidgetsFlutterBinding.ensureInitialized();
  16. logger.setMinimumLevel(LogLevel.UserOperate);
  17. await logger.init();
  18. await _initI18n();
  19. await LayoutConfiguration.ins.loadData();
  20. // LayoutConfiguration.ins.getRect("")
  21. final rpc = JsonRpcProxy();
  22. if (FPlatform.isMacOS || FPlatform.isWindows) {
  23. VidDataHostEnv.setPlatformGetter(() => rpc.platform);
  24. }
  25. runApp(const MyApp());
  26. }
  27. class MyApp extends StatelessWidget {
  28. const MyApp({Key? key}) : super(key: key);
  29. @override
  30. Widget build(BuildContext context) {
  31. return MaterialApp(
  32. debugShowCheckedModeBanner: false,
  33. title: 'Flutter Demo',
  34. theme: ThemeData(
  35. primarySwatch: Colors.blue,
  36. ),
  37. home: const MyHomePage(title: 'Flutter Demo Home Page'),
  38. // home: ImageDemoPage(),
  39. );
  40. }
  41. }
  42. class MyHomePage extends StatefulWidget {
  43. const MyHomePage({Key? key, required this.title}) : super(key: key);
  44. final String title;
  45. @override
  46. State<MyHomePage> createState() => _MyHomePageState();
  47. }
  48. class _MyHomePageState extends State<MyHomePage> {
  49. void _incrementCounter() {}
  50. @override
  51. Widget build(BuildContext context) {
  52. return Scaffold(
  53. appBar: AppBar(
  54. title: Text(widget.title),
  55. ),
  56. body: Center(
  57. child: Column(
  58. mainAxisAlignment: MainAxisAlignment.center,
  59. children: <Widget>[
  60. ElevatedButton(
  61. onPressed: () {
  62. // ThirdPartVidTest().run();
  63. ItemCreateTest().run();
  64. },
  65. child: const Text("Test 3rd vid"),
  66. ),
  67. const SizedBox(height: 10),
  68. ElevatedButton(
  69. onPressed: () {
  70. Navigator.of(context).push(
  71. MaterialPageRoute(
  72. builder: (context) => const MeasureTestPage(),
  73. ),
  74. );
  75. // MeasureController("").load();
  76. // const url =
  77. // "http://192.168.6.117:9001/Flyinsono-BJ-1300984704.VCS.AP-BeiJing/default.VID";
  78. // // final isMobile = Platform.isAndroid || Platform.isIOS;
  79. // Navigator.of(context).push(
  80. // MaterialPageRoute(
  81. // builder: (_) => VidPlayerPage(url),
  82. // // !kIsWeb ? VidPlayerMobilePage(url) : VidPlayerPage(url),
  83. // ),
  84. // );
  85. },
  86. child: const Text("Player"),
  87. ),
  88. const SizedBox(
  89. height: 15,
  90. ),
  91. ElevatedButton(
  92. onPressed: () {
  93. Navigator.of(context).push(
  94. MaterialPageRoute(
  95. builder: (context) => const MeasureMainPage(
  96. '50BB5ED499304A8C8BD77B39CBCF596E',
  97. 'RecordInfoDO_20220811025200rOow04',
  98. 'PatientInfoDO_202208110311443tup96',
  99. 'RemedicalDO_20220811025202y3u0Rc'),
  100. ),
  101. );
  102. },
  103. child: const Text("Measure image"),
  104. ),
  105. ],
  106. ),
  107. ),
  108. floatingActionButton: FloatingActionButton(
  109. onPressed: _incrementCounter,
  110. tooltip: 'Increment',
  111. child: const Icon(Icons.add),
  112. ), // This trailing comma makes auto-formatting nicer for build methods.
  113. );
  114. }
  115. }
  116. Future<void> _initI18n() async {
  117. final curLocale = window.locale;
  118. var bookOptions = [
  119. FTrKeybookOption.ChineseOption,
  120. FTrKeybookOption.EnglishOption,
  121. ];
  122. await FI18n.init((locale) => Get.updateLocale(locale), bookOptions);
  123. await FI18n.load(curLocale);
  124. Get.put(FI18n.ins);
  125. }