added support for web ; bumped dart_core_sdk version to 1.13.2

This commit is contained in:
2026-06-24 17:05:42 +02:00
parent fff5617757
commit 3efe4dcca6
20 changed files with 734 additions and 30 deletions

View File

@@ -0,0 +1,374 @@
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:intl/intl.dart' as intl;
import 'app_localizations_en.dart';
import 'app_localizations_fr.dart';
// ignore_for_file: type=lint
/// Callers can lookup localized strings with an instance of AppLocalizations
/// returned by `AppLocalizations.of(context)`.
///
/// Applications need to include `AppLocalizations.delegate()` in their app's
/// `localizationDelegates` list, and the locales they support in the app's
/// `supportedLocales` list. For example:
///
/// ```dart
/// import 'l10n/app_localizations.dart';
///
/// return MaterialApp(
/// localizationsDelegates: AppLocalizations.localizationsDelegates,
/// supportedLocales: AppLocalizations.supportedLocales,
/// home: MyApplicationHome(),
/// );
/// ```
///
/// ## Update pubspec.yaml
///
/// Please make sure to update your pubspec.yaml to include the following
/// packages:
///
/// ```yaml
/// dependencies:
/// # Internationalization support.
/// flutter_localizations:
/// sdk: flutter
/// intl: any # Use the pinned version from flutter_localizations
///
/// # Rest of dependencies
/// ```
///
/// ## iOS Applications
///
/// iOS applications define key application metadata, including supported
/// locales, in an Info.plist file that is built into the application bundle.
/// To configure the locales supported by your app, youll need to edit this
/// file.
///
/// First, open your projects ios/Runner.xcworkspace Xcode workspace file.
/// Then, in the Project Navigator, open the Info.plist file under the Runner
/// projects Runner folder.
///
/// Next, select the Information Property List item, select Add Item from the
/// Editor menu, then select Localizations from the pop-up menu.
///
/// Select and expand the newly-created Localizations item then, for each
/// locale your application supports, add a new item and select the locale
/// you wish to add from the pop-up menu in the Value field. This list should
/// be consistent with the languages listed in the AppLocalizations.supportedLocales
/// property.
abstract class AppLocalizations {
AppLocalizations(String locale)
: localeName = intl.Intl.canonicalizedLocale(locale.toString());
final String localeName;
static AppLocalizations? of(BuildContext context) {
return Localizations.of<AppLocalizations>(context, AppLocalizations);
}
static const LocalizationsDelegate<AppLocalizations> delegate =
_AppLocalizationsDelegate();
/// A list of this localizations delegate along with the default localizations
/// delegates.
///
/// Returns a list of localizations delegates containing this delegate along with
/// GlobalMaterialLocalizations.delegate, GlobalCupertinoLocalizations.delegate,
/// and GlobalWidgetsLocalizations.delegate.
///
/// Additional delegates can be added by appending to this list in
/// MaterialApp. This list does not have to be used at all if a custom list
/// of delegates is preferred or required.
static const List<LocalizationsDelegate<dynamic>> localizationsDelegates =
<LocalizationsDelegate<dynamic>>[
delegate,
GlobalMaterialLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
];
/// A list of this localizations delegate's supported locales.
static const List<Locale> supportedLocales = <Locale>[
Locale('en'),
Locale('fr'),
];
/// No description provided for @addPhoto.
///
/// In en, this message translates to:
/// **'Add photo'**
String get addPhoto;
/// No description provided for @anomaly.
///
/// In en, this message translates to:
/// **'Anomaly'**
String get anomaly;
/// No description provided for @anomalyBadHandlingUnit.
///
/// In en, this message translates to:
/// **'Declined - Package in bad condition'**
String get anomalyBadHandlingUnit;
/// No description provided for @anomalyCustomerRefused.
///
/// In en, this message translates to:
/// **'Declined - Customer declined'**
String get anomalyCustomerRefused;
/// No description provided for @anomalyCustomerUnavailable.
///
/// In en, this message translates to:
/// **'Unavailable - Customer unavailable'**
String get anomalyCustomerUnavailable;
/// No description provided for @anomalyOther.
///
/// In en, this message translates to:
/// **'Other reason'**
String get anomalyOther;
/// No description provided for @anomalyReason.
///
/// In en, this message translates to:
/// **'Anomaly reason'**
String get anomalyReason;
/// No description provided for @cancel.
///
/// In en, this message translates to:
/// **'Cancel'**
String get cancel;
/// No description provided for @cannotNotifyDelivery.
///
/// In en, this message translates to:
/// **'Cannot notify delivery'**
String get cannotNotifyDelivery;
/// No description provided for @copied.
///
/// In en, this message translates to:
/// **'copied'**
String get copied;
/// No description provided for @dateOn.
///
/// In en, this message translates to:
/// **'the {date} at {time}'**
String dateOn(DateTime date, DateTime time);
/// No description provided for @deliveryOk.
///
/// In en, this message translates to:
/// **'Delivery notified as OK'**
String get deliveryOk;
/// No description provided for @deliveryWithAnomaly.
///
/// In en, this message translates to:
/// **'Delivery notified with anomaly'**
String get deliveryWithAnomaly;
/// No description provided for @dimensions.
///
/// In en, this message translates to:
/// **'Dimensions (H x W x L)'**
String get dimensions;
/// No description provided for @error.
///
/// In en, this message translates to:
/// **'Error'**
String get error;
/// No description provided for @handlingUnitIdentifier.
///
/// In en, this message translates to:
/// **'Handling unit Identifier'**
String get handlingUnitIdentifier;
/// No description provided for @handlingUnitType.
///
/// In en, this message translates to:
/// **'Handling unit type'**
String get handlingUnitType;
/// No description provided for @informations.
///
/// In en, this message translates to:
/// **'Informations'**
String get informations;
/// No description provided for @items.
///
/// In en, this message translates to:
/// **'Items'**
String get items;
/// No description provided for @itemId.
///
/// In en, this message translates to:
/// **'Item ID'**
String get itemId;
/// No description provided for @missingSendingFilesRights.
///
/// In en, this message translates to:
/// **'You are not allowed to send files in this project'**
String get missingSendingFilesRights;
/// No description provided for @nextDelivery.
///
/// In en, this message translates to:
/// **'Next delivery'**
String get nextDelivery;
/// No description provided for @noHandlingUnitFound.
///
/// In en, this message translates to:
/// **'No handling unit found'**
String get noHandlingUnitFound;
/// No description provided for @ok.
///
/// In en, this message translates to:
/// **'OK'**
String get ok;
/// No description provided for @or.
///
/// In en, this message translates to:
/// **'OR'**
String get or;
/// No description provided for @organization.
///
/// In en, this message translates to:
/// **'Organization'**
String get organization;
/// No description provided for @pleaseTryAgain.
///
/// In en, this message translates to:
/// **'Please try again'**
String get pleaseTryAgain;
/// No description provided for @pleaseIndicateAnomaly.
///
/// In en, this message translates to:
/// **'Please indicate if the handling unit has an anomaly or not'**
String get pleaseIndicateAnomaly;
/// No description provided for @project.
///
/// In en, this message translates to:
/// **'Project'**
String get project;
/// No description provided for @quantity.
///
/// In en, this message translates to:
/// **'Quantity'**
String get quantity;
/// No description provided for @scanBarcode.
///
/// In en, this message translates to:
/// **'SCAN BARCODE'**
String get scanBarcode;
/// No description provided for @search.
///
/// In en, this message translates to:
/// **'Search'**
String get search;
/// No description provided for @selectContext.
///
/// In en, this message translates to:
/// **'Select the desired organization and project of your delivery'**
String get selectContext;
/// No description provided for @selectHandlingUnit.
///
/// In en, this message translates to:
/// **'Select a handling unit by typing or scanning its identifier'**
String get selectHandlingUnit;
/// No description provided for @signature.
///
/// In en, this message translates to:
/// **'Signature'**
String get signature;
/// No description provided for @start.
///
/// In en, this message translates to:
/// **'Start tour'**
String get start;
/// No description provided for @tryAgain.
///
/// In en, this message translates to:
/// **'Try again'**
String get tryAgain;
/// No description provided for @trackingNumber.
///
/// In en, this message translates to:
/// **'Tracking N°'**
String get trackingNumber;
/// No description provided for @validDelivery.
///
/// In en, this message translates to:
/// **'OK'**
String get validDelivery;
/// No description provided for @weight.
///
/// In en, this message translates to:
/// **'Weight'**
String get weight;
}
class _AppLocalizationsDelegate
extends LocalizationsDelegate<AppLocalizations> {
const _AppLocalizationsDelegate();
@override
Future<AppLocalizations> load(Locale locale) {
return SynchronousFuture<AppLocalizations>(lookupAppLocalizations(locale));
}
@override
bool isSupported(Locale locale) =>
<String>['en', 'fr'].contains(locale.languageCode);
@override
bool shouldReload(_AppLocalizationsDelegate old) => false;
}
AppLocalizations lookupAppLocalizations(Locale locale) {
// Lookup logic when only language code is specified.
switch (locale.languageCode) {
case 'en':
return AppLocalizationsEn();
case 'fr':
return AppLocalizationsFr();
}
throw FlutterError(
'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely '
'an issue with the localizations generation tool. Please file an issue '
'on GitHub with a reproducible sample app and the gen-l10n configuration '
'that was used.',
);
}

