|
|
@ -9,54 +9,13 @@ part of 'router.dart'; |
|
|
|
List<RouteBase> get $appRoutes => [ |
|
|
|
List<RouteBase> get $appRoutes => [ |
|
|
|
$homeRoute, |
|
|
|
$homeRoute, |
|
|
|
$loginRoute, |
|
|
|
$loginRoute, |
|
|
|
|
|
|
|
$settingsRoute, |
|
|
|
]; |
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
RouteBase get $homeRoute => GoRouteData.$route( |
|
|
|
RouteBase get $homeRoute => GoRouteData.$route( |
|
|
|
path: '/', |
|
|
|
path: '/', |
|
|
|
name: 'home', |
|
|
|
name: 'home', |
|
|
|
factory: $HomeRouteExtension._fromState, |
|
|
|
factory: $HomeRouteExtension._fromState, |
|
|
|
routes: [ |
|
|
|
|
|
|
|
GoRouteData.$route( |
|
|
|
|
|
|
|
path: 'settings', |
|
|
|
|
|
|
|
name: 'Settings', |
|
|
|
|
|
|
|
factory: $SettingsRouteExtension._fromState, |
|
|
|
|
|
|
|
routes: [ |
|
|
|
|
|
|
|
GoRouteData.$route( |
|
|
|
|
|
|
|
path: 'apps/:appid', |
|
|
|
|
|
|
|
name: 'NextcloudAppSettings', |
|
|
|
|
|
|
|
factory: $NextcloudAppSettingsRouteExtension._fromState, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
GoRouteData.$route( |
|
|
|
|
|
|
|
path: 'account/add', |
|
|
|
|
|
|
|
name: 'addAccount', |
|
|
|
|
|
|
|
factory: $_AddAccountRouteExtension._fromState, |
|
|
|
|
|
|
|
routes: [ |
|
|
|
|
|
|
|
GoRouteData.$route( |
|
|
|
|
|
|
|
path: 'flow', |
|
|
|
|
|
|
|
factory: $_AddAccountFlowRouteExtension._fromState, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
GoRouteData.$route( |
|
|
|
|
|
|
|
path: 'qrcode', |
|
|
|
|
|
|
|
factory: $_AddAccountQrcodeRouteExtension._fromState, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
GoRouteData.$route( |
|
|
|
|
|
|
|
path: 'check/server', |
|
|
|
|
|
|
|
factory: $_AddAccountCheckServerStatusRouteExtension._fromState, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
GoRouteData.$route( |
|
|
|
|
|
|
|
path: 'check/account', |
|
|
|
|
|
|
|
factory: $_AddAccountCheckAccountRouteExtension._fromState, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
GoRouteData.$route( |
|
|
|
|
|
|
|
path: 'account/:accountid', |
|
|
|
|
|
|
|
name: 'AccountSettings', |
|
|
|
|
|
|
|
factory: $AccountSettingsRouteExtension._fromState, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
extension $HomeRouteExtension on HomeRoute { |
|
|
|
extension $HomeRouteExtension on HomeRoute { |
|
|
@ -75,17 +34,35 @@ extension $HomeRouteExtension on HomeRoute { |
|
|
|
void replace(BuildContext context) => context.replace(location); |
|
|
|
void replace(BuildContext context) => context.replace(location); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
extension $SettingsRouteExtension on SettingsRoute { |
|
|
|
RouteBase get $loginRoute => GoRouteData.$route( |
|
|
|
static SettingsRoute _fromState(GoRouterState state) => SettingsRoute( |
|
|
|
path: '/login', |
|
|
|
initialCategory: |
|
|
|
name: 'login', |
|
|
|
_$convertMapValue('initial-category', state.uri.queryParameters, _$SettingsCageoriesEnumMap._$fromName), |
|
|
|
factory: $LoginRouteExtension._fromState, |
|
|
|
); |
|
|
|
routes: [ |
|
|
|
|
|
|
|
GoRouteData.$route( |
|
|
|
|
|
|
|
path: 'flow', |
|
|
|
|
|
|
|
factory: $LoginFlowRouteExtension._fromState, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
GoRouteData.$route( |
|
|
|
|
|
|
|
path: 'qrcode', |
|
|
|
|
|
|
|
factory: $LoginQrcodeRouteExtension._fromState, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
GoRouteData.$route( |
|
|
|
|
|
|
|
path: 'check/server', |
|
|
|
|
|
|
|
factory: $LoginCheckServerStatusRouteExtension._fromState, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
GoRouteData.$route( |
|
|
|
|
|
|
|
path: 'check/account', |
|
|
|
|
|
|
|
factory: $LoginCheckAccountRouteExtension._fromState, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extension $LoginRouteExtension on LoginRoute { |
|
|
|
|
|
|
|
static LoginRoute _fromState(GoRouterState state) => const LoginRoute(); |
|
|
|
|
|
|
|
|
|
|
|
String get location => GoRouteData.$location( |
|
|
|
String get location => GoRouteData.$location( |
|
|
|
'/settings', |
|
|
|
'/login', |
|
|
|
queryParams: { |
|
|
|
|
|
|
|
if (initialCategory != null) 'initial-category': _$SettingsCageoriesEnumMap[initialCategory!], |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
void go(BuildContext context) => context.go(location); |
|
|
|
void go(BuildContext context) => context.go(location); |
|
|
@ -97,24 +74,16 @@ extension $SettingsRouteExtension on SettingsRoute { |
|
|
|
void replace(BuildContext context) => context.replace(location); |
|
|
|
void replace(BuildContext context) => context.replace(location); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const _$SettingsCageoriesEnumMap = { |
|
|
|
extension $LoginFlowRouteExtension on LoginFlowRoute { |
|
|
|
SettingsCageories.apps: 'apps', |
|
|
|
static LoginFlowRoute _fromState(GoRouterState state) => LoginFlowRoute( |
|
|
|
SettingsCageories.theme: 'theme', |
|
|
|
serverUrl: state.uri.queryParameters['server-url']!, |
|
|
|
SettingsCageories.navigation: 'navigation', |
|
|
|
|
|
|
|
SettingsCageories.pushNotifications: 'push-notifications', |
|
|
|
|
|
|
|
SettingsCageories.startup: 'startup', |
|
|
|
|
|
|
|
SettingsCageories.systemTray: 'system-tray', |
|
|
|
|
|
|
|
SettingsCageories.accounts: 'accounts', |
|
|
|
|
|
|
|
SettingsCageories.other: 'other', |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extension $NextcloudAppSettingsRouteExtension on NextcloudAppSettingsRoute { |
|
|
|
|
|
|
|
static NextcloudAppSettingsRoute _fromState(GoRouterState state) => NextcloudAppSettingsRoute( |
|
|
|
|
|
|
|
appid: state.pathParameters['appid']!, |
|
|
|
|
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
String get location => GoRouteData.$location( |
|
|
|
String get location => GoRouteData.$location( |
|
|
|
'/settings/apps/${Uri.encodeComponent(appid)}', |
|
|
|
'/login/flow', |
|
|
|
|
|
|
|
queryParams: { |
|
|
|
|
|
|
|
'server-url': serverUrl, |
|
|
|
|
|
|
|
}, |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
void go(BuildContext context) => context.go(location); |
|
|
|
void go(BuildContext context) => context.go(location); |
|
|
@ -126,11 +95,11 @@ extension $NextcloudAppSettingsRouteExtension on NextcloudAppSettingsRoute { |
|
|
|
void replace(BuildContext context) => context.replace(location); |
|
|
|
void replace(BuildContext context) => context.replace(location); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
extension $_AddAccountRouteExtension on _AddAccountRoute { |
|
|
|
extension $LoginQrcodeRouteExtension on LoginQrcodeRoute { |
|
|
|
static _AddAccountRoute _fromState(GoRouterState state) => const _AddAccountRoute(); |
|
|
|
static LoginQrcodeRoute _fromState(GoRouterState state) => const LoginQrcodeRoute(); |
|
|
|
|
|
|
|
|
|
|
|
String get location => GoRouteData.$location( |
|
|
|
String get location => GoRouteData.$location( |
|
|
|
'/settings/account/add', |
|
|
|
'/login/qrcode', |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
void go(BuildContext context) => context.go(location); |
|
|
|
void go(BuildContext context) => context.go(location); |
|
|
@ -142,15 +111,19 @@ extension $_AddAccountRouteExtension on _AddAccountRoute { |
|
|
|
void replace(BuildContext context) => context.replace(location); |
|
|
|
void replace(BuildContext context) => context.replace(location); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
extension $_AddAccountFlowRouteExtension on _AddAccountFlowRoute { |
|
|
|
extension $LoginCheckServerStatusRouteExtension on LoginCheckServerStatusRoute { |
|
|
|
static _AddAccountFlowRoute _fromState(GoRouterState state) => _AddAccountFlowRoute( |
|
|
|
static LoginCheckServerStatusRoute _fromState(GoRouterState state) => LoginCheckServerStatusRoute( |
|
|
|
serverUrl: state.uri.queryParameters['server-url']!, |
|
|
|
serverUrl: state.uri.queryParameters['server-url']!, |
|
|
|
|
|
|
|
loginName: state.uri.queryParameters['login-name'], |
|
|
|
|
|
|
|
password: state.uri.queryParameters['password'], |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
String get location => GoRouteData.$location( |
|
|
|
String get location => GoRouteData.$location( |
|
|
|
'/settings/account/add/flow', |
|
|
|
'/login/check/server', |
|
|
|
queryParams: { |
|
|
|
queryParams: { |
|
|
|
'server-url': serverUrl, |
|
|
|
'server-url': serverUrl, |
|
|
|
|
|
|
|
if (loginName != null) 'login-name': loginName, |
|
|
|
|
|
|
|
if (password != null) 'password': password, |
|
|
|
}, |
|
|
|
}, |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
@ -163,31 +136,19 @@ extension $_AddAccountFlowRouteExtension on _AddAccountFlowRoute { |
|
|
|
void replace(BuildContext context) => context.replace(location); |
|
|
|
void replace(BuildContext context) => context.replace(location); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
extension $_AddAccountQrcodeRouteExtension on _AddAccountQrcodeRoute { |
|
|
|
extension $LoginCheckAccountRouteExtension on LoginCheckAccountRoute { |
|
|
|
static _AddAccountQrcodeRoute _fromState(GoRouterState state) => const _AddAccountQrcodeRoute(); |
|
|
|
static LoginCheckAccountRoute _fromState(GoRouterState state) => LoginCheckAccountRoute( |
|
|
|
|
|
|
|
|
|
|
|
String get location => GoRouteData.$location( |
|
|
|
|
|
|
|
'/settings/account/add/qrcode', |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void go(BuildContext context) => context.go(location); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Future<T?> push<T>(BuildContext context) => context.push<T>(location); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void pushReplacement(BuildContext context) => context.pushReplacement(location); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void replace(BuildContext context) => context.replace(location); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extension $_AddAccountCheckServerStatusRouteExtension on _AddAccountCheckServerStatusRoute { |
|
|
|
|
|
|
|
static _AddAccountCheckServerStatusRoute _fromState(GoRouterState state) => _AddAccountCheckServerStatusRoute( |
|
|
|
|
|
|
|
serverUrl: state.uri.queryParameters['server-url']!, |
|
|
|
serverUrl: state.uri.queryParameters['server-url']!, |
|
|
|
|
|
|
|
loginName: state.uri.queryParameters['login-name']!, |
|
|
|
|
|
|
|
password: state.uri.queryParameters['password']!, |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
String get location => GoRouteData.$location( |
|
|
|
String get location => GoRouteData.$location( |
|
|
|
'/settings/account/add/check/server', |
|
|
|
'/login/check/account', |
|
|
|
queryParams: { |
|
|
|
queryParams: { |
|
|
|
'server-url': serverUrl, |
|
|
|
'server-url': serverUrl, |
|
|
|
|
|
|
|
'login-name': loginName, |
|
|
|
|
|
|
|
'password': password, |
|
|
|
}, |
|
|
|
}, |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
@ -200,19 +161,57 @@ extension $_AddAccountCheckServerStatusRouteExtension on _AddAccountCheckServerS |
|
|
|
void replace(BuildContext context) => context.replace(location); |
|
|
|
void replace(BuildContext context) => context.replace(location); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
extension $_AddAccountCheckAccountRouteExtension on _AddAccountCheckAccountRoute { |
|
|
|
RouteBase get $settingsRoute => GoRouteData.$route( |
|
|
|
static _AddAccountCheckAccountRoute _fromState(GoRouterState state) => _AddAccountCheckAccountRoute( |
|
|
|
path: '/settings', |
|
|
|
serverUrl: state.uri.queryParameters['server-url']!, |
|
|
|
name: 'Settings', |
|
|
|
loginName: state.uri.queryParameters['login-name']!, |
|
|
|
factory: $SettingsRouteExtension._fromState, |
|
|
|
password: state.uri.queryParameters['password']!, |
|
|
|
routes: [ |
|
|
|
|
|
|
|
GoRouteData.$route( |
|
|
|
|
|
|
|
path: 'apps/:appid', |
|
|
|
|
|
|
|
name: 'NextcloudAppSettings', |
|
|
|
|
|
|
|
factory: $NextcloudAppSettingsRouteExtension._fromState, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
GoRouteData.$route( |
|
|
|
|
|
|
|
path: 'account/add', |
|
|
|
|
|
|
|
name: 'addAccount', |
|
|
|
|
|
|
|
factory: $_AddAccountRouteExtension._fromState, |
|
|
|
|
|
|
|
routes: [ |
|
|
|
|
|
|
|
GoRouteData.$route( |
|
|
|
|
|
|
|
path: 'flow', |
|
|
|
|
|
|
|
factory: $_AddAccountFlowRouteExtension._fromState, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
GoRouteData.$route( |
|
|
|
|
|
|
|
path: 'qrcode', |
|
|
|
|
|
|
|
factory: $_AddAccountQrcodeRouteExtension._fromState, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
GoRouteData.$route( |
|
|
|
|
|
|
|
path: 'check/server', |
|
|
|
|
|
|
|
factory: $_AddAccountCheckServerStatusRouteExtension._fromState, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
GoRouteData.$route( |
|
|
|
|
|
|
|
path: 'check/account', |
|
|
|
|
|
|
|
factory: $_AddAccountCheckAccountRouteExtension._fromState, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
GoRouteData.$route( |
|
|
|
|
|
|
|
path: 'account/:accountid', |
|
|
|
|
|
|
|
name: 'AccountSettings', |
|
|
|
|
|
|
|
factory: $AccountSettingsRouteExtension._fromState, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extension $SettingsRouteExtension on SettingsRoute { |
|
|
|
|
|
|
|
static SettingsRoute _fromState(GoRouterState state) => SettingsRoute( |
|
|
|
|
|
|
|
initialCategory: |
|
|
|
|
|
|
|
_$convertMapValue('initial-category', state.uri.queryParameters, _$SettingsCageoriesEnumMap._$fromName), |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
String get location => GoRouteData.$location( |
|
|
|
String get location => GoRouteData.$location( |
|
|
|
'/settings/account/add/check/account', |
|
|
|
'/settings', |
|
|
|
queryParams: { |
|
|
|
queryParams: { |
|
|
|
'server-url': serverUrl, |
|
|
|
if (initialCategory != null) 'initial-category': _$SettingsCageoriesEnumMap[initialCategory!], |
|
|
|
'login-name': loginName, |
|
|
|
|
|
|
|
'password': password, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
@ -225,13 +224,24 @@ extension $_AddAccountCheckAccountRouteExtension on _AddAccountCheckAccountRoute |
|
|
|
void replace(BuildContext context) => context.replace(location); |
|
|
|
void replace(BuildContext context) => context.replace(location); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
extension $AccountSettingsRouteExtension on AccountSettingsRoute { |
|
|
|
const _$SettingsCageoriesEnumMap = { |
|
|
|
static AccountSettingsRoute _fromState(GoRouterState state) => AccountSettingsRoute( |
|
|
|
SettingsCageories.apps: 'apps', |
|
|
|
accountid: state.pathParameters['accountid']!, |
|
|
|
SettingsCageories.theme: 'theme', |
|
|
|
|
|
|
|
SettingsCageories.navigation: 'navigation', |
|
|
|
|
|
|
|
SettingsCageories.pushNotifications: 'push-notifications', |
|
|
|
|
|
|
|
SettingsCageories.startup: 'startup', |
|
|
|
|
|
|
|
SettingsCageories.systemTray: 'system-tray', |
|
|
|
|
|
|
|
SettingsCageories.accounts: 'accounts', |
|
|
|
|
|
|
|
SettingsCageories.other: 'other', |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extension $NextcloudAppSettingsRouteExtension on NextcloudAppSettingsRoute { |
|
|
|
|
|
|
|
static NextcloudAppSettingsRoute _fromState(GoRouterState state) => NextcloudAppSettingsRoute( |
|
|
|
|
|
|
|
appid: state.pathParameters['appid']!, |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
String get location => GoRouteData.$location( |
|
|
|
String get location => GoRouteData.$location( |
|
|
|
'/settings/account/${Uri.encodeComponent(accountid)}', |
|
|
|
'/settings/apps/${Uri.encodeComponent(appid)}', |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
void go(BuildContext context) => context.go(location); |
|
|
|
void go(BuildContext context) => context.go(location); |
|
|
@ -243,48 +253,11 @@ extension $AccountSettingsRouteExtension on AccountSettingsRoute { |
|
|
|
void replace(BuildContext context) => context.replace(location); |
|
|
|
void replace(BuildContext context) => context.replace(location); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
T? _$convertMapValue<T>( |
|
|
|
extension $_AddAccountRouteExtension on _AddAccountRoute { |
|
|
|
String key, |
|
|
|
static _AddAccountRoute _fromState(GoRouterState state) => const _AddAccountRoute(); |
|
|
|
Map<String, String> map, |
|
|
|
|
|
|
|
T Function(String) converter, |
|
|
|
|
|
|
|
) { |
|
|
|
|
|
|
|
final value = map[key]; |
|
|
|
|
|
|
|
return value == null ? null : converter(value); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extension<T extends Enum> on Map<T, String> { |
|
|
|
|
|
|
|
T _$fromName(String value) => entries.singleWhere((element) => element.value == value).key; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RouteBase get $loginRoute => GoRouteData.$route( |
|
|
|
|
|
|
|
path: '/login', |
|
|
|
|
|
|
|
name: 'login', |
|
|
|
|
|
|
|
factory: $LoginRouteExtension._fromState, |
|
|
|
|
|
|
|
routes: [ |
|
|
|
|
|
|
|
GoRouteData.$route( |
|
|
|
|
|
|
|
path: 'flow', |
|
|
|
|
|
|
|
factory: $LoginFlowRouteExtension._fromState, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
GoRouteData.$route( |
|
|
|
|
|
|
|
path: 'qrcode', |
|
|
|
|
|
|
|
factory: $LoginQrcodeRouteExtension._fromState, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
GoRouteData.$route( |
|
|
|
|
|
|
|
path: 'check/server', |
|
|
|
|
|
|
|
factory: $LoginCheckServerStatusRouteExtension._fromState, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
GoRouteData.$route( |
|
|
|
|
|
|
|
path: 'check/account', |
|
|
|
|
|
|
|
factory: $LoginCheckAccountRouteExtension._fromState, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extension $LoginRouteExtension on LoginRoute { |
|
|
|
|
|
|
|
static LoginRoute _fromState(GoRouterState state) => const LoginRoute(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String get location => GoRouteData.$location( |
|
|
|
String get location => GoRouteData.$location( |
|
|
|
'/login', |
|
|
|
'/settings/account/add', |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
void go(BuildContext context) => context.go(location); |
|
|
|
void go(BuildContext context) => context.go(location); |
|
|
@ -296,13 +269,13 @@ extension $LoginRouteExtension on LoginRoute { |
|
|
|
void replace(BuildContext context) => context.replace(location); |
|
|
|
void replace(BuildContext context) => context.replace(location); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
extension $LoginFlowRouteExtension on LoginFlowRoute { |
|
|
|
extension $_AddAccountFlowRouteExtension on _AddAccountFlowRoute { |
|
|
|
static LoginFlowRoute _fromState(GoRouterState state) => LoginFlowRoute( |
|
|
|
static _AddAccountFlowRoute _fromState(GoRouterState state) => _AddAccountFlowRoute( |
|
|
|
serverUrl: state.uri.queryParameters['server-url']!, |
|
|
|
serverUrl: state.uri.queryParameters['server-url']!, |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
String get location => GoRouteData.$location( |
|
|
|
String get location => GoRouteData.$location( |
|
|
|
'/login/flow', |
|
|
|
'/settings/account/add/flow', |
|
|
|
queryParams: { |
|
|
|
queryParams: { |
|
|
|
'server-url': serverUrl, |
|
|
|
'server-url': serverUrl, |
|
|
|
}, |
|
|
|
}, |
|
|
@ -317,11 +290,11 @@ extension $LoginFlowRouteExtension on LoginFlowRoute { |
|
|
|
void replace(BuildContext context) => context.replace(location); |
|
|
|
void replace(BuildContext context) => context.replace(location); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
extension $LoginQrcodeRouteExtension on LoginQrcodeRoute { |
|
|
|
extension $_AddAccountQrcodeRouteExtension on _AddAccountQrcodeRoute { |
|
|
|
static LoginQrcodeRoute _fromState(GoRouterState state) => const LoginQrcodeRoute(); |
|
|
|
static _AddAccountQrcodeRoute _fromState(GoRouterState state) => const _AddAccountQrcodeRoute(); |
|
|
|
|
|
|
|
|
|
|
|
String get location => GoRouteData.$location( |
|
|
|
String get location => GoRouteData.$location( |
|
|
|
'/login/qrcode', |
|
|
|
'/settings/account/add/qrcode', |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
void go(BuildContext context) => context.go(location); |
|
|
|
void go(BuildContext context) => context.go(location); |
|
|
@ -333,19 +306,15 @@ extension $LoginQrcodeRouteExtension on LoginQrcodeRoute { |
|
|
|
void replace(BuildContext context) => context.replace(location); |
|
|
|
void replace(BuildContext context) => context.replace(location); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
extension $LoginCheckServerStatusRouteExtension on LoginCheckServerStatusRoute { |
|
|
|
extension $_AddAccountCheckServerStatusRouteExtension on _AddAccountCheckServerStatusRoute { |
|
|
|
static LoginCheckServerStatusRoute _fromState(GoRouterState state) => LoginCheckServerStatusRoute( |
|
|
|
static _AddAccountCheckServerStatusRoute _fromState(GoRouterState state) => _AddAccountCheckServerStatusRoute( |
|
|
|
serverUrl: state.uri.queryParameters['server-url']!, |
|
|
|
serverUrl: state.uri.queryParameters['server-url']!, |
|
|
|
loginName: state.uri.queryParameters['login-name'], |
|
|
|
|
|
|
|
password: state.uri.queryParameters['password'], |
|
|
|
|
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
String get location => GoRouteData.$location( |
|
|
|
String get location => GoRouteData.$location( |
|
|
|
'/login/check/server', |
|
|
|
'/settings/account/add/check/server', |
|
|
|
queryParams: { |
|
|
|
queryParams: { |
|
|
|
'server-url': serverUrl, |
|
|
|
'server-url': serverUrl, |
|
|
|
if (loginName != null) 'login-name': loginName, |
|
|
|
|
|
|
|
if (password != null) 'password': password, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
@ -358,15 +327,15 @@ extension $LoginCheckServerStatusRouteExtension on LoginCheckServerStatusRoute { |
|
|
|
void replace(BuildContext context) => context.replace(location); |
|
|
|
void replace(BuildContext context) => context.replace(location); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
extension $LoginCheckAccountRouteExtension on LoginCheckAccountRoute { |
|
|
|
extension $_AddAccountCheckAccountRouteExtension on _AddAccountCheckAccountRoute { |
|
|
|
static LoginCheckAccountRoute _fromState(GoRouterState state) => LoginCheckAccountRoute( |
|
|
|
static _AddAccountCheckAccountRoute _fromState(GoRouterState state) => _AddAccountCheckAccountRoute( |
|
|
|
serverUrl: state.uri.queryParameters['server-url']!, |
|
|
|
serverUrl: state.uri.queryParameters['server-url']!, |
|
|
|
loginName: state.uri.queryParameters['login-name']!, |
|
|
|
loginName: state.uri.queryParameters['login-name']!, |
|
|
|
password: state.uri.queryParameters['password']!, |
|
|
|
password: state.uri.queryParameters['password']!, |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
String get location => GoRouteData.$location( |
|
|
|
String get location => GoRouteData.$location( |
|
|
|
'/login/check/account', |
|
|
|
'/settings/account/add/check/account', |
|
|
|
queryParams: { |
|
|
|
queryParams: { |
|
|
|
'server-url': serverUrl, |
|
|
|
'server-url': serverUrl, |
|
|
|
'login-name': loginName, |
|
|
|
'login-name': loginName, |
|
|
@ -382,3 +351,34 @@ extension $LoginCheckAccountRouteExtension on LoginCheckAccountRoute { |
|
|
|
|
|
|
|
|
|
|
|
void replace(BuildContext context) => context.replace(location); |
|
|
|
void replace(BuildContext context) => context.replace(location); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extension $AccountSettingsRouteExtension on AccountSettingsRoute { |
|
|
|
|
|
|
|
static AccountSettingsRoute _fromState(GoRouterState state) => AccountSettingsRoute( |
|
|
|
|
|
|
|
accountid: state.pathParameters['accountid']!, |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String get location => GoRouteData.$location( |
|
|
|
|
|
|
|
'/settings/account/${Uri.encodeComponent(accountid)}', |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void go(BuildContext context) => context.go(location); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Future<T?> push<T>(BuildContext context) => context.push<T>(location); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void pushReplacement(BuildContext context) => context.pushReplacement(location); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void replace(BuildContext context) => context.replace(location); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
T? _$convertMapValue<T>( |
|
|
|
|
|
|
|
String key, |
|
|
|
|
|
|
|
Map<String, String> map, |
|
|
|
|
|
|
|
T Function(String) converter, |
|
|
|
|
|
|
|
) { |
|
|
|
|
|
|
|
final value = map[key]; |
|
|
|
|
|
|
|
return value == null ? null : converter(value); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extension<T extends Enum> on Map<T, String> { |
|
|
|
|
|
|
|
T _$fromName(String value) => entries.singleWhere((element) => element.value == value).key; |
|
|
|
|
|
|
|
} |
|
|
|