INNER CODE UNIT · Dart
_MapsDemoState
maplibre/flutter-maplibre-gl · maplibre_gl_example/lib/main.dart:268
class _MapsDemoState extends State<MapsDemo> {
Future<void> _pushPage(BuildContext context, ExamplePage page) async {
// The page reads ExampleConstants.demoMapStyle while it builds, so wait
// for the probe started in main() to settle. Tapping a second example
// while it is still in flight awaits that same probe instead of putting
// a second burst of requests on the limiter.
await ExampleConstants.resolveDemoMapStyle();
if (!kIsWeb && page.needsLocationPermission) {
final status = await Permission.locationWhenInUse.status;
if (!status.isGranted) {
await Permission.locationWhenInUse.request();
}
}
if (context.mounted) {
Navigator.of(context).push(
MaterialPageRoute<void>(
builder:
(_) => Scaffold(