- Updated Android build files: gradle plugin 8.2.2, gradle 8.3, SDK 34, minSdk 21 - Ran dart fix --apply for 87 automatic null-safety fixes - Migrated flutter_map v6 API breaking changes: - MapOptions: center → initialCenter, zoom → initialZoom - layers → children structure - TileLayerOptions/MarkerLayerOptions/PolylineLayerOptions → TileLayer/MarkerLayer/PolylineLayer - Removed plugin_api.dart imports - Converted old plugin system (ZoomMapPlugin, AttributionPlugin, etc.) to direct widgets - Updated onTap callback signature: (TapPosition) → (TapPosition, LatLng) - Migrated all marker/polyline creation to v6 API - Fixed FlatButton → TextButton deprecation - Fixed stackTrace access with catch(e, stackTrace) pattern - Removed deprecated flutter_google_places_autocomplete dependency - Removed deprecated dependencies: latlong, connectivity, launch_review - Updated all imports from latlong → latlong2 - Placeholder implementation for places autocomplete (feature temporarily disabled) Remaining tasks (non-blocking for build): - Complete null-safety fixes for _location variables in genericMap.dart - Fix theme.dart MaterialTheme parameter issues - Fix customStepper.dart null-safety issues - Final build and testing
80 lines
2.7 KiB
Dart
80 lines
2.7 KiB
Dart
import 'package:comunes_flutter/comunes_flutter.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_localizations/flutter_localizations.dart';
|
|
import 'package:flutter_redux/flutter_redux.dart';
|
|
import 'package:redux/redux.dart';
|
|
|
|
import 'activeFires.dart';
|
|
import 'fireAlert.dart';
|
|
import 'fireNotificationList.dart';
|
|
import 'generated/i18n.dart';
|
|
import 'globals.dart';
|
|
import 'homePage.dart';
|
|
import 'introPage.dart';
|
|
import 'models/appState.dart';
|
|
import 'monitoredAreas.dart';
|
|
import 'privacyPage.dart';
|
|
import 'sandbox.dart';
|
|
import 'supportPage.dart';
|
|
import 'theme.dart';
|
|
import 'themeDev.dart';
|
|
|
|
class FiresApp extends StatefulWidget {
|
|
FiresApp(this.store);
|
|
|
|
final Store<AppState> store;
|
|
|
|
@override
|
|
_FiresAppState createState() => _FiresAppState(store);
|
|
}
|
|
|
|
class _FiresAppState extends State<FiresApp> {
|
|
final GlobalKey<NavigatorState> navigatorKey =
|
|
new GlobalKey<NavigatorState>();
|
|
static final WidgetBuilder introWidget = (context) => new IntroPage();
|
|
static final WidgetBuilder continueWidget = (context) => new HomePage();
|
|
|
|
final Map routes = <String, WidgetBuilder>{
|
|
IntroPage.routeName: introWidget,
|
|
HomePage.routeName: continueWidget,
|
|
PrivacyPage.routeName: (BuildContext context) => new PrivacyPage(context),
|
|
ActiveFiresPage.routeName: (BuildContext context) => new ActiveFiresPage(),
|
|
Sandbox.routeName: (BuildContext context) => new Sandbox(),
|
|
FireAlert.routeName: (BuildContext context) => new FireAlert(),
|
|
SupportPage.routeName: (BuildContext context) => new SupportPage(),
|
|
FireNotificationList.routeName: (BuildContext context) =>
|
|
new FireNotificationList(),
|
|
MonitoredAreasPage.routeName: (BuildContext context) =>
|
|
new MonitoredAreasPage()
|
|
};
|
|
|
|
final Store<AppState> store;
|
|
|
|
// globals.getIt.registerSingleton
|
|
_FiresAppState(this.store);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
StatefulWidget home = new MaterialAppWithIntroHome(
|
|
introWidget, continueWidget, 'showInitialWizard-2018-06-27-01');
|
|
return new StoreProvider<AppState>(
|
|
store: this.store,
|
|
child: new MaterialApp(
|
|
navigatorKey: navigatorKey,
|
|
localizationsDelegates: [
|
|
S.delegate,
|
|
GlobalMaterialLocalizations.delegate,
|
|
GlobalWidgetsLocalizations.delegate,
|
|
],
|
|
supportedLocales: S.delegate.supportedLocales,
|
|
localeResolutionCallback:
|
|
S.delegate.resolution(fallback: new Locale("en", "")),
|
|
home: home,
|
|
onGenerateTitle: (context) {
|
|
print('MaterialApp onGenerateTitle');
|
|
return S.of(context).appName;
|
|
},
|
|
theme: isDevelopment ? devFiresTheme : firesTheme,
|
|
routes: routes));
|
|
}
|
|
}
|