mirror of
https://github.com/hmalik144/days_left_flutter.git
synced 2025-12-10 03:05:21 +00:00
- Implementation of firebase - Implementation of dependency injection Took 11 hours 26 minutes
21 lines
649 B
Dart
21 lines
649 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
class NavigationService {
|
|
GlobalKey<NavigatorState> _navigationKey = GlobalKey<NavigatorState>();
|
|
|
|
GlobalKey<NavigatorState> get navigationKey => _navigationKey;
|
|
|
|
void pop() {
|
|
return _navigationKey.currentState.pop();
|
|
}
|
|
|
|
Future<dynamic> navigateTo(String routeName, {dynamic arguments}) {
|
|
return _navigationKey.currentState
|
|
.pushNamed(routeName, arguments: arguments);
|
|
}
|
|
|
|
Future<dynamic> navigateToAndClearStack(String routeName, {dynamic arguments}) {
|
|
return _navigationKey.currentState
|
|
.pushNamedAndRemoveUntil(routeName, (r) => false, arguments: arguments);
|
|
}
|
|
} |