From f3da8f5349c809f8c3071dbb068855d5cb6e6ecb Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Mon, 12 Feb 2024 17:50:06 +0800 Subject: [PATCH] :lipstick: Optimized UX --- lib/screens/application.dart | 12 ++++++++---- lib/screens/dashboard.dart | 5 ++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/screens/application.dart b/lib/screens/application.dart index 3d1a7ae..7e67182 100644 --- a/lib/screens/application.dart +++ b/lib/screens/application.dart @@ -9,18 +9,22 @@ class ApplicationScreen extends StatelessWidget { @override Widget build(BuildContext context) { - ScaffoldMessenger.of(context).showSnackBar(const SnackBar( - content: Text("Swipe from left to back to dashboard."), - )); - return Scaffold( body: SafeArea( + bottom: false, child: Stack( children: [ WebViewWidget( controller: WebViewController() ..setJavaScriptMode(JavaScriptMode.unrestricted) ..setBackgroundColor(Colors.white) + ..setNavigationDelegate(NavigationDelegate( + onPageStarted: (_) { + ScaffoldMessenger.of(context).showSnackBar(const SnackBar( + content: Text("Swipe from left to back to dashboard."), + )); + } + )) ..loadRequest(link) ..clearCache(), ), diff --git a/lib/screens/dashboard.dart b/lib/screens/dashboard.dart index 9ff5d87..ee89c90 100644 --- a/lib/screens/dashboard.dart +++ b/lib/screens/dashboard.dart @@ -74,7 +74,10 @@ class _DashboardScreenState extends State { ), ListTile( title: Text(element['name']), - subtitle: Text(element['description']), + subtitle: Padding( + padding: const EdgeInsets.only(top: 2), + child: Text(element['description'], style: Theme.of(context).textTheme.bodySmall), + ), ), ], ),