refactor: fix remaining lint warnings and deprecated APIs
- Fix deprecated @ignore in json_serializable models (appState, yourLocation) - Fix empty catch blocks in compassMapPlugin, globalFiresBottomStats, locationUtils - Fix no_logic_in_create_state in firesApp, markdownPage, slider - Fix use_build_context_synchronously in fireAlert - Fix only_throw_errors in firesApi (8 instances) - Exclude generated .g.dart files from analysis - Update deprecated nullable: false to @JsonSerializable() Build: APK generated successfully, 0 errors, 0 warnings
This commit is contained in:
parent
948a609619
commit
862d423f6b
14 changed files with 96 additions and 69 deletions
|
|
@ -25,23 +25,29 @@ class FiresApp extends StatefulWidget {
|
|||
final Store<AppState> store;
|
||||
|
||||
@override
|
||||
_FiresAppState createState() => _FiresAppState(store);
|
||||
_FiresAppState createState() => _FiresAppState();
|
||||
}
|
||||
|
||||
class _FiresAppState extends State<FiresApp> {
|
||||
|
||||
// globals.getIt.registerSingleton
|
||||
_FiresAppState(this.store);
|
||||
final GlobalKey<NavigatorState> navigatorKey =
|
||||
GlobalKey<NavigatorState>();
|
||||
_FiresAppState();
|
||||
late final Store<AppState> store;
|
||||
final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
|
||||
static Widget introWidget(BuildContext context) => IntroPage();
|
||||
static Widget continueWidget(BuildContext context) => const HomePage();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
store = widget.store;
|
||||
}
|
||||
|
||||
final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{
|
||||
IntroPage.routeName: introWidget,
|
||||
HomePage.routeName: continueWidget,
|
||||
PrivacyPage.routeName: (BuildContext context) => PrivacyPage(context),
|
||||
ActiveFiresPage.routeName: (BuildContext context) => const ActiveFiresPage(),
|
||||
ActiveFiresPage.routeName: (BuildContext context) =>
|
||||
const ActiveFiresPage(),
|
||||
Sandbox.routeName: (BuildContext context) => const Sandbox(),
|
||||
FireAlert.routeName: (BuildContext context) => const FireAlert(),
|
||||
SupportPage.routeName: (BuildContext context) => const SupportPage(),
|
||||
|
|
@ -51,8 +57,6 @@ class _FiresAppState extends State<FiresApp> {
|
|||
const MonitoredAreasPage()
|
||||
};
|
||||
|
||||
final Store<AppState> store;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final StatefulWidget home = MaterialAppWithIntroHome(
|
||||
|
|
@ -61,7 +65,7 @@ class _FiresAppState extends State<FiresApp> {
|
|||
store: store,
|
||||
child: MaterialApp(
|
||||
navigatorKey: navigatorKey,
|
||||
localizationsDelegates: const <LocalizationsDelegate<dynamic>> [
|
||||
localizationsDelegates: const <LocalizationsDelegate<dynamic>>[
|
||||
S.delegate,
|
||||
GlobalMaterialLocalizations.delegate,
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue