diff --git a/flutter_hbb/lib/common.dart b/flutter_hbb/lib/common.dart index 9f25f8fb1..bce191c93 100644 --- a/flutter_hbb/lib/common.dart +++ b/flutter_hbb/lib/common.dart @@ -19,6 +19,7 @@ class MyTheme { static const Color grayBg = Color(0xFFEEEEEE); static const Color white = Color(0xFFFFFFFF); static const Color accent = Color(0xFF0071FF); + static const Color accent50 = Color(0x770071FF); } // https://github.com/huangjianke/flutter_easyloading diff --git a/flutter_hbb/lib/remote_page.dart b/flutter_hbb/lib/remote_page.dart index 6c9f63702..b844f0611 100644 --- a/flutter_hbb/lib/remote_page.dart +++ b/flutter_hbb/lib/remote_page.dart @@ -19,6 +19,7 @@ class RemotePage extends StatefulWidget { // https://github.com/hanxu317317/flutter_plan_demo/blob/master/lib/src/enter.dart class _RemotePageState extends State { Timer _interval; + bool _show_bar = true; @override void initState() { @@ -50,15 +51,64 @@ class _RemotePageState extends State { Widget build(BuildContext context) { // Size size = MediaQueryData.fromWindow(ui.window).size; // MediaQuery.of(context).size.height; - return FlutterEasyLoading( - child: InteractiveViewer( - constrained: false, - panEnabled: true, - onInteractionUpdate: (details) { - print("$details"); - }, - child: Container(child: ImagePaint(), color: MyTheme.grayBg), - )); + return Scaffold( + floatingActionButton: _show_bar + ? null + : FloatingActionButton( + mini: true, + child: Icon(Icons.expand_less), + backgroundColor: MyTheme.accent50, + onPressed: () { + setState(() => _show_bar = !_show_bar); + }), + bottomNavigationBar: _show_bar + ? BottomAppBar( + color: MyTheme.accent, + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row(children: [ + IconButton( + color: Colors.white, + icon: Icon(Icons.clear), + onPressed: () {}, + ), + IconButton( + color: Colors.white, + icon: Icon(Icons.keyboard), + onPressed: () {}, + ), + IconButton( + color: Colors.white, + icon: Icon(Icons.tv), + onPressed: () {}, + ), + IconButton( + color: Colors.white, + icon: Icon(Icons.settings), + onPressed: () {}, + ) + ]), + IconButton( + color: Colors.white, + icon: Icon(Icons.expand_more), + onPressed: () { + setState(() => _show_bar = !_show_bar); + }), + ], + ), + ) + : null, + body: FlutterEasyLoading( + child: InteractiveViewer( + constrained: false, + panEnabled: true, + onInteractionUpdate: (details) { + print("$details"); + }, + child: Container(child: ImagePaint(), color: MyTheme.grayBg), + ))); } }