diff --git a/flutter_hbb/lib/home_page.dart b/flutter_hbb/lib/home_page.dart index 1a4a9e36d..ffc346305 100644 --- a/flutter_hbb/lib/home_page.dart +++ b/flutter_hbb/lib/home_page.dart @@ -15,10 +15,15 @@ class HomePage extends StatefulWidget { class _HomePageState extends State { final _idController = TextEditingController(); + @override + void initState() { + super.initState(); + _idController.text = FFI.getId(); + } + @override Widget build(BuildContext context) { Provider.of(context); - _idController.text = FFI.getId(); // This method is rerun every time setState is called return Scaffold( appBar: AppBar( diff --git a/flutter_hbb/lib/remote_page.dart b/flutter_hbb/lib/remote_page.dart index aea147a3a..f6a1e2985 100644 --- a/flutter_hbb/lib/remote_page.dart +++ b/flutter_hbb/lib/remote_page.dart @@ -39,6 +39,21 @@ class _RemotePageState extends State { void interval() { print(DateTime.now()); + var evt = FFI.popEvent(); + if (evt == null) return; + var name = evt["name"]; + if (name == "msgbox") { + handleMsgbox(evt); + } + } + + void handleMsgbox(evt) { + var type = evt["type"]; + var title = evt["title"]; + var text = evt["text"]; + if (type == "error") { + } else if (type == "re-input-password") { + } else if (type == "input-password") {} } @override