nc-photos/app/lib/navigation_manager.dart

26 lines
499 B
Dart
Raw Normal View History

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();
}