You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
397 B
Dart
16 lines
397 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
class NavigationService {
|
|
final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
|
|
|
|
BuildContext? get context => navigatorKey.currentContext;
|
|
|
|
Future<T?> push<T>(Route<T> route) {
|
|
return navigatorKey.currentState!.push(route);
|
|
}
|
|
|
|
void pop<T extends Object?>([T? result]) {
|
|
navigatorKey.currentState!.pop(result);
|
|
}
|
|
}
|