diff --git a/CHANGELOG.md b/CHANGELOG.md index b9771873a..2543adf57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,110 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-04-26 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_localizations` - `v1.3.0`](#deriv_localizations---v130) + - [`deriv_auth` - `v6.4.2`](#deriv_auth---v642) + +Packages with dependency updates only: + +> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project. + + - `deriv_auth` - `v6.4.2` + +--- + +#### `deriv_localizations` - `v1.3.0` + + - **FEAT**(deriv_localization): Update localization string for deriv_auth ([#571](https://github.com/regentmarkets/flutter-deriv-packages/issues/571)). ([d2d76902](https://github.com/regentmarkets/flutter-deriv-packages/commit/d2d769023b651419270842d450a56a4bbd264327)) + + +## 2024-04-24 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_auth` - `v6.4.1`](#deriv_auth---v641) + +--- + +#### `deriv_auth` - `v6.4.1` + + - **FIX**(deriv_auth): Update settings page navigation in auth flow with callback ([#567](https://github.com/regentmarkets/flutter-deriv-packages/issues/567)). ([53857baf](https://github.com/regentmarkets/flutter-deriv-packages/commit/53857baf66ecc870e8a1452663c564b8ee57837a)) + + +## 2024-04-22 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_auth` - `v6.4.0`](#deriv_auth---v640) + +--- + +#### `deriv_auth` - `v6.4.0` + + - **FEAT**(deriv_auth): [P2PS-2679] add widget keys to auth components ([#565](https://github.com/regentmarkets/flutter-deriv-packages/issues/565)). ([e7bc54b4](https://github.com/regentmarkets/flutter-deriv-packages/commit/e7bc54b4be3d80236c83f1fecbe6f012f8759690)) + + +## 2024-04-22 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_web_view` - `v0.2.2+1`](#deriv_web_view---v0221) + - [`deriv_auth` - `v6.3.8`](#deriv_auth---v638) + - [`deriv_ui` - `v0.0.7+3`](#deriv_ui---v0073) + - [`deriv_widgetbook` - `v0.0.2+3`](#deriv_widgetbook---v0023) + - [`deriv_language_selector` - `v0.0.2+1`](#deriv_language_selector---v0021) + +Packages with dependency updates only: + +> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project. + + - `deriv_auth` - `v6.3.8` + - `deriv_ui` - `v0.0.7+3` + - `deriv_widgetbook` - `v0.0.2+3` + - `deriv_language_selector` - `v0.0.2+1` + +--- + +#### `deriv_web_view` - `v0.2.2+1` + + - **FIX**(deriv_web_view): update PTA model ([#557](https://github.com/regentmarkets/flutter-deriv-packages/issues/557)). ([49583f82](https://github.com/regentmarkets/flutter-deriv-packages/commit/49583f823fdac9c3ec3a85529fad9ab9f6784c67)) + + ## 2024-04-03 ### Changes diff --git a/README.md b/README.md index 6baaf6016..138d11478 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This repository contains private packages & plugins that are used by the company ## Using the packages -Each package has been released as git tag with convention as **packageName-vVersionNumber**`(Example: deriv_auth-v6.3.7)`. To use the package, add the following to your pubspec.yaml file: +Each package has been released as git tag with convention as **packageName-vVersionNumber**`(Example: deriv_auth-v6.4.2)`. To use the package, add the following to your pubspec.yaml file: ```yaml @@ -12,7 +12,7 @@ deriv_ui: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.7+2 #your prefered version + ref: deriv_ui-v0.0.7+3 #your prefered version ``` ## Packages @@ -20,7 +20,7 @@ deriv_ui: | Name | Description | Version | | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | | [analytics](./packages/analytics) | Used to collect and send analytical information to 'Firebase' and 'Segment'. | [v1.0.2](./packages/analytics/CHANGELOG.md) | -| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.3.7 ](./packages/deriv_auth/CHANGELOG.md) | +| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.4.2 ](./packages/deriv_auth/CHANGELOG.md) | | [deriv_banner](./packages/deriv_banner) | A widget to show banner in apps. | [v0.0.1+1](./packages/deriv_banner/CHANGELOG.md) | | [deriv_bloc_manager](./packages/deriv_bloc_manager) | Provides some tools to manage blocs. | [v0.0.1](./packages/deriv_bloc_manager/CHANGELOG.md) | | [deriv_datadog](./packages/deriv_datadog) | A package that helps you monitor the performance and user interactions of your Flutter app by sending data to Datadog. | [v0.0.1](./packages/deriv_datadog/CHANGELOG.md) | @@ -31,18 +31,18 @@ deriv_ui: | [deriv_http_client](./packages/deriv_http_client) | A package that provides a wrapper for http package. | [v2.0.0](./packages/deriv_http_client/CHANGELOG.md) | | [deriv_lint](./packages/deriv_lint) | A Dart package that provides lint rules for Dart and Flutter. | [v1.0.0](./packages/deriv_lint/CHANGELOG.md) | | [deriv_live_chat](./packages/deriv_live_chat) | A plugin for live chat SDK support to dart. | [v0.0.1+1](./packages/deriv_live_chat/CHANGELOG.md) | -| [deriv_language_selector](./packages/deriv_language_selector) | A package to handle language change of the app. | [v0.0.1+2](./packages/deriv_language_selector/CHANGELOG.md) | -| [deriv_localizations](./packages/deriv_localizations) | A Package that contains the localization arb(coming from Crowdin) and dart generated files for flutter_deriv_packages. | [v1.1.1](./packages/deriv_localizations/CHANGELOG.md) | | [v1.2.0](./packages/deriv_localizations/CHANGELOG.md) | +| [deriv_language_selector](./packages/deriv_language_selector) | A package to handle language change of the app. | [v0.0.2+1](./packages/deriv_language_selector/CHANGELOG.md) | +| [deriv_localizations](./packages/deriv_localizations) | A Package that contains the localization arb(coming from Crowdin) and dart generated files for flutter_deriv_packages. | [v1.1.1](./packages/deriv_localizations/CHANGELOG.md) | | [v1.3.0](./packages/deriv_localizations/CHANGELOG.md) | | [deriv_numpad](./packages/deriv_numpad) | Number Pad Widget for number input. | [v1.1.3](./packages/deriv_numpad/CHANGELOG.md) | | [deriv_rudderstack](./packages/deriv_rudderstack) | A plugin that add RudderStack SDK support to Flutter. | [v1.1.0](./packages/deriv_rudderstack/CHANGELOG.md) | | [deriv_store_launcher](./packages/deriv_store_launcher) | A plugin to launch app stores base on platform and manufacturer. | [v0.0.1+1](./packages/deriv_store_launcher/CHANGELOG.md) | | [deriv_technical_analysis](./packages/deriv_technical_analysis) | A Dart package for Technical Analysis. | [v0.0.1](./packages/deriv_technical_analysis/CHANGELOG.md) | | [deriv_theme](./packages/deriv_theme) | A package that contains the theme used by Deriv products. | [v2.4.0](./packages/deriv_theme/CHANGELOG.md) | -| [deriv_ui](./packages/deriv_ui) | A package that contains the UI components used by Deriv products. | [v0.0.7+2](./packages/deriv_ui/CHANGELOG.md) | +| [deriv_ui](./packages/deriv_ui) | A package that contains the UI components used by Deriv products. | [v0.0.7+3](./packages/deriv_ui/CHANGELOG.md) | | [deriv_utilities](./packages/deriv_utilities) | A package that contains the utilities including helper functions, mixins, and extensions. | [v1.0.0](./packages/deriv_utilities/CHANGELOG.md) | | [deriv_websocket](./packages/deriv_web_socket_client) | A package that provides a easy to use websocket client. | [v1.0.1](./packages/deriv_web_socket_client/CHANGELOG.md) | -| [deriv_web_view](./packages/deriv_web_view) | Deriv web view package. | [v0.2.2](./packages/deriv_web_view/CHANGELOG.md) | -| [deriv_widgetbook](./packages/deriv_widgetbook) |Storybook for Deriv UI Widgets and Components | [v0.0.2+2](./packages/deriv_widgetbook/CHANGELOG.md) | +| [deriv_web_view](./packages/deriv_web_view) | Deriv web view package. | [v0.2.2+1](./packages/deriv_web_view/CHANGELOG.md) | +| [deriv_widgetbook](./packages/deriv_widgetbook) |Storybook for Deriv UI Widgets and Components | [v0.0.2+3](./packages/deriv_widgetbook/CHANGELOG.md) | | [form_builder](./packages/form_builder) | A simpler and cleaner way to create, validate and submit forms. | [v1.0.0+1](./packages/form_builder/CHANGELOG.md) | | [update_checker](./packages/update_checker) | Check and retrieve update information from the server for the given package. | [v1.2.2](./packages/update_checker/CHANGELOG.md) | | [deriv_feature_flag](./packages/deriv_feature_flag) | A package to provide feature flag functionality for apps. | [v0.1.0+1](./packages/deriv_feature_flag/CHANGELOG.md) | diff --git a/melos.yaml b/melos.yaml index 2c94ec58c..8e75065c7 100644 --- a/melos.yaml +++ b/melos.yaml @@ -40,3 +40,6 @@ scripts: packageFilters: dirExists: - test + ignore: + # Ignore until we have a proper test. + - "deriv_feature_flag" diff --git a/packages/deriv_auth/CHANGELOG.md b/packages/deriv_auth/CHANGELOG.md index 1d2349916..3bba4148c 100644 --- a/packages/deriv_auth/CHANGELOG.md +++ b/packages/deriv_auth/CHANGELOG.md @@ -1,3 +1,19 @@ +## 6.4.2 + + - Update a dependency to the latest release. + +## 6.4.1 + + - **FIX**(deriv_auth): Update settings page navigation in auth flow with callback ([#567](https://github.com/regentmarkets/flutter-deriv-packages/issues/567)). ([53857baf](https://github.com/regentmarkets/flutter-deriv-packages/commit/53857baf66ecc870e8a1452663c564b8ee57837a)) + +## 6.4.0 + + - **FEAT**(deriv_auth): [P2PS-2679] add widget keys to auth components ([#565](https://github.com/regentmarkets/flutter-deriv-packages/issues/565)). ([e7bc54b4](https://github.com/regentmarkets/flutter-deriv-packages/commit/e7bc54b4be3d80236c83f1fecbe6f012f8759690)) + +## 6.3.8 + + - Update a dependency to the latest release. + ## 6.3.7 - Update a dependency to the latest release. diff --git a/packages/deriv_auth/docs/deriv_auth_layouts.md b/packages/deriv_auth/docs/deriv_auth_layouts.md index e2bb1f3f7..5110a84f6 100644 --- a/packages/deriv_auth/docs/deriv_auth_layouts.md +++ b/packages/deriv_auth/docs/deriv_auth_layouts.md @@ -1,6 +1,7 @@ ## Deriv Auth Layouts ### - Get Started Flow + - **Get Started Layout** ``` dart DerivGetStartedLayout( @@ -13,10 +14,17 @@ onSignupTapped: () {}, ); ``` + ### - Login Flow + - **Login Layout** ``` dart DerivLoginLayout( + titleKey: Key('title key'), + emailTextFieldKey: Key('email text field key'), + passwordTextFieldKey: Key('password text field key'), + forgotPasswordButtonKey: Key('forgot password button key'), + loginButtonKey: Key('login button key'), welcomeLabel: 'Welcome back!', greetingLabel: 'Log in to your Deriv account to start trading and investing.', @@ -55,6 +63,7 @@ ``` ### - Signup Flow + - **Signup Layout** ``` dart DerivSignupLayout( @@ -113,6 +122,7 @@ residence: 'residence', ); ``` + ### - Reset Password Flow - **Reset Password Layout** diff --git a/packages/deriv_auth/lib/features/get_started/presentation/layouts/deriv_get_started_layout.dart b/packages/deriv_auth/lib/features/get_started/presentation/layouts/deriv_get_started_layout.dart index 4543a1ce9..2924059d7 100644 --- a/packages/deriv_auth/lib/features/get_started/presentation/layouts/deriv_get_started_layout.dart +++ b/packages/deriv_auth/lib/features/get_started/presentation/layouts/deriv_get_started_layout.dart @@ -41,7 +41,7 @@ class DerivGetStartedLayout extends StatefulWidget { final VoidCallback onSignupTapped; /// Navigation to be called when screen is tapped seven times. - final VoidCallback onTapNavigation; + final Function(BuildContext context) onTapNavigation; @override State createState() => _DerivGetStartedLayoutState(); diff --git a/packages/deriv_auth/lib/features/login/presentation/layouts/deriv_login_layout.dart b/packages/deriv_auth/lib/features/login/presentation/layouts/deriv_login_layout.dart index f6b8253ea..35018b066 100644 --- a/packages/deriv_auth/lib/features/login/presentation/layouts/deriv_login_layout.dart +++ b/packages/deriv_auth/lib/features/login/presentation/layouts/deriv_login_layout.dart @@ -1,4 +1,5 @@ import 'dart:async'; + import 'package:deriv_auth/deriv_auth.dart'; import 'package:deriv_theme/deriv_theme.dart'; import 'package:deriv_ui/deriv_ui.dart'; @@ -24,6 +25,11 @@ class DerivLoginLayout extends StatefulWidget { this.authErrorStateHandler, this.onLoginError, this.onLoginTapped, + this.titleKey, + this.emailTextFieldKey, + this.passwordTextFieldKey, + this.forgotPasswordButtonKey, + this.loginButtonKey, Key? key, }) : super(key: key); @@ -74,6 +80,21 @@ class DerivLoginLayout extends StatefulWidget { /// Callback for web view error. final Function(String) onWebViewError; + /// Widget key for title. + final Key? titleKey; + + /// Widget key for email text box. + final Key? emailTextFieldKey; + + /// Widget key for password text box. + final Key? passwordTextFieldKey; + + /// Widget key for forgot password button. + final Key? forgotPasswordButtonKey; + + /// Widget key for login button button. + final Key? loginButtonKey; + @override State createState() => _DerivLoginLayoutState(); } @@ -102,6 +123,7 @@ class _DerivLoginLayoutState extends State { elevation: ThemeProvider.zeroMargin, title: Text( context.derivAuthLocalization.labelLogIn, + key: widget.titleKey, style: TextStyles.title, ), backgroundColor: context.theme.colors.secondary, @@ -180,6 +202,7 @@ class _DerivLoginLayoutState extends State { List _buildTextFields({required bool isEnabled}) => [ BaseTextField( + key: widget.emailTextFieldKey, semanticLabel: SemanticsLabels.loginEmailFieldSemantic, controller: _emailController, focusNode: _emailFocusNode, @@ -195,6 +218,7 @@ class _DerivLoginLayoutState extends State { ), const SizedBox(height: ThemeProvider.margin32), BaseTextField( + key: widget.passwordTextFieldKey, semanticLabel: SemanticsLabels.loginPasswordFieldSemantic, controller: _passwordController, focusNode: _passwordFocusNode, @@ -222,6 +246,7 @@ class _DerivLoginLayoutState extends State { Widget _buildForgotPassButton() => Align( alignment: Alignment.centerRight, child: InkWell( + key: widget.forgotPasswordButtonKey, onTap: widget.onResetPassTapped, child: Text( context.derivAuthLocalization.actionForgotPassword, @@ -236,6 +261,7 @@ class _DerivLoginLayoutState extends State { Widget _buildLoginButton() => BlocBuilder( bloc: authCubit, builder: (BuildContext context, DerivAuthState state) => ElevatedButton( + key: widget.loginButtonKey, style: ButtonStyle( backgroundColor: MaterialStateProperty.all( context.theme.colors.coral.withOpacity( diff --git a/packages/deriv_auth/lib/features/single_entry/core/models/setting_page_model.dart b/packages/deriv_auth/lib/features/single_entry/core/models/setting_page_model.dart index d0e8083d0..3093a9857 100644 --- a/packages/deriv_auth/lib/features/single_entry/core/models/setting_page_model.dart +++ b/packages/deriv_auth/lib/features/single_entry/core/models/setting_page_model.dart @@ -1,3 +1,5 @@ +import 'package:flutter/material.dart'; + /// Setting page model class SettingPageModel { /// Constructor [SettingPageModel] @@ -7,6 +9,7 @@ class SettingPageModel { required this.endpoint, required this.saveValues, required this.updateFlavorConfigs, + this.settingsPageNavigation, }); /// Setting page App label @@ -24,4 +27,7 @@ class SettingPageModel { /// Update flavor configurations final Function({required String endpoint, required String appId}) updateFlavorConfigs; + + /// Settings page navigation + final Function(BuildContext context)? settingsPageNavigation; } diff --git a/packages/deriv_auth/lib/features/single_entry/features/get_started/pages/get_started_page.dart b/packages/deriv_auth/lib/features/single_entry/features/get_started/pages/get_started_page.dart index b09669843..c82f1d293 100644 --- a/packages/deriv_auth/lib/features/single_entry/features/get_started/pages/get_started_page.dart +++ b/packages/deriv_auth/lib/features/single_entry/features/get_started/pages/get_started_page.dart @@ -25,13 +25,15 @@ class GetStartedPage extends StatelessWidget { builder: (BuildContext context) => const SignupPage(), ), ), - onTapNavigation: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (BuildContext context) => const SettingsPage(), - ), - ); - }, + onTapNavigation: + AuthData().data.settingPageModel.settingsPageNavigation ?? + (BuildContext context) { + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => const SettingsPage(), + ), + ); + }, ); } diff --git a/packages/deriv_auth/lib/features/social_auth/presentation/widgets/deriv_social_auth_panel.dart b/packages/deriv_auth/lib/features/social_auth/presentation/widgets/deriv_social_auth_panel.dart index c515840de..7dd943a7b 100644 --- a/packages/deriv_auth/lib/features/social_auth/presentation/widgets/deriv_social_auth_panel.dart +++ b/packages/deriv_auth/lib/features/social_auth/presentation/widgets/deriv_social_auth_panel.dart @@ -68,18 +68,25 @@ class _DerivSocialAuthPanelState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - _buildSocialAuthButton(SocialAuthProvider.apple), + _buildSocialAuthButton(SocialAuthProvider.apple, + key: const Key('social_auth_button_apple')), const SizedBox(width: ThemeProvider.margin24), - _buildSocialAuthButton(SocialAuthProvider.google), + _buildSocialAuthButton(SocialAuthProvider.google, + key: const Key('social_auth_button_google')), const SizedBox(width: ThemeProvider.margin24), - _buildSocialAuthButton(SocialAuthProvider.facebook), + _buildSocialAuthButton(SocialAuthProvider.facebook, + key: const Key('social_auth_button_facebook')), ], ), ), ); - Widget _buildSocialAuthButton(SocialAuthProvider socialAuthProvider) => + Widget _buildSocialAuthButton( + SocialAuthProvider socialAuthProvider, { + Key? key, + }) => IconButton( + key: key, padding: EdgeInsets.zero, iconSize: ThemeProvider.iconSize40, icon: Opacity( diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index 151eb0964..8fe3910f7 100644 --- a/packages/deriv_auth/pubspec.yaml +++ b/packages/deriv_auth/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_auth description: Provides deriv authentication functionalities for dart/flutter apps. -version: 6.3.7 +version: 6.4.2 environment: @@ -23,7 +23,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.7+2 + ref: deriv_ui-v0.0.7+3 deriv_http_client: git: @@ -40,13 +40,13 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_web_view - ref: deriv_web_view-v0.2.2 + ref: deriv_web_view-v0.2.2+1 deriv_localizations: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_localizations - ref: deriv_localizations-v1.2.0 + ref: deriv_localizations-v1.3.0 flutter_bloc: ^8.1.3 flutter_svg: ^2.0.7 diff --git a/packages/deriv_auth/test/features/get_started/presentation/layouts/deriv_get_started_layout_test.dart b/packages/deriv_auth/test/features/get_started/presentation/layouts/deriv_get_started_layout_test.dart index 0f7c817e0..2f01f1bae 100644 --- a/packages/deriv_auth/test/features/get_started/presentation/layouts/deriv_get_started_layout_test.dart +++ b/packages/deriv_auth/test/features/get_started/presentation/layouts/deriv_get_started_layout_test.dart @@ -30,7 +30,7 @@ void main() { patrolWidgetTest('should render DerivGetStartedLayout', (PatrolTester $) async { await $.pumpApp(DerivGetStartedLayout( - onTapNavigation: () {}, + onTapNavigation: (context) {}, slides: [mockSlideModel], appLogoIconPath: appLogoIconPath, backgroundImagePath: backgroundImagePath, @@ -49,7 +49,7 @@ void main() { bool loginTapped = false; await $.pumpApp(DerivGetStartedLayout( - onTapNavigation: () {}, + onTapNavigation: (context) {}, slides: [mockSlideModel], appLogoIconPath: appLogoIconPath, backgroundImagePath: backgroundImagePath, @@ -69,7 +69,7 @@ void main() { bool signupTapped = false; await $.pumpApp(DerivGetStartedLayout( - onTapNavigation: () {}, + onTapNavigation: (context) {}, slides: [mockSlideModel], appLogoIconPath: appLogoIconPath, backgroundImagePath: backgroundImagePath, diff --git a/packages/deriv_language_selector/CHANGELOG.md b/packages/deriv_language_selector/CHANGELOG.md index 7d3b1d161..8abf34b68 100644 --- a/packages/deriv_language_selector/CHANGELOG.md +++ b/packages/deriv_language_selector/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.2+1 + + - Update a dependency to the latest release. + ## 0.0.2 - **FEAT**(deriv_language_selector): aliakbar/1586/set_device_lang_as_default_if_app_supports ([#540](https://github.com/regentmarkets/flutter-deriv-packages/issues/540)). ([88ba3104](https://github.com/regentmarkets/flutter-deriv-packages/commit/88ba31049eb3a718db3e1ee5e8e85f56689d94ba)) diff --git a/packages/deriv_language_selector/pubspec.yaml b/packages/deriv_language_selector/pubspec.yaml index 1f5143b06..e5a21763b 100644 --- a/packages/deriv_language_selector/pubspec.yaml +++ b/packages/deriv_language_selector/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_language_selector description: A package to select language for the app. It provides both UI and logic for language selection. -version: 0.0.2 +version: 0.0.2+1 publish_to: "none" environment: @@ -14,7 +14,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.7+2 + ref: deriv_ui-v0.0.7+3 shared_preferences: ^2.2.2 flutter_bloc: ^8.1.4 equatable: ^2.0.5 diff --git a/packages/deriv_localizations/CHANGELOG.md b/packages/deriv_localizations/CHANGELOG.md index 46217f90c..5680decba 100644 --- a/packages/deriv_localizations/CHANGELOG.md +++ b/packages/deriv_localizations/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.3.0 + + - **FEAT**(deriv_localization): Update localization string for deriv_auth ([#571](https://github.com/regentmarkets/flutter-deriv-packages/issues/571)). ([d2d76902](https://github.com/regentmarkets/flutter-deriv-packages/commit/d2d769023b651419270842d450a56a4bbd264327)) + ## 1.2.0 - **FEAT**(deriv_localizations): [UPM-856] Adding deriv passkeys localizations. ([#544](https://github.com/regentmarkets/flutter-deriv-packages/issues/544)). ([9a3b42e2](https://github.com/regentmarkets/flutter-deriv-packages/commit/9a3b42e2468c9586eae4eb03ba8a7b2712f44de2)) diff --git a/packages/deriv_localizations/l10n.sh b/packages/deriv_localizations/l10n.sh index d6ffe302f..7781220e9 100755 --- a/packages/deriv_localizations/l10n.sh +++ b/packages/deriv_localizations/l10n.sh @@ -2,7 +2,7 @@ # Directories containing ARB files -feature_dirs=("deriv_auth", "deriv_passkeys") +feature_dirs=( "deriv_auth" "deriv_passkeys" ) # Base localization directory base_l10n_dir="lib/l10n" diff --git a/packages/deriv_localizations/lib/l10n/deriv_auth/app_en.arb b/packages/deriv_localizations/lib/l10n/deriv_auth/app_en.arb index 03cf1ea3c..e3602bb49 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_auth/app_en.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_auth/app_en.arb @@ -95,7 +95,7 @@ "informInvalid2FACode": "The code you entered is invalid. Check and try again.", "informFailedAuthentication": "Your email or password may be incorrect. Did you sign up with a social account? Check and try again.", "informDeactivatedAccount": "Your account is deactivated.", - "informFailedAuthorization": "Authorization failed.", + "informFailedAuthorization": "Authorization failed.", "informInvalidResidence": "Invalid residence.", "informInvalidCredentials": "Invalid credentials.", "informMissingOtp": "Missing one-time password.", @@ -112,5 +112,6 @@ "warnInvalidEndpoint": "invalid endpoint", "labelApplicationID": "Application ID", "semanticApplicationID": "Application ID", - "warnInvalidApplicationID": "invalid application ID" -} + "warnInvalidApplicationID": "invalid application ID", + "labelLanguage": "Language" +} \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations.dart index 9885ff1a0..4612318cd 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations.dart @@ -75,18 +75,15 @@ import 'deriv_auth_localizations_zh.dart'; /// be consistent with the languages listed in the DerivAuthLocalizations.supportedLocales /// property. abstract class DerivAuthLocalizations { - DerivAuthLocalizations(String locale) - : localeName = intl.Intl.canonicalizedLocale(locale.toString()); + DerivAuthLocalizations(String locale) : localeName = intl.Intl.canonicalizedLocale(locale.toString()); final String localeName; static DerivAuthLocalizations of(BuildContext context) { - return Localizations.of( - context, DerivAuthLocalizations)!; + return Localizations.of(context, DerivAuthLocalizations)!; } - static const LocalizationsDelegate delegate = - _DerivAuthLocalizationsDelegate(); + static const LocalizationsDelegate delegate = _DerivAuthLocalizationsDelegate(); /// A list of this localizations delegate along with the default localizations /// delegates. @@ -98,8 +95,7 @@ abstract class DerivAuthLocalizations { /// 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> localizationsDelegates = - >[ + static const List> localizationsDelegates = >[ delegate, GlobalMaterialLocalizations.delegate, GlobalCupertinoLocalizations.delegate, @@ -648,85 +644,57 @@ abstract class DerivAuthLocalizations { /// In en, this message translates to: /// **'invalid application ID'** String get warnInvalidApplicationID; + + /// No description provided for @labelLanguage. + /// + /// In en, this message translates to: + /// **'Language'** + String get labelLanguage; } -class _DerivAuthLocalizationsDelegate - extends LocalizationsDelegate { +class _DerivAuthLocalizationsDelegate extends LocalizationsDelegate { const _DerivAuthLocalizationsDelegate(); @override Future load(Locale locale) { - return SynchronousFuture( - lookupDerivAuthLocalizations(locale)); + return SynchronousFuture(lookupDerivAuthLocalizations(locale)); } @override - bool isSupported(Locale locale) => [ - 'ar', - 'bn', - 'de', - 'en', - 'es', - 'fr', - 'it', - 'ko', - 'pl', - 'pt', - 'ru', - 'si', - 'sw', - 'th', - 'tr', - 'vi', - 'zh' - ].contains(locale.languageCode); + bool isSupported(Locale locale) => ['ar', 'bn', 'de', 'en', 'es', 'fr', 'it', 'ko', 'pl', 'pt', 'ru', 'si', 'sw', 'th', 'tr', 'vi', 'zh'].contains(locale.languageCode); @override bool shouldReload(_DerivAuthLocalizationsDelegate old) => false; } DerivAuthLocalizations lookupDerivAuthLocalizations(Locale locale) { + + // Lookup logic when only language code is specified. switch (locale.languageCode) { - case 'ar': - return DerivAuthLocalizationsAr(); - case 'bn': - return DerivAuthLocalizationsBn(); - case 'de': - return DerivAuthLocalizationsDe(); - case 'en': - return DerivAuthLocalizationsEn(); - case 'es': - return DerivAuthLocalizationsEs(); - case 'fr': - return DerivAuthLocalizationsFr(); - case 'it': - return DerivAuthLocalizationsIt(); - case 'ko': - return DerivAuthLocalizationsKo(); - case 'pl': - return DerivAuthLocalizationsPl(); - case 'pt': - return DerivAuthLocalizationsPt(); - case 'ru': - return DerivAuthLocalizationsRu(); - case 'si': - return DerivAuthLocalizationsSi(); - case 'sw': - return DerivAuthLocalizationsSw(); - case 'th': - return DerivAuthLocalizationsTh(); - case 'tr': - return DerivAuthLocalizationsTr(); - case 'vi': - return DerivAuthLocalizationsVi(); - case 'zh': - return DerivAuthLocalizationsZh(); + case 'ar': return DerivAuthLocalizationsAr(); + case 'bn': return DerivAuthLocalizationsBn(); + case 'de': return DerivAuthLocalizationsDe(); + case 'en': return DerivAuthLocalizationsEn(); + case 'es': return DerivAuthLocalizationsEs(); + case 'fr': return DerivAuthLocalizationsFr(); + case 'it': return DerivAuthLocalizationsIt(); + case 'ko': return DerivAuthLocalizationsKo(); + case 'pl': return DerivAuthLocalizationsPl(); + case 'pt': return DerivAuthLocalizationsPt(); + case 'ru': return DerivAuthLocalizationsRu(); + case 'si': return DerivAuthLocalizationsSi(); + case 'sw': return DerivAuthLocalizationsSw(); + case 'th': return DerivAuthLocalizationsTh(); + case 'tr': return DerivAuthLocalizationsTr(); + case 'vi': return DerivAuthLocalizationsVi(); + case 'zh': return DerivAuthLocalizationsZh(); } throw FlutterError( - 'DerivAuthLocalizations.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.'); + 'DerivAuthLocalizations.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.' + ); } diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_ar.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_ar.dart index 3bd1902ac..833bcacd7 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_ar.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_ar.dart @@ -270,4 +270,7 @@ class DerivAuthLocalizationsAr extends DerivAuthLocalizations { @override String get warnInvalidApplicationID => 'معرف تطبيق غير صالح'; + + @override + String get labelLanguage => 'Language'; } diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_bn.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_bn.dart index 0c0964ab7..e79aaf975 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_bn.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_bn.dart @@ -270,4 +270,7 @@ class DerivAuthLocalizationsBn extends DerivAuthLocalizations { @override String get warnInvalidApplicationID => 'অবৈধ অ্যাপ্লিকেশন আইডি'; + + @override + String get labelLanguage => 'Language'; } diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_de.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_de.dart index a73ccb132..5226c6012 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_de.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_de.dart @@ -270,4 +270,7 @@ class DerivAuthLocalizationsDe extends DerivAuthLocalizations { @override String get warnInvalidApplicationID => 'ungültige Anwendungs-ID'; + + @override + String get labelLanguage => 'Language'; } diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_en.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_en.dart index 7feae0cb1..ae5d2b79e 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_en.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_en.dart @@ -270,4 +270,7 @@ class DerivAuthLocalizationsEn extends DerivAuthLocalizations { @override String get warnInvalidApplicationID => 'invalid application ID'; + + @override + String get labelLanguage => 'Language'; } diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_es.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_es.dart index a01c93de3..07ab38b6d 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_es.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_es.dart @@ -270,4 +270,7 @@ class DerivAuthLocalizationsEs extends DerivAuthLocalizations { @override String get warnInvalidApplicationID => 'ID de aplicación no válido'; + + @override + String get labelLanguage => 'Language'; } diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_fr.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_fr.dart index f16d449f3..025de3cd6 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_fr.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_fr.dart @@ -270,4 +270,7 @@ class DerivAuthLocalizationsFr extends DerivAuthLocalizations { @override String get warnInvalidApplicationID => 'identifiant de l\'application non valide'; + + @override + String get labelLanguage => 'Language'; } diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_it.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_it.dart index 4da676b84..e6a046750 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_it.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_it.dart @@ -270,4 +270,7 @@ class DerivAuthLocalizationsIt extends DerivAuthLocalizations { @override String get warnInvalidApplicationID => 'ID applicazione non valido'; + + @override + String get labelLanguage => 'Language'; } diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_ko.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_ko.dart index a209d6bfd..ea5448e15 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_ko.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_ko.dart @@ -270,4 +270,7 @@ class DerivAuthLocalizationsKo extends DerivAuthLocalizations { @override String get warnInvalidApplicationID => '유효하지 않은 애플리케이션 ID'; + + @override + String get labelLanguage => 'Language'; } diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_pl.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_pl.dart index 74d3daaa0..11b7fde7a 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_pl.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_pl.dart @@ -270,4 +270,7 @@ class DerivAuthLocalizationsPl extends DerivAuthLocalizations { @override String get warnInvalidApplicationID => 'nieprawidłowe ID aplikacji'; + + @override + String get labelLanguage => 'Language'; } diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_pt.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_pt.dart index c2e3b1d63..bf70cca82 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_pt.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_pt.dart @@ -270,4 +270,7 @@ class DerivAuthLocalizationsPt extends DerivAuthLocalizations { @override String get warnInvalidApplicationID => 'ID da aplicação inválido'; + + @override + String get labelLanguage => 'Language'; } diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_ru.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_ru.dart index b9b0c5906..1ce378c8f 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_ru.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_ru.dart @@ -270,4 +270,7 @@ class DerivAuthLocalizationsRu extends DerivAuthLocalizations { @override String get warnInvalidApplicationID => 'неверный ID приложения'; + + @override + String get labelLanguage => 'Language'; } diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_si.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_si.dart index 334dafbe3..1b58aed28 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_si.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_si.dart @@ -270,4 +270,7 @@ class DerivAuthLocalizationsSi extends DerivAuthLocalizations { @override String get warnInvalidApplicationID => 'අවලංගු යෙදුම් හැඳුනු'; + + @override + String get labelLanguage => 'Language'; } diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_sw.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_sw.dart index eaf120577..72eaa67a8 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_sw.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_sw.dart @@ -270,4 +270,7 @@ class DerivAuthLocalizationsSw extends DerivAuthLocalizations { @override String get warnInvalidApplicationID => 'kitambulisho cha programu halali'; + + @override + String get labelLanguage => 'Language'; } diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_th.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_th.dart index ec2c59a61..0a446c97d 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_th.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_th.dart @@ -270,4 +270,7 @@ class DerivAuthLocalizationsTh extends DerivAuthLocalizations { @override String get warnInvalidApplicationID => 'รหัสไอดีแอปพลิเคชั่นไม่ถูกต้อง'; + + @override + String get labelLanguage => 'Language'; } diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_tr.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_tr.dart index 0b982d5d4..e71109819 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_tr.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_tr.dart @@ -270,4 +270,7 @@ class DerivAuthLocalizationsTr extends DerivAuthLocalizations { @override String get warnInvalidApplicationID => 'geçersiz başvuru ID'; + + @override + String get labelLanguage => 'Language'; } diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_vi.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_vi.dart index 1ee890b10..6ba920b0d 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_vi.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_vi.dart @@ -270,4 +270,7 @@ class DerivAuthLocalizationsVi extends DerivAuthLocalizations { @override String get warnInvalidApplicationID => 'mã đăng ký không hợp lệ'; + + @override + String get labelLanguage => 'Language'; } diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_zh.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_zh.dart index 8e29222fe..5b1dfc072 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_zh.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_auth/deriv_auth_localizations_zh.dart @@ -270,4 +270,7 @@ class DerivAuthLocalizationsZh extends DerivAuthLocalizations { @override String get warnInvalidApplicationID => '無效的應用程式 ID'; + + @override + String get labelLanguage => 'Language'; } diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations.dart index 22c48dc4b..b6dd424fb 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations.dart @@ -59,18 +59,15 @@ import 'deriv_passkeys_localizations_en.dart'; /// be consistent with the languages listed in the DerivPasskeysLocalizations.supportedLocales /// property. abstract class DerivPasskeysLocalizations { - DerivPasskeysLocalizations(String locale) - : localeName = intl.Intl.canonicalizedLocale(locale.toString()); + DerivPasskeysLocalizations(String locale) : localeName = intl.Intl.canonicalizedLocale(locale.toString()); final String localeName; static DerivPasskeysLocalizations of(BuildContext context) { - return Localizations.of( - context, DerivPasskeysLocalizations)!; + return Localizations.of(context, DerivPasskeysLocalizations)!; } - static const LocalizationsDelegate delegate = - _DerivPasskeysLocalizationsDelegate(); + static const LocalizationsDelegate delegate = _DerivPasskeysLocalizationsDelegate(); /// A list of this localizations delegate along with the default localizations /// delegates. @@ -82,8 +79,7 @@ abstract class DerivPasskeysLocalizations { /// 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> localizationsDelegates = - >[ + static const List> localizationsDelegates = >[ delegate, GlobalMaterialLocalizations.delegate, GlobalCupertinoLocalizations.delegate, @@ -91,7 +87,9 @@ abstract class DerivPasskeysLocalizations { ]; /// A list of this localizations delegate's supported locales. - static const List supportedLocales = [Locale('en')]; + static const List supportedLocales = [ + Locale('en') + ]; /// No description provided for @passkeyCreatedSuccessTitle. /// @@ -334,34 +332,33 @@ abstract class DerivPasskeysLocalizations { String get revoke; } -class _DerivPasskeysLocalizationsDelegate - extends LocalizationsDelegate { +class _DerivPasskeysLocalizationsDelegate extends LocalizationsDelegate { const _DerivPasskeysLocalizationsDelegate(); @override Future load(Locale locale) { - return SynchronousFuture( - lookupDerivPasskeysLocalizations(locale)); + return SynchronousFuture(lookupDerivPasskeysLocalizations(locale)); } @override - bool isSupported(Locale locale) => - ['en'].contains(locale.languageCode); + bool isSupported(Locale locale) => ['en'].contains(locale.languageCode); @override bool shouldReload(_DerivPasskeysLocalizationsDelegate old) => false; } DerivPasskeysLocalizations lookupDerivPasskeysLocalizations(Locale locale) { + + // Lookup logic when only language code is specified. switch (locale.languageCode) { - case 'en': - return DerivPasskeysLocalizationsEn(); + case 'en': return DerivPasskeysLocalizationsEn(); } throw FlutterError( - 'DerivPasskeysLocalizations.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.'); + 'DerivPasskeysLocalizations.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.' + ); } diff --git a/packages/deriv_localizations/pubspec.yaml b/packages/deriv_localizations/pubspec.yaml index 418d8a92d..a283c13ff 100644 --- a/packages/deriv_localizations/pubspec.yaml +++ b/packages/deriv_localizations/pubspec.yaml @@ -3,7 +3,7 @@ description: This packages contains all localizations for the deriv packages publish_to: 'none' -version: 1.2.0 +version: 1.3.0 environment: sdk: '>=3.0.2 <4.0.0' diff --git a/packages/deriv_ui/CHANGELOG.md b/packages/deriv_ui/CHANGELOG.md index f268e2cf2..826d2edff 100644 --- a/packages/deriv_ui/CHANGELOG.md +++ b/packages/deriv_ui/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.7+3 + + - Update a dependency to the latest release. + ## 0.0.7+2 - Update a dependency to the latest release. diff --git a/packages/deriv_ui/lib/components/numpad/core/exchange_notifier.dart b/packages/deriv_ui/lib/components/numpad/core/exchange_notifier.dart index 75f705c8a..e823e458b 100644 --- a/packages/deriv_ui/lib/components/numpad/core/exchange_notifier.dart +++ b/packages/deriv_ui/lib/components/numpad/core/exchange_notifier.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import '../models/models.dart'; +import 'package:intl/intl.dart'; /// This class is used to provide [ExchangeController] to the widget tree. class ExchangeNotifier extends InheritedNotifier { @@ -71,6 +72,9 @@ class ExchangeController extends ChangeNotifier { } } + /// This will return the current currency formatter that is in use. + NumberFormat get activeNumberFormat => primaryCurrency.formatter; + /// This will interchange the currency, amount from textField to switcher and vice-versa. void swap() { _isSwapped = !_isSwapped; diff --git a/packages/deriv_ui/lib/components/numpad/models/currency_detail.dart b/packages/deriv_ui/lib/components/numpad/models/currency_detail.dart index 89871fc8a..1cb784034 100644 --- a/packages/deriv_ui/lib/components/numpad/models/currency_detail.dart +++ b/packages/deriv_ui/lib/components/numpad/models/currency_detail.dart @@ -1,3 +1,5 @@ +import 'package:intl/intl.dart'; + import '../core/helpers/custom_website_status_helper.dart'; /// This is a data class for storing the currency data like amount, currencyType. @@ -10,7 +12,20 @@ class CurrencyDetail { CurrencyDetail(this.amount, this.currencyType); /// Available fiat currency that Deriv supports. - static List fiatCurrencies = ['USD', 'AUD', 'EUR', 'GBP']; + static List fiatCurrencies = [ + 'USD', + 'AUD', + 'EUR', + 'GBP', + ]; + + /// Available stable coin currency that Deriv supports. + static List stableCurrencies = [ + 'USDC', + 'USDT', + 'TUSDT', + 'EUSDT' + ]; /// Amount passed for exchance. final double amount; @@ -21,13 +36,28 @@ class CurrencyDetail { /// This will check if this instance is a fiat type currency or not. bool get isFiat => fiatCurrencies.contains(currencyType); + /// This will check if the currency is stable coin currency(USDC,tUSDT,eUSDT) or not. + bool get isStableCurrency => + stableCurrencies.contains(currencyType.toUpperCase()); + /// Amount that is used to display for user. String get displayAmount { if (amount == 0.0) { return ''; } - return isFiat ? amount.toStringAsFixed(2) : amount.toStringAsFixed(8); + return isFiat || isStableCurrency + ? amount.toStringAsFixed(2) + : amount.toStringAsFixed(8); + } + + /// This will give a specific currency formatter based on what type of currency it is like fiat or crypto currency. + NumberFormat get formatter { + if (isFiat || isStableCurrency) { + return NumberFormat.decimalPattern()..maximumFractionDigits = 2; + } else { + return NumberFormat.decimalPattern()..maximumFractionDigits = 8; + } } /// This method is used to display currency for user. diff --git a/packages/deriv_ui/lib/components/numpad/widgets/number_pad.dart b/packages/deriv_ui/lib/components/numpad/widgets/number_pad.dart index aee1be9b3..5bbd15020 100644 --- a/packages/deriv_ui/lib/components/numpad/widgets/number_pad.dart +++ b/packages/deriv_ui/lib/components/numpad/widgets/number_pad.dart @@ -401,7 +401,7 @@ class _NumberPadState extends State { break; default: - if (_isInputValid(controller, text)) { + if (_isInputValid(context, controller, text)) { _setNewAmount(controller, text); } } @@ -588,7 +588,11 @@ class _NumberPadState extends State { setState(() {}); } - bool _isInputValid(TextEditingController controller, String input) { + bool _isInputValid( + BuildContext context, + TextEditingController controller, + String input, + ) { /// Increment maxInputLength by 1 because it counts the symbol one character final String currentText = controller.text; if (currentText.length >= (widget.maxInputLength + 1)) { @@ -599,12 +603,16 @@ class _NumberPadState extends State { return false; } else if (!hasValidPrecision( value: '$currentText$input', - validDecimalNumber: _formatter.maximumFractionDigits)) { + validDecimalNumber: _getDecimalNumber(context))) { return false; } return true; } + int _getDecimalNumber(BuildContext ctx) => + ExchangeNotifier.of(ctx)?.activeNumberFormat.maximumFractionDigits ?? + _formatter.maximumFractionDigits; + TextEditingController? _getFocusedInput() { if (widget.numberPadType == NumberPadWidgetType.singleInput) { return _firstInputController; diff --git a/packages/deriv_ui/pubspec.yaml b/packages/deriv_ui/pubspec.yaml index 1d2dc9a36..a0ff4e285 100644 --- a/packages/deriv_ui/pubspec.yaml +++ b/packages/deriv_ui/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_ui description: A new Flutter package project. -version: 0.0.7+2 +version: 0.0.7+3 publish_to: none environment: @@ -23,7 +23,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_web_view - ref: deriv_web_view-v0.2.2 + ref: deriv_web_view-v0.2.2+1 flutter_svg: ^2.0.7 intl: ^0.18.0 diff --git a/packages/deriv_web_view/CHANGELOG.md b/packages/deriv_web_view/CHANGELOG.md index 67fbf7a59..c90de8c2a 100644 --- a/packages/deriv_web_view/CHANGELOG.md +++ b/packages/deriv_web_view/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.2.2+1 + + - **FIX**(deriv_web_view): update PTA model ([#557](https://github.com/regentmarkets/flutter-deriv-packages/issues/557)). ([49583f82](https://github.com/regentmarkets/flutter-deriv-packages/commit/49583f823fdac9c3ec3a85529fad9ab9f6784c67)) + ## 0.2.2 - **FEAT**(deriv_http_client): update to the latest deriv_http_client ([#501](https://github.com/regentmarkets/flutter-deriv-packages/issues/501)). ([d582995a](https://github.com/regentmarkets/flutter-deriv-packages/commit/d582995a226906c34c69c7716b3e5573c88c0c4e)) diff --git a/packages/deriv_web_view/lib/deriv_web_view.dart b/packages/deriv_web_view/lib/deriv_web_view.dart index 0a0fd2dc1..8580ac4e7 100644 --- a/packages/deriv_web_view/lib/deriv_web_view.dart +++ b/packages/deriv_web_view/lib/deriv_web_view.dart @@ -153,6 +153,7 @@ Future openLoggedInWebPage({ required bool rootNavigator, required String appToken, required String userAgent, + required String platform, HttpClientPredicate? getHttpClient, String destinationAppId = '16929', String? action, @@ -177,6 +178,7 @@ Future openLoggedInWebPage({ getHttpClient: getHttpClient, action: action, code: code, + platform: platform, ); if (oneTimeToken == null) { @@ -216,6 +218,7 @@ Future openLoggedInWebPage({ getHttpClient: getHttpClient, action: action, code: code, + platform: platform, ); } @@ -245,6 +248,7 @@ Future _fetchOneTimeToken({ required void Function(BuildContext context) loadingDialog, required bool rootNavigator, required String appToken, + required String platform, HttpClientPredicate? getHttpClient, String? action, String? code, @@ -262,6 +266,7 @@ Future _fetchOneTimeToken({ action: action, code: code, getHttpClient: getHttpClient, + platform: platform, ); Navigator.of(context, rootNavigator: rootNavigator).pop(); @@ -278,6 +283,7 @@ Future _getOneTimeToken({ required String? refreshToken, required String? defaultAccount, required String appToken, + required String platform, HttpClientPredicate? getHttpClient, String? action, String? code, @@ -294,6 +300,7 @@ Future _getOneTimeToken({ action: action, code: code, getHttpClient: getHttpClient, + platform: platform, ); return token; @@ -311,6 +318,7 @@ Future _validateCredentials({ required String appId, required String destinationAppId, required String? refreshToken, + required String platform, required String? defaultAccount, required void Function(BuildContext context) loadingDialog, required Future Function(BuildContext context) tokenExpiredDialog, @@ -334,6 +342,7 @@ Future _validateCredentials({ getHttpClient: getHttpClient, action: action, code: code, + platform: platform, ); if (oneTimeToken == null) { diff --git a/packages/deriv_web_view/lib/helper.dart b/packages/deriv_web_view/lib/helper.dart index 1c13c942e..37a4ed291 100644 --- a/packages/deriv_web_view/lib/helper.dart +++ b/packages/deriv_web_view/lib/helper.dart @@ -22,6 +22,7 @@ Future performPassThroughAuthentication({ required String endpoint, required String appId, required String appToken, + required String platform, HttpClientPredicate? getHttpClient, String? action, String? code, @@ -43,6 +44,7 @@ Future performPassThroughAuthentication({ urlParams: UrlParamsModel( redirectUrl: redirectPath, selectedAccount: defaultAccount ?? '', + platform: platform, action: action, code: code, ), diff --git a/packages/deriv_web_view/lib/models/pta_login_request_model.dart b/packages/deriv_web_view/lib/models/pta_login_request_model.dart index 887385099..4dfee0910 100644 --- a/packages/deriv_web_view/lib/models/pta_login_request_model.dart +++ b/packages/deriv_web_view/lib/models/pta_login_request_model.dart @@ -30,6 +30,7 @@ class UrlParamsModel { UrlParamsModel({ required this.redirectUrl, required this.selectedAccount, + required this.platform, this.action, this.code, }); @@ -40,6 +41,9 @@ class UrlParamsModel { /// Login Id of account. final String selectedAccount; + /// Platform. + final String platform; + /// The action that caused redirect for example `passthrough_authentication`. final String? action; @@ -52,6 +56,6 @@ class UrlParamsModel { 'selected_acct': selectedAccount, if (action != null) 'action': action, if (code != null) 'code': code, - 'platform': 'derivgo', + 'platform': platform, }; } diff --git a/packages/deriv_web_view/pubspec.yaml b/packages/deriv_web_view/pubspec.yaml index 4168c5b45..b2198fe66 100644 --- a/packages/deriv_web_view/pubspec.yaml +++ b/packages/deriv_web_view/pubspec.yaml @@ -1,7 +1,7 @@ name: deriv_web_view description: Deriv Web View package project. -version: 0.2.2 +version: 0.2.2+1 homepage: https://deriv.com/ publish_to: "none" diff --git a/packages/deriv_widgetbook/CHANGELOG.md b/packages/deriv_widgetbook/CHANGELOG.md index fb1604cee..4cb8fecb3 100644 --- a/packages/deriv_widgetbook/CHANGELOG.md +++ b/packages/deriv_widgetbook/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.2+3 + + - Update a dependency to the latest release. + ## 0.0.2+2 - Update a dependency to the latest release. diff --git a/packages/deriv_widgetbook/pubspec.yaml b/packages/deriv_widgetbook/pubspec.yaml index 3d7440444..42979e3e3 100644 --- a/packages/deriv_widgetbook/pubspec.yaml +++ b/packages/deriv_widgetbook/pubspec.yaml @@ -1,7 +1,7 @@ name: deriv_widgetbook description: Storybook for Deriv UI widgets and components. publish_to: "none" -version: 0.0.2+2 +version: 0.0.2+3 environment: sdk: ">=3.0.0 <4.0.0" @@ -16,7 +16,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.7+2 + ref: deriv_ui-v0.0.7+3 deriv_theme: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git