import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_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 ?? 'Navigation Service', style: Theme.of(context).textTheme.headlineSmall?.copyWith( color: colorScheme.onSurface, ), ), content: SingleChildScrollView( child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( l10n?.navigationTcDescription ?? 'This app uses Google Navigation to provide turn-by-turn navigation for deliveries.', style: Theme.of(context).textTheme.bodyMedium?.copyWith( color: colorScheme.onSurface, ), ), const SizedBox(height: 16), Text( l10n?.navigationTcAttribution ?? 'Attribution: Maps and navigation services provided by Google Maps.', style: Theme.of(context).textTheme.bodySmall?.copyWith( color: colorScheme.onSurfaceVariant, ), ), const SizedBox(height: 12), Text( l10n?.navigationTcTerms ?? 'By accepting, you agree to Google\'s Terms of Service and Privacy Policy for Navigation services.', 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 ?? 'Decline', style: TextStyle(color: colorScheme.error), ), ), TextButton( onPressed: () { Navigator.of(context).pop(); onAccept(); }, child: Text( l10n?.accept ?? 'Accept', style: TextStyle(color: colorScheme.primary), ), ), ], ); } }