import 'package:ecg_list_view/rpc/rpc_bridge.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:fis_common/logger/logger.dart'; import 'package:fis_jsonrpc/rpc.dart'; import 'ecg_list/controller.dart'; import 'ecg_list/view.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); await Global.init(); runApp(const MyApp()); } class Global { static init() async { await logger.init(); var rpc = JsonRpcProxy(host: "platform.xinglinghui.com:9308"); rpc.setServerHost("platform.xinglinghui.com:9308", true); Get.put(RPCBridge(rpc, "2507110B51FA453BA0472EDD76DDFB78")); } } class MyApp extends StatelessWidget { const MyApp({super.key}); // This widget is the root of your application. @override Widget build(BuildContext context) { return GetMaterialApp( title: "心电列表模块", routes: { "/mainPage": (context) => EcgListPage( onEditReport: _test, onExam: (p, q) {}, ), "/home": (context) => const MyHomePage() }, initialRoute: '/home', theme: ThemeData( primarySwatch: Colors.blue, ), home: const MyHomePage(), ); } void _test(String p1, ElectrocardiogramRecord p2) {} } class MyHomePage extends StatefulWidget { const MyHomePage({super.key}); @override State createState() => _MyHomePageState(); } class _MyHomePageState extends State { @override void initState() { super.initState(); } @override Widget build(BuildContext context) { return Container( color: Colors.white, child: Center( child: ElevatedButton( onPressed: () { Get.toNamed("/mainPage"); }, child: const Text("test"), ), ), ); } }