View File

@@ -0,0 +1,141 @@
// ignore: unused_import
import 'package:intl/intl.dart' as intl;
import 'app_localizations.dart';
// ignore_for_file: type=lint
/// The translations for English (`en`).
class AppLocalizationsEn extends AppLocalizations {
AppLocalizationsEn([String locale = 'en']) : super(locale);
@override
String get addPhoto => 'Add photo';
@override
String get anomaly => 'Anomaly';
@override
String get anomalyBadHandlingUnit => 'Declined - Package in bad condition';
@override
String get anomalyCustomerRefused => 'Declined - Customer declined';
@override
String get anomalyCustomerUnavailable => 'Unavailable - Customer unavailable';
@override
String get anomalyOther => 'Other reason';
@override
String get anomalyReason => 'Anomaly reason';
@override
String get cancel => 'Cancel';
@override
String get cannotNotifyDelivery => 'Cannot notify delivery';
@override
String get copied => 'copied';
@override
String dateOn(DateTime date, DateTime time) {
final intl.DateFormat dateDateFormat = intl.DateFormat.yMd(localeName);
final String dateString = dateDateFormat.format(date);
final intl.DateFormat timeDateFormat = intl.DateFormat.jm(localeName);
final String timeString = timeDateFormat.format(time);
return 'the $dateString at $timeString';
}
@override
String get deliveryOk => 'Delivery notified as OK';
@override
String get deliveryWithAnomaly => 'Delivery notified with anomaly';
@override
String get dimensions => 'Dimensions (H x W x L)';
@override
String get error => 'Error';
@override
String get handlingUnitIdentifier => 'Handling unit Identifier';
@override
String get handlingUnitType => 'Handling unit type';
@override
String get informations => 'Informations';
@override
String get items => 'Items';
@override
String get itemId => 'Item ID';
@override
String get missingSendingFilesRights =>
'You are not allowed to send files in this project';
@override
String get nextDelivery => 'Next delivery';
@override
String get noHandlingUnitFound => 'No handling unit found';
@override
String get ok => 'OK';
@override
String get or => 'OR';
@override
String get organization => 'Organization';
@override
String get pleaseTryAgain => 'Please try again';
@override
String get pleaseIndicateAnomaly =>
'Please indicate if the handling unit has an anomaly or not';
@override
String get project => 'Project';
@override
String get quantity => 'Quantity';
@override
String get scanBarcode => 'SCAN BARCODE';
@override
String get search => 'Search';
@override
String get selectContext =>
'Select the desired organization and project of your delivery';
@override
String get selectHandlingUnit =>
'Select a handling unit by typing or scanning its identifier';
@override
String get signature => 'Signature';
@override
String get start => 'Start tour';
@override
String get tryAgain => 'Try again';
@override
String get trackingNumber => 'Tracking N°';
@override
String get validDelivery => 'OK';
@override
String get weight => 'Weight';
}

