feat: 實作監視器畫面切換功能
This commit is contained in:
parent
f20380815b
commit
c078333129
|
|
@ -17,12 +17,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 PopScope(
|
return Scaffold(
|
||||||
child: Scaffold(
|
|
||||||
body: Center(
|
body: Center(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
|
|
@ -58,7 +58,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(
|
||||||
|
|
@ -100,10 +100,8 @@ class _MessagePageState extends State<MessagePage> {
|
||||||
physics: NeverScrollableScrollPhysics(),
|
physics: NeverScrollableScrollPhysics(),
|
||||||
padding: EdgeInsets.all(16),
|
padding: EdgeInsets.all(16),
|
||||||
children: [
|
children: [
|
||||||
_buildGridItem(Icons.monitor_outlined, '畫面1', context),
|
_buildGridItem(Icons.monitor_outlined, '畫面1', 0, context),
|
||||||
_buildGridItem(Icons.monitor_outlined, '畫面2', context),
|
_buildGridItem(Icons.monitor_outlined, '畫面2', 1, context),
|
||||||
/*_buildGridItem(Icons.monitor_outlined, '切換畫面', context),
|
|
||||||
_buildGridItem(Icons.person_sharp, '個人資料', context),*/
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
@ -123,43 +121,7 @@ class _MessagePageState extends State<MessagePage> {
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
/*if (label == '跌倒紀錄') {
|
_webViewController.loadRequest(Uri.parse('http://203.64.84.154:8088/$camera_id'));
|
||||||
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(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user