mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-24 18:07:56 +00:00
29 lines
748 B
Dart
29 lines
748 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
import 'routing_constants.dart';
|
|
|
|
class RouteManager {
|
|
List<String> routesWithoutLogin = [
|
|
Routes.homeRoute,
|
|
];
|
|
|
|
List<String> exclusionList = [];
|
|
|
|
//TODO (to mohammad) add the context extension
|
|
routerManager({required String routeName, required BuildContext context}) {
|
|
Navigator.of(context).pushNamed(routeName);
|
|
}
|
|
|
|
routerManagerPushUntil(BuildContext? context, {required String routeName}) {
|
|
if (context != null) {
|
|
Navigator.of(context)
|
|
.pushNamedAndRemoveUntil(routeName, (route) => false);
|
|
}
|
|
}
|
|
|
|
routerManagerPopAndPushNamed(
|
|
{required String routeName, required BuildContext context}) {
|
|
Navigator.of(context).popAndPushNamed(routeName);
|
|
}
|
|
}
|