Nikolas Rimikis
1 year ago
5 changed files with 62 additions and 1 deletions
@ -0,0 +1,18 @@
|
||||
import 'package:flutter/widgets.dart'; |
||||
import 'package:go_router/go_router.dart'; |
||||
import 'package:neon/utils.dart'; |
||||
import 'package:neon_notifications/neon_notifications.dart'; |
||||
|
||||
part 'routes.g.dart'; |
||||
|
||||
@TypedGoRoute<NotificationsAppRoute>( |
||||
path: '$appsRoutePrefix${NotificationsApp.appId}', |
||||
name: NotificationsApp.appId, |
||||
) |
||||
@immutable |
||||
class NotificationsAppRoute extends NeonAppRoute { |
||||
const NotificationsAppRoute(); |
||||
|
||||
@override |
||||
Widget build(final BuildContext context, final GoRouterState state) => const NotificationsMainPage(); |
||||
} |
@ -0,0 +1,33 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND |
||||
|
||||
part of 'routes.dart'; |
||||
|
||||
// ************************************************************************** |
||||
// GoRouterGenerator |
||||
// ************************************************************************** |
||||
|
||||
List<RouteBase> get $appRoutes => [ |
||||
$notificationsAppRoute, |
||||
]; |
||||
|
||||
RouteBase get $notificationsAppRoute => GoRouteData.$route( |
||||
path: '/apps/notifications', |
||||
name: 'notifications', |
||||
factory: $NotificationsAppRouteExtension._fromState, |
||||
); |
||||
|
||||
extension $NotificationsAppRouteExtension on NotificationsAppRoute { |
||||
static NotificationsAppRoute _fromState(GoRouterState state) => const NotificationsAppRoute(); |
||||
|
||||
String get location => GoRouteData.$location( |
||||
'/apps/notifications', |
||||
); |
||||
|
||||
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); |
||||
} |
Loading…
Reference in new issue