Fix 23 additional lint issues to reduce from 129 to 106 issues
- Add const constructors to @immutable classes (5 issues: prefer_const_constructors_in_immutables) - Fix nullable value casts in firesApi.dart (3 issues: cast_nullable_to_non_nullable) - Remove redundant default argument values (2 issues: avoid_redundant_argument_values) - Make YourLocation immutable with final fields (2 issues: avoid_equals_and_hash_code_on_mutable_classes) - Update imports and fix formatting Reduces lint issues from 129 to 106. APK builds successfully (146 MB).
This commit is contained in:
parent
270d9a569e
commit
8da3752193
12 changed files with 61 additions and 47 deletions
|
|
@ -1,8 +1,13 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:meta/meta.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'dart:async';
|
||||
|
||||
@immutable
|
||||
abstract class MaterialAppWithIntro extends StatelessWidget {
|
||||
const MaterialAppWithIntro(this.name, this.theme, this.routes,
|
||||
this.introWidget, this.continueWidget, this.prefsKey);
|
||||
|
||||
final String name;
|
||||
final ThemeData theme;
|
||||
final Map<String, WidgetBuilder> routes;
|
||||
|
|
@ -10,9 +15,6 @@ abstract class MaterialAppWithIntro extends StatelessWidget {
|
|||
final WidgetBuilder continueWidget;
|
||||
final String prefsKey;
|
||||
|
||||
MaterialAppWithIntro(this.name, this.theme, this.routes, this.introWidget,
|
||||
this.continueWidget, this.prefsKey);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
|
|
@ -25,26 +27,26 @@ abstract class MaterialAppWithIntro extends StatelessWidget {
|
|||
}
|
||||
|
||||
class MaterialAppWithIntroHome extends StatefulWidget {
|
||||
const MaterialAppWithIntroHome(
|
||||
this.introWidget, this.continueWidget, this.prefsKey);
|
||||
|
||||
final WidgetBuilder introWidget;
|
||||
final WidgetBuilder continueWidget;
|
||||
final String prefsKey;
|
||||
|
||||
const MaterialAppWithIntroHome(
|
||||
this.introWidget, this.continueWidget, this.prefsKey);
|
||||
|
||||
@override
|
||||
_MaterialAppWithIntroState createState() =>
|
||||
_MaterialAppWithIntroState(introWidget, continueWidget, prefsKey);
|
||||
}
|
||||
|
||||
class _MaterialAppWithIntroState extends State<MaterialAppWithIntroHome> {
|
||||
_MaterialAppWithIntroState(
|
||||
this.introWidget, this.continueWidget, this.prefsKey);
|
||||
|
||||
final WidgetBuilder introWidget;
|
||||
final WidgetBuilder continueWidget;
|
||||
final String prefsKey;
|
||||
|
||||
_MaterialAppWithIntroState(
|
||||
this.introWidget, this.continueWidget, this.prefsKey);
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
|
@ -63,19 +65,19 @@ class _MaterialAppWithIntroState extends State<MaterialAppWithIntroHome> {
|
|||
await prefs.setBool(initialWizardKey, false);
|
||||
if (mounted) {
|
||||
await Navigator.of(context)
|
||||
.pushReplacement(MaterialPageRoute(builder: introWidget));
|
||||
.pushReplacement(MaterialPageRoute<void>(builder: introWidget));
|
||||
}
|
||||
} else {
|
||||
if (mounted) {
|
||||
await Navigator.of(context)
|
||||
.pushReplacement(MaterialPageRoute(builder: continueWidget));
|
||||
.pushReplacement(MaterialPageRoute<void>(builder: continueWidget));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
return const Scaffold(
|
||||
body: Center(
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue