MO-Fuel-Tax-Back/lib/app_navigator.dart

14 lines
673 B
Dart

import 'package:flutter/material.dart';
/// A stable handle on the app's navigator, for the few places that need to
/// put something on screen from outside a widget's own build method:
///
/// - [AppState.onAdWatched]'s "remove ads for a year" upsell, which fires
/// from deep inside a background sync rather than from a widget.
/// - `showAdPlaceholder`, called by [AdService], which owns no
/// [BuildContext] of its own (real ads are native overlays that never
/// needed one).
///
/// Lives here rather than in `main.dart` so services and widgets can reach
/// it without importing the app's entry point.
final navigatorKey = GlobalKey<NavigatorState>();