url_strategy_main.dart 903 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'package:flutter/material.dart';

final GlobalKey<NavigatorState> navKey = GlobalKey(debugLabel: 'mainNavigator');
Map<String, WidgetBuilder>? appRoutes;

final Map<String, WidgetBuilder> _defaultAppRoutes = <String, WidgetBuilder>{
  '/': (BuildContext context) => Container(),
};

void main() {
  runApp(MyApp(appRoutes ?? _defaultAppRoutes));
}

class MyApp extends StatelessWidget {
19
  const MyApp(this.routes, {super.key});
20 21 22 23 24 25 26 27 28 29 30 31 32 33

  final Map<String, WidgetBuilder> routes;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      key: const Key('mainapp'),
      navigatorKey: navKey,
      theme: ThemeData(fontFamily: 'RobotoMono'),
      title: 'Integration Test App',
      routes: routes,
    );
  }
}