View File

@@ -0,0 +1,142 @@
// ignore: unused_import
import 'package:intl/intl.dart' as intl;
import 'app_localizations.dart';
// ignore_for_file: type=lint
/// The translations for French (`fr`).
class AppLocalizationsFr extends AppLocalizations {
AppLocalizationsFr([String locale = 'fr']) : super(locale);
@override
String get addPhoto => 'Ajouter une photo';
@override
String get anomaly => 'Anomalie';
@override
String get anomalyBadHandlingUnit => 'Refusé - Colis abimé';
@override
String get anomalyCustomerRefused => 'Refusé - Refus client';
@override
String get anomalyCustomerUnavailable => 'Absence - Client non présent';
@override
String get anomalyOther => 'Autres raisons';
@override
String get anomalyReason => 'Raison de l\'anomalie';
@override
String get cancel => 'Annuler';
@override
String get cannotNotifyDelivery => 'Impossible de notifier la livraison';
@override
String get copied => 'copié';
@override
String dateOn(DateTime date, DateTime time) {
final intl.DateFormat dateDateFormat = intl.DateFormat.yMd(localeName);
final String dateString = dateDateFormat.format(date);
final intl.DateFormat timeDateFormat = intl.DateFormat.jm(localeName);
final String timeString = timeDateFormat.format(time);
return 'le $dateString à $timeString';
}
@override
String get deliveryOk => 'Livraison déclarée conforme';
@override
String get deliveryWithAnomaly => 'Livraison déclarée en anomalie';
@override
String get dimensions => 'Dimensions (H x L x P)';
@override
String get error => 'Erreur';
@override
String get handlingUnitIdentifier => 'Identifiant du colis';
@override
String get handlingUnitType => 'Type de colis';
@override
String get informations => 'Informations';
@override
String get items => 'Articles';
@override
String get itemId => 'Article ID';
@override
String get missingSendingFilesRights =>
'Vous n\'avez pas le droit d\'envoyer de fichiers dans ce projet';
@override
String get nextDelivery => 'Livraison suivante';
@override
String get noHandlingUnitFound =>
'Aucun colis trouvé pour cet identifiant de colis.';
@override
String get ok => 'OK';
@override
String get or => 'OU';
@override
String get organization => 'Organisation';
@override
String get pleaseTryAgain => 'Veuillez réessayer';
@override
String get pleaseIndicateAnomaly =>
'Veuillez indiquer si le colis présente une anomalie ou non';
@override
String get project => 'Projet';
@override
String get quantity => 'Quantité';
@override
String get scanBarcode => 'SCANNER UN CODE BARRE';
@override
String get search => 'Rechercher';
@override
String get selectContext =>
'Sélectionner l\'organisation et le projet cible de votre livraison';
@override
String get selectHandlingUnit =>
'Sélectionner un colis en scannant ou tapant son numéro ou son identifiant tracking';
@override
String get signature => 'Signature';
@override
String get start => 'Démarrer la tournée';
@override
String get tryAgain => 'Réessayer';
@override
String get trackingNumber => 'N° Tracking';
@override
String get validDelivery => 'Valide';
@override
String get weight => 'Poids';
}