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_ru.dart';
import 'app_localizations_uz.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, you’ll need to edit this
/// file.
///
/// First, open your project’s ios/Runner.xcworkspace Xcode workspace file.
/// Then, in the Project Navigator, open the Info.plist file under the Runner
/// project’s 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('ru'),
    Locale('uz'),
  ];

  /// No description provided for @useYourTAxiAccount.
  ///
  /// In en, this message translates to:
  /// **'Use your uber account to get started'**
  String get useYourTAxiAccount;

  /// No description provided for @enterYourMobileNumber.
  ///
  /// In en, this message translates to:
  /// **'Enter your mobile number'**
  String get enterYourMobileNumber;

  /// No description provided for @mobileNumber.
  ///
  /// In en, this message translates to:
  /// **'Mobile number'**
  String get mobileNumber;

  /// No description provided for @next.
  ///
  /// In en, this message translates to:
  /// **'Next'**
  String get next;

  /// No description provided for @contestToGetCallAndSms.
  ///
  /// In en, this message translates to:
  /// **'By proceeding, you consent to get calls, Whatsapp or SMS messages, including by automated means, from uber and its affiliates to the number provided.'**
  String get contestToGetCallAndSms;

  /// No description provided for @continueWithGoogle.
  ///
  /// In en, this message translates to:
  /// **'Continue with google'**
  String get continueWithGoogle;

  /// No description provided for @or.
  ///
  /// In en, this message translates to:
  /// **'or'**
  String get or;

  /// No description provided for @welcomeBack.
  ///
  /// In en, this message translates to:
  /// **'Welcome back, John'**
  String get welcomeBack;

  /// No description provided for @pleaseEnterYourPassword.
  ///
  /// In en, this message translates to:
  /// **'Please enter your password'**
  String get pleaseEnterYourPassword;

  /// No description provided for @iHaveForgotPassword.
  ///
  /// In en, this message translates to:
  /// **'I\'ve forgotten my password'**
  String get iHaveForgotPassword;

  /// No description provided for @iCantSignIn.
  ///
  /// In en, this message translates to:
  /// **'I cant sign in'**
  String get iCantSignIn;

  /// No description provided for @enter4DigitCodeSentYou.
  ///
  /// In en, this message translates to:
  /// **'Enter the 4-digit code sent to you at {phone}'**
  String enter4DigitCodeSentYou(String phone);

  /// No description provided for @iHavenRecievedCode.
  ///
  /// In en, this message translates to:
  /// **'I haven’t recieved a code (\${time})'**
  String iHavenRecievedCode(String time);

  /// No description provided for @delivery.
  ///
  /// In en, this message translates to:
  /// **'Delivery'**
  String get delivery;

  /// No description provided for @pickUp.
  ///
  /// In en, this message translates to:
  /// **'Pickup'**
  String get pickUp;

  /// No description provided for @dineIn.
  ///
  /// In en, this message translates to:
  /// **'Dine-in'**
  String get dineIn;

  /// No description provided for @allCategories.
  ///
  /// In en, this message translates to:
  /// **'All categories'**
  String get allCategories;

  /// No description provided for @convenience.
  ///
  /// In en, this message translates to:
  /// **'Convenience'**
  String get convenience;

  /// No description provided for @alcohol.
  ///
  /// In en, this message translates to:
  /// **'Alcohol'**
  String get alcohol;

  /// No description provided for @petSupplies.
  ///
  /// In en, this message translates to:
  /// **'Pet Supplies'**
  String get petSupplies;

  /// No description provided for @flowers.
  ///
  /// In en, this message translates to:
  /// **'Flowers'**
  String get flowers;

  /// No description provided for @grocery.
  ///
  /// In en, this message translates to:
  /// **'Grocery'**
  String get grocery;

  /// No description provided for @american.
  ///
  /// In en, this message translates to:
  /// **'American'**
  String get american;

  /// No description provided for @speciality.
  ///
  /// In en, this message translates to:
  /// **'Speciality'**
  String get speciality;

  /// No description provided for @takeout.
  ///
  /// In en, this message translates to:
  /// **'Takeout'**
  String get takeout;

  /// No description provided for @asian.
  ///
  /// In en, this message translates to:
  /// **'Asian'**
  String get asian;

  /// No description provided for @iceCream.
  ///
  /// In en, this message translates to:
  /// **'Ice Cream'**
  String get iceCream;

  /// No description provided for @halal.
  ///
  /// In en, this message translates to:
  /// **'Halal'**
  String get halal;

  /// No description provided for @retails.
  ///
  /// In en, this message translates to:
  /// **'Retails'**
  String get retails;

  /// No description provided for @caribbean.
  ///
  /// In en, this message translates to:
  /// **'Caribbean'**
  String get caribbean;

  /// No description provided for @indian.
  ///
  /// In en, this message translates to:
  /// **'Indian'**
  String get indian;

  /// No description provided for @french.
  ///
  /// In en, this message translates to:
  /// **'French'**
  String get french;

  /// No description provided for @fastFoods.
  ///
  /// In en, this message translates to:
  /// **'Fast Foods'**
  String get fastFoods;

  /// No description provided for @burger.
  ///
  /// In en, this message translates to:
  /// **'Burger'**
  String get burger;

  /// No description provided for @ride.
  ///
  /// In en, this message translates to:
  /// **'Ride'**
  String get ride;

  /// No description provided for @chinese.
  ///
  /// In en, this message translates to:
  /// **'Chinese'**
  String get chinese;

  /// No description provided for @dessert.
  ///
  /// In en, this message translates to:
  /// **'Dessert'**
  String get dessert;

  /// No description provided for @more.
  ///
  /// In en, this message translates to:
  /// **'More'**
  String get more;

  /// No description provided for @orderDetails.
  ///
  /// In en, this message translates to:
  /// **'Order details'**
  String get orderDetails;

  /// No description provided for @deliverNow.
  ///
  /// In en, this message translates to:
  /// **'Deliver now'**
  String get deliverNow;

  /// No description provided for @schedule.
  ///
  /// In en, this message translates to:
  /// **'Schedule'**
  String get schedule;

  /// No description provided for @enterNewAddress.
  ///
  /// In en, this message translates to:
  /// **'Enter a new address'**
  String get enterNewAddress;

  /// No description provided for @nearby.
  ///
  /// In en, this message translates to:
  /// **'Nearby'**
  String get nearby;

  /// No description provided for @currentLocation.
  ///
  /// In en, this message translates to:
  /// **'Current location'**
  String get currentLocation;

  /// No description provided for @enable.
  ///
  /// In en, this message translates to:
  /// **'Enable'**
  String get enable;

  /// No description provided for @recentLocations.
  ///
  /// In en, this message translates to:
  /// **'Recent locations'**
  String get recentLocations;

  /// No description provided for @allFilters.
  ///
  /// In en, this message translates to:
  /// **'All filters'**
  String get allFilters;

  /// No description provided for @sort.
  ///
  /// In en, this message translates to:
  /// **'Sort'**
  String get sort;

  /// No description provided for @pickedForYou.
  ///
  /// In en, this message translates to:
  /// **'Picked for you (default)'**
  String get pickedForYou;

  /// No description provided for @mostPopular.
  ///
  /// In en, this message translates to:
  /// **'Most popular'**
  String get mostPopular;

  /// No description provided for @rating.
  ///
  /// In en, this message translates to:
  /// **'Rating'**
  String get rating;

  /// No description provided for @deliveryTime.
  ///
  /// In en, this message translates to:
  /// **'Delivery time'**
  String get deliveryTime;

  /// No description provided for @fromUberEats.
  ///
  /// In en, this message translates to:
  /// **'From {name}'**
  String fromUberEats(String name);

  /// No description provided for @deals.
  ///
  /// In en, this message translates to:
  /// **'Deals'**
  String get deals;

  /// No description provided for @bestOverall.
  ///
  /// In en, this message translates to:
  /// **'Best Overall'**
  String get bestOverall;

  /// No description provided for @priceRange.
  ///
  /// In en, this message translates to:
  /// **'Price range'**
  String get priceRange;

  /// No description provided for @maxDeliveryFee.
  ///
  /// In en, this message translates to:
  /// **'Max. Delivery Fee'**
  String get maxDeliveryFee;

  /// No description provided for @dietary.
  ///
  /// In en, this message translates to:
  /// **'Dietary'**
  String get dietary;

  /// No description provided for @vegetarian.
  ///
  /// In en, this message translates to:
  /// **'Vegetarian'**
  String get vegetarian;

  /// No description provided for @vegan.
  ///
  /// In en, this message translates to:
  /// **'Vegan'**
  String get vegan;

  /// No description provided for @glutenFree.
  ///
  /// In en, this message translates to:
  /// **'Gluten-free'**
  String get glutenFree;

  /// No description provided for @allergyFriendly.
  ///
  /// In en, this message translates to:
  /// **'Allergy friendly'**
  String get allergyFriendly;

  /// No description provided for @atLeast.
  ///
  /// In en, this message translates to:
  /// **'At least'**
  String get atLeast;

  /// No description provided for @apply.
  ///
  /// In en, this message translates to:
  /// **'Apply'**
  String get apply;

  /// No description provided for @pickedForYouDefault.
  ///
  /// In en, this message translates to:
  /// **'Picked for you (default)'**
  String get pickedForYouDefault;

  /// No description provided for @popular.
  ///
  /// In en, this message translates to:
  /// **'Most popular'**
  String get popular;

  /// No description provided for @topRated.
  ///
  /// In en, this message translates to:
  /// **'Top rated'**
  String get topRated;

  /// No description provided for @fast.
  ///
  /// In en, this message translates to:
  /// **'Fast'**
  String get fast;

  /// No description provided for @featuredStores.
  ///
  /// In en, this message translates to:
  /// **'Featured stores'**
  String get featuredStores;

  /// No description provided for @opensAt.
  ///
  /// In en, this message translates to:
  /// **'Opens at {time}'**
  String opensAt(String time);

  /// No description provided for @spendAndSave.
  ///
  /// In en, this message translates to:
  /// **'Spend {spend}, save {save}'**
  String spendAndSave(String spend, String save);

  /// No description provided for @cartsTitle.
  ///
  /// In en, this message translates to:
  /// **'Carts'**
  String get cartsTitle;

  /// No description provided for @addItemsStartBasket.
  ///
  /// In en, this message translates to:
  /// **'Add items to start a basket'**
  String get addItemsStartBasket;

  /// No description provided for @basketHint.
  ///
  /// In en, this message translates to:
  /// **'Once you add items from a restaurant or store, your basket will appear here.'**
  String get basketHint;

  /// No description provided for @startShopping.
  ///
  /// In en, this message translates to:
  /// **'Start Shopping'**
  String get startShopping;

  /// No description provided for @orders.
  ///
  /// In en, this message translates to:
  /// **'Orders'**
  String get orders;

  /// No description provided for @recentSearches.
  ///
  /// In en, this message translates to:
  /// **'Recent searches'**
  String get recentSearches;

  /// No description provided for @cafe.
  ///
  /// In en, this message translates to:
  /// **'Cafe'**
  String get cafe;

  /// No description provided for @irish.
  ///
  /// In en, this message translates to:
  /// **'Irish'**
  String get irish;

  /// No description provided for @topCategories.
  ///
  /// In en, this message translates to:
  /// **'Top Categories'**
  String get topCategories;

  /// No description provided for @breakfastAndBrunch.
  ///
  /// In en, this message translates to:
  /// **'Breakfast and Brunch'**
  String get breakfastAndBrunch;

  /// No description provided for @coffeeAndTea.
  ///
  /// In en, this message translates to:
  /// **'Coffee and Tea'**
  String get coffeeAndTea;

  /// No description provided for @latestDeals.
  ///
  /// In en, this message translates to:
  /// **'Latest Deals'**
  String get latestDeals;

  /// No description provided for @restaurantRewards.
  ///
  /// In en, this message translates to:
  /// **'Restaurant Rewards'**
  String get restaurantRewards;

  /// No description provided for @nationwideShipping.
  ///
  /// In en, this message translates to:
  /// **'Nationwide Shipping'**
  String get nationwideShipping;

  /// No description provided for @mexican.
  ///
  /// In en, this message translates to:
  /// **'Mexican'**
  String get mexican;

  /// No description provided for @fastFood.
  ///
  /// In en, this message translates to:
  /// **'Fast Food'**
  String get fastFood;

  /// No description provided for @healthy.
  ///
  /// In en, this message translates to:
  /// **'Healthy'**
  String get healthy;

  /// No description provided for @pizza.
  ///
  /// In en, this message translates to:
  /// **'Pizza'**
  String get pizza;

  /// No description provided for @sandwich.
  ///
  /// In en, this message translates to:
  /// **'Sandwich'**
  String get sandwich;

  /// No description provided for @bakery.
  ///
  /// In en, this message translates to:
  /// **'Bakery'**
  String get bakery;

  /// No description provided for @categoriesShort.
  ///
  /// In en, this message translates to:
  /// **'Food, shopping, drinks, etc.'**
  String get categoriesShort;

  /// No description provided for @yourFavourites.
  ///
  /// In en, this message translates to:
  /// **'Your favourites'**
  String get yourFavourites;

  /// No description provided for @wallet.
  ///
  /// In en, this message translates to:
  /// **'Wallet'**
  String get wallet;

  /// No description provided for @sendAGift.
  ///
  /// In en, this message translates to:
  /// **'Send a gift'**
  String get sendAGift;

  /// No description provided for @businessPreferences.
  ///
  /// In en, this message translates to:
  /// **'Business preferences'**
  String get businessPreferences;

  /// No description provided for @businessSub.
  ///
  /// In en, this message translates to:
  /// **'Make work meals quicker and easier'**
  String get businessSub;

  /// No description provided for @help.
  ///
  /// In en, this message translates to:
  /// **'Help'**
  String get help;

  /// No description provided for @promotions.
  ///
  /// In en, this message translates to:
  /// **'Promotions'**
  String get promotions;

  /// No description provided for @uberPass.
  ///
  /// In en, this message translates to:
  /// **'Uber Pass'**
  String get uberPass;

  /// No description provided for @uberPassSub.
  ///
  /// In en, this message translates to:
  /// **'Join free for 1 month'**
  String get uberPassSub;

  /// No description provided for @deliverWithUber.
  ///
  /// In en, this message translates to:
  /// **'Deliver with Uber'**
  String get deliverWithUber;

  /// No description provided for @settings.
  ///
  /// In en, this message translates to:
  /// **'Settings'**
  String get settings;

  /// No description provided for @home.
  ///
  /// In en, this message translates to:
  /// **'Home'**
  String get home;

  /// No description provided for @browse.
  ///
  /// In en, this message translates to:
  /// **'Browse'**
  String get browse;

  /// No description provided for @baskets.
  ///
  /// In en, this message translates to:
  /// **'Baskets'**
  String get baskets;

  /// No description provided for @account.
  ///
  /// In en, this message translates to:
  /// **'Account'**
  String get account;

  /// No description provided for @changeLanguage.
  ///
  /// In en, this message translates to:
  /// **'Change language'**
  String get changeLanguage;

  /// No description provided for @language.
  ///
  /// In en, this message translates to:
  /// **'Language'**
  String get language;

  /// No description provided for @login.
  ///
  /// In en, this message translates to:
  /// **'Login'**
  String get login;

  /// No description provided for @phone_number.
  ///
  /// In en, this message translates to:
  /// **'Phone number'**
  String get phone_number;

  /// No description provided for @enter_phone_number.
  ///
  /// In en, this message translates to:
  /// **'Enter phone number'**
  String get enter_phone_number;

  /// No description provided for @password.
  ///
  /// In en, this message translates to:
  /// **'Password'**
  String get password;

  /// No description provided for @enter_password.
  ///
  /// In en, this message translates to:
  /// **'Enter password'**
  String get enter_password;

  /// No description provided for @forgot_password.
  ///
  /// In en, this message translates to:
  /// **'Forgot password'**
  String get forgot_password;

  /// No description provided for @continue_str.
  ///
  /// In en, this message translates to:
  /// **'Continue'**
  String get continue_str;

  /// No description provided for @dont_have_account.
  ///
  /// In en, this message translates to:
  /// **'Don\'t have an account?'**
  String get dont_have_account;

  /// No description provided for @sign_up.
  ///
  /// In en, this message translates to:
  /// **'SignUp'**
  String get sign_up;

  /// No description provided for @field_cannot_be_empty.
  ///
  /// In en, this message translates to:
  /// **'This field cannot be empty'**
  String get field_cannot_be_empty;

  /// No description provided for @password_too_short.
  ///
  /// In en, this message translates to:
  /// **'Password must be at least 6 characters long'**
  String get password_too_short;

  /// No description provided for @invalid_phone_format.
  ///
  /// In en, this message translates to:
  /// **'Invalid phone number format'**
  String get invalid_phone_format;

  /// No description provided for @first_name.
  ///
  /// In en, this message translates to:
  /// **'First name'**
  String get first_name;

  /// No description provided for @enter_first_name.
  ///
  /// In en, this message translates to:
  /// **'Enter first name'**
  String get enter_first_name;

  /// No description provided for @repeat_password.
  ///
  /// In en, this message translates to:
  /// **'Repeat password'**
  String get repeat_password;

  /// No description provided for @enter_repeat_password.
  ///
  /// In en, this message translates to:
  /// **'Enter repeat password'**
  String get enter_repeat_password;

  /// No description provided for @already_has_account.
  ///
  /// In en, this message translates to:
  /// **'Already have an account?'**
  String get already_has_account;

  /// No description provided for @unexpected_error.
  ///
  /// In en, this message translates to:
  /// **'Unexpected error'**
  String get unexpected_error;

  /// No description provided for @consent_message.
  ///
  /// In en, this message translates to:
  /// **'By proceeding, you consent to get calls or SMS messages, including by automated means, from {appName} and its affiliates to the number provided.'**
  String consent_message(String appName);
}

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', 'ru', 'uz'].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 'ru':
      return AppLocalizationsRu();
    case 'uz':
      return AppLocalizationsUz();
  }

  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.',
  );
}
