mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-20 02:59:26 +01:00
fix: Initial url on web
This commit is contained in:
parent
4e026c1f20
commit
445a2498f1
@ -30,10 +30,16 @@ import 'package:vrouter/vrouter.dart';
|
|||||||
|
|
||||||
class AppRoutes {
|
class AppRoutes {
|
||||||
final bool columnMode;
|
final bool columnMode;
|
||||||
|
final String initialUrl;
|
||||||
|
|
||||||
AppRoutes(this.columnMode);
|
AppRoutes(this.columnMode, {this.initialUrl});
|
||||||
|
|
||||||
List<VRouteElement> get routes => [
|
List<VRouteElement> get routes => [
|
||||||
|
if (initialUrl != null && initialUrl != '/')
|
||||||
|
VRouteRedirector(
|
||||||
|
path: '/',
|
||||||
|
redirectTo: initialUrl,
|
||||||
|
),
|
||||||
..._homeRoutes,
|
..._homeRoutes,
|
||||||
if (columnMode) ..._tabletRoutes,
|
if (columnMode) ..._tabletRoutes,
|
||||||
if (!columnMode) ..._mobileRoutes,
|
if (!columnMode) ..._mobileRoutes,
|
||||||
|
@ -102,12 +102,24 @@ class _FluffyChatAppState extends State<FluffyChatApp> {
|
|||||||
locale: kIsWeb
|
locale: kIsWeb
|
||||||
? Locale(html.window.navigator.language.split('-').first)
|
? Locale(html.window.navigator.language.split('-').first)
|
||||||
: null,
|
: null,
|
||||||
routes: AppRoutes(columnMode).routes,
|
routes: AppRoutes(columnMode, initialUrl: _initialUrl).routes,
|
||||||
builder: (context, child) {
|
builder: (context, child) {
|
||||||
LoadingDialog.defaultTitle = L10n.of(context).loadingPleaseWait;
|
LoadingDialog.defaultTitle = L10n.of(context).loadingPleaseWait;
|
||||||
LoadingDialog.defaultBackLabel = L10n.of(context).close;
|
LoadingDialog.defaultBackLabel = L10n.of(context).close;
|
||||||
LoadingDialog.defaultOnError =
|
LoadingDialog.defaultOnError =
|
||||||
(Object e) => e.toLocalizedString(context);
|
(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(
|
return Matrix(
|
||||||
key: _matrix,
|
key: _matrix,
|
||||||
context: context,
|
context: context,
|
||||||
|
Loading…
Reference in New Issue
Block a user