mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-19 10:39:26 +01:00
chore: Remove workaround of initialUrl
This commit is contained in:
parent
30011f4761
commit
0fb9218b89
@ -28,16 +28,10 @@ import 'package:vrouter/vrouter.dart';
|
|||||||
|
|
||||||
class AppRoutes {
|
class AppRoutes {
|
||||||
final bool columnMode;
|
final bool columnMode;
|
||||||
final String initialUrl;
|
|
||||||
|
|
||||||
AppRoutes(this.columnMode, {this.initialUrl});
|
AppRoutes(this.columnMode);
|
||||||
|
|
||||||
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,
|
||||||
|
@ -85,6 +85,7 @@ class _FluffyChatAppState extends State<FluffyChatApp> {
|
|||||||
columnMode ??= newColumns > 1;
|
columnMode ??= newColumns > 1;
|
||||||
_router ??= GlobalKey<VRouterState>();
|
_router ??= GlobalKey<VRouterState>();
|
||||||
if (columnMode != newColumns > 1) {
|
if (columnMode != newColumns > 1) {
|
||||||
|
Logs().v('Set Column Mode = $columnMode');
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_initialUrl = _router.currentState.url;
|
_initialUrl = _router.currentState.url;
|
||||||
@ -104,7 +105,7 @@ 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, initialUrl: _initialUrl).routes,
|
routes: AppRoutes(columnMode).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;
|
||||||
|
Loading…
Reference in New Issue
Block a user