mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-22 16:56:19 +01:00
25 lines
499 B
Dart
25 lines
499 B
Dart
import 'package:flutter/widgets.dart';
|
|
|
|
class NavigationManager {
|
|
factory NavigationManager() => _inst;
|
|
|
|
NavigationManager._();
|
|
|
|
void setHandler(NavigationHandler handler) {
|
|
_handler = handler;
|
|
}
|
|
|
|
void unsetHandler(NavigationHandler handler) {
|
|
_handler = null;
|
|
}
|
|
|
|
NavigatorState? getNavigator() => _handler?.getNavigator();
|
|
|
|
NavigationHandler? _handler;
|
|
|
|
static final _inst = NavigationManager._();
|
|
}
|
|
|
|
abstract class NavigationHandler {
|
|
NavigatorState? getNavigator();
|
|
}
|