selfprivacy.org.app/lib/logic/get_it/navigation.dart
2021-03-15 16:39:44 +01:00

17 lines
441 B
Dart

import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
class NavigationService {
final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
NavigatorState? get navigator => navigatorKey.currentState;
void showPopUpDialog(AlertDialog dialog) {
final context = navigatorKey.currentState!.overlay!.context;
showDialog(
context: context,
builder: (_) => dialog,
);
}
}