From c078333129dbfa1cc34a6cbb1e34710d4f5145e2 Mon Sep 17 00:00:00 2001 From: JingChiang Date: Mon, 9 Sep 2024 15:52:43 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AF=A6=E4=BD=9C=E7=9B=A3=E8=A6=96?= =?UTF-8?q?=E5=99=A8=E7=95=AB=E9=9D=A2=E5=88=87=E6=8F=9B=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/MessagePage.dart | 50 ++++++-------------------------------------- 1 file changed, 6 insertions(+), 44 deletions(-) diff --git a/lib/MessagePage.dart b/lib/MessagePage.dart index 80a811f..d0561bb 100644 --- a/lib/MessagePage.dart +++ b/lib/MessagePage.dart @@ -17,12 +17,12 @@ class _MessagePageState extends State { @override void initState() { super.initState(); + _webViewController = WebViewController(); } @override Widget build(BuildContext context) { - return PopScope( - child: Scaffold( + return Scaffold( body: Center( child: Column( children: [ @@ -58,7 +58,7 @@ class _MessagePageState extends State { width: double.infinity, // TODO: 如果用http需要分別設定ios, android權限 child: WebViewWidget( - controller: WebViewController() + controller: _webViewController ..setJavaScriptMode(JavaScriptMode.unrestricted) ..setNavigationDelegate( NavigationDelegate( @@ -100,10 +100,8 @@ class _MessagePageState extends State { physics: NeverScrollableScrollPhysics(), padding: EdgeInsets.all(16), children: [ - _buildGridItem(Icons.monitor_outlined, '畫面1', context), - _buildGridItem(Icons.monitor_outlined, '畫面2', context), - /*_buildGridItem(Icons.monitor_outlined, '切換畫面', context), - _buildGridItem(Icons.person_sharp, '個人資料', context),*/ + _buildGridItem(Icons.monitor_outlined, '畫面1', 0, context), + _buildGridItem(Icons.monitor_outlined, '畫面2', 1, context), ], ), ), @@ -123,43 +121,7 @@ class _MessagePageState extends State { color: Colors.white, child: InkWell( onTap: () { - /*if (label == '跌倒紀錄') { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => BottomNavBar( - email: widget.email, - initTabIndex: 1, - )), - ); - } else if (label == '知識補充') { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => BottomNavBar( - email: widget.email, - initTabIndex: 2, - )), - ); - } else if (label == '切換畫面') { - Navigator.push( - context, - MaterialPageRoute - (builder: (context) => BottomNavBar( - email: widget.email, - initTabIndex: 3, - )), - ); - } else if (label == '個人資料') { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => BottomNavBar( - email: widget.email, - initTabIndex: 4, - )), - ); - }*/ + _webViewController.loadRequest(Uri.parse('http://203.64.84.154:8088/$camera_id')); }, child: Center( child: Column(