revanced-manager/lib/app/app.router.dart

169 lines
5.3 KiB
Dart
Raw Normal View History

// GENERATED CODE - DO NOT MODIFY BY HAND
// **************************************************************************
// StackedRouterGenerator
// **************************************************************************
// ignore_for_file: no_leading_underscores_for_library_prefixes, implementation_imports
import 'package:flutter/material.dart';
import 'package:flutter/src/foundation/key.dart' as _i7;
import 'package:stacked/stacked.dart' as _i1;
2022-08-12 20:07:16 +02:00
import 'package:stacked_services/stacked_services.dart' as _i8;
import '../ui/views/app_selector/app_selector_view.dart' as _i2;
import '../ui/views/contributors/contributors_view.dart' as _i6;
import '../ui/views/installer/installer_view.dart' as _i4;
import '../ui/views/patches_selector/patches_selector_view.dart' as _i3;
import '../ui/views/settings/settings_view.dart' as _i5;
class Routes {
static const appSelectorView = '/app-selector-view';
2022-08-07 21:15:52 +02:00
static const patchesSelectorView = '/patches-selector-view';
static const installerView = '/installer-view';
2022-08-10 14:30:28 +02:00
static const settingsView = '/settings-view';
2022-08-12 20:07:16 +02:00
static const contributorsView = '/contributors-view';
2022-08-07 21:15:52 +02:00
static const all = <String>{
appSelectorView,
2022-08-10 14:30:28 +02:00
patchesSelectorView,
installerView,
2022-08-12 20:07:16 +02:00
settingsView,
contributorsView
2022-08-07 21:15:52 +02:00
};
}
class StackedRouter extends _i1.RouterBase {
final _routes = <_i1.RouteDef>[
_i1.RouteDef(Routes.appSelectorView, page: _i2.AppSelectorView),
_i1.RouteDef(Routes.patchesSelectorView, page: _i3.PatchesSelectorView),
_i1.RouteDef(Routes.installerView, page: _i4.InstallerView),
_i1.RouteDef(Routes.settingsView, page: _i5.SettingsView),
_i1.RouteDef(Routes.contributorsView, page: _i6.ContributorsView)
];
final _pagesMap = <Type, _i1.StackedRouteFactory>{
_i2.AppSelectorView: (data) {
return MaterialPageRoute<dynamic>(
builder: (context) => const _i2.AppSelectorView(),
settings: data,
);
},
_i3.PatchesSelectorView: (data) {
return MaterialPageRoute<dynamic>(
builder: (context) => const _i3.PatchesSelectorView(),
settings: data,
);
},
_i4.InstallerView: (data) {
final args = data.getArgs<InstallerViewArguments>(
orElse: () => const InstallerViewArguments(),
);
2022-08-07 21:15:52 +02:00
return MaterialPageRoute<dynamic>(
builder: (context) => _i4.InstallerView(key: args.key),
2022-08-07 21:15:52 +02:00
settings: data,
);
2022-08-10 14:30:28 +02:00
},
_i5.SettingsView: (data) {
2022-08-10 14:30:28 +02:00
return MaterialPageRoute<dynamic>(
builder: (context) => const _i5.SettingsView(),
2022-08-10 14:30:28 +02:00
settings: data,
);
2022-08-12 20:07:16 +02:00
},
_i6.ContributorsView: (data) {
2022-08-12 20:07:16 +02:00
return MaterialPageRoute<dynamic>(
builder: (context) => const _i6.ContributorsView(),
2022-08-12 20:07:16 +02:00
settings: data,
);
}
};
@override
List<_i1.RouteDef> get routes => _routes;
@override
Map<Type, _i1.StackedRouteFactory> get pagesMap => _pagesMap;
}
class InstallerViewArguments {
const InstallerViewArguments({this.key});
final _i7.Key? key;
}
extension NavigatorStateExtension on _i8.NavigationService {
Future<dynamic> navigateToAppSelectorView(
[int? routerId,
bool preventDuplicates = true,
Map<String, String>? parameters,
Widget Function(
BuildContext, Animation<double>, Animation<double>, Widget)?
transition]) async {
navigateTo(Routes.appSelectorView,
id: routerId,
preventDuplicates: preventDuplicates,
parameters: parameters,
transition: transition);
}
Future<dynamic> navigateToPatchesSelectorView(
[int? routerId,
bool preventDuplicates = true,
Map<String, String>? parameters,
Widget Function(
BuildContext, Animation<double>, Animation<double>, Widget)?
transition]) async {
navigateTo(Routes.patchesSelectorView,
id: routerId,
preventDuplicates: preventDuplicates,
parameters: parameters,
transition: transition);
}
2022-08-07 21:15:52 +02:00
Future<dynamic> navigateToInstallerView(
{_i7.Key? key,
int? routerId,
2022-08-07 21:15:52 +02:00
bool preventDuplicates = true,
Map<String, String>? parameters,
Widget Function(
BuildContext, Animation<double>, Animation<double>, Widget)?
transition}) async {
navigateTo(Routes.installerView,
arguments: InstallerViewArguments(key: key),
2022-08-07 21:15:52 +02:00
id: routerId,
preventDuplicates: preventDuplicates,
parameters: parameters,
transition: transition);
}
2022-08-10 14:30:28 +02:00
Future<dynamic> navigateToSettingsView(
[int? routerId,
bool preventDuplicates = true,
Map<String, String>? parameters,
Widget Function(
BuildContext, Animation<double>, Animation<double>, Widget)?
transition]) async {
navigateTo(Routes.settingsView,
id: routerId,
preventDuplicates: preventDuplicates,
parameters: parameters,
transition: transition);
}
2022-08-12 20:07:16 +02:00
Future<dynamic> navigateToContributorsView(
[int? routerId,
bool preventDuplicates = true,
Map<String, String>? parameters,
Widget Function(
BuildContext, Animation<double>, Animation<double>, Widget)?
transition]) async {
navigateTo(Routes.contributorsView,
id: routerId,
preventDuplicates: preventDuplicates,
parameters: parameters,
transition: transition);
}
}