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>
80 lines
2.2 KiB
Dart
80 lines
2.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:planb_logistic/l10n/app_localizations.dart';
|
|
|
|
class NavigationTermsAndConditionsDialog extends StatelessWidget {
|
|
final VoidCallback onAccept;
|
|
final VoidCallback? onDecline;
|
|
|
|
const NavigationTermsAndConditionsDialog({
|
|
super.key,
|
|
required this.onAccept,
|
|
this.onDecline,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final l10n = AppLocalizations.of(context);
|
|
final colorScheme = Theme.of(context).colorScheme;
|
|
|
|
return AlertDialog(
|
|
title: Text(
|
|
l10n.navigationTcTitle,
|
|
style: Theme.of(context).textTheme.headlineSmall?.copyWith(
|
|
color: colorScheme.onSurface,
|
|
),
|
|
),
|
|
content: SingleChildScrollView(
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
l10n.navigationTcDescription,
|
|
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
|
color: colorScheme.onSurface,
|
|
),
|
|
),
|
|
const SizedBox(height: 16),
|
|
Text(
|
|
l10n.navigationTcAttribution,
|
|
style: Theme.of(context).textTheme.bodySmall?.copyWith(
|
|
color: colorScheme.onSurfaceVariant,
|
|
),
|
|
),
|
|
const SizedBox(height: 12),
|
|
Text(
|
|
l10n.navigationTcTerms,
|
|
style: Theme.of(context).textTheme.bodySmall?.copyWith(
|
|
color: colorScheme.onSurfaceVariant,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
actions: [
|
|
if (onDecline != null)
|
|
TextButton(
|
|
onPressed: () {
|
|
Navigator.of(context).pop();
|
|
onDecline!();
|
|
},
|
|
child: Text(
|
|
l10n.decline,
|
|
style: TextStyle(color: colorScheme.error),
|
|
),
|
|
),
|
|
TextButton(
|
|
onPressed: () {
|
|
Navigator.of(context).pop();
|
|
onAccept();
|
|
},
|
|
child: Text(
|
|
l10n.accept,
|
|
style: TextStyle(color: colorScheme.primary),
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|