move auth feature from container to profile
This commit is contained in:
@@ -77,6 +77,7 @@ import 'package:weblibre/features/user/domain/presentation/screens/profile_backu
|
||||
import 'package:weblibre/features/user/domain/presentation/screens/profile_edit.dart';
|
||||
import 'package:weblibre/features/user/domain/presentation/screens/profile_list.dart';
|
||||
import 'package:weblibre/features/user/domain/presentation/screens/profile_restore.dart';
|
||||
import 'package:weblibre/features/user/domain/presentation/widgets/auth_gate.dart';
|
||||
import 'package:weblibre/features/web_feed/presentation/add_feed_dialog.dart';
|
||||
import 'package:weblibre/features/web_feed/presentation/screens/feed_article.dart';
|
||||
import 'package:weblibre/features/web_feed/presentation/screens/feed_article_list.dart';
|
||||
@@ -103,10 +104,13 @@ class AboutRoute extends GoRouteData with $AboutRoute {
|
||||
}
|
||||
|
||||
@TypedGoRoute<OnboardingRoute>(
|
||||
name: 'OnboardingRoute',
|
||||
path: '/onboarding/:currentRevision/:targetRevision',
|
||||
name: OnboardingRoute.name,
|
||||
path: '${OnboardingRoute.pathPrefix}/:currentRevision/:targetRevision',
|
||||
)
|
||||
class OnboardingRoute extends GoRouteData with $OnboardingRoute {
|
||||
static const name = 'OnboardingRoute';
|
||||
static const pathPrefix = '/onboarding';
|
||||
|
||||
final int currentRevision;
|
||||
final int targetRevision;
|
||||
|
||||
@@ -123,3 +127,16 @@ class OnboardingRoute extends GoRouteData with $OnboardingRoute {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@TypedGoRoute<LockRoute>(name: LockRoute.name, path: LockRoute.path)
|
||||
class LockRoute extends GoRouteData with $LockRoute {
|
||||
static const name = 'LockRoute';
|
||||
static const path = '/lock';
|
||||
|
||||
const LockRoute();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, GoRouterState state) {
|
||||
return const LockScreen();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ part of 'routes.dart';
|
||||
List<RouteBase> get $appRoutes => [
|
||||
$aboutRoute,
|
||||
$onboardingRoute,
|
||||
$lockRoute,
|
||||
$bangMenuRoute,
|
||||
$bookmarksRoute,
|
||||
$browserRoute,
|
||||
@@ -78,6 +79,32 @@ mixin $OnboardingRoute on GoRouteData {
|
||||
void replace(BuildContext context) => context.replace(location);
|
||||
}
|
||||
|
||||
RouteBase get $lockRoute => GoRouteData.$route(
|
||||
path: '/lock',
|
||||
name: 'LockRoute',
|
||||
factory: $LockRoute._fromState,
|
||||
);
|
||||
|
||||
mixin $LockRoute on GoRouteData {
|
||||
static LockRoute _fromState(GoRouterState state) => const LockRoute();
|
||||
|
||||
@override
|
||||
String get location => GoRouteData.$location('/lock');
|
||||
|
||||
@override
|
||||
void go(BuildContext context) => context.go(location);
|
||||
|
||||
@override
|
||||
Future<T?> push<T>(BuildContext context) => context.push<T>(location);
|
||||
|
||||
@override
|
||||
void pushReplacement(BuildContext context) =>
|
||||
context.pushReplacement(location);
|
||||
|
||||
@override
|
||||
void replace(BuildContext context) => context.replace(location);
|
||||
}
|
||||
|
||||
RouteBase get $bangMenuRoute => GoRouteData.$route(
|
||||
path: '/bangs',
|
||||
name: 'BangRoute',
|
||||
|
||||
Reference in New Issue
Block a user