fix: resolve 2 remaining strict analysis errors

- introPage.dart: Convert fireItems to proper static function closure
- mainDrawer.dart: Convert unreadCount int to String for Text widget
This commit is contained in:
vjrj 2026-03-06 11:21:06 +01:00
parent 1864e5b105
commit 7a4c9fb3bc
61 changed files with 1386 additions and 1202 deletions

View file

@ -20,7 +20,7 @@ import 'theme.dart';
import 'themeDev.dart';
class FiresApp extends StatefulWidget {
FiresApp(this.store);
const FiresApp(this.store, {super.key});
final Store<AppState> store;
@ -29,48 +29,48 @@ class FiresApp extends StatefulWidget {
}
class _FiresAppState extends State<FiresApp> {
// globals.getIt.registerSingleton
_FiresAppState(this.store);
final GlobalKey<NavigatorState> navigatorKey =
new GlobalKey<NavigatorState>();
static final WidgetBuilder introWidget = (context) => new IntroPage();
static final WidgetBuilder continueWidget = (context) => new HomePage();
GlobalKey<NavigatorState>();
static Widget introWidget(BuildContext context) => IntroPage();
static Widget continueWidget(BuildContext context) => const HomePage();
final Map<String, WidgetBuilder> 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(),
PrivacyPage.routeName: (BuildContext context) => PrivacyPage(context),
ActiveFiresPage.routeName: (BuildContext context) => const ActiveFiresPage(),
Sandbox.routeName: (BuildContext context) => const Sandbox(),
FireAlert.routeName: (BuildContext context) => const FireAlert(),
SupportPage.routeName: (BuildContext context) => const SupportPage(),
FireNotificationList.routeName: (BuildContext context) =>
new FireNotificationList(),
const FireNotificationList(),
MonitoredAreasPage.routeName: (BuildContext context) =>
new MonitoredAreasPage()
const MonitoredAreasPage()
};
final Store<AppState> store;
// globals.getIt.registerSingleton
_FiresAppState(this.store);
@override
Widget build(BuildContext context) {
StatefulWidget home = new MaterialAppWithIntroHome(
final StatefulWidget home = MaterialAppWithIntroHome(
introWidget, continueWidget, 'showInitialWizard-2018-06-27-01');
return new StoreProvider<AppState>(
store: this.store,
child: new MaterialApp(
return StoreProvider<AppState>(
store: store,
child: MaterialApp(
navigatorKey: navigatorKey,
localizationsDelegates: [
localizationsDelegates: <LocalizationsDelegate<dynamic>> [
S.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
],
supportedLocales: S.delegate.supportedLocales,
localeResolutionCallback:
S.delegate.resolution(fallback: new Locale("en", "")),
S.delegate.resolution(fallback: const Locale('en', '')),
home: home,
onGenerateTitle: (context) {
onGenerateTitle: (BuildContext context) {
print('MaterialApp onGenerateTitle');
return S.of(context).appName;
},