auto-claude: subtask-6-1 - Run flutter analyze to ensure no errors or warnings
Fixed all 39 analyzer issues: - Removed unused import (animation_system.dart in collapsible_routes_sidebar.dart) - Removed unused element (_buildActionButton in dark_mode_map.dart) - Fixed unnecessary non-null assertions on AppLocalizations.of(context) - Removed unnecessary type checks in providers.dart - Used super parameters for key in navigation_tc_dialog.dart and status_colors.dart - Replaced print statements with debugPrint in providers.dart and logging_interceptor.dart Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -88,7 +88,7 @@ class _DeliveriesPageState extends ConsumerState<DeliveriesPage> {
|
||||
final deliveriesData = ref.watch(deliveriesProvider(widget.routeFragmentId));
|
||||
final tokenAsync = ref.watch(authTokenProvider);
|
||||
final token = tokenAsync.hasValue ? tokenAsync.value : null;
|
||||
final l10n = AppLocalizations.of(context)!;
|
||||
final l10n = AppLocalizations.of(context);
|
||||
|
||||
// When embedded in sidebar, show only the delivery list with back button
|
||||
// This is a responsive sidebar that collapses like routes
|
||||
@@ -300,7 +300,7 @@ class _DeliveriesPageState extends ConsumerState<DeliveriesPage> {
|
||||
}
|
||||
|
||||
if (token == null) {
|
||||
final l10n = AppLocalizations.of(context)!;
|
||||
final l10n = AppLocalizations.of(context);
|
||||
ToastHelper.showError(context, l10n.authenticationRequired);
|
||||
return;
|
||||
}
|
||||
@@ -322,7 +322,7 @@ class _DeliveriesPageState extends ConsumerState<DeliveriesPage> {
|
||||
);
|
||||
result.when(
|
||||
success: (_) {
|
||||
final l10n = AppLocalizations.of(context)!;
|
||||
final l10n = AppLocalizations.of(context);
|
||||
// ignore: unused_result
|
||||
ref.refresh(deliveriesProvider(widget.routeFragmentId));
|
||||
// ignore: unused_result
|
||||
@@ -330,7 +330,7 @@ class _DeliveriesPageState extends ConsumerState<DeliveriesPage> {
|
||||
ToastHelper.showSuccess(context, l10n.deliverySuccessful);
|
||||
},
|
||||
onError: (error) {
|
||||
final l10n = AppLocalizations.of(context)!;
|
||||
final l10n = AppLocalizations.of(context);
|
||||
ToastHelper.showError(context, l10n.error(error.message));
|
||||
},
|
||||
);
|
||||
@@ -343,7 +343,6 @@ class _DeliveriesPageState extends ConsumerState<DeliveriesPage> {
|
||||
);
|
||||
result.when(
|
||||
success: (_) {
|
||||
final l10n = AppLocalizations.of(context)!;
|
||||
// ignore: unused_result
|
||||
ref.refresh(deliveriesProvider(widget.routeFragmentId));
|
||||
// ignore: unused_result
|
||||
@@ -351,7 +350,7 @@ class _DeliveriesPageState extends ConsumerState<DeliveriesPage> {
|
||||
ToastHelper.showSuccess(context, 'Delivery marked as uncompleted');
|
||||
},
|
||||
onError: (error) {
|
||||
final l10n = AppLocalizations.of(context)!;
|
||||
final l10n = AppLocalizations.of(context);
|
||||
ToastHelper.showError(context, l10n.error(error.message));
|
||||
},
|
||||
);
|
||||
@@ -386,7 +385,7 @@ class _DeliveriesPageState extends ConsumerState<DeliveriesPage> {
|
||||
String? token,
|
||||
) async {
|
||||
if (token == null) {
|
||||
final l10n = AppLocalizations.of(context)!;
|
||||
final l10n = AppLocalizations.of(context);
|
||||
ToastHelper.showError(context, l10n.authenticationRequired);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ class _LoginPageState extends ConsumerState<LoginPage> {
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.appTitle,
|
||||
AppLocalizations.of(context).appTitle,
|
||||
textAlign: TextAlign.center,
|
||||
style: Theme.of(context).textTheme.displayMedium?.copyWith(
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
@@ -88,7 +88,7 @@ class _LoginPageState extends ConsumerState<LoginPage> {
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.appDescription,
|
||||
AppLocalizations.of(context).appDescription,
|
||||
textAlign: TextAlign.center,
|
||||
style: Theme.of(context).textTheme.bodyLarge?.copyWith(
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
@@ -98,8 +98,8 @@ class _LoginPageState extends ConsumerState<LoginPage> {
|
||||
TextFormField(
|
||||
controller: _usernameController,
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context)!.username,
|
||||
hintText: AppLocalizations.of(context)!.usernameHint,
|
||||
labelText: AppLocalizations.of(context).username,
|
||||
hintText: AppLocalizations.of(context).usernameHint,
|
||||
prefixIcon: const Icon(Icons.person),
|
||||
border: const OutlineInputBorder(),
|
||||
),
|
||||
@@ -107,7 +107,7 @@ class _LoginPageState extends ConsumerState<LoginPage> {
|
||||
enabled: !_isLoading,
|
||||
validator: (value) {
|
||||
if (value == null || value.trim().isEmpty) {
|
||||
return AppLocalizations.of(context)!.usernameRequired;
|
||||
return AppLocalizations.of(context).usernameRequired;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
@@ -116,8 +116,8 @@ class _LoginPageState extends ConsumerState<LoginPage> {
|
||||
TextFormField(
|
||||
controller: _passwordController,
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context)!.password,
|
||||
hintText: AppLocalizations.of(context)!.passwordHint,
|
||||
labelText: AppLocalizations.of(context).password,
|
||||
hintText: AppLocalizations.of(context).passwordHint,
|
||||
prefixIcon: const Icon(Icons.lock),
|
||||
border: const OutlineInputBorder(),
|
||||
suffixIcon: IconButton(
|
||||
@@ -137,7 +137,7 @@ class _LoginPageState extends ConsumerState<LoginPage> {
|
||||
onFieldSubmitted: (_) => _handleLogin(),
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return AppLocalizations.of(context)!.passwordRequired;
|
||||
return AppLocalizations.of(context).passwordRequired;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
@@ -159,7 +159,7 @@ class _LoginPageState extends ConsumerState<LoginPage> {
|
||||
),
|
||||
),
|
||||
)
|
||||
: Text(AppLocalizations.of(context)!.loginButton),
|
||||
: Text(AppLocalizations.of(context).loginButton),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -11,7 +11,7 @@ class SettingsPage extends ConsumerWidget {
|
||||
final userProfile = ref.watch(userProfileProvider);
|
||||
final languageAsync = ref.watch(languageProvider);
|
||||
final themeMode = ref.watch(themeModeProvider);
|
||||
final l10n = AppLocalizations.of(context)!;
|
||||
final l10n = AppLocalizations.of(context);
|
||||
|
||||
final language = languageAsync.maybeWhen(
|
||||
data: (value) => value,
|
||||
|
||||
Reference in New Issue
Block a user