Compare commits

..

No commits in common. "c078333129dbfa1cc34a6cbb1e34710d4f5145e2" and "ce02fd3b50d04cb97712ac9690d097d25f50143b" have entirely different histories.

2 changed files with 47 additions and 8 deletions

View File

@ -84,7 +84,7 @@ class _HomePageState extends State<HomePage> {
}, },
), ),
) )
..loadRequest(Uri.parse('http://203.64.84.154:8088/0')), ..loadRequest(Uri.parse('http://203.64.84.154:8088')),
), ),
), ),
Text( Text(

View File

@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:mysql_client/mysql_client.dart'; import 'package:mysql_client/mysql_client.dart';
import 'package:webview_flutter/webview_flutter.dart'; import 'package:webview_flutter/webview_flutter.dart';
import 'BottomNavBar.dart';
class MessagePage extends StatefulWidget { class MessagePage extends StatefulWidget {
final String email; // email final String email; // email
@ -17,12 +18,12 @@ class _MessagePageState extends State<MessagePage> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_webViewController = WebViewController();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return PopScope(
child: Scaffold(
body: Center( body: Center(
child: Column( child: Column(
children: [ children: [
@ -58,7 +59,7 @@ class _MessagePageState extends State<MessagePage> {
width: double.infinity, width: double.infinity,
// TODO: http需要分別設定ios, android權限 // TODO: http需要分別設定ios, android權限
child: WebViewWidget( child: WebViewWidget(
controller: _webViewController controller: WebViewController()
..setJavaScriptMode(JavaScriptMode.unrestricted) ..setJavaScriptMode(JavaScriptMode.unrestricted)
..setNavigationDelegate( ..setNavigationDelegate(
NavigationDelegate( NavigationDelegate(
@ -83,7 +84,7 @@ class _MessagePageState extends State<MessagePage> {
}, },
), ),
) )
..loadRequest(Uri.parse('http://203.64.84.154:8088/0')), ..loadRequest(Uri.parse('http://203.64.84.154:8088')),
), ),
), ),
Text( Text(
@ -100,8 +101,10 @@ class _MessagePageState extends State<MessagePage> {
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.all(16), padding: EdgeInsets.all(16),
children: [ children: [
_buildGridItem(Icons.monitor_outlined, '畫面1', 0, context), _buildGridItem(Icons.monitor_outlined, '畫面1', context),
_buildGridItem(Icons.monitor_outlined, '畫面2', 1, context), _buildGridItem(Icons.monitor_outlined, '畫面2', context),
/*_buildGridItem(Icons.monitor_outlined, '切換畫面', context),
_buildGridItem(Icons.person_sharp, '個人資料', context),*/
], ],
), ),
), ),
@ -121,7 +124,43 @@ class _MessagePageState extends State<MessagePage> {
color: Colors.white, color: Colors.white,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
_webViewController.loadRequest(Uri.parse('http://203.64.84.154:8088/$camera_id')); /*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,
)),
);
}*/
}, },
child: Center( child: Center(
child: Column( child: Column(