Fix linting issues and code quality improvements

Resolve 62 linting issues identified by flutter analyze, reducing
total issues from 79 to 17. All critical warnings addressed.

Changes:
- Replace deprecated withOpacity() with withValues(alpha:) (25 instances)
- Remove unused imports from 9 files
- Remove unused variables and fields (6 instances)
- Fix Riverpod 3.0 state access violations in settings_page
- Remove unnecessary null-aware operators in navigation_page (6 instances)
- Fix unnecessary type casts in providers (4 instances)
- Remove unused methods: _getDarkMapStyle, _showPermissionDialog
- Simplify hover state management by removing unused _isHovered fields

Remaining 17 issues are info-level style suggestions and defensive
programming patterns that don't impact functionality.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Jean-Philippe Brule
2025-11-16 01:39:35 -05:00
parent d8bdaed63e
commit 57b81d1e95
14 changed files with 37 additions and 239 deletions
+6 -6
View File
@@ -97,7 +97,7 @@ class ComponentThemes {
static InputDecorationTheme inputDecorationTheme(ColorScheme colorScheme) {
return InputDecorationTheme(
filled: true,
fillColor: colorScheme.surfaceContainerHighest.withOpacity(0.5),
fillColor: colorScheme.surfaceContainerHighest.withValues(alpha: 0.5),
contentPadding: EdgeInsets.symmetric(
horizontal: AppSpacing.inputPadding,
vertical: AppSpacing.md,
@@ -105,13 +105,13 @@ class ComponentThemes {
border: OutlineInputBorder(
borderRadius: AppBorders.circularSm,
borderSide: BorderSide(
color: colorScheme.outline.withOpacity(0.3),
color: colorScheme.outline.withValues(alpha: 0.3),
),
),
enabledBorder: OutlineInputBorder(
borderRadius: AppBorders.circularSm,
borderSide: BorderSide(
color: colorScheme.outline.withOpacity(0.3),
color: colorScheme.outline.withValues(alpha: 0.3),
width: 1,
),
),
@@ -144,7 +144,7 @@ class ComponentThemes {
hintStyle: TextStyle(
fontFamily: 'Montserrat',
fontWeight: FontWeight.w400,
color: colorScheme.onSurfaceVariant.withOpacity(0.6),
color: colorScheme.onSurfaceVariant.withValues(alpha: 0.6),
),
);
}
@@ -204,7 +204,7 @@ class ComponentThemes {
return ChipThemeData(
backgroundColor: colorScheme.surfaceContainerHighest,
deleteIconColor: colorScheme.onSurfaceVariant,
disabledColor: colorScheme.surfaceContainerHighest.withOpacity(0.38),
disabledColor: colorScheme.surfaceContainerHighest.withValues(alpha: 0.38),
padding: EdgeInsets.symmetric(
horizontal: AppSpacing.sm,
vertical: AppSpacing.xs,
@@ -255,7 +255,7 @@ class ComponentThemes {
activeTrackColor: colorScheme.primary,
inactiveTrackColor: colorScheme.surfaceContainerHighest,
thumbColor: colorScheme.primary,
overlayColor: colorScheme.primary.withOpacity(0.12),
overlayColor: colorScheme.primary.withValues(alpha: 0.12),
valueIndicatorColor: colorScheme.primary,
);
}
+2 -2
View File
@@ -75,7 +75,7 @@ class AppGradients {
end: horizontal ? Alignment.centerRight : Alignment.bottomCenter,
colors: [
color,
color.withOpacity(0.8),
color.withValues(alpha: 0.8),
],
);
}
@@ -311,7 +311,7 @@ class AppGradients {
begin: gradient.begin,
end: gradient.end,
colors: gradient.colors
.map((color) => color.withOpacity(opacity))
.map((color) => color.withValues(alpha: opacity))
.toList(),
stops: gradient.stops,
);
-1
View File
@@ -1,4 +1,3 @@
import 'package:flutter/material.dart';
/// Svrnty Size System
/// Standard sizing constants for icons, buttons, containers, and other components
+1 -1
View File
@@ -257,7 +257,7 @@ class AppTypography {
) {
final color = baseStyle.color ?? Colors.black;
return baseStyle.copyWith(
color: color.withOpacity(opacity),
color: color.withValues(alpha: opacity),
);
}