mirror of
https://github.com/smmarty/friflex_flutter_starter.git
synced 2026-02-05 03:32:18 +00:00
init
This commit is contained in:
32
lib/features/debug/debug_routes.dart
Normal file
32
lib/features/debug/debug_routes.dart
Normal file
@@ -0,0 +1,32 @@
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:friflex_starter/features/debug/debug_screen.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
abstract final class DebugRoutes {
|
||||
/// Название роута страницы профиля пользователя
|
||||
static const String debugScreenName = 'debug_screen';
|
||||
|
||||
/// Путь роута страницы профиля пользователя
|
||||
static const String _debugScreenPath = '/debug';
|
||||
|
||||
/// Метод для построения ветки роутов по фиче профиля пользователя
|
||||
///
|
||||
/// Принимает:
|
||||
/// - [routes] - вложенные роуты
|
||||
static StatefulShellBranch buildShellBranch({
|
||||
List<RouteBase> routes = const [],
|
||||
List<NavigatorObserver>? observers,
|
||||
}) =>
|
||||
StatefulShellBranch(
|
||||
initialLocation: _debugScreenPath,
|
||||
observers: observers,
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: _debugScreenPath,
|
||||
name: debugScreenName,
|
||||
builder: (context, state) => const DebugScreen(),
|
||||
routes: routes,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user