ionic-planb-logistic-app-fl.../lib/components/navigation_tc_dialog.dart
Jean-Philippe Brule d8bdaed63e Upgrade Flutter packages and fix breaking changes for Riverpod 3.0
Major package upgrades:
- Riverpod 2.x → 3.0.3 (breaking changes)
- flutter_appauth 7.0.0 → 11.0.0
- go_router 14.0.0 → 17.0.0
- permission_handler 11.3.0 → 12.0.1
- flutter_lints 5.0.0 → 6.0.0
- animate_do 3.1.2 → 4.2.0
- Plus 41 transitive dependency updates

Breaking changes fixed:

Riverpod 3.0 migration:
- Replace StateProvider with NotifierProvider pattern
- Update .valueOrNull to proper async value handling with .future
- Create LanguageNotifier and ThemeModeNotifier classes
- Fix all provider async value access patterns

Google Maps Navigation API updates:
- Rename GoogleMapsNavigationViewController to GoogleNavigationViewController
- Update Waypoint to NavigationWaypoint.withLatLngTarget
- Migrate controller methods to static GoogleMapsNavigator methods
- Update event listener types and callbacks

Localization system fixes:
- Update l10n.yaml synthetic-package configuration
- Fix import paths from flutter_gen to package imports
- Add errorTitle translation key for both en/fr
- Remove unnecessary null-aware operators (AppLocalizations is non-nullable)
- Regenerate localization files

iOS/macOS configuration:
- Update CocoaPods dependencies (AppAuth 1.7.5 → 2.0.0)
- Create missing Profile.xcconfig files for both platforms
- Sync Podfile.lock files with updated dependencies

Code quality:
- Fix all analyzer errors (0 errors remaining)
- Resolve deprecated API usage warnings
- Update async/await patterns for better error handling

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-16 01:25:16 -05:00

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({
Key? key,
required this.onAccept,
this.onDecline,
}) : super(key: key);
@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),
),
),
],
);
}
}