diff --git a/lib/config/routes.dart b/lib/config/routes.dart index 86a869ea..9fd35701 100644 --- a/lib/config/routes.dart +++ b/lib/config/routes.dart @@ -30,10 +30,16 @@ import 'package:vrouter/vrouter.dart'; class AppRoutes { final bool columnMode; + final String initialUrl; - AppRoutes(this.columnMode); + AppRoutes(this.columnMode, {this.initialUrl}); List get routes => [ + if (initialUrl != null && initialUrl != '/') + VRouteRedirector( + path: '/', + redirectTo: initialUrl, + ), ..._homeRoutes, if (columnMode) ..._tabletRoutes, if (!columnMode) ..._mobileRoutes, diff --git a/lib/main.dart b/lib/main.dart index fe3cebe5..e908f8ff 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -102,12 +102,24 @@ class _FluffyChatAppState extends State { locale: kIsWeb ? Locale(html.window.navigator.language.split('-').first) : null, - routes: AppRoutes(columnMode).routes, + routes: AppRoutes(columnMode, initialUrl: _initialUrl).routes, builder: (context, child) { LoadingDialog.defaultTitle = L10n.of(context).loadingPleaseWait; LoadingDialog.defaultBackLabel = L10n.of(context).close; LoadingDialog.defaultOnError = (Object e) => e.toLocalizedString(context); + WidgetsBinding.instance.addPostFrameCallback((_) { + SystemChrome.setSystemUIOverlayStyle( + SystemUiOverlayStyle( + statusBarColor: Colors.transparent, + systemNavigationBarColor: Theme.of(context).backgroundColor, + systemNavigationBarIconBrightness: + Theme.of(context).brightness == Brightness.light + ? Brightness.dark + : Brightness.light, + ), + ); + }); return Matrix( key: _matrix, context: context,