123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- import 'dart:convert';
- import 'dart:ui';
- import 'package:fis_common/helpers/http.dart';
- import 'package:fis_common/index.dart';
- import 'package:fis_common/logger/logger.dart';
- import 'package:fis_jsonrpc/rpc.dart';
- import 'package:fis_measure/measure_page_test.dart';
- import 'package:fis_measure/process/layout/configuration.dart';
- import 'package:fis_measure/view/measure/measure_view.dart';
- import 'package:fis_vid/index.dart';
- import 'package:flutter/material.dart';
- import 'package:flutter/services.dart';
- import 'package:get/get.dart';
- import 'package:fis_i18n/i18n.dart';
- import 'item_create_test.dart';
- void main() async {
- WidgetsFlutterBinding.ensureInitialized();
- logger.setMinimumLevel(LogLevel.UserOperate);
- await logger.init();
- await _initI18n();
- await LayoutConfiguration.ins.loadData();
- // LayoutConfiguration.ins.getRect("")
- runApp(const MyApp());
- }
- class MyApp extends StatelessWidget {
- const MyApp({Key? key}) : super(key: key);
- @override
- Widget build(BuildContext context) {
- return MaterialApp(
- debugShowCheckedModeBanner: false,
- title: 'Flutter Demo',
- theme: ThemeData(
- primarySwatch: Colors.blue,
- ),
- home: const MyHomePage(title: 'Flutter Demo Home Page'),
- // home: ImageDemoPage(),
- );
- }
- }
- class MyHomePage extends StatefulWidget {
- const MyHomePage({Key? key, required this.title}) : super(key: key);
- final String title;
- @override
- State<MyHomePage> createState() => _MyHomePageState();
- }
- class _MyHomePageState extends State<MyHomePage> {
- void _incrementCounter() {}
- String _playerBtnText = "Player";
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- title: Text(widget.title),
- ),
- body: Center(
- child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
- children: <Widget>[
- ElevatedButton(
- onPressed: () {
- // ThirdPartVidTest().run();
- // ItemCreateTest().run();
- },
- child: const Text("Function Test"),
- ),
- const SizedBox(height: 10),
- ElevatedButton(
- onPressed: () async {
- setState(() {
- _playerBtnText = "Player loading...";
- });
- if (MeasureTestPage.MetaDTOList.isEmpty) {
- final txt = await FHttpHelper.downloadString(
- ItemCreateTest.C_JSON_PATH);
- MeasureTestPage.MetaDTOList =
- jsonDecode(txt ?? '[]') as List<dynamic>;
- }
- setState(() {
- _playerBtnText = "Player";
- });
- Navigator.of(context).push(
- MaterialPageRoute(
- builder: (context) => const MeasureTestPage(),
- ),
- );
- // MeasureController("").load();
- // const url =
- // "http://192.168.6.117:9001/Flyinsono-BJ-1300984704.VCS.AP-BeiJing/default.VID";
- // // final isMobile = Platform.isAndroid || Platform.isIOS;
- // Navigator.of(context).push(
- // MaterialPageRoute(
- // builder: (_) => VidPlayerPage(url),
- // // !kIsWeb ? VidPlayerMobilePage(url) : VidPlayerPage(url),
- // ),
- // );
- },
- child: Text(_playerBtnText),
- ),
- const SizedBox(
- height: 15,
- ),
- ElevatedButton(
- onPressed: () {
- Navigator.of(context).push(
- MaterialPageRoute(
- builder: (context) => const MeasureMainPage(
- '50BB5ED499304A8C8BD77B39CBCF596E',
- 'RecordInfoDO_20220811025200rOow04',
- 'PatientInfoDO_202208110311443tup96',
- 'RemedicalDO_20220811025202y3u0Rc'),
- ),
- );
- },
- child: const Text("Measure image"),
- ),
- ],
- ),
- ),
- floatingActionButton: FloatingActionButton(
- onPressed: _incrementCounter,
- tooltip: 'Increment',
- child: const Icon(Icons.add),
- ), // This trailing comma makes auto-formatting nicer for build methods.
- );
- }
- }
- Future<void> _initI18n() async {
- final curLocale = window.locale;
- var bookOptions = [
- FTrKeybookOption.ChineseOption,
- FTrKeybookOption.EnglishOption,
- ];
- await FI18n.init((locale) => Get.updateLocale(locale), bookOptions);
- await FI18n.load(curLocale);
- Get.put(FI18n.ins);
- }
|