Fix 13 lint issues: immutability, imports, async/await, and code style
High-priority fixes (10 issues): - assignment_to_final errors (7): Use copyWith() to respect immutability in YourLocation, active_fires.dart, generic_map.dart, location_utils.dart, and fetch_data_middleware.dart instead of direct assignment - Fixed import paths (3): Updated falsePositiveTypes.dart → false_positive_types.dart and firesApi.dart → fires_api.dart in reducers.dart, fire_notification_actions.dart, fires_api.dart Medium/Low priority fixes (3 issues): - unnecessary_non_null_assertion: Removed redundant '!' in app_intro_page.dart line 54 - use_super_parameters: Updated app_intro_page.dart to use modern super(key: key) syntax - no_logic_in_create_state: Fixed material_app_with_intro.dart by moving parameters to State instead of createState - noop_primitive_operations: Removed redundant .toString() in string interpolation - avoid_void_async: Changed void _selectLocation to Future<void> in places_autocomplete_utils.dart - avoid_dynamic_calls: Fixed dynamic map access in fires_api.dart by properly casting intermediate values Result: Reduced lint issues from 56 to 20 (all remaining are by-design: library_private_types_in_public_api and implementation_imports from external packages) APK builds successfully with no errors.
This commit is contained in:
parent
12653b80a4
commit
30a89fc5c0
23 changed files with 205 additions and 80 deletions
|
|
@ -17,9 +17,11 @@ typedef OnIntroFinish = void Function(BuildContext context);
|
|||
typedef ListItems = List<AppIntroItem> Function(BuildContext context);
|
||||
|
||||
abstract class AppIntroPage extends StatelessWidget {
|
||||
const AppIntroPage(
|
||||
{Key? key, required this.items, required this.onIntroFinish})
|
||||
: super(key: key);
|
||||
const AppIntroPage({
|
||||
super.key,
|
||||
required this.items,
|
||||
required this.onIntroFinish,
|
||||
});
|
||||
|
||||
static const String routeName = '/appintro';
|
||||
final ListItems items;
|
||||
|
|
@ -43,7 +45,7 @@ class _AppIntroPageSelector extends StatelessWidget {
|
|||
final OnIntroFinish onFinish;
|
||||
|
||||
void _handleArrowButtonPress(BuildContext context, int delta) {
|
||||
final TabController controller = DefaultTabController.of(context)!;
|
||||
final TabController controller = DefaultTabController.of(context);
|
||||
if (!controller.indexIsChanging)
|
||||
controller.animateTo(
|
||||
(controller.index + delta).clamp(0, items(context).length - 1));
|
||||
|
|
@ -51,7 +53,7 @@ class _AppIntroPageSelector extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final TabController controller = DefaultTabController.of(context)!;
|
||||
final TabController controller = DefaultTabController.of(context);
|
||||
|
||||
final ThemeData theme = Theme.of(context);
|
||||
final Color color = theme.colorScheme.secondary;
|
||||
|
|
|
|||
|
|
@ -46,17 +46,15 @@ class MaterialAppWithIntroHome extends StatefulWidget {
|
|||
final String prefsKey;
|
||||
|
||||
@override
|
||||
_MaterialAppWithIntroState createState() =>
|
||||
_MaterialAppWithIntroState(introWidget, continueWidget, prefsKey);
|
||||
_MaterialAppWithIntroState createState() => _MaterialAppWithIntroState();
|
||||
}
|
||||
|
||||
class _MaterialAppWithIntroState extends State<MaterialAppWithIntroHome> {
|
||||
_MaterialAppWithIntroState(
|
||||
this.introWidget, this.continueWidget, this.prefsKey);
|
||||
_MaterialAppWithIntroState();
|
||||
|
||||
final WidgetBuilder introWidget;
|
||||
final WidgetBuilder continueWidget;
|
||||
final String prefsKey;
|
||||
late final WidgetBuilder introWidget = widget.introWidget;
|
||||
late final WidgetBuilder continueWidget = widget.continueWidget;
|
||||
late final String prefsKey = widget.prefsKey;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue