Skip to content

Commit

Permalink
[FIX] Resolve example project to use pub package versions. (#15)
Browse files Browse the repository at this point in the history
## Description

Resolve example project to use pub package versions.

## Please check the following boxes

<!--- Put an `X` in all the boxes that apply: -->

- [x] Pull Request title is consistent with the implemented feature, fix
etc.
- [x] I have followed proper descriptive code style and conventions
- [x] The code is self-documenting and has no unnecessary comments. I
named the functions and variables to clearly describe their purpose.
- [ ] I have added Unit Tests and coverage is 70%+
- [x] I have tested and verified this implementation and it works as
expected
  • Loading branch information
kwado-tech authored Mar 16, 2024
1 parent f997e32 commit 6f98803
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 81 deletions.
84 changes: 30 additions & 54 deletions example/lib/localization/gen-l10n/app_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,24 +63,17 @@ import 'app_localizations_en.dart';
import 'package:l10n_mapper_annotation/l10n_mapper_annotation.dart';
part 'app_localizations.g.dart';

@L10nMapperAnnotation(
mapperExtension:
L10nMapperExtension(l10n: true, locale: true, l10nParser: true),
translationConfig: TranslationConfig(
nullable: false, message: 'Cannot find translation-key!'),
)
@L10nMapperAnnotation(mapperExtension: L10nMapperExtension(l10n: true, locale: true, l10nParser: true), translationConfig: TranslationConfig(nullable: false, message: 'Cannot find translation-key!'),)
abstract class AppLocalizations {
AppLocalizations(String locale)
: localeName = intl.Intl.canonicalizedLocale(locale.toString());
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();
static const LocalizationsDelegate<AppLocalizations> delegate = _AppLocalizationsDelegate();

/// A list of this localizations delegate along with the default localizations
/// delegates.
Expand All @@ -92,8 +85,7 @@ abstract class AppLocalizations {
/// 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>>[
static const List<LocalizationsDelegate<dynamic>> localizationsDelegates = <LocalizationsDelegate<dynamic>>[
delegate,
GlobalMaterialLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
Expand Down Expand Up @@ -2073,8 +2065,7 @@ abstract class AppLocalizations {
///
/// In en, this message translates to:
/// **'Your deducted amount depends on the bank you use.'**
String
get cashier_fiat_deposit_bank_transfer_voucher_atm_jeton_provider_form_description;
String get cashier_fiat_deposit_bank_transfer_voucher_atm_jeton_provider_form_description;

/// No description provided for @cashier_fiat_deposit_bank_transfer_voucher_atm_fee.
///
Expand Down Expand Up @@ -2434,8 +2425,7 @@ abstract class AppLocalizations {
///
/// In en, this message translates to:
/// **'Minimum and maximum deposit amounts: <b>{min} / {max}</b>\n'**
String cashier_fiat_deposit_ezeebill_provider_bank_transfer_jpy_limits(
Object min, Object max);
String cashier_fiat_deposit_ezeebill_provider_bank_transfer_jpy_limits(Object min, Object max);

/// No description provided for @cashier_fiat_deposit_ezeebill_city_placeholder.
///
Expand Down Expand Up @@ -2609,15 +2599,13 @@ abstract class AppLocalizations {
///
/// In en, this message translates to:
/// **'Daily deposit limit: total of USD 500,000 every 24 hours'**
String
get cashier_fiat_deposit_jeton_provider_bank_transfer_voucher_atm_jpy_jpy_limits;
String get cashier_fiat_deposit_jeton_provider_bank_transfer_voucher_atm_jpy_jpy_limits;

/// Additional warning under limits
///
/// In en, this message translates to:
/// **'‎'**
String
get cashier_fiat_deposit_jeton_provider_bank_transfer_voucher_atm_jpy_limits;
String get cashier_fiat_deposit_jeton_provider_bank_transfer_voucher_atm_jpy_limits;

/// No description provided for @cashier_fiat_deposit_jpy_instant_bank_transfer_fee.
///
Expand Down Expand Up @@ -4051,8 +4039,7 @@ abstract class AppLocalizations {
///
/// In en, this message translates to:
/// **'Almost done'**
String
get cashier_fiat_withdrawal_bank_transfer_trustly_open_new_window_title;
String get cashier_fiat_withdrawal_bank_transfer_trustly_open_new_window_title;

/// No description provided for @cashier_fiat_withdrawal_bankaccount.
///
Expand Down Expand Up @@ -4610,22 +4597,19 @@ abstract class AppLocalizations {
///
/// In en, this message translates to:
/// **'If you don\'t complete your transaction your funds will be back to your player account in 15 mins.'**
String
get cashier_fiat_withdrawal_local_bank_transfer_qaicash_almost_done_message;
String get cashier_fiat_withdrawal_local_bank_transfer_qaicash_almost_done_message;

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

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

/// No description provided for @cashier_fiat_withdrawal_local_bank_transfer_qaicash_message.
///
Expand All @@ -4637,8 +4621,7 @@ abstract class AppLocalizations {
///
/// In en, this message translates to:
/// **'Almost done'**
String
get cashier_fiat_withdrawal_local_bank_transfer_qaicash_open_new_window_title;
String get cashier_fiat_withdrawal_local_bank_transfer_qaicash_open_new_window_title;

/// No description provided for @cashier_fiat_withdrawal_max_limit.
///
Expand Down Expand Up @@ -6366,15 +6349,13 @@ abstract class AppLocalizations {
///
/// In en, this message translates to:
/// **'Switch to {currency} and deposit'**
String cashier_reward_swich_currency_deposit_btn(
Object currency, Object curreny);
String cashier_reward_swich_currency_deposit_btn(Object currency, Object curreny);

/// No description provided for @cashier_reward_swich_currency_deposit_description.
///
/// In en, this message translates to:
/// **'You\'ve activated a deposit bonus reward in a different currency. Please switch to {currency} wallet and deposit {amount} {currency} in order to play the reward or you can forfeit it and try another reward.'**
String cashier_reward_swich_currency_deposit_description(
Object currency, Object amount);
String cashier_reward_swich_currency_deposit_description(Object currency, Object amount);

/// No description provided for @cashier_reward_swich_currency_description.
///
Expand Down Expand Up @@ -7364,8 +7345,7 @@ abstract class AppLocalizations {
///
/// In en, this message translates to:
/// **'Exceeds wallets balance amount {walletBalance} {currency}'**
String cashier_web3wallet_error_exceeds_wallet_balance(
Object walletBalance, Object currency);
String cashier_web3wallet_error_exceeds_wallet_balance(Object walletBalance, Object currency);

/// No description provided for @cashier_web3wallet_error_invalid_amount.
///
Expand All @@ -7377,8 +7357,7 @@ abstract class AppLocalizations {
///
/// In en, this message translates to:
/// **'Minimum deposit amount {minDeposit} {currency}'**
String cashier_web3wallet_error_min_deposit_amount(
Object minDeposit, Object currency);
String cashier_web3wallet_error_min_deposit_amount(Object minDeposit, Object currency);

/// No description provided for @cashier_web3wallet_error_prepare_contract.
///
Expand Down Expand Up @@ -8092,8 +8071,7 @@ abstract class AppLocalizations {
///
/// In en, this message translates to:
/// **'Currency mismatch between selected currency and market Bitcoin rate'**
String
get errors_currency_mismatch_between_selected_currency_and_market_btc_rate;
String get errors_currency_mismatch_between_selected_currency_and_market_btc_rate;

/// No description provided for @errors_disabled_withdrawals.
///
Expand Down Expand Up @@ -9638,8 +9616,7 @@ abstract class AppLocalizations {
String get wallet_withdraw;
}

class _AppLocalizationsDelegate
extends LocalizationsDelegate<AppLocalizations> {
class _AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations> {
const _AppLocalizationsDelegate();

@override
Expand All @@ -9648,27 +9625,26 @@ class _AppLocalizationsDelegate
}

@override
bool isSupported(Locale locale) =>
<String>['ar', 'de', 'en'].contains(locale.languageCode);
bool isSupported(Locale locale) => <String>['ar', 'de', 'en'].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 'ar':
return AppLocalizationsAr();
case 'de':
return AppLocalizationsDe();
case 'en':
return AppLocalizationsEn();
case 'ar': return AppLocalizationsAr();
case 'de': return AppLocalizationsDe();
case 'en': return AppLocalizationsEn();
}

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.');
'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.'
);
}
1 change: 1 addition & 0 deletions example/lib/localization/translations/local_old/app_ar.arb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions example/lib/localization/translations/local_old/app_de.arb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions example/lib/localization/translations/local_old/app_en.arb

Large diffs are not rendered by default.

18 changes: 8 additions & 10 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -299,20 +299,18 @@ packages:
l10n_mapper_annotation:
dependency: "direct main"
description:
path: l10n_mapper_annotation
ref: "1.3.0"
resolved-ref: "6964e7574784553ecc4af97a9d904b04813b8cb7"
url: "https://github.com/kwado-tech/l10n_mapper.git"
source: git
name: l10n_mapper_annotation
sha256: "428d3e34c1d458f19264b8641e9cb020c7ce126fb0a4b265332d0f86661a32a0"
url: "https://pub.dev"
source: hosted
version: "1.3.0"
l10n_mapper_generator:
dependency: "direct dev"
description:
path: l10n_mapper_generator
ref: "1.3.1"
resolved-ref: "8ef3087fb5d58fd95182cde95fe5a74676993edd"
url: "https://github.com/kwado-tech/l10n_mapper.git"
source: git
name: l10n_mapper_generator
sha256: "250c23ccabe885443274b703649c64880872467b64546e4aab265dcdebcffad7"
url: "https://pub.dev"
source: hosted
version: "1.3.0"
lints:
dependency: transitive
Expand Down
12 changes: 2 additions & 10 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,15 @@ dependencies:

flutter_localizations:
sdk: flutter
l10n_mapper_annotation:
git:
url: https://github.com/kwado-tech/l10n_mapper.git
path: l10n_mapper_annotation
ref: 1.3.0
l10n_mapper_annotation: ^1.3.0

dev_dependencies:
build_runner: ^2.3.3
flutter_lints: ^2.0.0
flutter_test:
sdk: flutter

l10n_mapper_generator:
git:
url: https://github.com/kwado-tech/l10n_mapper.git
path: l10n_mapper_generator
ref: 1.3.1
l10n_mapper_generator: ^1.3.0

flutter:
uses-material-design: true
8 changes: 1 addition & 7 deletions l10n_mapper_generator/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ description: A dart package to generate localization-mapper to support parsing
version: 1.3.0
homepage: https://github.com/kwado-tech/l10n_mapper/tree/main/l10n_mapper_generator
repository: https://github.com/kwado-tech/l10n_mapper/tree/main/l10n_mapper_generator
publish_to: none

environment:
sdk: '>=3.0.0 <4.0.0'
Expand All @@ -17,12 +16,7 @@ dependencies:
build: ^2.3.1
flutter:
sdk: flutter
# l10n_mapper_annotation: ^1.0.0
l10n_mapper_annotation:
git:
url: https://github.com/kwado-tech/l10n_mapper.git
path: l10n_mapper_annotation
ref: 1.3.0
l10n_mapper_annotation: ^1.3.0
path: ^1.8.3
source_gen: ^1.4.0

Expand Down

0 comments on commit 6f98803

Please sign in to comment.