From c1e0067b7bbaf94cfd13f342cd05aaa8f65ba497 Mon Sep 17 00:00:00 2001 From: Ahrar Date: Fri, 26 Jan 2024 11:57:27 +0800 Subject: [PATCH 001/162] feat(deriv_auth): single entry feat that adds a single entry to the auth package --- packages/deriv_auth/lib/core/core.dart | 15 ++++++ packages/deriv_auth/lib/deriv_auth.dart | 48 +---------------- .../deriv_auth/lib/features/auth/auth.dart | 4 ++ .../deriv_auth/lib/features/features.dart | 8 +++ .../lib/features/get_started/get_started.dart | 2 + .../deriv_auth/lib/features/login/login.dart | 2 + .../reset_password/reset_password.dart | 6 +++ .../features/setting_page/setting_page.dart | 1 + .../lib/features/signup/signup.dart | 15 ++++++ .../features/single_entry/core/auth_data.dart | 23 ++++++++ .../core/models/auth_entry_model.dart | 20 +++++++ .../get_started/pages/get_started_page.dart | 39 ++++++++++++++ .../features/home/pages/home_page.dart | 30 +++++++++++ .../features/login/pages/login_page.dart | 51 ++++++++++++++++++ .../example_login_repository.dart | 36 +++++++++++++ .../login/services/example_login_service.dart | 52 ++++++++++++++++++ .../pages/choose_new_password_page.dart | 25 +++++++++ .../reset_pass/pages/reset_pass_page.dart | 53 +++++++++++++++++++ .../pages/reset_pass_success_page.dart | 49 +++++++++++++++++ .../services/example_reset_pass_service.dart | 17 ++++++ .../settings/pages/settings_page.dart | 28 ++++++++++ .../signup/pages/country_selection_page.dart | 29 ++++++++++ .../signup/pages/set_password_page.dart | 24 +++++++++ .../features/signup/pages/signup_page.dart | 39 ++++++++++++++ .../signup/pages/verification_done_page.dart | 23 ++++++++ .../signup/pages/verify_email_page.dart | 52 ++++++++++++++++++ .../example_referral_repository.dart | 7 +++ .../example_signup_repository.dart | 17 ++++++ .../single_entry/pages/auth_entry_page.dart | 15 ++++++ .../features/single_entry/single_entry.dart | 2 + packages/deriv_auth/pubspec.yaml | 7 ++- 31 files changed, 692 insertions(+), 47 deletions(-) create mode 100644 packages/deriv_auth/lib/core/core.dart create mode 100644 packages/deriv_auth/lib/features/auth/auth.dart create mode 100644 packages/deriv_auth/lib/features/features.dart create mode 100644 packages/deriv_auth/lib/features/get_started/get_started.dart create mode 100644 packages/deriv_auth/lib/features/login/login.dart create mode 100644 packages/deriv_auth/lib/features/reset_password/reset_password.dart create mode 100644 packages/deriv_auth/lib/features/setting_page/setting_page.dart create mode 100644 packages/deriv_auth/lib/features/signup/signup.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/core/auth_data.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/features/get_started/pages/get_started_page.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/features/home/pages/home_page.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/features/login/pages/login_page.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/features/login/repositories/example_login_repository.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/features/login/services/example_login_service.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/choose_new_password_page.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/reset_pass_page.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/reset_pass_success_page.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/features/reset_pass/services/example_reset_pass_service.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/features/settings/pages/settings_page.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/features/signup/pages/country_selection_page.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/features/signup/pages/set_password_page.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/features/signup/pages/signup_page.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/features/signup/pages/verification_done_page.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/features/signup/pages/verify_email_page.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/features/signup/repositories/example_referral_repository.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/features/signup/repositories/example_signup_repository.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/pages/auth_entry_page.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/single_entry.dart diff --git a/packages/deriv_auth/lib/core/core.dart b/packages/deriv_auth/lib/core/core.dart new file mode 100644 index 000000000..6a88d93ab --- /dev/null +++ b/packages/deriv_auth/lib/core/core.dart @@ -0,0 +1,15 @@ +export 'connection_info.dart'; +export 'exceptions/deriv_auth_exception.dart'; +export 'extensions/extensions.dart'; +export 'layouts/deriv_unavailable_country_layout.dart'; +export 'models/account_model.dart'; +export 'models/auth_error/auth_error.dart'; +export 'models/auth_error/auth_error_model.dart'; +export 'models/authorize_model.dart'; +export 'models/verify_email_model.dart'; +export 'services/jwt/repository/deriv_jwt_repository.dart'; +export 'services/jwt/services/deriv_jwt_service.dart'; +export 'services/referral/models/my_affiliate_referral_code_request_model.dart'; +export 'services/token/models/enums.dart'; +export 'services/token/services/deriv_token_service.dart'; +export 'states/states.dart'; diff --git a/packages/deriv_auth/lib/deriv_auth.dart b/packages/deriv_auth/lib/deriv_auth.dart index b04598088..3f246a444 100644 --- a/packages/deriv_auth/lib/deriv_auth.dart +++ b/packages/deriv_auth/lib/deriv_auth.dart @@ -1,46 +1,2 @@ -export 'core/connection_info.dart'; -export 'core/exceptions/deriv_auth_exception.dart'; -export 'core/extensions/extensions.dart'; -export 'core/models/account_model.dart'; -export 'core/models/auth_error/auth_error.dart'; -export 'core/models/auth_error/auth_error_model.dart'; -export 'core/models/authorize_model.dart'; -export 'core/models/verify_email_model.dart'; -export 'core/services/jwt/repository/deriv_jwt_repository.dart'; -export 'core/services/jwt/services/deriv_jwt_service.dart'; -export 'core/services/token/models/enums.dart'; -export 'core/services/token/services/deriv_token_service.dart'; -export 'core/services/referral/models/my_affiliate_referral_code_request_model.dart'; -export 'features/auth/cubit/deriv_auth_cubit.dart'; -export 'features/auth/models/logout/logout_response.dart'; -export 'features/auth/repository/base_auth_repository.dart'; -export 'features/auth/services/deriv_auth_service.dart'; -export 'features/reset_password/cubit/reset_password_cubit.dart'; -export 'features/reset_password/repository/base_reset_password_repository.dart'; -export 'features/reset_password/services/deriv_reset_password_service.dart'; -export 'features/signup/cubit/signup_cubit.dart'; -export 'features/signup/models/new_virtual_account_request_model.dart'; -export 'features/signup/models/signup_error_type.dart'; -export 'features/signup/repository/base_signup_repository.dart'; -export 'features/signup/services/deriv_signup_service.dart'; -export 'features/social_auth/social_auth.dart'; -export 'core/layouts/deriv_unavailable_country_layout.dart'; -export 'features/get_started/presentation/layouts/deriv_get_started_layout.dart'; -export 'features/get_started/models/deriv_get_started_slide_model.dart'; -export 'features/login/presentation/layouts/deriv_2fa_layout.dart'; -export 'features/login/presentation/layouts/deriv_login_layout.dart'; -export 'features/reset_password/presentation/layouts/deriv_choose_new_pass_layout.dart'; -export 'features/reset_password/presentation/layouts/deriv_reset_pass_layout.dart'; -export 'features/reset_password/presentation/layouts/deriv_success_pass_change_layout.dart'; -export 'features/setting_page/presentation/layouts/deriv_setting_layout.dart'; -export 'features/signup/cubit/deriv_country_selection_cubit.dart'; -export 'features/signup/presentation/layouts/deriv_country_selection_layout.dart'; -export 'features/signup/presentation/layouts/deriv_email_not_received_layout.dart'; -export 'features/signup/presentation/layouts/deriv_set_password_layout.dart'; -export 'features/signup/presentation/layouts/deriv_signup_layout.dart'; -export 'features/signup/presentation/layouts/deriv_verification_done_layout.dart'; -export 'features/signup/presentation/layouts/deriv_verify_email_layout.dart'; -export 'features/signup/models/deriv_auth_utm_model.dart'; -export 'features/signup/models/deriv_password_policy_model.dart'; -export 'features/signup/models/deriv_residence_model.dart'; -export 'core/states/states.dart'; +export 'core/core.dart'; +export 'features/features.dart'; diff --git a/packages/deriv_auth/lib/features/auth/auth.dart b/packages/deriv_auth/lib/features/auth/auth.dart new file mode 100644 index 000000000..5c56748d0 --- /dev/null +++ b/packages/deriv_auth/lib/features/auth/auth.dart @@ -0,0 +1,4 @@ +export 'cubit/deriv_auth_cubit.dart'; +export 'models/logout/logout_response.dart'; +export 'repository/base_auth_repository.dart'; +export 'services/deriv_auth_service.dart'; diff --git a/packages/deriv_auth/lib/features/features.dart b/packages/deriv_auth/lib/features/features.dart new file mode 100644 index 000000000..7712e281d --- /dev/null +++ b/packages/deriv_auth/lib/features/features.dart @@ -0,0 +1,8 @@ +export 'auth/auth.dart'; +export 'get_started/get_started.dart'; +export 'login/login.dart'; +export 'reset_password/reset_password.dart'; +export 'setting_page/setting_page.dart'; +export 'signup/signup.dart'; +export 'single_entry/single_entry.dart'; +export 'social_auth/social_auth.dart'; diff --git a/packages/deriv_auth/lib/features/get_started/get_started.dart b/packages/deriv_auth/lib/features/get_started/get_started.dart new file mode 100644 index 000000000..2604a2649 --- /dev/null +++ b/packages/deriv_auth/lib/features/get_started/get_started.dart @@ -0,0 +1,2 @@ +export 'models/deriv_get_started_slide_model.dart'; +export 'presentation/layouts/deriv_get_started_layout.dart'; diff --git a/packages/deriv_auth/lib/features/login/login.dart b/packages/deriv_auth/lib/features/login/login.dart new file mode 100644 index 000000000..2dba1e7ff --- /dev/null +++ b/packages/deriv_auth/lib/features/login/login.dart @@ -0,0 +1,2 @@ +export 'presentation/layouts/deriv_2fa_layout.dart'; +export 'presentation/layouts/deriv_login_layout.dart'; diff --git a/packages/deriv_auth/lib/features/reset_password/reset_password.dart b/packages/deriv_auth/lib/features/reset_password/reset_password.dart new file mode 100644 index 000000000..96b1adce5 --- /dev/null +++ b/packages/deriv_auth/lib/features/reset_password/reset_password.dart @@ -0,0 +1,6 @@ +export 'cubit/reset_password_cubit.dart'; +export 'presentation/layouts/deriv_choose_new_pass_layout.dart'; +export 'presentation/layouts/deriv_reset_pass_layout.dart'; +export 'presentation/layouts/deriv_success_pass_change_layout.dart'; +export 'repository/base_reset_password_repository.dart'; +export 'services/deriv_reset_password_service.dart'; diff --git a/packages/deriv_auth/lib/features/setting_page/setting_page.dart b/packages/deriv_auth/lib/features/setting_page/setting_page.dart new file mode 100644 index 000000000..224c7bff0 --- /dev/null +++ b/packages/deriv_auth/lib/features/setting_page/setting_page.dart @@ -0,0 +1 @@ +export 'presentation/layouts/deriv_setting_layout.dart'; diff --git a/packages/deriv_auth/lib/features/signup/signup.dart b/packages/deriv_auth/lib/features/signup/signup.dart new file mode 100644 index 000000000..5b3b7d992 --- /dev/null +++ b/packages/deriv_auth/lib/features/signup/signup.dart @@ -0,0 +1,15 @@ +export 'cubit/deriv_country_selection_cubit.dart'; +export 'cubit/signup_cubit.dart'; +export 'models/deriv_auth_utm_model.dart'; +export 'models/deriv_password_policy_model.dart'; +export 'models/deriv_residence_model.dart'; +export 'models/new_virtual_account_request_model.dart'; +export 'models/signup_error_type.dart'; +export 'presentation/layouts/deriv_country_selection_layout.dart'; +export 'presentation/layouts/deriv_email_not_received_layout.dart'; +export 'presentation/layouts/deriv_set_password_layout.dart'; +export 'presentation/layouts/deriv_signup_layout.dart'; +export 'presentation/layouts/deriv_verification_done_layout.dart'; +export 'presentation/layouts/deriv_verify_email_layout.dart'; +export 'repository/base_signup_repository.dart'; +export 'services/deriv_signup_service.dart'; diff --git a/packages/deriv_auth/lib/features/single_entry/core/auth_data.dart b/packages/deriv_auth/lib/features/single_entry/core/auth_data.dart new file mode 100644 index 000000000..a611c3682 --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/core/auth_data.dart @@ -0,0 +1,23 @@ +// ignore_for_file: unnecessary_getters_setters + +import 'models/auth_entry_model.dart'; + +/// Authentication Data Singleton +class AuthData { + /// AuthData instance + factory AuthData() => _instance; + + AuthData._internal(); + + static final AuthData _instance = AuthData._internal(); + + late AuthEntryModel _data; + + /// data getter + AuthEntryModel get data => _data; + + /// data setter + set data(AuthEntryModel data) { + _data = data; + } +} diff --git a/packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart b/packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart new file mode 100644 index 000000000..6c01c33b6 --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart @@ -0,0 +1,20 @@ +import 'package:deriv_auth/deriv_auth.dart'; + +/// +class AuthEntryModel { + /// + const AuthEntryModel({ + required this.slides, + required this.appLogoIconPath, + required this.backgroundImagePath, + }); + + /// + final List slides; + + /// + final String appLogoIconPath; + + /// + final String backgroundImagePath; +} 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 new file mode 100644 index 000000000..264529e39 --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/features/get_started/pages/get_started_page.dart @@ -0,0 +1,39 @@ +import 'package:deriv_auth/features/get_started/presentation/layouts/deriv_get_started_layout.dart'; +import 'package:deriv_auth/features/single_entry/core/auth_data.dart'; +import 'package:deriv_auth/features/single_entry/features/login/pages/login_page.dart'; +import 'package:deriv_auth/features/single_entry/features/settings/pages/settings_page.dart'; +import 'package:deriv_auth/features/single_entry/features/signup/pages/signup_page.dart'; +import 'package:flutter/material.dart'; + +/// +class GetStartedPage extends StatelessWidget { + /// + const GetStartedPage(); + + /// + + @override + Widget build(BuildContext context) => DerivGetStartedLayout( + slides: AuthData().data.slides, + appLogoIconPath: AuthData().data.appLogoIconPath, + backgroundImagePath: AuthData().data.backgroundImagePath, + onLoginTapped: () => Navigator.of(context).push( + MaterialPageRoute( + builder: (context) => const LoginPage(), + ), + ), + onSignupTapped: () => Navigator.of(context).push( + MaterialPageRoute( + builder: (context) => const SignupPage(), + ), + ), + onTapNavigation: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => const SettingsPage(), + ), + ); + }, + ); +} diff --git a/packages/deriv_auth/lib/features/single_entry/features/home/pages/home_page.dart b/packages/deriv_auth/lib/features/single_entry/features/home/pages/home_page.dart new file mode 100644 index 000000000..b1ae6832a --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/features/home/pages/home_page.dart @@ -0,0 +1,30 @@ +import 'package:flutter/material.dart'; + +class HomePage extends StatelessWidget { + const HomePage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Deriv Auth UI'), + ), + body: const Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + 'Deriv Auth UI', + style: TextStyle(fontSize: 24), + ), + SizedBox(height: 16), + Text( + 'Deriv Auth UI is a Flutter package that provides a set of ready-to-use widgets for building authentication flows in your app.', + textAlign: TextAlign.center, + ), + ], + ), + ), + ); + } +} diff --git a/packages/deriv_auth/lib/features/single_entry/features/login/pages/login_page.dart b/packages/deriv_auth/lib/features/single_entry/features/login/pages/login_page.dart new file mode 100644 index 000000000..18d0507ef --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/features/login/pages/login_page.dart @@ -0,0 +1,51 @@ +import 'package:deriv_auth/core/states/auth_error_state_handler.dart'; +import 'package:deriv_auth/features/auth/cubit/deriv_auth_cubit.dart'; +import 'package:deriv_auth/features/login/presentation/layouts/deriv_login_layout.dart'; +import 'package:deriv_auth/features/single_entry/features/home/pages/home_page.dart'; +import 'package:deriv_auth/features/single_entry/features/reset_pass/pages/reset_pass_page.dart'; +import 'package:deriv_auth/features/single_entry/features/signup/pages/signup_page.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; + +class LoginPage extends StatefulWidget { + const LoginPage({super.key}); + + @override + State createState() => _LoginPageState(); +} + +class _LoginPageState extends State { + @override + void initState() { + BlocProvider.of(context).logout(); + super.initState(); + } + + @override + Widget build(BuildContext context) => DerivLoginLayout( + welcomeLabel: 'Welcome back!', + greetingLabel: + 'Log in to your Deriv account to start trading and investing.', + onLoggedIn: (_) => Navigator.pushReplacement( + context, + MaterialPageRoute( + builder: (context) => const HomePage(), + ), + ), + authErrorStateHandler: AuthErrorStateHandler(context: context), + onLoginError: (_) {}, + onResetPassTapped: () => Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const ResetPassPage(), + ), + ), + onSignupTapped: () => Navigator.pushReplacement( + context, + MaterialPageRoute( + builder: (context) => const SignupPage(), + ), + ), + onSocialAuthButtonPressed: (_) {}, + ); +} diff --git a/packages/deriv_auth/lib/features/single_entry/features/login/repositories/example_login_repository.dart b/packages/deriv_auth/lib/features/single_entry/features/login/repositories/example_login_repository.dart new file mode 100644 index 000000000..2e7f72a29 --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/features/login/repositories/example_login_repository.dart @@ -0,0 +1,36 @@ +import 'package:deriv_auth/core/models/landig_comany_model.dart'; +import 'package:deriv_auth/deriv_auth.dart'; + +class ExampleLoginRepository implements BaseAuthRepository { + @override + Future authorize(String? token) => + Future.value(const AuthorizeResponseEntity()); + + @override + Future getDefaultAccount() => Future.value(AccountModel( + accountId: "accountId", + )); + + @override + Future> getLatestAccounts() => Future.value([ + AccountModel( + accountId: "accountId", + ) + ]); + + @override + Future logout() => Future.value(); + + @override + Future onLogin(AuthorizeEntity authorizeEntity) => Future.value(); + + @override + Future onLogout() => Future.value(); + + @override + Future onPostLogout() => Future.value(); + + @override + Future getLandingCompany(String? countryCode) => + Future.value(const LandingCompanyEntity()); +} diff --git a/packages/deriv_auth/lib/features/single_entry/features/login/services/example_login_service.dart b/packages/deriv_auth/lib/features/single_entry/features/login/services/example_login_service.dart new file mode 100644 index 000000000..63c832a4f --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/features/login/services/example_login_service.dart @@ -0,0 +1,52 @@ +import 'package:deriv_auth/core/models/account_model.dart'; +import 'package:deriv_auth/core/models/authorize_model.dart'; +import 'package:deriv_auth/core/models/landig_comany_model.dart'; +import 'package:deriv_auth/core/services/token/models/login_request.dart'; +import 'package:deriv_auth/features/auth/repository/base_auth_repository.dart'; +import 'package:deriv_auth/features/auth/services/base_auth_service.dart'; + +/// `DerivGO` implementation of [BaseAuthService]. +class ExampleLoginService extends BaseAuthService { + /// Initializes a [ExampleLoginService] class. + ExampleLoginService({ + required this.authRepository, + }); + + /// Interface of all client related functions. + final BaseAuthRepository authRepository; + + @override + Future onLoginRequest( + {required GetTokensRequestModel request, String? userAgent}) async => + const AuthorizeEntity(); + + @override + Future login( + String token, { + required List accounts, + String? signupProvider, + String? refreshToken, + }) async => + const AuthorizeEntity(); + + @override + Future getDefaultAccount() => + authRepository.getDefaultAccount(); + + @override + Future> getLatestAccounts() => + authRepository.getLatestAccounts(); + + @override + Future logout() => authRepository.logout(); + + @override + Future onLogout() => authRepository.onLogout(); + + @override + Future onPostLogout() => authRepository.onPostLogout(); + + @override + Future getLandingCompany(String? countryCode) => + authRepository.getLandingCompany(countryCode); +} diff --git a/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/choose_new_password_page.dart b/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/choose_new_password_page.dart new file mode 100644 index 000000000..7dbf5afdb --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/choose_new_password_page.dart @@ -0,0 +1,25 @@ +import 'package:deriv_auth/features/reset_password/cubit/reset_password_cubit.dart'; +import 'package:deriv_auth/features/reset_password/presentation/layouts/deriv_choose_new_pass_layout.dart'; +import 'package:deriv_auth/features/single_entry/features/reset_pass/pages/reset_pass_success_page.dart'; +import 'package:flutter/material.dart'; + +class ChooseNewPasswordPage extends StatelessWidget { + const ChooseNewPasswordPage({required this.cubit, super.key}); + + final DerivResetPassCubit cubit; + + @override + Widget build(BuildContext context) { + return DerivChooseNewPassLayout( + token: 'token', + onResetPassSucceed: () { + Navigator.of(context).push( + MaterialPageRoute( + builder: (context) => const ResetPassSuccessPage(), + ), + ); + }, + onResetPassError: (_) {}, + ); + } +} diff --git a/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/reset_pass_page.dart b/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/reset_pass_page.dart new file mode 100644 index 000000000..08ebc6fdb --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/reset_pass_page.dart @@ -0,0 +1,53 @@ +import 'dart:async'; + +import 'package:deriv_auth/deriv_auth.dart'; +import 'package:deriv_auth/features/single_entry/features/reset_pass/pages/choose_new_password_page.dart'; +import 'package:deriv_auth/features/single_entry/features/reset_pass/services/example_reset_pass_service.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; + +class ResetPassPage extends StatefulWidget { + const ResetPassPage({super.key}); + + @override + State createState() => _ResetPassPageState(); +} + +class _ResetPassPageState extends State { + late final DerivResetPassCubit cubit; + late final StreamSubscription _streamSubscription; + + @override + void initState() { + super.initState(); + + cubit = DerivResetPassCubit(service: ExampleResetPassService()); + + _streamSubscription = cubit.stream.listen((state) { + if (state is DerivResetPassEmailSentState) { + Timer(const Duration(seconds: 3), () { + if (mounted) { + Navigator.of(context).push(MaterialPageRoute( + builder: (context) => BlocProvider.value( + value: cubit, child: ChooseNewPasswordPage(cubit: cubit)), + )); + } + }); + } + }); + } + + @override + Widget build(BuildContext context) { + return BlocProvider.value( + value: cubit, child: DerivResetPassLayout(onResetPassError: (_) {})); + } + + @override + void dispose() { + cubit.close(); + _streamSubscription.cancel(); + + super.dispose(); + } +} diff --git a/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/reset_pass_success_page.dart b/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/reset_pass_success_page.dart new file mode 100644 index 000000000..68ce4c769 --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/reset_pass_success_page.dart @@ -0,0 +1,49 @@ +import 'package:deriv_auth/deriv_auth.dart'; +import 'package:deriv_auth/features/single_entry/features/login/pages/login_page.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; + +/// Reset password success page +class ResetPassSuccessPage extends StatefulWidget { + /// Reset password success constructor + const ResetPassSuccessPage({super.key}); + + @override + State createState() => _ResetPassSuccessPageState(); +} + +class _ResetPassSuccessPageState extends State { + static const Duration _successPageHoldDuration = Duration(seconds: 2); + + @override + void initState() { + super.initState(); + + // wait for either [_successPageHoldDuration] or logout to finish + // then navigate to loginPage + Future.wait( + >[ + Future.delayed(_successPageHoldDuration), + BlocProvider.of(context).logout(), + ], + ).then( + (_) { + // Navigator.of(context).pushAndRemoveUntil( + // MaterialPageRoute( + // builder: (context) => const GetStartedPage(), + // ), + // (route) => false, + // ); + + Navigator.of(context).push( + MaterialPageRoute( + builder: (BuildContext context) => const LoginPage(), + ), + ); + }, + ); + } + + @override + Widget build(BuildContext context) => const DerivSuccessPassChangeLayout(); +} diff --git a/packages/deriv_auth/lib/features/single_entry/features/reset_pass/services/example_reset_pass_service.dart b/packages/deriv_auth/lib/features/single_entry/features/reset_pass/services/example_reset_pass_service.dart new file mode 100644 index 000000000..f65b527e0 --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/features/reset_pass/services/example_reset_pass_service.dart @@ -0,0 +1,17 @@ +import 'package:deriv_auth/core/models/verify_email_model.dart'; +import 'package:deriv_auth/features/reset_password/services/base_reset_password_service.dart'; + +class ExampleResetPassService implements BaseResetPasswordService { + @override + Future resetPassword({ + required String verificationCode, + required String newPassword, + }) => + Future.value(true); + + @override + Future sendVerificationEmail( + VerifyEmailRequestEntity request, + ) => + Future.value(const VerifyEmailResponseEntity(verifyEmail: true)); +} diff --git a/packages/deriv_auth/lib/features/single_entry/features/settings/pages/settings_page.dart b/packages/deriv_auth/lib/features/single_entry/features/settings/pages/settings_page.dart new file mode 100644 index 000000000..70d990683 --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/features/settings/pages/settings_page.dart @@ -0,0 +1,28 @@ +import 'dart:developer' as logger; +import 'package:deriv_auth/deriv_auth.dart'; +import 'package:flutter/material.dart'; + +class SettingsPage extends StatefulWidget { + const SettingsPage({super.key}); + + @override + State createState() => _SettingsPageState(); +} + +class _SettingsPageState extends State { + @override + Widget build(BuildContext context) => DerivSettingLayout( + updateFlavorConfigs: _updateFlavorConfig(), + appLabel: 'appLabel', + saveValues: _saveValues, + ); +} + +_saveValues({required String appId, required String endpoint}) { + logger.log('appId is $appId'); + logger.log('endpoint is $endpoint'); +} + +Future _updateFlavorConfig() async { + logger.log('Flavor CONFIG is updated'); +} diff --git a/packages/deriv_auth/lib/features/single_entry/features/signup/pages/country_selection_page.dart b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/country_selection_page.dart new file mode 100644 index 000000000..838961327 --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/country_selection_page.dart @@ -0,0 +1,29 @@ +import 'package:deriv_auth/features/signup/models/deriv_residence_model.dart'; +import 'package:deriv_auth/features/signup/presentation/layouts/deriv_country_selection_layout.dart'; +import 'package:deriv_auth/features/single_entry/features/signup/pages/set_password_page.dart'; +import 'package:flutter/material.dart'; + +class CountrySelectionPage extends StatelessWidget { + const CountrySelectionPage({required this.verificationCode, super.key}); + + final String verificationCode; + + @override + Widget build(BuildContext context) { + return DerivCountrySelectionLayout( + onNextPressed: () { + Navigator.of(context).push(MaterialPageRoute( + builder: (context) => const SetPasswordPage(verificationCode: 'code'), + )); + }, + residences: Future.value([ + const DerivResidenceModel( + code: 'ID', name: 'Indonesia', isDisabled: false), + const DerivResidenceModel( + code: 'UK', name: 'England', isDisabled: true), + ]), + verificationCode: verificationCode, + affiliateToken: 'token', + ); + } +} diff --git a/packages/deriv_auth/lib/features/single_entry/features/signup/pages/set_password_page.dart b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/set_password_page.dart new file mode 100644 index 000000000..8ec51a504 --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/set_password_page.dart @@ -0,0 +1,24 @@ +import 'package:deriv_auth/deriv_auth.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; + +class SetPasswordPage extends StatelessWidget { + const SetPasswordPage({required this.verificationCode, super.key}); + + final String verificationCode; + + @override + Widget build(BuildContext context) => DerivSetPasswordLayout( + authErrorStateHandler: AuthErrorStateHandler(context: context), + onDerivSignupState: (context, state) { + if (state is DerivSignupDoneState) { + context + .read() + .tokenLogin(state.account?.token ?? 'defaultToken'); + } + }, + onPreviousPressed: () => Navigator.of(context).pop(), + residence: 'residence', + verificationCode: verificationCode, + ); +} diff --git a/packages/deriv_auth/lib/features/single_entry/features/signup/pages/signup_page.dart b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/signup_page.dart new file mode 100644 index 000000000..232e2683c --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/signup_page.dart @@ -0,0 +1,39 @@ +import 'package:deriv_auth/core/states/auth_error_state_handler.dart'; +import 'package:deriv_auth/features/signup/presentation/layouts/deriv_signup_layout.dart'; +import 'package:deriv_auth/features/single_entry/features/login/pages/login_page.dart'; +import 'package:deriv_auth/features/single_entry/features/signup/pages/verify_email_page.dart'; +import 'package:flutter/material.dart'; + +class SignupPage extends StatefulWidget { + const SignupPage({super.key}); + + @override + State createState() => _SignupPageState(); +} + +class _SignupPageState extends State { + @override + Widget build(BuildContext context) => DerivSignupLayout( + authErrorStateHandler: AuthErrorStateHandler(context: context), + signupPageLabel: 'Start trading with Deriv', + signupPageDescription: + 'Join over 1 million traders worldwide who loves trading at Deriv.', + onSocialAuthButtonPressed: (_) {}, + onSingupError: (_) {}, + onSingupEmailSent: (email) { + Navigator.pushReplacement( + context, + MaterialPageRoute( + builder: (context) => VerifyEmailPage(email: email), + ), + ); + }, + onSignupPressed: () {}, + onLoginTapped: () => Navigator.pushReplacement( + context, + MaterialPageRoute( + builder: (context) => const LoginPage(), + ), + ), + ); +} diff --git a/packages/deriv_auth/lib/features/single_entry/features/signup/pages/verification_done_page.dart b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/verification_done_page.dart new file mode 100644 index 000000000..e7b1a42c2 --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/verification_done_page.dart @@ -0,0 +1,23 @@ +import 'package:deriv_auth/features/signup/presentation/layouts/deriv_verification_done_layout.dart'; +import 'package:deriv_auth/features/single_entry/features/signup/pages/country_selection_page.dart'; +import 'package:flutter/material.dart'; + +class VerificationDonePage extends StatelessWidget { + const VerificationDonePage({required this.verificationCode, super.key}); + + final String verificationCode; + + @override + Widget build(BuildContext context) { + return DerivVerificationDoneLayout( + onContinuePressed: () { + Navigator.of(context).push(MaterialPageRoute( + builder: (context) => + CountrySelectionPage(verificationCode: verificationCode), + )); + }, + verificationCode: verificationCode, + affiliateToken: '', + ); + } +} diff --git a/packages/deriv_auth/lib/features/single_entry/features/signup/pages/verify_email_page.dart b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/verify_email_page.dart new file mode 100644 index 000000000..cbd5a43a5 --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/verify_email_page.dart @@ -0,0 +1,52 @@ +import 'dart:async'; + +import 'package:deriv_auth/features/signup/presentation/layouts/deriv_email_not_received_layout.dart'; +import 'package:deriv_auth/features/signup/presentation/layouts/deriv_verify_email_layout.dart'; +import 'package:deriv_auth/features/single_entry/features/signup/pages/verification_done_page.dart'; +import 'package:flutter/material.dart'; + +class VerifyEmailPage extends StatefulWidget { + const VerifyEmailPage({required this.email, super.key}); + final String email; + + @override + State createState() => _VerifyEmailPageState(); +} + +class _VerifyEmailPageState extends State { + @override + void initState() { + super.initState(); + + Timer(const Duration(seconds: 3), () { + if (mounted) { + Navigator.of(context).push(MaterialPageRoute( + builder: (context) => + const VerificationDonePage(verificationCode: 'code'), + )); + } + }); + } + + @override + Widget build(BuildContext context) => DerivVerifyEmailLayout( + email: widget.email, + onEmailNotReceivedPressed: () => onEmailNotReceivedPressed(context), + ); + + void onEmailNotReceivedPressed(BuildContext context) { + Navigator.of(context).pushReplacement(MaterialPageRoute( + builder: (context) => DerivEmailNotReceivedLayout( + onReEnterEmailPressed: () => Navigator.of(context).pushReplacement( + MaterialPageRoute( + builder: (context) => DerivVerifyEmailLayout( + email: widget.email, + onEmailNotReceivedPressed: () => + onEmailNotReceivedPressed(context), + ), + ), + ), + ), + )); + } +} diff --git a/packages/deriv_auth/lib/features/single_entry/features/signup/repositories/example_referral_repository.dart b/packages/deriv_auth/lib/features/single_entry/features/signup/repositories/example_referral_repository.dart new file mode 100644 index 000000000..f59512705 --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/features/signup/repositories/example_referral_repository.dart @@ -0,0 +1,7 @@ +import 'package:deriv_auth/core/services/referral/base_referral_code_service.dart'; + +class ExampleReferralRepository implements BaseReferralCodeService { + @override + Future getReferralToken(String referralCode) => + Future.value('${referralCode}Token'); +} diff --git a/packages/deriv_auth/lib/features/single_entry/features/signup/repositories/example_signup_repository.dart b/packages/deriv_auth/lib/features/single_entry/features/signup/repositories/example_signup_repository.dart new file mode 100644 index 000000000..ae24ae64c --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/features/signup/repositories/example_signup_repository.dart @@ -0,0 +1,17 @@ +import 'package:deriv_auth/deriv_auth.dart'; + +class ExampleSignupRepository implements BaseSignupRepository { + @override + Future getClientServerTime() => Future.value(DateTime.now()); + + @override + Future openNewVirtualAccount({ + required NewVirtualAccountRequestModel newVirtualAccountModel, + }) => + Future.value(AccountModel(accountId: '1')); + + @override + Future sendVerificationEmail( + VerifyEmailRequestEntity request) => + Future.value(const VerifyEmailResponseEntity(verifyEmail: true)); +} diff --git a/packages/deriv_auth/lib/features/single_entry/pages/auth_entry_page.dart b/packages/deriv_auth/lib/features/single_entry/pages/auth_entry_page.dart new file mode 100644 index 000000000..a5409e9b3 --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/pages/auth_entry_page.dart @@ -0,0 +1,15 @@ +import 'package:deriv_auth/deriv_auth.dart'; +import 'package:deriv_auth/features/single_entry/core/auth_data.dart'; +import 'package:deriv_auth/features/single_entry/features/get_started/pages/get_started_page.dart'; +import 'package:flutter/material.dart'; + +/// +class AuthEntryPage extends StatelessWidget { + /// + AuthEntryPage(AuthEntryModel entryData) { + AuthData().data = entryData; + } + + @override + Widget build(BuildContext context) => const GetStartedPage(); +} diff --git a/packages/deriv_auth/lib/features/single_entry/single_entry.dart b/packages/deriv_auth/lib/features/single_entry/single_entry.dart new file mode 100644 index 000000000..77dc26ae2 --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/single_entry.dart @@ -0,0 +1,2 @@ +export 'core/models/auth_entry_model.dart'; +export 'pages/auth_entry_page.dart'; diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index 0239e05a7..c0cde7242 100644 --- a/packages/deriv_auth/pubspec.yaml +++ b/packages/deriv_auth/pubspec.yaml @@ -29,13 +29,18 @@ dependencies: path: packages/deriv_http_client ref: deriv_http_client-v1.0.0 + flutter_deriv_api: + git: + url: git@github.com:deriv-com/flutter-deriv-api.git + ref: flutter-version-3 + flutter_bloc: ^8.1.3 flutter_svg: ^1.1.6 smooth_page_indicator: ^1.1.0 intl_utils: ^2.8.3 intl: ^0.18.0 equatable: ^2.0.5 - package_info_plus: ^4.2.0 + package_info_plus: ^3.1.2 crypto: ^3.0.2 http: ^0.13.5 From 0e592c4f0ccea44b6a6c002fe404790c53ff5c0a Mon Sep 17 00:00:00 2001 From: Ahrar Date: Fri, 26 Jan 2024 13:58:39 +0800 Subject: [PATCH 002/162] chore(deriv_auth): improve some imports --- .../deriv_auth/lib/core/states/auth_error_state_mapper.dart | 1 - packages/deriv_auth/lib/core/states/auth_state_listener.dart | 1 - .../login/presentation/layouts/deriv_login_layout.dart | 2 -- .../presentation/layouts/deriv_set_password_layout.dart | 2 -- .../signup/presentation/layouts/deriv_signup_layout.dart | 1 - .../features/get_started/pages/get_started_page.dart | 4 ++-- 6 files changed, 2 insertions(+), 9 deletions(-) diff --git a/packages/deriv_auth/lib/core/states/auth_error_state_mapper.dart b/packages/deriv_auth/lib/core/states/auth_error_state_mapper.dart index 44cfa2036..ba4340725 100644 --- a/packages/deriv_auth/lib/core/states/auth_error_state_mapper.dart +++ b/packages/deriv_auth/lib/core/states/auth_error_state_mapper.dart @@ -1,4 +1,3 @@ -import 'package:deriv_auth/core/states/states.dart'; import 'package:deriv_auth/deriv_auth.dart'; /// Maps the [DerivAuthErrorState] to the corresponding [AuthErrorStateHandler]. diff --git a/packages/deriv_auth/lib/core/states/auth_state_listener.dart b/packages/deriv_auth/lib/core/states/auth_state_listener.dart index f51e278d0..9fb0e14f6 100644 --- a/packages/deriv_auth/lib/core/states/auth_state_listener.dart +++ b/packages/deriv_auth/lib/core/states/auth_state_listener.dart @@ -1,4 +1,3 @@ -import 'package:deriv_auth/core/states/states.dart'; import 'package:deriv_auth/deriv_auth.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; 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 da7845066..911ac9ffe 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,8 +1,6 @@ import 'dart:async'; import 'package:deriv_auth/core/helpers/semantic_labels.dart'; -import 'package:deriv_auth/core/states/auth_error_state_handler.dart'; -import 'package:deriv_auth/core/states/auth_error_state_mapper.dart'; import 'package:deriv_auth/deriv_auth.dart'; import 'package:deriv_auth/features/login/presentation/widgets/deriv_social_auth_divider.dart'; import 'package:deriv_auth/features/login/presentation/widgets/deriv_social_auth_panel.dart'; diff --git a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_set_password_layout.dart b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_set_password_layout.dart index 301e0944b..ecc3f6720 100644 --- a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_set_password_layout.dart +++ b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_set_password_layout.dart @@ -1,8 +1,6 @@ import 'package:deriv_auth/core/helpers/assets.dart'; -import 'package:deriv_auth/core/states/auth_error_state_handler.dart'; import 'package:deriv_auth/core/states/auth_state_listener.dart'; import 'package:deriv_auth/deriv_auth.dart'; -import 'package:deriv_auth/features/signup/models/deriv_auth_utm_model.dart'; import 'package:deriv_auth/features/signup/presentation/widgets/password_policy_checker_widget.dart'; import 'package:deriv_theme/deriv_theme.dart'; import 'package:deriv_ui/deriv_ui.dart'; diff --git a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_signup_layout.dart b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_signup_layout.dart index 7c3bcfe08..3ee53e42e 100644 --- a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_signup_layout.dart +++ b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_signup_layout.dart @@ -1,5 +1,4 @@ import 'package:deriv_auth/core/helpers/semantic_labels.dart'; -import 'package:deriv_auth/core/states/auth_error_state_handler.dart'; import 'package:deriv_auth/core/states/auth_state_listener.dart'; import 'package:deriv_auth/deriv_auth.dart'; import 'package:deriv_auth/features/login/presentation/widgets/deriv_social_auth_divider.dart'; 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 264529e39..93f407c29 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 @@ -19,12 +19,12 @@ class GetStartedPage extends StatelessWidget { backgroundImagePath: AuthData().data.backgroundImagePath, onLoginTapped: () => Navigator.of(context).push( MaterialPageRoute( - builder: (context) => const LoginPage(), + builder: (BuildContext context) => const LoginPage(), ), ), onSignupTapped: () => Navigator.of(context).push( MaterialPageRoute( - builder: (context) => const SignupPage(), + builder: (BuildContext context) => const SignupPage(), ), ), onTapNavigation: () { From 6a165702f97a3f86fc2e1014f01d125528cf5caa Mon Sep 17 00:00:00 2001 From: Ahrar Date: Mon, 29 Jan 2024 15:24:15 +0800 Subject: [PATCH 003/162] chore(deriv_auth): change deriv-api to dev branch change deriv_api to dev branch and package_info_plus to version 4 --- packages/deriv_auth/pubspec.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index d4a4ebdaa..cd2559c4c 100644 --- a/packages/deriv_auth/pubspec.yaml +++ b/packages/deriv_auth/pubspec.yaml @@ -32,7 +32,7 @@ dependencies: flutter_deriv_api: git: url: git@github.com:deriv-com/flutter-deriv-api.git - ref: flutter-version-3 + ref: dev flutter_bloc: ^8.1.3 flutter_svg: ^2.0.7 @@ -40,7 +40,7 @@ dependencies: intl_utils: ^2.8.3 intl: ^0.18.0 equatable: ^2.0.5 - package_info_plus: ^3.1.2 + package_info_plus: ^4.2.0 crypto: ^3.0.2 http: ^0.13.5 From 5ce30c3b0fbd84ad3a4cc191d0c7949ec9691ef5 Mon Sep 17 00:00:00 2001 From: Ahrar Date: Fri, 2 Feb 2024 17:59:09 +0800 Subject: [PATCH 004/162] feat(deriv_auth): adding login page to single entry --- .../core/models/auth_entry_model.dart | 19 +++---- .../core/models/get_started_page_model.dart | 20 +++++++ .../core/models/login_page_model.dart | 44 ++++++++++++++++ .../single_entry/core/models/models.dart | 3 ++ .../get_started/pages/get_started_page.dart | 6 +-- .../features/login/pages/login_page.dart | 15 +++--- .../example_login_repository.dart | 36 ------------- .../login/services/example_login_service.dart | 52 ------------------- .../features/single_entry/single_entry.dart | 2 +- 9 files changed, 87 insertions(+), 110 deletions(-) create mode 100644 packages/deriv_auth/lib/features/single_entry/core/models/get_started_page_model.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/core/models/login_page_model.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/core/models/models.dart delete mode 100644 packages/deriv_auth/lib/features/single_entry/features/login/repositories/example_login_repository.dart delete mode 100644 packages/deriv_auth/lib/features/single_entry/features/login/services/example_login_service.dart diff --git a/packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart b/packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart index 6c01c33b6..730d811c1 100644 --- a/packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart +++ b/packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart @@ -1,20 +1,17 @@ -import 'package:deriv_auth/deriv_auth.dart'; +import 'package:deriv_auth/features/single_entry/core/models/get_started_page_model.dart'; +import 'package:deriv_auth/features/single_entry/core/models/login_page_model.dart'; /// class AuthEntryModel { /// const AuthEntryModel({ - required this.slides, - required this.appLogoIconPath, - required this.backgroundImagePath, + required this.getStartedPage, + required this.loginPageModel, }); - /// - final List slides; - - /// - final String appLogoIconPath; + /// GetStartedPage data model + final GetStartedPageModel getStartedPage; - /// - final String backgroundImagePath; + /// LoginPage data model + final LoginPageModel loginPageModel; } diff --git a/packages/deriv_auth/lib/features/single_entry/core/models/get_started_page_model.dart b/packages/deriv_auth/lib/features/single_entry/core/models/get_started_page_model.dart new file mode 100644 index 000000000..574bf0a55 --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/core/models/get_started_page_model.dart @@ -0,0 +1,20 @@ +import 'package:deriv_auth/deriv_auth.dart'; + +/// +class GetStartedPageModel { + /// + const GetStartedPageModel({ + required this.slides, + required this.appLogoIconPath, + required this.backgroundImagePath, + }); + + /// + final List slides; + + /// + final String appLogoIconPath; + + /// + final String backgroundImagePath; +} diff --git a/packages/deriv_auth/lib/features/single_entry/core/models/login_page_model.dart b/packages/deriv_auth/lib/features/single_entry/core/models/login_page_model.dart new file mode 100644 index 000000000..a93b42214 --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/core/models/login_page_model.dart @@ -0,0 +1,44 @@ +import 'package:deriv_auth/deriv_auth.dart'; + +/// LoginPageModel class +class LoginPageModel { + /// Initializes [LoginPageModel]. + const LoginPageModel({ + required this.onLoggedIn, + required this.onSocialAuthButtonPressed, + required this.welcomeLabel, + required this.greetingLabel, + this.isForgotPasswordEnabled = true, + this.isCreateAccountEnabled = true, + this.isSocialAuthEnabled = true, + this.authErrorStateHandler, + this.onLoginError, + }); + + /// Extension of base [AuthErrorStateHandler]. If not provided, base implementation will be used. + final AuthErrorStateHandler? authErrorStateHandler; + + /// Callback to be called when login error occurs. + final Function(DerivAuthErrorState)? onLoginError; + + /// Callback to be called when user is logged in. + final Function(DerivAuthLoggedInState) onLoggedIn; + + /// Callback to be called when social auth button is tapped. + final void Function(SocialAuthProvider) onSocialAuthButtonPressed; + + /// Welcome text to be displayed on login page. + final String welcomeLabel; + + /// Greeting text to be displayed on login page. + final String greetingLabel; + + /// Whether to display social auth buttons. + final bool isSocialAuthEnabled; + + /// Whether to display forgot password section. + final bool isForgotPasswordEnabled; + + /// Whether to display create account section. + final bool isCreateAccountEnabled; +} diff --git a/packages/deriv_auth/lib/features/single_entry/core/models/models.dart b/packages/deriv_auth/lib/features/single_entry/core/models/models.dart new file mode 100644 index 000000000..9a314c7e0 --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/core/models/models.dart @@ -0,0 +1,3 @@ +export 'auth_entry_model.dart'; +export 'get_started_page_model.dart'; +export 'login_page_model.dart'; 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 93f407c29..17d2af0c0 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 @@ -14,9 +14,9 @@ class GetStartedPage extends StatelessWidget { @override Widget build(BuildContext context) => DerivGetStartedLayout( - slides: AuthData().data.slides, - appLogoIconPath: AuthData().data.appLogoIconPath, - backgroundImagePath: AuthData().data.backgroundImagePath, + slides: AuthData().data.getStartedPage.slides, + appLogoIconPath: AuthData().data.getStartedPage.appLogoIconPath, + backgroundImagePath: AuthData().data.getStartedPage.backgroundImagePath, onLoginTapped: () => Navigator.of(context).push( MaterialPageRoute( builder: (BuildContext context) => const LoginPage(), diff --git a/packages/deriv_auth/lib/features/single_entry/features/login/pages/login_page.dart b/packages/deriv_auth/lib/features/single_entry/features/login/pages/login_page.dart index 18d0507ef..d1c2c7503 100644 --- a/packages/deriv_auth/lib/features/single_entry/features/login/pages/login_page.dart +++ b/packages/deriv_auth/lib/features/single_entry/features/login/pages/login_page.dart @@ -1,6 +1,6 @@ -import 'package:deriv_auth/core/states/auth_error_state_handler.dart'; import 'package:deriv_auth/features/auth/cubit/deriv_auth_cubit.dart'; import 'package:deriv_auth/features/login/presentation/layouts/deriv_login_layout.dart'; +import 'package:deriv_auth/features/single_entry/core/auth_data.dart'; import 'package:deriv_auth/features/single_entry/features/home/pages/home_page.dart'; import 'package:deriv_auth/features/single_entry/features/reset_pass/pages/reset_pass_page.dart'; import 'package:deriv_auth/features/single_entry/features/signup/pages/signup_page.dart'; @@ -23,17 +23,17 @@ class _LoginPageState extends State { @override Widget build(BuildContext context) => DerivLoginLayout( - welcomeLabel: 'Welcome back!', - greetingLabel: - 'Log in to your Deriv account to start trading and investing.', + welcomeLabel: AuthData().data.loginPageModel.welcomeLabel, + greetingLabel: AuthData().data.loginPageModel.greetingLabel, onLoggedIn: (_) => Navigator.pushReplacement( context, MaterialPageRoute( builder: (context) => const HomePage(), ), ), - authErrorStateHandler: AuthErrorStateHandler(context: context), - onLoginError: (_) {}, + authErrorStateHandler: + AuthData().data.loginPageModel.authErrorStateHandler, + onLoginError: AuthData().data.loginPageModel.onLoginError, onResetPassTapped: () => Navigator.push( context, MaterialPageRoute( @@ -46,6 +46,7 @@ class _LoginPageState extends State { builder: (context) => const SignupPage(), ), ), - onSocialAuthButtonPressed: (_) {}, + onSocialAuthButtonPressed: + AuthData().data.loginPageModel.onSocialAuthButtonPressed, ); } diff --git a/packages/deriv_auth/lib/features/single_entry/features/login/repositories/example_login_repository.dart b/packages/deriv_auth/lib/features/single_entry/features/login/repositories/example_login_repository.dart deleted file mode 100644 index 2e7f72a29..000000000 --- a/packages/deriv_auth/lib/features/single_entry/features/login/repositories/example_login_repository.dart +++ /dev/null @@ -1,36 +0,0 @@ -import 'package:deriv_auth/core/models/landig_comany_model.dart'; -import 'package:deriv_auth/deriv_auth.dart'; - -class ExampleLoginRepository implements BaseAuthRepository { - @override - Future authorize(String? token) => - Future.value(const AuthorizeResponseEntity()); - - @override - Future getDefaultAccount() => Future.value(AccountModel( - accountId: "accountId", - )); - - @override - Future> getLatestAccounts() => Future.value([ - AccountModel( - accountId: "accountId", - ) - ]); - - @override - Future logout() => Future.value(); - - @override - Future onLogin(AuthorizeEntity authorizeEntity) => Future.value(); - - @override - Future onLogout() => Future.value(); - - @override - Future onPostLogout() => Future.value(); - - @override - Future getLandingCompany(String? countryCode) => - Future.value(const LandingCompanyEntity()); -} diff --git a/packages/deriv_auth/lib/features/single_entry/features/login/services/example_login_service.dart b/packages/deriv_auth/lib/features/single_entry/features/login/services/example_login_service.dart deleted file mode 100644 index 63c832a4f..000000000 --- a/packages/deriv_auth/lib/features/single_entry/features/login/services/example_login_service.dart +++ /dev/null @@ -1,52 +0,0 @@ -import 'package:deriv_auth/core/models/account_model.dart'; -import 'package:deriv_auth/core/models/authorize_model.dart'; -import 'package:deriv_auth/core/models/landig_comany_model.dart'; -import 'package:deriv_auth/core/services/token/models/login_request.dart'; -import 'package:deriv_auth/features/auth/repository/base_auth_repository.dart'; -import 'package:deriv_auth/features/auth/services/base_auth_service.dart'; - -/// `DerivGO` implementation of [BaseAuthService]. -class ExampleLoginService extends BaseAuthService { - /// Initializes a [ExampleLoginService] class. - ExampleLoginService({ - required this.authRepository, - }); - - /// Interface of all client related functions. - final BaseAuthRepository authRepository; - - @override - Future onLoginRequest( - {required GetTokensRequestModel request, String? userAgent}) async => - const AuthorizeEntity(); - - @override - Future login( - String token, { - required List accounts, - String? signupProvider, - String? refreshToken, - }) async => - const AuthorizeEntity(); - - @override - Future getDefaultAccount() => - authRepository.getDefaultAccount(); - - @override - Future> getLatestAccounts() => - authRepository.getLatestAccounts(); - - @override - Future logout() => authRepository.logout(); - - @override - Future onLogout() => authRepository.onLogout(); - - @override - Future onPostLogout() => authRepository.onPostLogout(); - - @override - Future getLandingCompany(String? countryCode) => - authRepository.getLandingCompany(countryCode); -} diff --git a/packages/deriv_auth/lib/features/single_entry/single_entry.dart b/packages/deriv_auth/lib/features/single_entry/single_entry.dart index 77dc26ae2..a3a619eae 100644 --- a/packages/deriv_auth/lib/features/single_entry/single_entry.dart +++ b/packages/deriv_auth/lib/features/single_entry/single_entry.dart @@ -1,2 +1,2 @@ -export 'core/models/auth_entry_model.dart'; +export 'core/models/models.dart'; export 'pages/auth_entry_page.dart'; From 7ff56536e97f194e60890cab9dc9f3b833fe1540 Mon Sep 17 00:00:00 2001 From: Bassam El Obeid <127500305+bassam-deriv@users.noreply.github.com> Date: Tue, 6 Feb 2024 11:33:41 +0400 Subject: [PATCH 005/162] Update Crowdin configuration file --- crowdin.yml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 crowdin.yml diff --git a/crowdin.yml b/crowdin.yml new file mode 100644 index 000000000..0d5ff5853 --- /dev/null +++ b/crowdin.yml @@ -0,0 +1,3 @@ +files: + - source: /packages/deriv_localizations/lib/l10n/**/app_en.arb + translation: /packages/deriv_localizations/lib/l10n/**/app_%two_letters_code%.arb From 573a4a787a6aa518537f2678c19a748cebcf0fb4 Mon Sep 17 00:00:00 2001 From: Ahrar Date: Sun, 11 Feb 2024 17:21:45 +0800 Subject: [PATCH 006/162] feat(deriv_auth): single entry login and reset pass added --- .../core/models/auth_entry_model.dart | 7 ++- .../features/login/pages/login_page.dart | 14 +++-- .../pages/choose_new_password_page.dart | 34 +++++------ .../reset_pass/pages/reset_pass_page.dart | 56 +++++-------------- .../pages/reset_pass_success_page.dart | 17 ++---- .../services/example_reset_pass_service.dart | 17 ------ 6 files changed, 49 insertions(+), 96 deletions(-) delete mode 100644 packages/deriv_auth/lib/features/single_entry/features/reset_pass/services/example_reset_pass_service.dart diff --git a/packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart b/packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart index 730d811c1..f0bd98a9f 100644 --- a/packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart +++ b/packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart @@ -1,5 +1,4 @@ -import 'package:deriv_auth/features/single_entry/core/models/get_started_page_model.dart'; -import 'package:deriv_auth/features/single_entry/core/models/login_page_model.dart'; +import 'package:deriv_auth/deriv_auth.dart'; /// class AuthEntryModel { @@ -7,6 +6,7 @@ class AuthEntryModel { const AuthEntryModel({ required this.getStartedPage, required this.loginPageModel, + required this.derivAuthCubit, }); /// GetStartedPage data model @@ -14,4 +14,7 @@ class AuthEntryModel { /// LoginPage data model final LoginPageModel loginPageModel; + + /// DerivAuthCubit + final DerivAuthCubit derivAuthCubit; } diff --git a/packages/deriv_auth/lib/features/single_entry/features/login/pages/login_page.dart b/packages/deriv_auth/lib/features/single_entry/features/login/pages/login_page.dart index d1c2c7503..44f80ce93 100644 --- a/packages/deriv_auth/lib/features/single_entry/features/login/pages/login_page.dart +++ b/packages/deriv_auth/lib/features/single_entry/features/login/pages/login_page.dart @@ -7,7 +7,9 @@ import 'package:deriv_auth/features/single_entry/features/signup/pages/signup_pa import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; +/// Login page class LoginPage extends StatefulWidget { + /// Constructor [LoginPage] const LoginPage({super.key}); @override @@ -27,8 +29,8 @@ class _LoginPageState extends State { greetingLabel: AuthData().data.loginPageModel.greetingLabel, onLoggedIn: (_) => Navigator.pushReplacement( context, - MaterialPageRoute( - builder: (context) => const HomePage(), + MaterialPageRoute( + builder: (BuildContext context) => const HomePage(), ), ), authErrorStateHandler: @@ -36,14 +38,14 @@ class _LoginPageState extends State { onLoginError: AuthData().data.loginPageModel.onLoginError, onResetPassTapped: () => Navigator.push( context, - MaterialPageRoute( - builder: (context) => const ResetPassPage(), + MaterialPageRoute( + builder: (BuildContext context) => const ResetPassPage(), ), ), onSignupTapped: () => Navigator.pushReplacement( context, - MaterialPageRoute( - builder: (context) => const SignupPage(), + MaterialPageRoute( + builder: (BuildContext context) => const SignupPage(), ), ), onSocialAuthButtonPressed: diff --git a/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/choose_new_password_page.dart b/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/choose_new_password_page.dart index 7dbf5afdb..aa8407a83 100644 --- a/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/choose_new_password_page.dart +++ b/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/choose_new_password_page.dart @@ -1,25 +1,25 @@ -import 'package:deriv_auth/features/reset_password/cubit/reset_password_cubit.dart'; -import 'package:deriv_auth/features/reset_password/presentation/layouts/deriv_choose_new_pass_layout.dart'; +import 'package:deriv_auth/deriv_auth.dart'; import 'package:deriv_auth/features/single_entry/features/reset_pass/pages/reset_pass_success_page.dart'; import 'package:flutter/material.dart'; +/// Choose new password page class ChooseNewPasswordPage extends StatelessWidget { - const ChooseNewPasswordPage({required this.cubit, super.key}); + /// Constructor [ChooseNewPasswordPage] + const ChooseNewPasswordPage({required this.token, super.key}); - final DerivResetPassCubit cubit; + /// Token + final String token; @override - Widget build(BuildContext context) { - return DerivChooseNewPassLayout( - token: 'token', - onResetPassSucceed: () { - Navigator.of(context).push( - MaterialPageRoute( - builder: (context) => const ResetPassSuccessPage(), - ), - ); - }, - onResetPassError: (_) {}, - ); - } + Widget build(BuildContext context) => DerivChooseNewPassLayout( + token: token, + onResetPassSucceed: () { + Navigator.of(context).push( + MaterialPageRoute( + builder: (BuildContext context) => const ResetPassSuccessPage(), + ), + ); + }, + onResetPassError: (_) {}, + ); } diff --git a/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/reset_pass_page.dart b/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/reset_pass_page.dart index 08ebc6fdb..24200e4ef 100644 --- a/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/reset_pass_page.dart +++ b/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/reset_pass_page.dart @@ -1,53 +1,25 @@ -import 'dart:async'; - import 'package:deriv_auth/deriv_auth.dart'; -import 'package:deriv_auth/features/single_entry/features/reset_pass/pages/choose_new_password_page.dart'; -import 'package:deriv_auth/features/single_entry/features/reset_pass/services/example_reset_pass_service.dart'; +import 'package:deriv_ui/deriv_ui.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; +/// Reset password page class ResetPassPage extends StatefulWidget { + /// Constructor for reset password page const ResetPassPage({super.key}); @override - State createState() => _ResetPassPageState(); + State createState() => _ResetPasswordPageState(); } -class _ResetPassPageState extends State { - late final DerivResetPassCubit cubit; - late final StreamSubscription _streamSubscription; - +class _ResetPasswordPageState extends State { @override - void initState() { - super.initState(); - - cubit = DerivResetPassCubit(service: ExampleResetPassService()); - - _streamSubscription = cubit.stream.listen((state) { - if (state is DerivResetPassEmailSentState) { - Timer(const Duration(seconds: 3), () { - if (mounted) { - Navigator.of(context).push(MaterialPageRoute( - builder: (context) => BlocProvider.value( - value: cubit, child: ChooseNewPasswordPage(cubit: cubit)), - )); - } - }); - } - }); - } - - @override - Widget build(BuildContext context) { - return BlocProvider.value( - value: cubit, child: DerivResetPassLayout(onResetPassError: (_) {})); - } - - @override - void dispose() { - cubit.close(); - _streamSubscription.cancel(); - - super.dispose(); - } + Widget build(BuildContext context) => DerivResetPassLayout( + onResetPassError: (String? errorMessage) { + showErrorDialog( + context: context, + errorMessage: errorMessage, + actionLabel: 'okay', + ); + }, + ); } diff --git a/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/reset_pass_success_page.dart b/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/reset_pass_success_page.dart index 68ce4c769..cec69f638 100644 --- a/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/reset_pass_success_page.dart +++ b/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/reset_pass_success_page.dart @@ -1,11 +1,11 @@ import 'package:deriv_auth/deriv_auth.dart'; +import 'package:deriv_auth/features/single_entry/core/auth_data.dart'; import 'package:deriv_auth/features/single_entry/features/login/pages/login_page.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -/// Reset password success page +/// Reset Password success page class ResetPassSuccessPage extends StatefulWidget { - /// Reset password success constructor + /// Constructor [ResetPassSuccessPage] const ResetPassSuccessPage({super.key}); @override @@ -24,19 +24,12 @@ class _ResetPassSuccessPageState extends State { Future.wait( >[ Future.delayed(_successPageHoldDuration), - BlocProvider.of(context).logout(), + AuthData().data.derivAuthCubit.logout(), ], ).then( (_) { - // Navigator.of(context).pushAndRemoveUntil( - // MaterialPageRoute( - // builder: (context) => const GetStartedPage(), - // ), - // (route) => false, - // ); - Navigator.of(context).push( - MaterialPageRoute( + MaterialPageRoute( builder: (BuildContext context) => const LoginPage(), ), ); diff --git a/packages/deriv_auth/lib/features/single_entry/features/reset_pass/services/example_reset_pass_service.dart b/packages/deriv_auth/lib/features/single_entry/features/reset_pass/services/example_reset_pass_service.dart deleted file mode 100644 index f65b527e0..000000000 --- a/packages/deriv_auth/lib/features/single_entry/features/reset_pass/services/example_reset_pass_service.dart +++ /dev/null @@ -1,17 +0,0 @@ -import 'package:deriv_auth/core/models/verify_email_model.dart'; -import 'package:deriv_auth/features/reset_password/services/base_reset_password_service.dart'; - -class ExampleResetPassService implements BaseResetPasswordService { - @override - Future resetPassword({ - required String verificationCode, - required String newPassword, - }) => - Future.value(true); - - @override - Future sendVerificationEmail( - VerifyEmailRequestEntity request, - ) => - Future.value(const VerifyEmailResponseEntity(verifyEmail: true)); -} From f38cc253209afdf3573e3a85fe8ec0cd7082c5d5 Mon Sep 17 00:00:00 2001 From: Ahrar Date: Sun, 11 Feb 2024 19:20:29 +0800 Subject: [PATCH 007/162] feat(deriv_auth): single entry signup page --- .../core/models/auth_entry_model.dart | 5 ++ .../single_entry/core/models/models.dart | 1 + .../core/models/signup_page_model.dart | 26 +++++++++ .../signup/pages/country_selection_page.dart | 58 ++++++++++++------- .../signup/pages/set_password_page.dart | 26 +++++++-- .../features/signup/pages/signup_page.dart | 32 +++++----- .../signup/pages/verification_done_page.dart | 40 ++++++++----- .../signup/pages/verify_email_page.dart | 28 +++------ .../example_signup_repository.dart | 17 ------ ...pository.dart => referral_repository.dart} | 3 +- 10 files changed, 146 insertions(+), 90 deletions(-) create mode 100644 packages/deriv_auth/lib/features/single_entry/core/models/signup_page_model.dart delete mode 100644 packages/deriv_auth/lib/features/single_entry/features/signup/repositories/example_signup_repository.dart rename packages/deriv_auth/lib/features/single_entry/features/signup/repositories/{example_referral_repository.dart => referral_repository.dart} (70%) diff --git a/packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart b/packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart index f0bd98a9f..f3cb4b2ea 100644 --- a/packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart +++ b/packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart @@ -1,4 +1,5 @@ import 'package:deriv_auth/deriv_auth.dart'; +import 'package:deriv_auth/features/single_entry/core/models/signup_page_model.dart'; /// class AuthEntryModel { @@ -7,6 +8,7 @@ class AuthEntryModel { required this.getStartedPage, required this.loginPageModel, required this.derivAuthCubit, + required this.signupPageModel, }); /// GetStartedPage data model @@ -17,4 +19,7 @@ class AuthEntryModel { /// DerivAuthCubit final DerivAuthCubit derivAuthCubit; + + /// SignupPage data model + final SignupPageModel signupPageModel; } diff --git a/packages/deriv_auth/lib/features/single_entry/core/models/models.dart b/packages/deriv_auth/lib/features/single_entry/core/models/models.dart index 9a314c7e0..6c16661b2 100644 --- a/packages/deriv_auth/lib/features/single_entry/core/models/models.dart +++ b/packages/deriv_auth/lib/features/single_entry/core/models/models.dart @@ -1,3 +1,4 @@ export 'auth_entry_model.dart'; export 'get_started_page_model.dart'; export 'login_page_model.dart'; +export 'signup_page_model.dart'; diff --git a/packages/deriv_auth/lib/features/single_entry/core/models/signup_page_model.dart b/packages/deriv_auth/lib/features/single_entry/core/models/signup_page_model.dart new file mode 100644 index 000000000..10f12dc06 --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/core/models/signup_page_model.dart @@ -0,0 +1,26 @@ +/// Sign-up page model +class SignupPageModel { + /// Constructor [SignupPageModel] + SignupPageModel({ + required this.verificationCode, + required this.signupPageLable, + required this.signupPageDescription, + required this.isSocialAuthEnabled, + this.affiliateToken, + }); + + /// verification code + final String verificationCode; + + /// affiliate token + final String? affiliateToken; + + /// sing-up page label + final String signupPageLable; + + /// sign-up page description + final String signupPageDescription; + + /// is social auth enabled + final bool isSocialAuthEnabled; +} diff --git a/packages/deriv_auth/lib/features/single_entry/features/signup/pages/country_selection_page.dart b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/country_selection_page.dart index 838961327..900219243 100644 --- a/packages/deriv_auth/lib/features/single_entry/features/signup/pages/country_selection_page.dart +++ b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/country_selection_page.dart @@ -1,29 +1,47 @@ -import 'package:deriv_auth/features/signup/models/deriv_residence_model.dart'; -import 'package:deriv_auth/features/signup/presentation/layouts/deriv_country_selection_layout.dart'; +import 'package:deriv_auth/deriv_auth.dart'; import 'package:deriv_auth/features/single_entry/features/signup/pages/set_password_page.dart'; import 'package:flutter/material.dart'; +/// Country selection page class CountrySelectionPage extends StatelessWidget { - const CountrySelectionPage({required this.verificationCode, super.key}); + /// + const CountrySelectionPage({ + required this.verificationCode, + this.affiliateToken, + super.key, + }); + /// Verification code final String verificationCode; + /// + final String? affiliateToken; + @override - Widget build(BuildContext context) { - return DerivCountrySelectionLayout( - onNextPressed: () { - Navigator.of(context).push(MaterialPageRoute( - builder: (context) => const SetPasswordPage(verificationCode: 'code'), - )); - }, - residences: Future.value([ - const DerivResidenceModel( - code: 'ID', name: 'Indonesia', isDisabled: false), - const DerivResidenceModel( - code: 'UK', name: 'England', isDisabled: true), - ]), - verificationCode: verificationCode, - affiliateToken: 'token', - ); - } + Widget build(BuildContext context) => DerivCountrySelectionLayout( + onNextPressed: () { + Navigator.of(context).push( + MaterialPageRoute( + builder: (BuildContext context) => SetPasswordPage( + verificationCode: verificationCode, + affiliateToken: affiliateToken, + ), + ), + ); + }, + residences: Future.value([ + const DerivResidenceModel( + code: 'ID', + name: 'Indonesia', + isDisabled: false, + ), + const DerivResidenceModel( + code: 'UK', + name: 'England', + isDisabled: true, + ), + ]), + verificationCode: verificationCode, + affiliateToken: affiliateToken, + ); } diff --git a/packages/deriv_auth/lib/features/single_entry/features/signup/pages/set_password_page.dart b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/set_password_page.dart index 8ec51a504..727c26be2 100644 --- a/packages/deriv_auth/lib/features/single_entry/features/signup/pages/set_password_page.dart +++ b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/set_password_page.dart @@ -1,24 +1,42 @@ import 'package:deriv_auth/deriv_auth.dart'; +import 'package:deriv_auth/features/single_entry/features/signup/pages/country_selection_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; +/// Set password page class SetPasswordPage extends StatelessWidget { - const SetPasswordPage({required this.verificationCode, super.key}); + /// Constructor [SetPasswordPage] + const SetPasswordPage({ + required this.verificationCode, + this.affiliateToken, + super.key, + }); + /// Verification code final String verificationCode; + /// + final String? affiliateToken; + @override Widget build(BuildContext context) => DerivSetPasswordLayout( authErrorStateHandler: AuthErrorStateHandler(context: context), - onDerivSignupState: (context, state) { + onDerivSignupState: (BuildContext constext, DerivSignupState state) { if (state is DerivSignupDoneState) { context .read() .tokenLogin(state.account?.token ?? 'defaultToken'); } }, - onPreviousPressed: () => Navigator.of(context).pop(), - residence: 'residence', + onPreviousPressed: () => Navigator.of(context).push( + MaterialPageRoute( + builder: (BuildContext context) => CountrySelectionPage( + verificationCode: verificationCode, + affiliateToken: affiliateToken, + ), + ), + ), + residence: 'id', verificationCode: verificationCode, ); } diff --git a/packages/deriv_auth/lib/features/single_entry/features/signup/pages/signup_page.dart b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/signup_page.dart index 232e2683c..f3f209cb3 100644 --- a/packages/deriv_auth/lib/features/single_entry/features/signup/pages/signup_page.dart +++ b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/signup_page.dart @@ -1,10 +1,12 @@ -import 'package:deriv_auth/core/states/auth_error_state_handler.dart'; -import 'package:deriv_auth/features/signup/presentation/layouts/deriv_signup_layout.dart'; +import 'package:deriv_auth/deriv_auth.dart'; +import 'package:deriv_auth/features/single_entry/core/auth_data.dart'; import 'package:deriv_auth/features/single_entry/features/login/pages/login_page.dart'; import 'package:deriv_auth/features/single_entry/features/signup/pages/verify_email_page.dart'; import 'package:flutter/material.dart'; +/// Sing up page class SignupPage extends StatefulWidget { + /// Constructor for sign up page const SignupPage({super.key}); @override @@ -15,24 +17,24 @@ class _SignupPageState extends State { @override Widget build(BuildContext context) => DerivSignupLayout( authErrorStateHandler: AuthErrorStateHandler(context: context), - signupPageLabel: 'Start trading with Deriv', + signupPageLabel: AuthData().data.signupPageModel.signupPageLable, signupPageDescription: - 'Join over 1 million traders worldwide who loves trading at Deriv.', + AuthData().data.signupPageModel.signupPageDescription, onSocialAuthButtonPressed: (_) {}, onSingupError: (_) {}, - onSingupEmailSent: (email) { - Navigator.pushReplacement( - context, - MaterialPageRoute( - builder: (context) => VerifyEmailPage(email: email), + onSingupEmailSent: (String email) => Navigator.of(context).push( + MaterialPageRoute( + builder: (BuildContext context) => VerifyEmailPage( + email: email, ), - ); - }, + ), + ), onSignupPressed: () {}, - onLoginTapped: () => Navigator.pushReplacement( - context, - MaterialPageRoute( - builder: (context) => const LoginPage(), + isSocialAuthEnabled: + AuthData().data.signupPageModel.isSocialAuthEnabled, + onLoginTapped: () => Navigator.of(context).pushReplacement( + MaterialPageRoute( + builder: (BuildContext context) => const LoginPage(), ), ), ); diff --git a/packages/deriv_auth/lib/features/single_entry/features/signup/pages/verification_done_page.dart b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/verification_done_page.dart index e7b1a42c2..70e34d723 100644 --- a/packages/deriv_auth/lib/features/single_entry/features/signup/pages/verification_done_page.dart +++ b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/verification_done_page.dart @@ -1,23 +1,35 @@ -import 'package:deriv_auth/features/signup/presentation/layouts/deriv_verification_done_layout.dart'; +import 'package:deriv_auth/deriv_auth.dart'; import 'package:deriv_auth/features/single_entry/features/signup/pages/country_selection_page.dart'; import 'package:flutter/material.dart'; +/// Verification done page class VerificationDonePage extends StatelessWidget { - const VerificationDonePage({required this.verificationCode, super.key}); + /// + const VerificationDonePage({ + required this.verificationCode, + super.key, + this.affiliateToken, + }); + /// verification code final String verificationCode; + /// + final String? affiliateToken; + @override - Widget build(BuildContext context) { - return DerivVerificationDoneLayout( - onContinuePressed: () { - Navigator.of(context).push(MaterialPageRoute( - builder: (context) => - CountrySelectionPage(verificationCode: verificationCode), - )); - }, - verificationCode: verificationCode, - affiliateToken: '', - ); - } + Widget build(BuildContext context) => DerivVerificationDoneLayout( + onContinuePressed: () { + Navigator.of(context).push( + MaterialPageRoute( + builder: (BuildContext context) => CountrySelectionPage( + verificationCode: verificationCode, + affiliateToken: affiliateToken, + ), + ), + ); + }, + verificationCode: verificationCode, + affiliateToken: affiliateToken, + ); } diff --git a/packages/deriv_auth/lib/features/single_entry/features/signup/pages/verify_email_page.dart b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/verify_email_page.dart index cbd5a43a5..008bc705f 100644 --- a/packages/deriv_auth/lib/features/single_entry/features/signup/pages/verify_email_page.dart +++ b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/verify_email_page.dart @@ -1,12 +1,12 @@ -import 'dart:async'; - -import 'package:deriv_auth/features/signup/presentation/layouts/deriv_email_not_received_layout.dart'; -import 'package:deriv_auth/features/signup/presentation/layouts/deriv_verify_email_layout.dart'; -import 'package:deriv_auth/features/single_entry/features/signup/pages/verification_done_page.dart'; +import 'package:deriv_auth/deriv_auth.dart'; import 'package:flutter/material.dart'; +/// Verify email page class VerifyEmailPage extends StatefulWidget { + /// Constructor for verify email page const VerifyEmailPage({required this.email, super.key}); + + /// email final String email; @override @@ -17,15 +17,6 @@ class _VerifyEmailPageState extends State { @override void initState() { super.initState(); - - Timer(const Duration(seconds: 3), () { - if (mounted) { - Navigator.of(context).push(MaterialPageRoute( - builder: (context) => - const VerificationDonePage(verificationCode: 'code'), - )); - } - }); } @override @@ -33,13 +24,12 @@ class _VerifyEmailPageState extends State { email: widget.email, onEmailNotReceivedPressed: () => onEmailNotReceivedPressed(context), ); - void onEmailNotReceivedPressed(BuildContext context) { - Navigator.of(context).pushReplacement(MaterialPageRoute( - builder: (context) => DerivEmailNotReceivedLayout( + Navigator.of(context).pushReplacement(MaterialPageRoute( + builder: (BuildContext context) => DerivEmailNotReceivedLayout( onReEnterEmailPressed: () => Navigator.of(context).pushReplacement( - MaterialPageRoute( - builder: (context) => DerivVerifyEmailLayout( + MaterialPageRoute( + builder: (BuildContext context) => DerivVerifyEmailLayout( email: widget.email, onEmailNotReceivedPressed: () => onEmailNotReceivedPressed(context), diff --git a/packages/deriv_auth/lib/features/single_entry/features/signup/repositories/example_signup_repository.dart b/packages/deriv_auth/lib/features/single_entry/features/signup/repositories/example_signup_repository.dart deleted file mode 100644 index ae24ae64c..000000000 --- a/packages/deriv_auth/lib/features/single_entry/features/signup/repositories/example_signup_repository.dart +++ /dev/null @@ -1,17 +0,0 @@ -import 'package:deriv_auth/deriv_auth.dart'; - -class ExampleSignupRepository implements BaseSignupRepository { - @override - Future getClientServerTime() => Future.value(DateTime.now()); - - @override - Future openNewVirtualAccount({ - required NewVirtualAccountRequestModel newVirtualAccountModel, - }) => - Future.value(AccountModel(accountId: '1')); - - @override - Future sendVerificationEmail( - VerifyEmailRequestEntity request) => - Future.value(const VerifyEmailResponseEntity(verifyEmail: true)); -} diff --git a/packages/deriv_auth/lib/features/single_entry/features/signup/repositories/example_referral_repository.dart b/packages/deriv_auth/lib/features/single_entry/features/signup/repositories/referral_repository.dart similarity index 70% rename from packages/deriv_auth/lib/features/single_entry/features/signup/repositories/example_referral_repository.dart rename to packages/deriv_auth/lib/features/single_entry/features/signup/repositories/referral_repository.dart index f59512705..f3a42d877 100644 --- a/packages/deriv_auth/lib/features/single_entry/features/signup/repositories/example_referral_repository.dart +++ b/packages/deriv_auth/lib/features/single_entry/features/signup/repositories/referral_repository.dart @@ -1,6 +1,7 @@ import 'package:deriv_auth/core/services/referral/base_referral_code_service.dart'; -class ExampleReferralRepository implements BaseReferralCodeService { +/// Referral repository +class ReferralRepository implements BaseReferralCodeService { @override Future getReferralToken(String referralCode) => Future.value('${referralCode}Token'); From 11c8aca2042eb0ab86f3cd462927b1422df7471b Mon Sep 17 00:00:00 2001 From: Ahrar Date: Tue, 13 Feb 2024 13:51:14 +0800 Subject: [PATCH 008/162] chore: setting page fist attempt --- .../core/models/setting_page_model.dart | 8 +++ .../settings/pages/settings_page.dart | 53 +++++++++++++++---- 2 files changed, 51 insertions(+), 10 deletions(-) create mode 100644 packages/deriv_auth/lib/features/single_entry/core/models/setting_page_model.dart 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 new file mode 100644 index 000000000..406a19f1f --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/core/models/setting_page_model.dart @@ -0,0 +1,8 @@ +/// Setting page model +class SettingPageModel { + /// Setting page App label + final String appLabel; + + final String appId; + final String endpoint; +} diff --git a/packages/deriv_auth/lib/features/single_entry/features/settings/pages/settings_page.dart b/packages/deriv_auth/lib/features/single_entry/features/settings/pages/settings_page.dart index 70d990683..7d214a172 100644 --- a/packages/deriv_auth/lib/features/single_entry/features/settings/pages/settings_page.dart +++ b/packages/deriv_auth/lib/features/single_entry/features/settings/pages/settings_page.dart @@ -1,8 +1,12 @@ -import 'dart:developer' as logger; import 'package:deriv_auth/deriv_auth.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_deriv_api/services/connection/api_manager/connection_information.dart'; +import 'package:flutter_deriv_api/state/connection/connection_cubit.dart'; +/// Setting page class SettingsPage extends StatefulWidget { + /// Constructor for setting page const SettingsPage({super.key}); @override @@ -12,17 +16,46 @@ class SettingsPage extends StatefulWidget { class _SettingsPageState extends State { @override Widget build(BuildContext context) => DerivSettingLayout( - updateFlavorConfigs: _updateFlavorConfig(), - appLabel: 'appLabel', + updateFlavorConfigs: _updateFlavorConfigs(), + appLabel: 'blanc', saveValues: _saveValues, + appId: PrefService.getString('appId') ?? defaultAppId, + endpoint: PrefService.getString('endpoint') ?? defaultEndpoint, ); -} + Future _saveValues({ + required String endpoint, + required String appId, + }) async { + await PrefService.setString('endpoint', endpoint); + await PrefService.setString('appId', appId); + } -_saveValues({required String appId, required String endpoint}) { - logger.log('appId is $appId'); - logger.log('endpoint is $endpoint'); -} + Future _updateFlavorConfigs() async { + final authEndpoint = generateEndpointUrl( + endpoint: PrefService.getString('endpoint'), + isAuthUrl: true, + ) ?? + defaultAuthEndpoint; + + final endpoint = + generateEndpointUrl(endpoint: PrefService.getString('endpoint')) ?? + defaultEndpoint; + + FlavorConfig.instance.copyWith( + FlavorValues( + endPoint: endpoint, + authEndPoint: authEndpoint, + appId: PrefService.getString('appId')!, + ), + ); -Future _updateFlavorConfig() async { - logger.log('Flavor CONFIG is updated'); + await BlocProvider.of(context).reconnect( + connectionInformation: ConnectionInformation( + appId: FlavorConfig.instance.flavorValues.appId, + brand: 'deriv', + endpoint: FlavorConfig.instance.flavorValues.endPoint!, + authEndpoint: FlavorConfig.instance.flavorValues.authEndPoint!, + ), + ); + } } From dc29784f2f74c34a7a5bf9910b4041adca591e74 Mon Sep 17 00:00:00 2001 From: Ahrar Date: Wed, 14 Feb 2024 13:58:07 +0800 Subject: [PATCH 009/162] feat(deriv_auith): single entry setting page --- .../layouts/deriv_setting_layout.dart | 22 ++++---- .../core/models/auth_entry_model.dart | 5 +- .../single_entry/core/models/models.dart | 1 + .../core/models/setting_page_model.dart | 23 ++++++++- .../settings/pages/settings_page.dart | 51 +++---------------- 5 files changed, 45 insertions(+), 57 deletions(-) diff --git a/packages/deriv_auth/lib/features/setting_page/presentation/layouts/deriv_setting_layout.dart b/packages/deriv_auth/lib/features/setting_page/presentation/layouts/deriv_setting_layout.dart index 9d00ee918..e61f0d754 100644 --- a/packages/deriv_auth/lib/features/setting_page/presentation/layouts/deriv_setting_layout.dart +++ b/packages/deriv_auth/lib/features/setting_page/presentation/layouts/deriv_setting_layout.dart @@ -26,7 +26,8 @@ class DerivSettingLayout extends StatefulWidget { }) : super(key: key); /// Update flavor configurations - final Future updateFlavorConfigs; + final Function({required String endpoint, required String appId}) + updateFlavorConfigs; /// Save values to shared preferences final Function({required String endpoint, required String appId}) saveValues; @@ -75,18 +76,19 @@ class _SettingsPageState extends State { @override Widget build(BuildContext context) => WillPopScope( onWillPop: () async { + final String endpoint = _endpointController.text.isNotEmpty + ? _endpointController.text + : defaultEndpoint; + final String appId = _appIdController.text.isNotEmpty + ? _appIdController.text + : defaultAppId; + // Save Values to shared preferences - widget.saveValues( - endpoint: _endpointController.text.isNotEmpty - ? _endpointController.text - : defaultEndpoint, - appId: _appIdController.text.isNotEmpty - ? _appIdController.text - : defaultAppId, - ); + await widget.saveValues(endpoint: endpoint, appId: appId); // Update Flavor Configurations before dismissing the page - await widget.updateFlavorConfigs; + await widget.updateFlavorConfigs(endpoint: endpoint, appId: appId); + return true; }, child: Scaffold( diff --git a/packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart b/packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart index f3cb4b2ea..77c12be75 100644 --- a/packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart +++ b/packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart @@ -1,5 +1,4 @@ import 'package:deriv_auth/deriv_auth.dart'; -import 'package:deriv_auth/features/single_entry/core/models/signup_page_model.dart'; /// class AuthEntryModel { @@ -9,6 +8,7 @@ class AuthEntryModel { required this.loginPageModel, required this.derivAuthCubit, required this.signupPageModel, + required this.settingPageModel, }); /// GetStartedPage data model @@ -22,4 +22,7 @@ class AuthEntryModel { /// SignupPage data model final SignupPageModel signupPageModel; + + /// SettingPage data model + final SettingPageModel settingPageModel; } diff --git a/packages/deriv_auth/lib/features/single_entry/core/models/models.dart b/packages/deriv_auth/lib/features/single_entry/core/models/models.dart index 6c16661b2..a4ed79042 100644 --- a/packages/deriv_auth/lib/features/single_entry/core/models/models.dart +++ b/packages/deriv_auth/lib/features/single_entry/core/models/models.dart @@ -2,3 +2,4 @@ export 'auth_entry_model.dart'; export 'get_started_page_model.dart'; export 'login_page_model.dart'; export 'signup_page_model.dart'; +export 'setting_page_model.dart'; 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 406a19f1f..d0e8083d0 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,8 +1,27 @@ /// Setting page model class SettingPageModel { + /// Constructor [SettingPageModel] + SettingPageModel({ + required this.appLabel, + required this.appId, + required this.endpoint, + required this.saveValues, + required this.updateFlavorConfigs, + }); + /// Setting page App label final String appLabel; - final String appId; - final String endpoint; + /// application id + final String Function() appId; + + /// end point + final String Function() endpoint; + + /// Save values to shared preferences + final Function({required String endpoint, required String appId}) saveValues; + + /// Update flavor configurations + final Function({required String endpoint, required String appId}) + updateFlavorConfigs; } diff --git a/packages/deriv_auth/lib/features/single_entry/features/settings/pages/settings_page.dart b/packages/deriv_auth/lib/features/single_entry/features/settings/pages/settings_page.dart index 7d214a172..149c3a540 100644 --- a/packages/deriv_auth/lib/features/single_entry/features/settings/pages/settings_page.dart +++ b/packages/deriv_auth/lib/features/single_entry/features/settings/pages/settings_page.dart @@ -1,8 +1,6 @@ import 'package:deriv_auth/deriv_auth.dart'; +import 'package:deriv_auth/features/single_entry/core/auth_data.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:flutter_deriv_api/services/connection/api_manager/connection_information.dart'; -import 'package:flutter_deriv_api/state/connection/connection_cubit.dart'; /// Setting page class SettingsPage extends StatefulWidget { @@ -16,46 +14,11 @@ class SettingsPage extends StatefulWidget { class _SettingsPageState extends State { @override Widget build(BuildContext context) => DerivSettingLayout( - updateFlavorConfigs: _updateFlavorConfigs(), - appLabel: 'blanc', - saveValues: _saveValues, - appId: PrefService.getString('appId') ?? defaultAppId, - endpoint: PrefService.getString('endpoint') ?? defaultEndpoint, + updateFlavorConfigs: + AuthData().data.settingPageModel.updateFlavorConfigs, + appLabel: AuthData().data.settingPageModel.appLabel, + saveValues: AuthData().data.settingPageModel.saveValues, + appId: AuthData().data.settingPageModel.appId.call(), + endpoint: AuthData().data.settingPageModel.endpoint.call(), ); - Future _saveValues({ - required String endpoint, - required String appId, - }) async { - await PrefService.setString('endpoint', endpoint); - await PrefService.setString('appId', appId); - } - - Future _updateFlavorConfigs() async { - final authEndpoint = generateEndpointUrl( - endpoint: PrefService.getString('endpoint'), - isAuthUrl: true, - ) ?? - defaultAuthEndpoint; - - final endpoint = - generateEndpointUrl(endpoint: PrefService.getString('endpoint')) ?? - defaultEndpoint; - - FlavorConfig.instance.copyWith( - FlavorValues( - endPoint: endpoint, - authEndPoint: authEndpoint, - appId: PrefService.getString('appId')!, - ), - ); - - await BlocProvider.of(context).reconnect( - connectionInformation: ConnectionInformation( - appId: FlavorConfig.instance.flavorValues.appId, - brand: 'deriv', - endpoint: FlavorConfig.instance.flavorValues.endPoint!, - authEndpoint: FlavorConfig.instance.flavorValues.authEndPoint!, - ), - ); - } } From f7930d66880d2d091959646dd928e79189ce5704 Mon Sep 17 00:00:00 2001 From: Ahrar Date: Wed, 14 Feb 2024 16:51:03 +0800 Subject: [PATCH 010/162] feat(deriv_auth): single entry reset password and merge conflicts --- packages/deriv_auth/lib/core/core.dart | 1 + .../deriv_auth/lib/core/helpers/helpers.dart | 1 + .../deriv_auth/lib/core/states/states.dart | 1 + .../layouts/deriv_login_layout.dart | 2 -- .../layouts/deriv_signup_layout.dart | 3 +- .../core/models/auth_entry_model.dart | 4 +++ .../core/models/login_page_model.dart | 15 +++++++++- .../single_entry/core/models/models.dart | 1 + .../core/models/reset_pass_page_model.dart | 17 +++++++++++ .../core/models/signup_page_model.dart | 28 +++++++++++++++++++ .../features/login/pages/login_page.dart | 4 +++ .../pages/choose_new_password_page.dart | 20 +++++++------ .../features/signup/pages/signup_page.dart | 12 ++++++-- 13 files changed, 93 insertions(+), 16 deletions(-) create mode 100644 packages/deriv_auth/lib/features/single_entry/core/models/reset_pass_page_model.dart diff --git a/packages/deriv_auth/lib/core/core.dart b/packages/deriv_auth/lib/core/core.dart index 6a88d93ab..d90ac1ac4 100644 --- a/packages/deriv_auth/lib/core/core.dart +++ b/packages/deriv_auth/lib/core/core.dart @@ -13,3 +13,4 @@ export 'services/referral/models/my_affiliate_referral_code_request_model.dart'; export 'services/token/models/enums.dart'; export 'services/token/services/deriv_token_service.dart'; export 'states/states.dart'; +export 'helpers/helpers.dart'; diff --git a/packages/deriv_auth/lib/core/helpers/helpers.dart b/packages/deriv_auth/lib/core/helpers/helpers.dart index ab5f4b441..bc7dc3ce0 100644 --- a/packages/deriv_auth/lib/core/helpers/helpers.dart +++ b/packages/deriv_auth/lib/core/helpers/helpers.dart @@ -2,3 +2,4 @@ export 'account_helpers.dart'; export 'bool_helper.dart'; export 'date_time_helper.dart'; export 'number_helper.dart'; +export 'semantic_labels.dart'; diff --git a/packages/deriv_auth/lib/core/states/states.dart b/packages/deriv_auth/lib/core/states/states.dart index 7545c9d18..3fcce922f 100644 --- a/packages/deriv_auth/lib/core/states/states.dart +++ b/packages/deriv_auth/lib/core/states/states.dart @@ -1,2 +1,3 @@ export 'auth_error_state_mapper.dart'; export 'auth_error_state_handler.dart'; +export 'auth_state_listener.dart'; 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 298a6ac93..cebec3622 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,6 +1,4 @@ import 'dart:async'; - -import 'package:deriv_auth/core/helpers/semantic_labels.dart'; import 'package:deriv_auth/deriv_auth.dart'; import 'package:deriv_theme/deriv_theme.dart'; import 'package:deriv_ui/deriv_ui.dart'; diff --git a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_signup_layout.dart b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_signup_layout.dart index 8b7a95d0e..c466189ed 100644 --- a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_signup_layout.dart +++ b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_signup_layout.dart @@ -1,5 +1,3 @@ -import 'package:deriv_auth/core/helpers/semantic_labels.dart'; -import 'package:deriv_auth/core/states/auth_state_listener.dart'; import 'package:deriv_auth/deriv_auth.dart'; import 'package:deriv_theme/deriv_theme.dart'; import 'package:deriv_ui/deriv_ui.dart'; @@ -137,6 +135,7 @@ class _DerivSignupLayoutState extends State { socialAuthStateHandler: widget.socialAuthStateHandler, redirectURL: widget.redirectURL, onWebViewError: widget.onWebViewError, + onPressed: widget.onSocialAuthButtonPressed, ), if (widget.isSocialAuthEnabled) const SizedBox(height: ThemeProvider.margin24), diff --git a/packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart b/packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart index 77c12be75..274692cab 100644 --- a/packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart +++ b/packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart @@ -9,6 +9,7 @@ class AuthEntryModel { required this.derivAuthCubit, required this.signupPageModel, required this.settingPageModel, + required this.resetPassPageModel, }); /// GetStartedPage data model @@ -25,4 +26,7 @@ class AuthEntryModel { /// SettingPage data model final SettingPageModel settingPageModel; + + /// ResetPassPage data model + final ResetPassPageModel resetPassPageModel; } diff --git a/packages/deriv_auth/lib/features/single_entry/core/models/login_page_model.dart b/packages/deriv_auth/lib/features/single_entry/core/models/login_page_model.dart index a93b42214..bfb98d9ef 100644 --- a/packages/deriv_auth/lib/features/single_entry/core/models/login_page_model.dart +++ b/packages/deriv_auth/lib/features/single_entry/core/models/login_page_model.dart @@ -8,6 +8,9 @@ class LoginPageModel { required this.onSocialAuthButtonPressed, required this.welcomeLabel, required this.greetingLabel, + required this.socialAuthStateHandler, + required this.redirectURL, + required this.onWebViewError, this.isForgotPasswordEnabled = true, this.isCreateAccountEnabled = true, this.isSocialAuthEnabled = true, @@ -25,7 +28,8 @@ class LoginPageModel { final Function(DerivAuthLoggedInState) onLoggedIn; /// Callback to be called when social auth button is tapped. - final void Function(SocialAuthProvider) onSocialAuthButtonPressed; + /// Give access to [SocialAuthDto] for 2FA. + final SocialAuthCallback? onSocialAuthButtonPressed; /// Welcome text to be displayed on login page. final String welcomeLabel; @@ -41,4 +45,13 @@ class LoginPageModel { /// Whether to display create account section. final bool isCreateAccountEnabled; + + /// Social auth state handler. + final Function(SocialAuthState) socialAuthStateHandler; + + /// Redirect URL for social auth. + final String redirectURL; + + /// Callback for web view error. + final Function(String) onWebViewError; } diff --git a/packages/deriv_auth/lib/features/single_entry/core/models/models.dart b/packages/deriv_auth/lib/features/single_entry/core/models/models.dart index a4ed79042..4aea9f511 100644 --- a/packages/deriv_auth/lib/features/single_entry/core/models/models.dart +++ b/packages/deriv_auth/lib/features/single_entry/core/models/models.dart @@ -3,3 +3,4 @@ export 'get_started_page_model.dart'; export 'login_page_model.dart'; export 'signup_page_model.dart'; export 'setting_page_model.dart'; +export 'reset_pass_page_model.dart'; diff --git a/packages/deriv_auth/lib/features/single_entry/core/models/reset_pass_page_model.dart b/packages/deriv_auth/lib/features/single_entry/core/models/reset_pass_page_model.dart new file mode 100644 index 000000000..e68916f6f --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/core/models/reset_pass_page_model.dart @@ -0,0 +1,17 @@ +import 'package:deriv_auth/deriv_auth.dart'; +import 'package:flutter/foundation.dart' show VoidCallback; + +/// Reset password page model +class ResetPassPageModel { + /// Constructor [ResetPassPageModel] + const ResetPassPageModel({ + required this.onResetPassError, + this.onResetPassSucceed, + }); + + /// Callback to be called when reset pass fails. + final ResetPassErrorCallback onResetPassError; + + /// Callback to be called when reset pass succeeds. + final VoidCallback? onResetPassSucceed; +} diff --git a/packages/deriv_auth/lib/features/single_entry/core/models/signup_page_model.dart b/packages/deriv_auth/lib/features/single_entry/core/models/signup_page_model.dart index 10f12dc06..a182228c8 100644 --- a/packages/deriv_auth/lib/features/single_entry/core/models/signup_page_model.dart +++ b/packages/deriv_auth/lib/features/single_entry/core/models/signup_page_model.dart @@ -1,3 +1,6 @@ +import 'package:deriv_auth/deriv_auth.dart'; +import 'package:flutter/foundation.dart' show VoidCallback; + /// Sign-up page model class SignupPageModel { /// Constructor [SignupPageModel] @@ -5,7 +8,13 @@ class SignupPageModel { required this.verificationCode, required this.signupPageLable, required this.signupPageDescription, + required this.onSingupError, required this.isSocialAuthEnabled, + required this.socialAuthStateHandler, + required this.redirectURL, + required this.onWebViewError, + this.onSignupPressed, + this.onSocialAuthButtonPressed, this.affiliateToken, }); @@ -15,6 +24,12 @@ class SignupPageModel { /// affiliate token final String? affiliateToken; + /// Callback to be called when signup button is pressed. + final VoidCallback? onSignupPressed; + + /// Callback to be called when signup error occurs. + final Function(DerivSignupErrorState) onSingupError; + /// sing-up page label final String signupPageLable; @@ -23,4 +38,17 @@ class SignupPageModel { /// is social auth enabled final bool isSocialAuthEnabled; + + /// Social auth state handler. + final Function(SocialAuthState) socialAuthStateHandler; + + /// Redirect URL for social auth. + final String redirectURL; + + /// Callback for web view error. + final Function(String) onWebViewError; + + /// Callback to be called when social auth button is tapped. + /// Give access to [SocialAuthDto] for 2FA. + final SocialAuthCallback? onSocialAuthButtonPressed; } diff --git a/packages/deriv_auth/lib/features/single_entry/features/login/pages/login_page.dart b/packages/deriv_auth/lib/features/single_entry/features/login/pages/login_page.dart index 44f80ce93..7df28097f 100644 --- a/packages/deriv_auth/lib/features/single_entry/features/login/pages/login_page.dart +++ b/packages/deriv_auth/lib/features/single_entry/features/login/pages/login_page.dart @@ -50,5 +50,9 @@ class _LoginPageState extends State { ), onSocialAuthButtonPressed: AuthData().data.loginPageModel.onSocialAuthButtonPressed, + socialAuthStateHandler: + AuthData().data.loginPageModel.socialAuthStateHandler, + redirectURL: AuthData().data.loginPageModel.redirectURL, + onWebViewError: AuthData().data.loginPageModel.onWebViewError, ); } diff --git a/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/choose_new_password_page.dart b/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/choose_new_password_page.dart index aa8407a83..7b1ed804b 100644 --- a/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/choose_new_password_page.dart +++ b/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/choose_new_password_page.dart @@ -1,4 +1,5 @@ import 'package:deriv_auth/deriv_auth.dart'; +import 'package:deriv_auth/features/single_entry/core/auth_data.dart'; import 'package:deriv_auth/features/single_entry/features/reset_pass/pages/reset_pass_success_page.dart'; import 'package:flutter/material.dart'; @@ -13,13 +14,16 @@ class ChooseNewPasswordPage extends StatelessWidget { @override Widget build(BuildContext context) => DerivChooseNewPassLayout( token: token, - onResetPassSucceed: () { - Navigator.of(context).push( - MaterialPageRoute( - builder: (BuildContext context) => const ResetPassSuccessPage(), - ), - ); - }, - onResetPassError: (_) {}, + onResetPassSucceed: + AuthData().data.resetPassPageModel.onResetPassSucceed ?? + () { + Navigator.of(context).push( + MaterialPageRoute( + builder: (BuildContext context) => + const ResetPassSuccessPage(), + ), + ); + }, + onResetPassError: AuthData().data.resetPassPageModel.onResetPassError, ); } diff --git a/packages/deriv_auth/lib/features/single_entry/features/signup/pages/signup_page.dart b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/signup_page.dart index f3f209cb3..712b8b31b 100644 --- a/packages/deriv_auth/lib/features/single_entry/features/signup/pages/signup_page.dart +++ b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/signup_page.dart @@ -3,6 +3,7 @@ import 'package:deriv_auth/features/single_entry/core/auth_data.dart'; import 'package:deriv_auth/features/single_entry/features/login/pages/login_page.dart'; import 'package:deriv_auth/features/single_entry/features/signup/pages/verify_email_page.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_deriv_api/api/response/app_update_response_result.dart'; /// Sing up page class SignupPage extends StatefulWidget { @@ -20,8 +21,9 @@ class _SignupPageState extends State { signupPageLabel: AuthData().data.signupPageModel.signupPageLable, signupPageDescription: AuthData().data.signupPageModel.signupPageDescription, - onSocialAuthButtonPressed: (_) {}, - onSingupError: (_) {}, + onSocialAuthButtonPressed: + AuthData().data.signupPageModel.onSocialAuthButtonPressed, + onSingupError: AuthData().data.signupPageModel.onSingupError, onSingupEmailSent: (String email) => Navigator.of(context).push( MaterialPageRoute( builder: (BuildContext context) => VerifyEmailPage( @@ -29,7 +31,7 @@ class _SignupPageState extends State { ), ), ), - onSignupPressed: () {}, + onSignupPressed: AuthData().data.signupPageModel.onSignupPressed, isSocialAuthEnabled: AuthData().data.signupPageModel.isSocialAuthEnabled, onLoginTapped: () => Navigator.of(context).pushReplacement( @@ -37,5 +39,9 @@ class _SignupPageState extends State { builder: (BuildContext context) => const LoginPage(), ), ), + socialAuthStateHandler: + AuthData().data.signupPageModel.socialAuthStateHandler, + redirectURL: AuthData().data.signupPageModel.redirectURL, + onWebViewError: AuthData().data.signupPageModel.onWebViewError, ); } From 5e62ee117adffc744048dfe6821df46c7262a760 Mon Sep 17 00:00:00 2001 From: Ahrar Date: Mon, 19 Feb 2024 15:12:11 +0800 Subject: [PATCH 011/162] chore(deriv_auth): code review comments add docs and minor changes --- .../single_entry/core/models/auth_entry_model.dart | 4 ++-- .../core/models/get_started_page_model.dart | 10 +++++----- .../core/models/reset_pass_page_model.dart | 8 ++++++++ .../get_started/pages/get_started_page.dart | 10 ++++------ .../signup/pages/country_selection_page.dart | 14 ++------------ .../features/signup/pages/set_password_page.dart | 3 ++- .../features/signup/pages/signup_page.dart | 1 - .../features/signup/pages/verify_email_page.dart | 1 + .../single_entry/pages/auth_entry_page.dart | 4 ++-- 9 files changed, 26 insertions(+), 29 deletions(-) diff --git a/packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart b/packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart index 274692cab..23b2a5336 100644 --- a/packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart +++ b/packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart @@ -1,8 +1,8 @@ import 'package:deriv_auth/deriv_auth.dart'; -/// +/// Auth Entry Model class class AuthEntryModel { - /// + /// Constructor [AuthEntryModel] const AuthEntryModel({ required this.getStartedPage, required this.loginPageModel, diff --git a/packages/deriv_auth/lib/features/single_entry/core/models/get_started_page_model.dart b/packages/deriv_auth/lib/features/single_entry/core/models/get_started_page_model.dart index 574bf0a55..1bf244b2a 100644 --- a/packages/deriv_auth/lib/features/single_entry/core/models/get_started_page_model.dart +++ b/packages/deriv_auth/lib/features/single_entry/core/models/get_started_page_model.dart @@ -1,20 +1,20 @@ import 'package:deriv_auth/deriv_auth.dart'; -/// +/// Get Started Page Model class GetStartedPageModel { - /// + /// Constructor [GetStartedPageModel] const GetStartedPageModel({ required this.slides, required this.appLogoIconPath, required this.backgroundImagePath, }); - /// + /// List of Deriv Get Started page Slides final List slides; - /// + /// Logo icon path final String appLogoIconPath; - /// + /// Background image path final String backgroundImagePath; } diff --git a/packages/deriv_auth/lib/features/single_entry/core/models/reset_pass_page_model.dart b/packages/deriv_auth/lib/features/single_entry/core/models/reset_pass_page_model.dart index e68916f6f..e7cca15bb 100644 --- a/packages/deriv_auth/lib/features/single_entry/core/models/reset_pass_page_model.dart +++ b/packages/deriv_auth/lib/features/single_entry/core/models/reset_pass_page_model.dart @@ -6,6 +6,8 @@ class ResetPassPageModel { /// Constructor [ResetPassPageModel] const ResetPassPageModel({ required this.onResetPassError, + required this.residences, + required this.residence, this.onResetPassSucceed, }); @@ -14,4 +16,10 @@ class ResetPassPageModel { /// Callback to be called when reset pass succeeds. final VoidCallback? onResetPassSucceed; + + /// List of residences to be shown. + final Future> residences; + + /// Residence + final String residence; } 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 17d2af0c0..b09669843 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 @@ -5,25 +5,23 @@ import 'package:deriv_auth/features/single_entry/features/settings/pages/setting import 'package:deriv_auth/features/single_entry/features/signup/pages/signup_page.dart'; import 'package:flutter/material.dart'; -/// +/// Get started page class GetStartedPage extends StatelessWidget { - /// + /// Constructor [GetStartedPage] const GetStartedPage(); - /// - @override Widget build(BuildContext context) => DerivGetStartedLayout( slides: AuthData().data.getStartedPage.slides, appLogoIconPath: AuthData().data.getStartedPage.appLogoIconPath, backgroundImagePath: AuthData().data.getStartedPage.backgroundImagePath, onLoginTapped: () => Navigator.of(context).push( - MaterialPageRoute( + MaterialPageRoute( builder: (BuildContext context) => const LoginPage(), ), ), onSignupTapped: () => Navigator.of(context).push( - MaterialPageRoute( + MaterialPageRoute( builder: (BuildContext context) => const SignupPage(), ), ), diff --git a/packages/deriv_auth/lib/features/single_entry/features/signup/pages/country_selection_page.dart b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/country_selection_page.dart index 900219243..a9b0f03fe 100644 --- a/packages/deriv_auth/lib/features/single_entry/features/signup/pages/country_selection_page.dart +++ b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/country_selection_page.dart @@ -1,4 +1,5 @@ import 'package:deriv_auth/deriv_auth.dart'; +import 'package:deriv_auth/features/single_entry/core/auth_data.dart'; import 'package:deriv_auth/features/single_entry/features/signup/pages/set_password_page.dart'; import 'package:flutter/material.dart'; @@ -29,18 +30,7 @@ class CountrySelectionPage extends StatelessWidget { ), ); }, - residences: Future.value([ - const DerivResidenceModel( - code: 'ID', - name: 'Indonesia', - isDisabled: false, - ), - const DerivResidenceModel( - code: 'UK', - name: 'England', - isDisabled: true, - ), - ]), + residences: AuthData().data.resetPassPageModel.residences, verificationCode: verificationCode, affiliateToken: affiliateToken, ); diff --git a/packages/deriv_auth/lib/features/single_entry/features/signup/pages/set_password_page.dart b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/set_password_page.dart index 727c26be2..7d373daf9 100644 --- a/packages/deriv_auth/lib/features/single_entry/features/signup/pages/set_password_page.dart +++ b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/set_password_page.dart @@ -1,4 +1,5 @@ import 'package:deriv_auth/deriv_auth.dart'; +import 'package:deriv_auth/features/single_entry/core/auth_data.dart'; import 'package:deriv_auth/features/single_entry/features/signup/pages/country_selection_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -36,7 +37,7 @@ class SetPasswordPage extends StatelessWidget { ), ), ), - residence: 'id', + residence: AuthData().data.resetPassPageModel.residence, verificationCode: verificationCode, ); } diff --git a/packages/deriv_auth/lib/features/single_entry/features/signup/pages/signup_page.dart b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/signup_page.dart index 712b8b31b..0a13d63fd 100644 --- a/packages/deriv_auth/lib/features/single_entry/features/signup/pages/signup_page.dart +++ b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/signup_page.dart @@ -3,7 +3,6 @@ import 'package:deriv_auth/features/single_entry/core/auth_data.dart'; import 'package:deriv_auth/features/single_entry/features/login/pages/login_page.dart'; import 'package:deriv_auth/features/single_entry/features/signup/pages/verify_email_page.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_deriv_api/api/response/app_update_response_result.dart'; /// Sing up page class SignupPage extends StatefulWidget { diff --git a/packages/deriv_auth/lib/features/single_entry/features/signup/pages/verify_email_page.dart b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/verify_email_page.dart index 008bc705f..09cacf63e 100644 --- a/packages/deriv_auth/lib/features/single_entry/features/signup/pages/verify_email_page.dart +++ b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/verify_email_page.dart @@ -24,6 +24,7 @@ class _VerifyEmailPageState extends State { email: widget.email, onEmailNotReceivedPressed: () => onEmailNotReceivedPressed(context), ); + void onEmailNotReceivedPressed(BuildContext context) { Navigator.of(context).pushReplacement(MaterialPageRoute( builder: (BuildContext context) => DerivEmailNotReceivedLayout( diff --git a/packages/deriv_auth/lib/features/single_entry/pages/auth_entry_page.dart b/packages/deriv_auth/lib/features/single_entry/pages/auth_entry_page.dart index a5409e9b3..f15fcaa86 100644 --- a/packages/deriv_auth/lib/features/single_entry/pages/auth_entry_page.dart +++ b/packages/deriv_auth/lib/features/single_entry/pages/auth_entry_page.dart @@ -3,9 +3,9 @@ import 'package:deriv_auth/features/single_entry/core/auth_data.dart'; import 'package:deriv_auth/features/single_entry/features/get_started/pages/get_started_page.dart'; import 'package:flutter/material.dart'; -/// +/// Auth entry page for single entry class AuthEntryPage extends StatelessWidget { - /// + /// Constructor [AuthEntryPage] AuthEntryPage(AuthEntryModel entryData) { AuthData().data = entryData; } From fac89047f0d03c56358518e37fa3ae6318cad1f0 Mon Sep 17 00:00:00 2001 From: Ahrar Date: Thu, 22 Feb 2024 11:43:08 +0800 Subject: [PATCH 012/162] chore(deriv_auth): change residence to userResidence --- .../single_entry/core/models/reset_pass_page_model.dart | 6 +++--- .../features/signup/pages/set_password_page.dart | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/deriv_auth/lib/features/single_entry/core/models/reset_pass_page_model.dart b/packages/deriv_auth/lib/features/single_entry/core/models/reset_pass_page_model.dart index e7cca15bb..b19e0dcc7 100644 --- a/packages/deriv_auth/lib/features/single_entry/core/models/reset_pass_page_model.dart +++ b/packages/deriv_auth/lib/features/single_entry/core/models/reset_pass_page_model.dart @@ -7,7 +7,7 @@ class ResetPassPageModel { const ResetPassPageModel({ required this.onResetPassError, required this.residences, - required this.residence, + required this.userResidence, this.onResetPassSucceed, }); @@ -20,6 +20,6 @@ class ResetPassPageModel { /// List of residences to be shown. final Future> residences; - /// Residence - final String residence; + /// User residence like 'id' + final String userResidence; } diff --git a/packages/deriv_auth/lib/features/single_entry/features/signup/pages/set_password_page.dart b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/set_password_page.dart index 7d373daf9..6950bcdb3 100644 --- a/packages/deriv_auth/lib/features/single_entry/features/signup/pages/set_password_page.dart +++ b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/set_password_page.dart @@ -37,7 +37,7 @@ class SetPasswordPage extends StatelessWidget { ), ), ), - residence: AuthData().data.resetPassPageModel.residence, + residence: AuthData().data.resetPassPageModel.userResidence, verificationCode: verificationCode, ); } From 59278c7321f69c8f3c1f63a0973efdb5f01ed4f9 Mon Sep 17 00:00:00 2001 From: Ahrar Date: Mon, 26 Feb 2024 14:01:17 +0800 Subject: [PATCH 013/162] doc(deriv_auth): single entry doc and fix error handling --- .../layouts/deriv_choose_new_pass_layout.dart | 5 +- .../layouts/deriv_reset_pass_layout.dart | 7 +- .../lib/features/single_entry/README.md | 86 +++++++++++++++++++ .../reset_pass/pages/reset_pass_page.dart | 10 +-- 4 files changed, 96 insertions(+), 12 deletions(-) create mode 100644 packages/deriv_auth/lib/features/single_entry/README.md diff --git a/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_choose_new_pass_layout.dart b/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_choose_new_pass_layout.dart index 4ecaf102e..68dafc6cf 100644 --- a/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_choose_new_pass_layout.dart +++ b/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_choose_new_pass_layout.dart @@ -60,8 +60,9 @@ class _DerivChooseNewPassLayoutState extends State { widget.onResetPassSucceed(); } else if (state is DerivResetPassErrorState) { widget.onResetPassError( - error: state.errorMessage, - isLinkExpired: state.isLinkExpired); + error: state.errorMessage, + isLinkExpired: state.isLinkExpired, + ); } }, child: _buildChooseNewPassSection(context), diff --git a/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_reset_pass_layout.dart b/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_reset_pass_layout.dart index 9dc078629..e5406a496 100644 --- a/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_reset_pass_layout.dart +++ b/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_reset_pass_layout.dart @@ -18,7 +18,7 @@ class DerivResetPassLayout extends StatefulWidget { }) : super(key: key); /// Callback to be called when reset pass fails. - final Function(String?) onResetPassError; + final ResetPassErrorCallback onResetPassError; @override State createState() => _DerivResetPassLayoutState(); @@ -57,7 +57,10 @@ class _DerivResetPassLayoutState extends State { curve: Curves.easeInOut, ); } else if (state is DerivResetPassErrorState) { - widget.onResetPassError(state.errorMessage); + widget.onResetPassError( + error: state.errorMessage, + isLinkExpired: state.isLinkExpired, + ); } }, child: PageView( diff --git a/packages/deriv_auth/lib/features/single_entry/README.md b/packages/deriv_auth/lib/features/single_entry/README.md new file mode 100644 index 000000000..a595a6bfb --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/README.md @@ -0,0 +1,86 @@ +## Single Entry: + +Single entry will enable you to just call one Widget and get the entire Authentication flow
+ +#### Example: + +```Dart +AuthEntryPage( + AuthEntryModel( + getStartedPage: GetStartedPageModel( + slides: [ + DerivGetStartedSlideModel( + imagePath: 'lib/auth/assets/images/charts.svg', + supportingText: 'Charts', + ), + DerivGetStartedSlideModel( + imagePath: 'lib/auth/assets/images/live_chat.svg', + supportingText: 'Live Chat', + ), + DerivGetStartedSlideModel( + imagePath: 'lib/auth/assets/images/markets.svg', + supportingText: 'Markets', + ), + ], + appLogoIconPath: + 'lib/auth/assets/images/ic_logo_extended.svg', + backgroundImagePath: 'lib/auth/assets/images/triangles.svg', + ), + loginPageModel: LoginPageModel( + welcomeLabel: 'Welcome back testing!', + greetingLabel: + 'Log in to your Deriv account to start trading and investing.', + onLoggedIn: (_) => HomePageRoute().go(context), + authErrorStateHandler: + AuthErrorStateHandler(context: context), + onLoginError: (_) {}, + onSocialAuthButtonPressed: (_) {}, + isSocialAuthEnabled: false, + socialAuthStateHandler: (SocialAuthState) {}, + redirectURL: '', + onWebViewError: (String) {}, + ), + derivAuthCubit: BlocProvider.of(context), + signupPageModel: SignupPageModel( + verificationCode: '', + signupPageLable: 'Start trading with Deriv', + signupPageDescription: + 'Join over 1 million traders worldwide who loves trading at Deriv.', + isSocialAuthEnabled: false, + onSingupError: (DerivSignupErrorState) {}, + socialAuthStateHandler: (SocialAuthState) {}, + redirectURL: '', + onWebViewError: (String) {}, + ), + settingPageModel: SettingPageModel( + appLabel: 'dblanc', + appId: () => PrefService.getString('appId') ?? defaultAppId, + endpoint: () => + PrefService.getString('endpoint') ?? defaultEndpoint, + saveValues: _saveValues, + updateFlavorConfigs: _updateFlavorConfigs, + ), + resetPassPageModel: ResetPassPageModel( + onResetPassSucceed: () {}, + onResetPassError: ({ + required bool isLinkExpired, + String? error, + }) {}, + residences: Future.value([ + const DerivResidenceModel( + isDisabled: false, + name: 'Indonecsia', + code: 'ID', + ), + const DerivResidenceModel( + isDisabled: true, + name: 'England', + code: 'UK', + ), + ]), + userResidence: 'id', + ), + ), + ), + +``` diff --git a/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/reset_pass_page.dart b/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/reset_pass_page.dart index 24200e4ef..0c0bcf3c7 100644 --- a/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/reset_pass_page.dart +++ b/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/reset_pass_page.dart @@ -1,5 +1,5 @@ import 'package:deriv_auth/deriv_auth.dart'; -import 'package:deriv_ui/deriv_ui.dart'; +import 'package:deriv_auth/features/single_entry/core/auth_data.dart'; import 'package:flutter/material.dart'; /// Reset password page @@ -14,12 +14,6 @@ class ResetPassPage extends StatefulWidget { class _ResetPasswordPageState extends State { @override Widget build(BuildContext context) => DerivResetPassLayout( - onResetPassError: (String? errorMessage) { - showErrorDialog( - context: context, - errorMessage: errorMessage, - actionLabel: 'okay', - ); - }, + onResetPassError: AuthData().data.resetPassPageModel.onResetPassError, ); } From d4eb573eb7545d423031240a5bcc9f3af71075ff Mon Sep 17 00:00:00 2001 From: Ahrar Date: Mon, 26 Feb 2024 14:07:19 +0800 Subject: [PATCH 014/162] chore(deriv_auth): fixing the deriv reset pass layout test --- .../layouts/deriv_reset_pass_layout_test.dart | 31 ++++++++++++++----- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/packages/deriv_auth/test/features/reset_password/presentation/layouts/deriv_reset_pass_layout_test.dart b/packages/deriv_auth/test/features/reset_password/presentation/layouts/deriv_reset_pass_layout_test.dart index 30c43f2a3..b2e69bca5 100644 --- a/packages/deriv_auth/test/features/reset_password/presentation/layouts/deriv_reset_pass_layout_test.dart +++ b/packages/deriv_auth/test/features/reset_password/presentation/layouts/deriv_reset_pass_layout_test.dart @@ -1,7 +1,6 @@ // ignore_for_file: always_specify_types import 'package:deriv_auth/deriv_auth.dart'; -import 'package:deriv_auth/features/reset_password/presentation/layouts/deriv_reset_pass_layout.dart'; import 'package:deriv_ui/deriv_ui.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -32,7 +31,10 @@ void main() { BlocProvider.value( value: mockResetPassCubit, child: DerivResetPassLayout( - onResetPassError: (String? error) {}, + onResetPassError: ({ + required bool isLinkExpired, + String? error, + }) {}, ), ), ); @@ -53,7 +55,10 @@ void main() { BlocProvider.value( value: mockResetPassCubit, child: DerivResetPassLayout( - onResetPassError: (String? error) {}, + onResetPassError: ({ + required bool isLinkExpired, + String? error, + }) {}, ), ), ); @@ -77,7 +82,10 @@ void main() { BlocProvider.value( value: mockResetPassCubit, child: DerivResetPassLayout( - onResetPassError: (String? error) {}, + onResetPassError: ({ + required bool isLinkExpired, + String? error, + }) {}, ), ), ); @@ -102,7 +110,10 @@ void main() { BlocProvider.value( value: mockResetPassCubit, child: DerivResetPassLayout( - onResetPassError: (String? error) {}, + onResetPassError: ({ + required bool isLinkExpired, + String? error, + }) {}, ), ), ); @@ -132,7 +143,10 @@ void main() { BlocProvider.value( value: mockResetPassCubit, child: DerivResetPassLayout( - onResetPassError: (String? error) {}, + onResetPassError: ({ + required bool isLinkExpired, + String? error, + }) {}, ), ), ); @@ -162,7 +176,10 @@ void main() { BlocProvider.value( value: mockResetPassCubit, child: DerivResetPassLayout( - onResetPassError: (String? error) { + onResetPassError: ({ + required bool isLinkExpired, + String? error, + }) { onResetPassErrorCalled = true; }, ), From e96c81278999fa2dfae57e6adf5785bb82a51fe3 Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Mon, 26 Feb 2024 18:13:57 +0400 Subject: [PATCH 015/162] feat(deriv_auth): added deriv_passkeys to deriv_auth --- packages/deriv_auth/analysis_options.yaml | 2 - packages/deriv_auth/assets/icons/ic_apple.svg | 6 +- .../deriv_auth/assets/icons/ic_facebook.svg | 7 +-- .../deriv_auth/assets/icons/ic_google.svg | 11 ++-- .../ios/Flutter/AppFrameworkInfo.plist | 2 +- packages/deriv_auth/example/ios/Podfile | 2 +- packages/deriv_auth/example/ios/Podfile.lock | 47 +++++++++----- .../ios/Runner.xcodeproj/project.pbxproj | 8 +-- .../xcshareddata/xcschemes/Runner.xcscheme | 2 +- .../deriv_auth_connection_info.dart | 11 ++++ packages/deriv_auth/example/lib/main.dart | 33 +++++++++- packages/deriv_auth/example/pubspec.yaml | 21 +++++++ .../core/extensions/string_extensions.dart | 6 ++ .../widgets/deriv_social_auth_panel.dart | 62 +++++++++++++------ packages/deriv_auth/pubspec.yaml | 17 +++++ 15 files changed, 180 insertions(+), 57 deletions(-) create mode 100644 packages/deriv_auth/example/lib/features/social_auth/deriv_auth_connection_info.dart diff --git a/packages/deriv_auth/analysis_options.yaml b/packages/deriv_auth/analysis_options.yaml index e2bfedad3..fd638b40c 100644 --- a/packages/deriv_auth/analysis_options.yaml +++ b/packages/deriv_auth/analysis_options.yaml @@ -1,6 +1,4 @@ analyzer: - exclude: - - example/** errors: todo: ignore missing_required_param: warning diff --git a/packages/deriv_auth/assets/icons/ic_apple.svg b/packages/deriv_auth/assets/icons/ic_apple.svg index 34181e5d0..c4d2a029c 100644 --- a/packages/deriv_auth/assets/icons/ic_apple.svg +++ b/packages/deriv_auth/assets/icons/ic_apple.svg @@ -1,4 +1,4 @@ - - - + + + diff --git a/packages/deriv_auth/assets/icons/ic_facebook.svg b/packages/deriv_auth/assets/icons/ic_facebook.svg index 65b214b79..cb9d842fd 100644 --- a/packages/deriv_auth/assets/icons/ic_facebook.svg +++ b/packages/deriv_auth/assets/icons/ic_facebook.svg @@ -1,5 +1,4 @@ - - - - + + + diff --git a/packages/deriv_auth/assets/icons/ic_google.svg b/packages/deriv_auth/assets/icons/ic_google.svg index 4759de29f..8c0cc5a9d 100644 --- a/packages/deriv_auth/assets/icons/ic_google.svg +++ b/packages/deriv_auth/assets/icons/ic_google.svg @@ -1,7 +1,6 @@ - - - - - - + + + + + diff --git a/packages/deriv_auth/example/ios/Flutter/AppFrameworkInfo.plist b/packages/deriv_auth/example/ios/Flutter/AppFrameworkInfo.plist index 9625e105d..7c5696400 100644 --- a/packages/deriv_auth/example/ios/Flutter/AppFrameworkInfo.plist +++ b/packages/deriv_auth/example/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 11.0 + 12.0 diff --git a/packages/deriv_auth/example/ios/Podfile b/packages/deriv_auth/example/ios/Podfile index fdcc671eb..487163519 100644 --- a/packages/deriv_auth/example/ios/Podfile +++ b/packages/deriv_auth/example/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -# platform :ios, '11.0' +platform :ios, '15.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/packages/deriv_auth/example/ios/Podfile.lock b/packages/deriv_auth/example/ios/Podfile.lock index 3d9f26088..68f06f5d9 100644 --- a/packages/deriv_auth/example/ios/Podfile.lock +++ b/packages/deriv_auth/example/ios/Podfile.lock @@ -2,22 +2,29 @@ PODS: - connectivity_plus (0.0.1): - Flutter - ReachabilitySwift + - deriv_passkeys (0.0.1): + - Flutter - device_info_plus (0.0.1): - Flutter - Flutter (1.0.0) - flutter_deriv_api (0.0.1): - Flutter - - flutter_inappwebview (0.0.1): + - flutter_inappwebview_ios (0.0.1): - Flutter - - flutter_inappwebview/Core (= 0.0.1) + - flutter_inappwebview_ios/Core (= 0.0.1) - OrderedSet (~> 5.0) - - flutter_inappwebview/Core (0.0.1): + - flutter_inappwebview_ios/Core (0.0.1): - Flutter - OrderedSet (~> 5.0) - OrderedSet (5.0.0) - package_info_plus (0.4.5): - Flutter - ReachabilitySwift (5.0.0) + - shared_preferences_foundation (0.0.1): + - Flutter + - FlutterMacOS + - uni_links2 (0.0.1): + - Flutter - url_launcher_ios (0.0.1): - Flutter - webview_flutter_wkwebview (0.0.1): @@ -25,11 +32,14 @@ PODS: DEPENDENCIES: - connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`) + - deriv_passkeys (from `.symlinks/plugins/deriv_passkeys/ios`) - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`) - Flutter (from `Flutter`) - flutter_deriv_api (from `.symlinks/plugins/flutter_deriv_api/ios`) - - flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`) + - flutter_inappwebview_ios (from `.symlinks/plugins/flutter_inappwebview_ios/ios`) - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) + - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`) + - uni_links2 (from `.symlinks/plugins/uni_links2/ios`) - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) - webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`) @@ -41,33 +51,42 @@ SPEC REPOS: EXTERNAL SOURCES: connectivity_plus: :path: ".symlinks/plugins/connectivity_plus/ios" + deriv_passkeys: + :path: ".symlinks/plugins/deriv_passkeys/ios" device_info_plus: :path: ".symlinks/plugins/device_info_plus/ios" Flutter: :path: Flutter flutter_deriv_api: :path: ".symlinks/plugins/flutter_deriv_api/ios" - flutter_inappwebview: - :path: ".symlinks/plugins/flutter_inappwebview/ios" + flutter_inappwebview_ios: + :path: ".symlinks/plugins/flutter_inappwebview_ios/ios" package_info_plus: :path: ".symlinks/plugins/package_info_plus/ios" + shared_preferences_foundation: + :path: ".symlinks/plugins/shared_preferences_foundation/darwin" + uni_links2: + :path: ".symlinks/plugins/uni_links2/ios" url_launcher_ios: :path: ".symlinks/plugins/url_launcher_ios/ios" webview_flutter_wkwebview: :path: ".symlinks/plugins/webview_flutter_wkwebview/ios" SPEC CHECKSUMS: - connectivity_plus: 413a8857dd5d9f1c399a39130850d02fe0feaf7e + connectivity_plus: bf0076dd84a130856aa636df1c71ccaff908fa1d + deriv_passkeys: fadd039a48bae6f15ba8b955481a0f8f2b5bdede device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed - Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 + Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 flutter_deriv_api: 9e29abd7cc5091b72303f9c8be549618415f1437 - flutter_inappwebview: bfd58618f49dc62f2676de690fc6dcda1d6c3721 + flutter_inappwebview_ios: 97215cf7d4677db55df76782dbd2930c5e1c1ea0 OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c - package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e + package_info_plus: 115f4ad11e0698c8c1c5d8a689390df880f47e85 ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825 - url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4 - webview_flutter_wkwebview: 2e2d318f21a5e036e2c3f26171342e95908bd60a + shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695 + uni_links2: fbc37081577fc19c6e0f7e6cdbd3baa150023635 + url_launcher_ios: bbd758c6e7f9fd7b5b1d4cde34d2b95fcce5e812 + webview_flutter_wkwebview: 4f3e50f7273d31e5500066ed267e3ae4309c5ae4 -PODFILE CHECKSUM: 70d9d25280d0dd177a5f637cdb0f0b0b12c6a189 +PODFILE CHECKSUM: 9c46fd01abff66081b39f5fa5767b3f1d0b11d76 -COCOAPODS: 1.12.1 +COCOAPODS: 1.14.3 diff --git a/packages/deriv_auth/example/ios/Runner.xcodeproj/project.pbxproj b/packages/deriv_auth/example/ios/Runner.xcodeproj/project.pbxproj index 3d5f8164c..0572134d3 100644 --- a/packages/deriv_auth/example/ios/Runner.xcodeproj/project.pbxproj +++ b/packages/deriv_auth/example/ios/Runner.xcodeproj/project.pbxproj @@ -215,7 +215,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1430; ORGANIZATIONNAME = ""; TargetAttributes = { 331C8080294A63A400263BE5 = { @@ -452,7 +452,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -579,7 +579,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -628,7 +628,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; diff --git a/packages/deriv_auth/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/deriv_auth/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index e42adcb34..87131a09b 100644 --- a/packages/deriv_auth/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/packages/deriv_auth/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ ConnectionCubit.appId; + + @override + String get endpoint => ConnectionCubit.endpoint; +} diff --git a/packages/deriv_auth/example/lib/main.dart b/packages/deriv_auth/example/lib/main.dart index 3b0ad9175..ed6115f68 100644 --- a/packages/deriv_auth/example/lib/main.dart +++ b/packages/deriv_auth/example/lib/main.dart @@ -1,4 +1,10 @@ import 'package:deriv_auth/deriv_auth.dart'; +import 'package:deriv_http_client/deriv_http_client.dart'; +import 'package:deriv_passkeys/data/data_sources/deriv_passkeys_data_source.dart'; +import 'package:deriv_passkeys/data/mappers/deriv_passkeys_mapper.dart'; +import 'package:deriv_passkeys/data/repositories/deriv_passkeys_repository.dart'; +import 'package:deriv_passkeys/interactor/services/deriv_passkeys_service.dart'; +import 'package:deriv_passkeys/presentation/states/bloc/deriv_passkeys_bloc.dart'; import 'package:deriv_theme/deriv_theme.dart'; import 'package:device_preview/device_preview.dart'; import 'package:deriv_localizations/l10n/generated/deriv_auth/deriv_auth_localizations.dart'; @@ -6,6 +12,7 @@ import 'package:example/features/get_started/pages/get_started_page.dart'; import 'package:example/features/login/repositories/example_login_repository.dart'; import 'package:example/features/signup/repositories/example_referral_repository.dart'; import 'package:example/features/signup/repositories/example_signup_repository.dart'; +import 'package:example/features/social_auth/deriv_auth_connection_info.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -15,9 +22,11 @@ void main() { /// Added [DevicePreview] while fixing on UI issue /// that was only in smaller devices. This later can be removed /// when we are fully using widget book. - runApp(DevicePreview( - builder: (context) => const MyApp(), - )); + runApp( + DevicePreview( + builder: (context) => const MyApp(), + ), + ); } class MyApp extends StatelessWidget { @@ -40,6 +49,24 @@ class MyApp extends StatelessWidget { referralService: ExampleReferralRepository(), ), ), + BlocProvider( + create: (context) => SocialAuthCubit( + socialAuthService: DerivSocialAuthService( + client: HttpClient(), + connectionInfo: DerivAuthConnectionInfo(), + ), + ), + ), + BlocProvider( + create: (context) => DerivPasskeysBloc( + DerivPasskeysService( + DerivPasskeysRepository( + DerivPasskeysDataSource( + DerivPasskeysMapper(), + ), + ), + ), + )), ], child: DerivThemeProvider.builder( initialTheme: ThemeMode.dark, diff --git a/packages/deriv_auth/example/pubspec.yaml b/packages/deriv_auth/example/pubspec.yaml index e104b27a4..c6f8b8431 100644 --- a/packages/deriv_auth/example/pubspec.yaml +++ b/packages/deriv_auth/example/pubspec.yaml @@ -17,6 +17,27 @@ dependencies: flutter_bloc: ^8.1.3 http: ^0.13.6 device_preview: ^1.1.0 + deriv_http_client: + git: + url: git@github.com:regentmarkets/flutter-deriv-packages.git + path: packages/deriv_http_client + ref: deriv_http_client-v1.0.0 + deriv_passkeys: + git: + url: git@github.com:regentmarkets/flutter-deriv-packages.git + path: packages/deriv_passkeys + ref: e41aed43e93fdeb66adb37fd8094532e9a8a172f + +dependency_overrides: + flutter_deriv_api: + git: + url: git@github.com:deriv-com/flutter-deriv-api.git + ref: 64ad3673598ad807b43f751fc2ec7bc5ef01203e + deriv_ui: + git: + url: git@github.com:regentmarkets/flutter-deriv-packages.git + path: packages/deriv_ui + ref: deriv_ui-v0.0.6+1 dev_dependencies: flutter_test: diff --git a/packages/deriv_auth/lib/core/extensions/string_extensions.dart b/packages/deriv_auth/lib/core/extensions/string_extensions.dart index 8c2f488ce..dc5727920 100644 --- a/packages/deriv_auth/lib/core/extensions/string_extensions.dart +++ b/packages/deriv_auth/lib/core/extensions/string_extensions.dart @@ -25,3 +25,9 @@ extension RegexExtension on String { /// Signup valid Password Regex. bool get isValidSignupPassword => validPasswordRegex.hasMatch(this); } + +/// Extension methods for capitalizing [String]. +extension Capitalize on String { + /// Capitalize the first letter of the string. + String get capitalize => '${this[0].toUpperCase()}${substring(1)}'; +} 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 f13918148..609406fa8 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 @@ -1,4 +1,5 @@ import 'package:deriv_auth/deriv_auth.dart'; +import 'package:deriv_passkeys/presentation/widgets/continue_with_passkey_button.dart'; import 'package:deriv_theme/deriv_theme.dart'; import 'package:deriv_ui/deriv_ui.dart'; import 'package:flutter/material.dart'; @@ -65,31 +66,56 @@ class _DerivSocialAuthPanelState extends State { listener: (BuildContext context, SocialAuthState state) { widget.socialAuthStateHandler(state); }, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - _buildSocialAuthButton(SocialAuthProvider.apple), - const SizedBox(width: ThemeProvider.margin24), - _buildSocialAuthButton(SocialAuthProvider.google), - const SizedBox(width: ThemeProvider.margin24), - _buildSocialAuthButton(SocialAuthProvider.facebook), - ], + child: SizedBox( + width: double.infinity, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const ContinueWithPasskeyButton(), + const SizedBox(height: ThemeProvider.margin08), + _buildSocialAuthButton(SocialAuthProvider.google), + const SizedBox(height: ThemeProvider.margin08), + _buildSocialAuthButton(SocialAuthProvider.facebook), + const SizedBox(height: ThemeProvider.margin08), + _buildSocialAuthButton(SocialAuthProvider.apple), + ], + ), ), ), ); Widget _buildSocialAuthButton(SocialAuthProvider socialAuthProvider) => - IconButton( - padding: EdgeInsets.zero, - iconSize: ThemeProvider.iconSize40, - icon: Opacity( - opacity: getOpacity(isEnabled: widget.isEnabled), - child: SvgPicture.asset( - _getSocialMediaIcon(socialAuthProvider), - package: 'deriv_auth', + InkWell( + child: Container( + padding: const EdgeInsets.symmetric( + horizontal: 16, + vertical: 12, + ), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4), + border: Border.all( + color: context.theme.colors.active, + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SvgPicture.asset( + _getSocialMediaIcon(socialAuthProvider), + package: 'deriv_auth', + ), + const SizedBox(width: 8), + Text( + socialAuthProvider.name.capitalize, + style: context.theme.textStyle( + textStyle: TextStyles.body2, + color: context.theme.colors.prominent, + ), + ), + ], ), ), - onPressed: widget.isEnabled + onTap: widget.isEnabled ? () { _socialAuthCubit.selectSocialLoginProvider( selectedSocialAuthProvider: socialAuthProvider, diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index acd7748e4..a78417720 100644 --- a/packages/deriv_auth/pubspec.yaml +++ b/packages/deriv_auth/pubspec.yaml @@ -48,6 +48,12 @@ dependencies: path: packages/deriv_localizations ref: deriv_localizations-v1.1.1 + deriv_passkeys: + git: + url: git@github.com:regentmarkets/flutter-deriv-packages.git + path: packages/deriv_passkeys + ref: e41aed43e93fdeb66adb37fd8094532e9a8a172f + flutter_bloc: ^8.1.3 flutter_svg: ^2.0.7 smooth_page_indicator: ^1.1.0 @@ -57,6 +63,17 @@ dependencies: http: ^0.13.5 uni_links2: ^0.6.0+2 +dependency_overrides: + flutter_deriv_api: + git: + url: git@github.com:deriv-com/flutter-deriv-api.git + ref: 64ad3673598ad807b43f751fc2ec7bc5ef01203e + deriv_ui: + git: + url: git@github.com:regentmarkets/flutter-deriv-packages.git + path: packages/deriv_ui + ref: deriv_ui-v0.0.6+1 + dev_dependencies: mocktail: ^1.0.3 bloc_test: ^9.1.3 From d966d9f28a743d652dd14174827da5e20a697664 Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Tue, 27 Feb 2024 15:25:19 +0400 Subject: [PATCH 016/162] refactor(deriv_auth): updated passkeys dependencies. --- packages/deriv_auth/example/pubspec.yaml | 2 +- packages/deriv_auth/pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/deriv_auth/example/pubspec.yaml b/packages/deriv_auth/example/pubspec.yaml index c6f8b8431..a0f3da94c 100644 --- a/packages/deriv_auth/example/pubspec.yaml +++ b/packages/deriv_auth/example/pubspec.yaml @@ -26,7 +26,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: e41aed43e93fdeb66adb37fd8094532e9a8a172f + ref: c9b906bc20edbc94d0ca99f2211b142efa3aaf2e dependency_overrides: flutter_deriv_api: diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index a78417720..f52dbd562 100644 --- a/packages/deriv_auth/pubspec.yaml +++ b/packages/deriv_auth/pubspec.yaml @@ -52,7 +52,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: e41aed43e93fdeb66adb37fd8094532e9a8a172f + ref: c9b906bc20edbc94d0ca99f2211b142efa3aaf2e flutter_bloc: ^8.1.3 flutter_svg: ^2.0.7 From ac5dd5895caf6f2f2e60b2906a38f6ac27bfc11a Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Tue, 27 Feb 2024 18:47:41 +0400 Subject: [PATCH 017/162] refactor(deriv_auth): fixing deriv_passkeys dependencies --- packages/deriv_auth/example/pubspec.yaml | 2 +- packages/deriv_auth/pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/deriv_auth/example/pubspec.yaml b/packages/deriv_auth/example/pubspec.yaml index a0f3da94c..85d916e17 100644 --- a/packages/deriv_auth/example/pubspec.yaml +++ b/packages/deriv_auth/example/pubspec.yaml @@ -37,7 +37,7 @@ dependency_overrides: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.6+1 + ref: deriv_ui-v0.0.6+2 dev_dependencies: flutter_test: diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index a111a38e0..368979052 100644 --- a/packages/deriv_auth/pubspec.yaml +++ b/packages/deriv_auth/pubspec.yaml @@ -72,7 +72,7 @@ dependency_overrides: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.6+1 + ref: deriv_ui-v0.0.6+2 dev_dependencies: mocktail: ^1.0.3 From 2ade47f5f42a37325e4e4906c8c095fc26d777b6 Mon Sep 17 00:00:00 2001 From: sahani-deriv <125638269+sahani-deriv@users.noreply.github.com> Date: Thu, 29 Feb 2024 15:51:42 +0800 Subject: [PATCH 018/162] refactor(deriv_ui): update deriv_ui dependencies (#499) --- packages/deriv_ui/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/deriv_ui/pubspec.yaml b/packages/deriv_ui/pubspec.yaml index d3646bf28..09b93eeca 100644 --- a/packages/deriv_ui/pubspec.yaml +++ b/packages/deriv_ui/pubspec.yaml @@ -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.0 + ref: deriv_web_view-v0.2.1 flutter_svg: ^2.0.7 intl: ^0.18.0 From 2a7e09002d70a352bda60d06f9162e91e67d625f Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Thu, 29 Feb 2024 15:56:39 +0800 Subject: [PATCH 019/162] chore(version): bump version and update changelog (#500) * chore(release): publish packages - deriv_ui@0.0.6+4 - deriv_auth@6.0.2 * [create-pull-request] automated change --------- Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: sahani-deriv --- CHANGELOG.md | 28 ++++++++++++++++++++++++++++ README.md | 8 ++++---- packages/deriv_auth/CHANGELOG.md | 4 ++++ packages/deriv_auth/pubspec.yaml | 4 ++-- packages/deriv_ui/CHANGELOG.md | 4 ++++ packages/deriv_ui/pubspec.yaml | 2 +- 6 files changed, 43 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6a354052..66392cd4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,34 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-02-29 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_ui` - `v0.0.6+4`](#deriv_ui---v0064) + - [`deriv_auth` - `v6.0.2`](#deriv_auth---v602) + +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.0.2` + +--- + +#### `deriv_ui` - `v0.0.6+4` + + - **REFACTOR**(deriv_ui): update deriv_ui dependencies ([#499](https://github.com/regentmarkets/flutter-deriv-packages/issues/499)). ([2ade47f5](https://github.com/regentmarkets/flutter-deriv-packages/commit/2ade47f5f42a37325e4e4906c8c095fc26d777b6)) + + ## 2024-02-29 ### Changes diff --git a/README.md b/README.md index c54c6cb26..5c988f5d5 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,14 @@ 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.0.0)`. 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.0.2)`. To use the package, add the following to your pubspec.yaml file: ```yaml deriv_ui: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.6+3 #your prefered version + ref: deriv_ui-v0.0.6+4 #your prefered version ``` ## Packages @@ -19,7 +19,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.0.1 ](./packages/deriv_auth/CHANGELOG.md) | +| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.0.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) | @@ -36,7 +36,7 @@ deriv_ui: | [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.2.0](./packages/deriv_theme/CHANGELOG.md) | -| [deriv_ui](./packages/deriv_ui) | A package that contains the UI components used by Deriv products. | [v0.0.6+3](./packages/deriv_ui/CHANGELOG.md) | +| [deriv_ui](./packages/deriv_ui) | A package that contains the UI components used by Deriv products. | [v0.0.6+4](./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.1](./packages/deriv_web_view/CHANGELOG.md) | diff --git a/packages/deriv_auth/CHANGELOG.md b/packages/deriv_auth/CHANGELOG.md index acabb075a..50c2ae607 100644 --- a/packages/deriv_auth/CHANGELOG.md +++ b/packages/deriv_auth/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.0.2 + + - Update a dependency to the latest release. + ## 6.0.0 > Note: This release has breaking changes. diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index 86bf4452d..cc506bfa1 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.0.1 +version: 6.0.2 environment: sdk: ">=3.0.0 <4.0.0" @@ -22,7 +22,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.6+3 + ref: deriv_ui-v0.0.6+4 deriv_http_client: git: diff --git a/packages/deriv_ui/CHANGELOG.md b/packages/deriv_ui/CHANGELOG.md index 92cd744ff..7d52b3c14 100644 --- a/packages/deriv_ui/CHANGELOG.md +++ b/packages/deriv_ui/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.6+4 + + - **REFACTOR**(deriv_ui): update deriv_ui dependencies ([#499](https://github.com/regentmarkets/flutter-deriv-packages/issues/499)). ([2ade47f5](https://github.com/regentmarkets/flutter-deriv-packages/commit/2ade47f5f42a37325e4e4906c8c095fc26d777b6)) + ## 0.0.6+3 - Update a dependency to the latest release. diff --git a/packages/deriv_ui/pubspec.yaml b/packages/deriv_ui/pubspec.yaml index 09b93eeca..daa329820 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.6+3 +version: 0.0.6+4 publish_to: none environment: From e594c05b87c05d189913a7de8b9e1e4e6d03b76a Mon Sep 17 00:00:00 2001 From: Ahrar <98078754+ahrar-deriv@users.noreply.github.com> Date: Thu, 29 Feb 2024 16:28:48 +0800 Subject: [PATCH 020/162] feat(deriv_auth): single entry (#420) * feat(deriv_auth): single entry feat that adds a single entry to the auth package * chore(deriv_auth): improve some imports * chore(deriv_auth): change deriv-api to dev branch change deriv_api to dev branch and package_info_plus to version 4 * feat(deriv_auth): adding login page to single entry * feat(deriv_auth): single entry login and reset pass added * feat(deriv_auth): single entry signup page * chore: setting page fist attempt * feat(deriv_auith): single entry setting page * feat(deriv_auth): single entry reset password and merge conflicts * chore(deriv_auth): code review comments add docs and minor changes * chore(deriv_auth): change residence to userResidence * doc(deriv_auth): single entry doc and fix error handling * chore(deriv_auth): fixing the deriv reset pass layout test * chore(deriv_auth): change navigation to signupPage in verifyemailpage --- packages/deriv_auth/lib/core/core.dart | 16 ++++ .../deriv_auth/lib/core/helpers/helpers.dart | 1 + .../core/states/auth_error_state_mapper.dart | 1 - .../lib/core/states/auth_state_listener.dart | 1 - .../deriv_auth/lib/core/states/states.dart | 1 + packages/deriv_auth/lib/deriv_auth.dart | 49 +---------- .../deriv_auth/lib/features/auth/auth.dart | 4 + .../deriv_auth/lib/features/features.dart | 8 ++ .../lib/features/get_started/get_started.dart | 2 + .../deriv_auth/lib/features/login/login.dart | 2 + .../layouts/deriv_choose_new_pass_layout.dart | 5 +- .../layouts/deriv_reset_pass_layout.dart | 7 +- .../reset_password/reset_password.dart | 6 ++ .../layouts/deriv_setting_layout.dart | 22 ++--- .../features/setting_page/setting_page.dart | 1 + .../layouts/deriv_set_password_layout.dart | 2 - .../layouts/deriv_signup_layout.dart | 2 +- .../lib/features/signup/signup.dart | 15 ++++ .../lib/features/single_entry/README.md | 86 +++++++++++++++++++ .../features/single_entry/core/auth_data.dart | 23 +++++ .../core/models/auth_entry_model.dart | 32 +++++++ .../core/models/get_started_page_model.dart | 20 +++++ .../core/models/login_page_model.dart | 57 ++++++++++++ .../single_entry/core/models/models.dart | 6 ++ .../core/models/reset_pass_page_model.dart | 25 ++++++ .../core/models/setting_page_model.dart | 27 ++++++ .../core/models/signup_page_model.dart | 54 ++++++++++++ .../get_started/pages/get_started_page.dart | 37 ++++++++ .../features/home/pages/home_page.dart | 30 +++++++ .../features/login/pages/login_page.dart | 58 +++++++++++++ .../pages/choose_new_password_page.dart | 29 +++++++ .../reset_pass/pages/reset_pass_page.dart | 19 ++++ .../pages/reset_pass_success_page.dart | 42 +++++++++ .../settings/pages/settings_page.dart | 24 ++++++ .../signup/pages/country_selection_page.dart | 37 ++++++++ .../signup/pages/set_password_page.dart | 43 ++++++++++ .../features/signup/pages/signup_page.dart | 46 ++++++++++ .../signup/pages/verification_done_page.dart | 35 ++++++++ .../signup/pages/verify_email_page.dart | 40 +++++++++ .../repositories/referral_repository.dart | 8 ++ .../single_entry/pages/auth_entry_page.dart | 15 ++++ .../features/single_entry/single_entry.dart | 2 + .../layouts/deriv_reset_pass_layout_test.dart | 31 +++++-- 43 files changed, 898 insertions(+), 73 deletions(-) create mode 100644 packages/deriv_auth/lib/core/core.dart create mode 100644 packages/deriv_auth/lib/features/auth/auth.dart create mode 100644 packages/deriv_auth/lib/features/features.dart create mode 100644 packages/deriv_auth/lib/features/get_started/get_started.dart create mode 100644 packages/deriv_auth/lib/features/login/login.dart create mode 100644 packages/deriv_auth/lib/features/reset_password/reset_password.dart create mode 100644 packages/deriv_auth/lib/features/setting_page/setting_page.dart create mode 100644 packages/deriv_auth/lib/features/signup/signup.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/README.md create mode 100644 packages/deriv_auth/lib/features/single_entry/core/auth_data.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/core/models/get_started_page_model.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/core/models/login_page_model.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/core/models/models.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/core/models/reset_pass_page_model.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/core/models/setting_page_model.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/core/models/signup_page_model.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/features/get_started/pages/get_started_page.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/features/home/pages/home_page.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/features/login/pages/login_page.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/choose_new_password_page.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/reset_pass_page.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/reset_pass_success_page.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/features/settings/pages/settings_page.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/features/signup/pages/country_selection_page.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/features/signup/pages/set_password_page.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/features/signup/pages/signup_page.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/features/signup/pages/verification_done_page.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/features/signup/pages/verify_email_page.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/features/signup/repositories/referral_repository.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/pages/auth_entry_page.dart create mode 100644 packages/deriv_auth/lib/features/single_entry/single_entry.dart diff --git a/packages/deriv_auth/lib/core/core.dart b/packages/deriv_auth/lib/core/core.dart new file mode 100644 index 000000000..d90ac1ac4 --- /dev/null +++ b/packages/deriv_auth/lib/core/core.dart @@ -0,0 +1,16 @@ +export 'connection_info.dart'; +export 'exceptions/deriv_auth_exception.dart'; +export 'extensions/extensions.dart'; +export 'layouts/deriv_unavailable_country_layout.dart'; +export 'models/account_model.dart'; +export 'models/auth_error/auth_error.dart'; +export 'models/auth_error/auth_error_model.dart'; +export 'models/authorize_model.dart'; +export 'models/verify_email_model.dart'; +export 'services/jwt/repository/deriv_jwt_repository.dart'; +export 'services/jwt/services/deriv_jwt_service.dart'; +export 'services/referral/models/my_affiliate_referral_code_request_model.dart'; +export 'services/token/models/enums.dart'; +export 'services/token/services/deriv_token_service.dart'; +export 'states/states.dart'; +export 'helpers/helpers.dart'; diff --git a/packages/deriv_auth/lib/core/helpers/helpers.dart b/packages/deriv_auth/lib/core/helpers/helpers.dart index ab5f4b441..bc7dc3ce0 100644 --- a/packages/deriv_auth/lib/core/helpers/helpers.dart +++ b/packages/deriv_auth/lib/core/helpers/helpers.dart @@ -2,3 +2,4 @@ export 'account_helpers.dart'; export 'bool_helper.dart'; export 'date_time_helper.dart'; export 'number_helper.dart'; +export 'semantic_labels.dart'; diff --git a/packages/deriv_auth/lib/core/states/auth_error_state_mapper.dart b/packages/deriv_auth/lib/core/states/auth_error_state_mapper.dart index 05d10e41a..430d18fd7 100644 --- a/packages/deriv_auth/lib/core/states/auth_error_state_mapper.dart +++ b/packages/deriv_auth/lib/core/states/auth_error_state_mapper.dart @@ -1,4 +1,3 @@ -import 'package:deriv_auth/core/states/states.dart'; import 'package:deriv_auth/deriv_auth.dart'; /// Maps the [DerivAuthErrorState] to the corresponding [AuthErrorStateHandler]. diff --git a/packages/deriv_auth/lib/core/states/auth_state_listener.dart b/packages/deriv_auth/lib/core/states/auth_state_listener.dart index f51e278d0..9fb0e14f6 100644 --- a/packages/deriv_auth/lib/core/states/auth_state_listener.dart +++ b/packages/deriv_auth/lib/core/states/auth_state_listener.dart @@ -1,4 +1,3 @@ -import 'package:deriv_auth/core/states/states.dart'; import 'package:deriv_auth/deriv_auth.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; diff --git a/packages/deriv_auth/lib/core/states/states.dart b/packages/deriv_auth/lib/core/states/states.dart index 7545c9d18..3fcce922f 100644 --- a/packages/deriv_auth/lib/core/states/states.dart +++ b/packages/deriv_auth/lib/core/states/states.dart @@ -1,2 +1,3 @@ export 'auth_error_state_mapper.dart'; export 'auth_error_state_handler.dart'; +export 'auth_state_listener.dart'; diff --git a/packages/deriv_auth/lib/deriv_auth.dart b/packages/deriv_auth/lib/deriv_auth.dart index c572fd6b2..3f246a444 100644 --- a/packages/deriv_auth/lib/deriv_auth.dart +++ b/packages/deriv_auth/lib/deriv_auth.dart @@ -1,47 +1,2 @@ -export 'core/connection_info.dart'; -export 'core/exceptions/deriv_auth_exception.dart'; -export 'core/extensions/extensions.dart'; -export 'core/models/account_model.dart'; -export 'core/models/auth_error/auth_error.dart'; -export 'core/models/auth_error/auth_error_model.dart'; -export 'core/models/authorize_model.dart'; -export 'core/models/verify_email_model.dart'; -export 'core/services/jwt/repository/deriv_jwt_repository.dart'; -export 'core/services/jwt/services/deriv_jwt_service.dart'; -export 'core/helpers/semantic_labels.dart'; -export 'core/services/token/models/enums.dart'; -export 'core/services/token/services/deriv_token_service.dart'; -export 'core/services/referral/models/my_affiliate_referral_code_request_model.dart'; -export 'features/auth/cubit/deriv_auth_cubit.dart'; -export 'features/auth/models/logout/logout_response.dart'; -export 'features/auth/repository/base_auth_repository.dart'; -export 'features/auth/services/deriv_auth_service.dart'; -export 'features/reset_password/cubit/reset_password_cubit.dart'; -export 'features/reset_password/repository/base_reset_password_repository.dart'; -export 'features/reset_password/services/deriv_reset_password_service.dart'; -export 'features/signup/cubit/signup_cubit.dart'; -export 'features/signup/models/new_virtual_account_request_model.dart'; -export 'features/signup/models/signup_error_type.dart'; -export 'features/signup/repository/base_signup_repository.dart'; -export 'features/signup/services/deriv_signup_service.dart'; -export 'features/social_auth/social_auth.dart'; -export 'core/layouts/deriv_unavailable_country_layout.dart'; -export 'features/get_started/presentation/layouts/deriv_get_started_layout.dart'; -export 'features/get_started/models/deriv_get_started_slide_model.dart'; -export 'features/login/presentation/layouts/deriv_2fa_layout.dart'; -export 'features/login/presentation/layouts/deriv_login_layout.dart'; -export 'features/reset_password/presentation/layouts/deriv_choose_new_pass_layout.dart'; -export 'features/reset_password/presentation/layouts/deriv_reset_pass_layout.dart'; -export 'features/reset_password/presentation/layouts/deriv_success_pass_change_layout.dart'; -export 'features/setting_page/presentation/layouts/deriv_setting_layout.dart'; -export 'features/signup/cubit/deriv_country_selection_cubit.dart'; -export 'features/signup/presentation/layouts/deriv_country_selection_layout.dart'; -export 'features/signup/presentation/layouts/deriv_email_not_received_layout.dart'; -export 'features/signup/presentation/layouts/deriv_set_password_layout.dart'; -export 'features/signup/presentation/layouts/deriv_signup_layout.dart'; -export 'features/signup/presentation/layouts/deriv_verification_done_layout.dart'; -export 'features/signup/presentation/layouts/deriv_verify_email_layout.dart'; -export 'features/signup/models/deriv_auth_utm_model.dart'; -export 'features/signup/models/deriv_password_policy_model.dart'; -export 'features/signup/models/deriv_residence_model.dart'; -export 'core/states/states.dart'; +export 'core/core.dart'; +export 'features/features.dart'; diff --git a/packages/deriv_auth/lib/features/auth/auth.dart b/packages/deriv_auth/lib/features/auth/auth.dart new file mode 100644 index 000000000..5c56748d0 --- /dev/null +++ b/packages/deriv_auth/lib/features/auth/auth.dart @@ -0,0 +1,4 @@ +export 'cubit/deriv_auth_cubit.dart'; +export 'models/logout/logout_response.dart'; +export 'repository/base_auth_repository.dart'; +export 'services/deriv_auth_service.dart'; diff --git a/packages/deriv_auth/lib/features/features.dart b/packages/deriv_auth/lib/features/features.dart new file mode 100644 index 000000000..7712e281d --- /dev/null +++ b/packages/deriv_auth/lib/features/features.dart @@ -0,0 +1,8 @@ +export 'auth/auth.dart'; +export 'get_started/get_started.dart'; +export 'login/login.dart'; +export 'reset_password/reset_password.dart'; +export 'setting_page/setting_page.dart'; +export 'signup/signup.dart'; +export 'single_entry/single_entry.dart'; +export 'social_auth/social_auth.dart'; diff --git a/packages/deriv_auth/lib/features/get_started/get_started.dart b/packages/deriv_auth/lib/features/get_started/get_started.dart new file mode 100644 index 000000000..2604a2649 --- /dev/null +++ b/packages/deriv_auth/lib/features/get_started/get_started.dart @@ -0,0 +1,2 @@ +export 'models/deriv_get_started_slide_model.dart'; +export 'presentation/layouts/deriv_get_started_layout.dart'; diff --git a/packages/deriv_auth/lib/features/login/login.dart b/packages/deriv_auth/lib/features/login/login.dart new file mode 100644 index 000000000..2dba1e7ff --- /dev/null +++ b/packages/deriv_auth/lib/features/login/login.dart @@ -0,0 +1,2 @@ +export 'presentation/layouts/deriv_2fa_layout.dart'; +export 'presentation/layouts/deriv_login_layout.dart'; diff --git a/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_choose_new_pass_layout.dart b/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_choose_new_pass_layout.dart index 4ecaf102e..68dafc6cf 100644 --- a/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_choose_new_pass_layout.dart +++ b/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_choose_new_pass_layout.dart @@ -60,8 +60,9 @@ class _DerivChooseNewPassLayoutState extends State { widget.onResetPassSucceed(); } else if (state is DerivResetPassErrorState) { widget.onResetPassError( - error: state.errorMessage, - isLinkExpired: state.isLinkExpired); + error: state.errorMessage, + isLinkExpired: state.isLinkExpired, + ); } }, child: _buildChooseNewPassSection(context), diff --git a/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_reset_pass_layout.dart b/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_reset_pass_layout.dart index 9dc078629..e5406a496 100644 --- a/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_reset_pass_layout.dart +++ b/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_reset_pass_layout.dart @@ -18,7 +18,7 @@ class DerivResetPassLayout extends StatefulWidget { }) : super(key: key); /// Callback to be called when reset pass fails. - final Function(String?) onResetPassError; + final ResetPassErrorCallback onResetPassError; @override State createState() => _DerivResetPassLayoutState(); @@ -57,7 +57,10 @@ class _DerivResetPassLayoutState extends State { curve: Curves.easeInOut, ); } else if (state is DerivResetPassErrorState) { - widget.onResetPassError(state.errorMessage); + widget.onResetPassError( + error: state.errorMessage, + isLinkExpired: state.isLinkExpired, + ); } }, child: PageView( diff --git a/packages/deriv_auth/lib/features/reset_password/reset_password.dart b/packages/deriv_auth/lib/features/reset_password/reset_password.dart new file mode 100644 index 000000000..96b1adce5 --- /dev/null +++ b/packages/deriv_auth/lib/features/reset_password/reset_password.dart @@ -0,0 +1,6 @@ +export 'cubit/reset_password_cubit.dart'; +export 'presentation/layouts/deriv_choose_new_pass_layout.dart'; +export 'presentation/layouts/deriv_reset_pass_layout.dart'; +export 'presentation/layouts/deriv_success_pass_change_layout.dart'; +export 'repository/base_reset_password_repository.dart'; +export 'services/deriv_reset_password_service.dart'; diff --git a/packages/deriv_auth/lib/features/setting_page/presentation/layouts/deriv_setting_layout.dart b/packages/deriv_auth/lib/features/setting_page/presentation/layouts/deriv_setting_layout.dart index 9d00ee918..e61f0d754 100644 --- a/packages/deriv_auth/lib/features/setting_page/presentation/layouts/deriv_setting_layout.dart +++ b/packages/deriv_auth/lib/features/setting_page/presentation/layouts/deriv_setting_layout.dart @@ -26,7 +26,8 @@ class DerivSettingLayout extends StatefulWidget { }) : super(key: key); /// Update flavor configurations - final Future updateFlavorConfigs; + final Function({required String endpoint, required String appId}) + updateFlavorConfigs; /// Save values to shared preferences final Function({required String endpoint, required String appId}) saveValues; @@ -75,18 +76,19 @@ class _SettingsPageState extends State { @override Widget build(BuildContext context) => WillPopScope( onWillPop: () async { + final String endpoint = _endpointController.text.isNotEmpty + ? _endpointController.text + : defaultEndpoint; + final String appId = _appIdController.text.isNotEmpty + ? _appIdController.text + : defaultAppId; + // Save Values to shared preferences - widget.saveValues( - endpoint: _endpointController.text.isNotEmpty - ? _endpointController.text - : defaultEndpoint, - appId: _appIdController.text.isNotEmpty - ? _appIdController.text - : defaultAppId, - ); + await widget.saveValues(endpoint: endpoint, appId: appId); // Update Flavor Configurations before dismissing the page - await widget.updateFlavorConfigs; + await widget.updateFlavorConfigs(endpoint: endpoint, appId: appId); + return true; }, child: Scaffold( diff --git a/packages/deriv_auth/lib/features/setting_page/setting_page.dart b/packages/deriv_auth/lib/features/setting_page/setting_page.dart new file mode 100644 index 000000000..224c7bff0 --- /dev/null +++ b/packages/deriv_auth/lib/features/setting_page/setting_page.dart @@ -0,0 +1 @@ +export 'presentation/layouts/deriv_setting_layout.dart'; diff --git a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_set_password_layout.dart b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_set_password_layout.dart index b08f83c61..d989c1306 100644 --- a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_set_password_layout.dart +++ b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_set_password_layout.dart @@ -1,8 +1,6 @@ import 'package:deriv_auth/core/helpers/assets.dart'; -import 'package:deriv_auth/core/states/auth_error_state_handler.dart'; import 'package:deriv_auth/core/states/auth_state_listener.dart'; import 'package:deriv_auth/deriv_auth.dart'; -import 'package:deriv_auth/features/signup/models/deriv_auth_utm_model.dart'; import 'package:deriv_auth/features/signup/presentation/widgets/password_policy_checker_widget.dart'; import 'package:deriv_theme/deriv_theme.dart'; import 'package:deriv_ui/deriv_ui.dart'; diff --git a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_signup_layout.dart b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_signup_layout.dart index a777f5153..c466189ed 100644 --- a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_signup_layout.dart +++ b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_signup_layout.dart @@ -1,4 +1,3 @@ -import 'package:deriv_auth/core/states/auth_state_listener.dart'; import 'package:deriv_auth/deriv_auth.dart'; import 'package:deriv_theme/deriv_theme.dart'; import 'package:deriv_ui/deriv_ui.dart'; @@ -136,6 +135,7 @@ class _DerivSignupLayoutState extends State { socialAuthStateHandler: widget.socialAuthStateHandler, redirectURL: widget.redirectURL, onWebViewError: widget.onWebViewError, + onPressed: widget.onSocialAuthButtonPressed, ), if (widget.isSocialAuthEnabled) const SizedBox(height: ThemeProvider.margin24), diff --git a/packages/deriv_auth/lib/features/signup/signup.dart b/packages/deriv_auth/lib/features/signup/signup.dart new file mode 100644 index 000000000..5b3b7d992 --- /dev/null +++ b/packages/deriv_auth/lib/features/signup/signup.dart @@ -0,0 +1,15 @@ +export 'cubit/deriv_country_selection_cubit.dart'; +export 'cubit/signup_cubit.dart'; +export 'models/deriv_auth_utm_model.dart'; +export 'models/deriv_password_policy_model.dart'; +export 'models/deriv_residence_model.dart'; +export 'models/new_virtual_account_request_model.dart'; +export 'models/signup_error_type.dart'; +export 'presentation/layouts/deriv_country_selection_layout.dart'; +export 'presentation/layouts/deriv_email_not_received_layout.dart'; +export 'presentation/layouts/deriv_set_password_layout.dart'; +export 'presentation/layouts/deriv_signup_layout.dart'; +export 'presentation/layouts/deriv_verification_done_layout.dart'; +export 'presentation/layouts/deriv_verify_email_layout.dart'; +export 'repository/base_signup_repository.dart'; +export 'services/deriv_signup_service.dart'; diff --git a/packages/deriv_auth/lib/features/single_entry/README.md b/packages/deriv_auth/lib/features/single_entry/README.md new file mode 100644 index 000000000..a595a6bfb --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/README.md @@ -0,0 +1,86 @@ +## Single Entry: + +Single entry will enable you to just call one Widget and get the entire Authentication flow
+ +#### Example: + +```Dart +AuthEntryPage( + AuthEntryModel( + getStartedPage: GetStartedPageModel( + slides: [ + DerivGetStartedSlideModel( + imagePath: 'lib/auth/assets/images/charts.svg', + supportingText: 'Charts', + ), + DerivGetStartedSlideModel( + imagePath: 'lib/auth/assets/images/live_chat.svg', + supportingText: 'Live Chat', + ), + DerivGetStartedSlideModel( + imagePath: 'lib/auth/assets/images/markets.svg', + supportingText: 'Markets', + ), + ], + appLogoIconPath: + 'lib/auth/assets/images/ic_logo_extended.svg', + backgroundImagePath: 'lib/auth/assets/images/triangles.svg', + ), + loginPageModel: LoginPageModel( + welcomeLabel: 'Welcome back testing!', + greetingLabel: + 'Log in to your Deriv account to start trading and investing.', + onLoggedIn: (_) => HomePageRoute().go(context), + authErrorStateHandler: + AuthErrorStateHandler(context: context), + onLoginError: (_) {}, + onSocialAuthButtonPressed: (_) {}, + isSocialAuthEnabled: false, + socialAuthStateHandler: (SocialAuthState) {}, + redirectURL: '', + onWebViewError: (String) {}, + ), + derivAuthCubit: BlocProvider.of(context), + signupPageModel: SignupPageModel( + verificationCode: '', + signupPageLable: 'Start trading with Deriv', + signupPageDescription: + 'Join over 1 million traders worldwide who loves trading at Deriv.', + isSocialAuthEnabled: false, + onSingupError: (DerivSignupErrorState) {}, + socialAuthStateHandler: (SocialAuthState) {}, + redirectURL: '', + onWebViewError: (String) {}, + ), + settingPageModel: SettingPageModel( + appLabel: 'dblanc', + appId: () => PrefService.getString('appId') ?? defaultAppId, + endpoint: () => + PrefService.getString('endpoint') ?? defaultEndpoint, + saveValues: _saveValues, + updateFlavorConfigs: _updateFlavorConfigs, + ), + resetPassPageModel: ResetPassPageModel( + onResetPassSucceed: () {}, + onResetPassError: ({ + required bool isLinkExpired, + String? error, + }) {}, + residences: Future.value([ + const DerivResidenceModel( + isDisabled: false, + name: 'Indonecsia', + code: 'ID', + ), + const DerivResidenceModel( + isDisabled: true, + name: 'England', + code: 'UK', + ), + ]), + userResidence: 'id', + ), + ), + ), + +``` diff --git a/packages/deriv_auth/lib/features/single_entry/core/auth_data.dart b/packages/deriv_auth/lib/features/single_entry/core/auth_data.dart new file mode 100644 index 000000000..a611c3682 --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/core/auth_data.dart @@ -0,0 +1,23 @@ +// ignore_for_file: unnecessary_getters_setters + +import 'models/auth_entry_model.dart'; + +/// Authentication Data Singleton +class AuthData { + /// AuthData instance + factory AuthData() => _instance; + + AuthData._internal(); + + static final AuthData _instance = AuthData._internal(); + + late AuthEntryModel _data; + + /// data getter + AuthEntryModel get data => _data; + + /// data setter + set data(AuthEntryModel data) { + _data = data; + } +} diff --git a/packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart b/packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart new file mode 100644 index 000000000..23b2a5336 --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart @@ -0,0 +1,32 @@ +import 'package:deriv_auth/deriv_auth.dart'; + +/// Auth Entry Model class +class AuthEntryModel { + /// Constructor [AuthEntryModel] + const AuthEntryModel({ + required this.getStartedPage, + required this.loginPageModel, + required this.derivAuthCubit, + required this.signupPageModel, + required this.settingPageModel, + required this.resetPassPageModel, + }); + + /// GetStartedPage data model + final GetStartedPageModel getStartedPage; + + /// LoginPage data model + final LoginPageModel loginPageModel; + + /// DerivAuthCubit + final DerivAuthCubit derivAuthCubit; + + /// SignupPage data model + final SignupPageModel signupPageModel; + + /// SettingPage data model + final SettingPageModel settingPageModel; + + /// ResetPassPage data model + final ResetPassPageModel resetPassPageModel; +} diff --git a/packages/deriv_auth/lib/features/single_entry/core/models/get_started_page_model.dart b/packages/deriv_auth/lib/features/single_entry/core/models/get_started_page_model.dart new file mode 100644 index 000000000..1bf244b2a --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/core/models/get_started_page_model.dart @@ -0,0 +1,20 @@ +import 'package:deriv_auth/deriv_auth.dart'; + +/// Get Started Page Model +class GetStartedPageModel { + /// Constructor [GetStartedPageModel] + const GetStartedPageModel({ + required this.slides, + required this.appLogoIconPath, + required this.backgroundImagePath, + }); + + /// List of Deriv Get Started page Slides + final List slides; + + /// Logo icon path + final String appLogoIconPath; + + /// Background image path + final String backgroundImagePath; +} diff --git a/packages/deriv_auth/lib/features/single_entry/core/models/login_page_model.dart b/packages/deriv_auth/lib/features/single_entry/core/models/login_page_model.dart new file mode 100644 index 000000000..bfb98d9ef --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/core/models/login_page_model.dart @@ -0,0 +1,57 @@ +import 'package:deriv_auth/deriv_auth.dart'; + +/// LoginPageModel class +class LoginPageModel { + /// Initializes [LoginPageModel]. + const LoginPageModel({ + required this.onLoggedIn, + required this.onSocialAuthButtonPressed, + required this.welcomeLabel, + required this.greetingLabel, + required this.socialAuthStateHandler, + required this.redirectURL, + required this.onWebViewError, + this.isForgotPasswordEnabled = true, + this.isCreateAccountEnabled = true, + this.isSocialAuthEnabled = true, + this.authErrorStateHandler, + this.onLoginError, + }); + + /// Extension of base [AuthErrorStateHandler]. If not provided, base implementation will be used. + final AuthErrorStateHandler? authErrorStateHandler; + + /// Callback to be called when login error occurs. + final Function(DerivAuthErrorState)? onLoginError; + + /// Callback to be called when user is logged in. + final Function(DerivAuthLoggedInState) onLoggedIn; + + /// Callback to be called when social auth button is tapped. + /// Give access to [SocialAuthDto] for 2FA. + final SocialAuthCallback? onSocialAuthButtonPressed; + + /// Welcome text to be displayed on login page. + final String welcomeLabel; + + /// Greeting text to be displayed on login page. + final String greetingLabel; + + /// Whether to display social auth buttons. + final bool isSocialAuthEnabled; + + /// Whether to display forgot password section. + final bool isForgotPasswordEnabled; + + /// Whether to display create account section. + final bool isCreateAccountEnabled; + + /// Social auth state handler. + final Function(SocialAuthState) socialAuthStateHandler; + + /// Redirect URL for social auth. + final String redirectURL; + + /// Callback for web view error. + final Function(String) onWebViewError; +} diff --git a/packages/deriv_auth/lib/features/single_entry/core/models/models.dart b/packages/deriv_auth/lib/features/single_entry/core/models/models.dart new file mode 100644 index 000000000..4aea9f511 --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/core/models/models.dart @@ -0,0 +1,6 @@ +export 'auth_entry_model.dart'; +export 'get_started_page_model.dart'; +export 'login_page_model.dart'; +export 'signup_page_model.dart'; +export 'setting_page_model.dart'; +export 'reset_pass_page_model.dart'; diff --git a/packages/deriv_auth/lib/features/single_entry/core/models/reset_pass_page_model.dart b/packages/deriv_auth/lib/features/single_entry/core/models/reset_pass_page_model.dart new file mode 100644 index 000000000..b19e0dcc7 --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/core/models/reset_pass_page_model.dart @@ -0,0 +1,25 @@ +import 'package:deriv_auth/deriv_auth.dart'; +import 'package:flutter/foundation.dart' show VoidCallback; + +/// Reset password page model +class ResetPassPageModel { + /// Constructor [ResetPassPageModel] + const ResetPassPageModel({ + required this.onResetPassError, + required this.residences, + required this.userResidence, + this.onResetPassSucceed, + }); + + /// Callback to be called when reset pass fails. + final ResetPassErrorCallback onResetPassError; + + /// Callback to be called when reset pass succeeds. + final VoidCallback? onResetPassSucceed; + + /// List of residences to be shown. + final Future> residences; + + /// User residence like 'id' + final String userResidence; +} 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 new file mode 100644 index 000000000..d0e8083d0 --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/core/models/setting_page_model.dart @@ -0,0 +1,27 @@ +/// Setting page model +class SettingPageModel { + /// Constructor [SettingPageModel] + SettingPageModel({ + required this.appLabel, + required this.appId, + required this.endpoint, + required this.saveValues, + required this.updateFlavorConfigs, + }); + + /// Setting page App label + final String appLabel; + + /// application id + final String Function() appId; + + /// end point + final String Function() endpoint; + + /// Save values to shared preferences + final Function({required String endpoint, required String appId}) saveValues; + + /// Update flavor configurations + final Function({required String endpoint, required String appId}) + updateFlavorConfigs; +} diff --git a/packages/deriv_auth/lib/features/single_entry/core/models/signup_page_model.dart b/packages/deriv_auth/lib/features/single_entry/core/models/signup_page_model.dart new file mode 100644 index 000000000..a182228c8 --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/core/models/signup_page_model.dart @@ -0,0 +1,54 @@ +import 'package:deriv_auth/deriv_auth.dart'; +import 'package:flutter/foundation.dart' show VoidCallback; + +/// Sign-up page model +class SignupPageModel { + /// Constructor [SignupPageModel] + SignupPageModel({ + required this.verificationCode, + required this.signupPageLable, + required this.signupPageDescription, + required this.onSingupError, + required this.isSocialAuthEnabled, + required this.socialAuthStateHandler, + required this.redirectURL, + required this.onWebViewError, + this.onSignupPressed, + this.onSocialAuthButtonPressed, + this.affiliateToken, + }); + + /// verification code + final String verificationCode; + + /// affiliate token + final String? affiliateToken; + + /// Callback to be called when signup button is pressed. + final VoidCallback? onSignupPressed; + + /// Callback to be called when signup error occurs. + final Function(DerivSignupErrorState) onSingupError; + + /// sing-up page label + final String signupPageLable; + + /// sign-up page description + final String signupPageDescription; + + /// is social auth enabled + final bool isSocialAuthEnabled; + + /// Social auth state handler. + final Function(SocialAuthState) socialAuthStateHandler; + + /// Redirect URL for social auth. + final String redirectURL; + + /// Callback for web view error. + final Function(String) onWebViewError; + + /// Callback to be called when social auth button is tapped. + /// Give access to [SocialAuthDto] for 2FA. + final SocialAuthCallback? onSocialAuthButtonPressed; +} 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 new file mode 100644 index 000000000..b09669843 --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/features/get_started/pages/get_started_page.dart @@ -0,0 +1,37 @@ +import 'package:deriv_auth/features/get_started/presentation/layouts/deriv_get_started_layout.dart'; +import 'package:deriv_auth/features/single_entry/core/auth_data.dart'; +import 'package:deriv_auth/features/single_entry/features/login/pages/login_page.dart'; +import 'package:deriv_auth/features/single_entry/features/settings/pages/settings_page.dart'; +import 'package:deriv_auth/features/single_entry/features/signup/pages/signup_page.dart'; +import 'package:flutter/material.dart'; + +/// Get started page +class GetStartedPage extends StatelessWidget { + /// Constructor [GetStartedPage] + const GetStartedPage(); + + @override + Widget build(BuildContext context) => DerivGetStartedLayout( + slides: AuthData().data.getStartedPage.slides, + appLogoIconPath: AuthData().data.getStartedPage.appLogoIconPath, + backgroundImagePath: AuthData().data.getStartedPage.backgroundImagePath, + onLoginTapped: () => Navigator.of(context).push( + MaterialPageRoute( + builder: (BuildContext context) => const LoginPage(), + ), + ), + onSignupTapped: () => Navigator.of(context).push( + MaterialPageRoute( + builder: (BuildContext context) => const SignupPage(), + ), + ), + onTapNavigation: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => const SettingsPage(), + ), + ); + }, + ); +} diff --git a/packages/deriv_auth/lib/features/single_entry/features/home/pages/home_page.dart b/packages/deriv_auth/lib/features/single_entry/features/home/pages/home_page.dart new file mode 100644 index 000000000..b1ae6832a --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/features/home/pages/home_page.dart @@ -0,0 +1,30 @@ +import 'package:flutter/material.dart'; + +class HomePage extends StatelessWidget { + const HomePage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Deriv Auth UI'), + ), + body: const Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + 'Deriv Auth UI', + style: TextStyle(fontSize: 24), + ), + SizedBox(height: 16), + Text( + 'Deriv Auth UI is a Flutter package that provides a set of ready-to-use widgets for building authentication flows in your app.', + textAlign: TextAlign.center, + ), + ], + ), + ), + ); + } +} diff --git a/packages/deriv_auth/lib/features/single_entry/features/login/pages/login_page.dart b/packages/deriv_auth/lib/features/single_entry/features/login/pages/login_page.dart new file mode 100644 index 000000000..7df28097f --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/features/login/pages/login_page.dart @@ -0,0 +1,58 @@ +import 'package:deriv_auth/features/auth/cubit/deriv_auth_cubit.dart'; +import 'package:deriv_auth/features/login/presentation/layouts/deriv_login_layout.dart'; +import 'package:deriv_auth/features/single_entry/core/auth_data.dart'; +import 'package:deriv_auth/features/single_entry/features/home/pages/home_page.dart'; +import 'package:deriv_auth/features/single_entry/features/reset_pass/pages/reset_pass_page.dart'; +import 'package:deriv_auth/features/single_entry/features/signup/pages/signup_page.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; + +/// Login page +class LoginPage extends StatefulWidget { + /// Constructor [LoginPage] + const LoginPage({super.key}); + + @override + State createState() => _LoginPageState(); +} + +class _LoginPageState extends State { + @override + void initState() { + BlocProvider.of(context).logout(); + super.initState(); + } + + @override + Widget build(BuildContext context) => DerivLoginLayout( + welcomeLabel: AuthData().data.loginPageModel.welcomeLabel, + greetingLabel: AuthData().data.loginPageModel.greetingLabel, + onLoggedIn: (_) => Navigator.pushReplacement( + context, + MaterialPageRoute( + builder: (BuildContext context) => const HomePage(), + ), + ), + authErrorStateHandler: + AuthData().data.loginPageModel.authErrorStateHandler, + onLoginError: AuthData().data.loginPageModel.onLoginError, + onResetPassTapped: () => Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => const ResetPassPage(), + ), + ), + onSignupTapped: () => Navigator.pushReplacement( + context, + MaterialPageRoute( + builder: (BuildContext context) => const SignupPage(), + ), + ), + onSocialAuthButtonPressed: + AuthData().data.loginPageModel.onSocialAuthButtonPressed, + socialAuthStateHandler: + AuthData().data.loginPageModel.socialAuthStateHandler, + redirectURL: AuthData().data.loginPageModel.redirectURL, + onWebViewError: AuthData().data.loginPageModel.onWebViewError, + ); +} diff --git a/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/choose_new_password_page.dart b/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/choose_new_password_page.dart new file mode 100644 index 000000000..7b1ed804b --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/choose_new_password_page.dart @@ -0,0 +1,29 @@ +import 'package:deriv_auth/deriv_auth.dart'; +import 'package:deriv_auth/features/single_entry/core/auth_data.dart'; +import 'package:deriv_auth/features/single_entry/features/reset_pass/pages/reset_pass_success_page.dart'; +import 'package:flutter/material.dart'; + +/// Choose new password page +class ChooseNewPasswordPage extends StatelessWidget { + /// Constructor [ChooseNewPasswordPage] + const ChooseNewPasswordPage({required this.token, super.key}); + + /// Token + final String token; + + @override + Widget build(BuildContext context) => DerivChooseNewPassLayout( + token: token, + onResetPassSucceed: + AuthData().data.resetPassPageModel.onResetPassSucceed ?? + () { + Navigator.of(context).push( + MaterialPageRoute( + builder: (BuildContext context) => + const ResetPassSuccessPage(), + ), + ); + }, + onResetPassError: AuthData().data.resetPassPageModel.onResetPassError, + ); +} diff --git a/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/reset_pass_page.dart b/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/reset_pass_page.dart new file mode 100644 index 000000000..0c0bcf3c7 --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/reset_pass_page.dart @@ -0,0 +1,19 @@ +import 'package:deriv_auth/deriv_auth.dart'; +import 'package:deriv_auth/features/single_entry/core/auth_data.dart'; +import 'package:flutter/material.dart'; + +/// Reset password page +class ResetPassPage extends StatefulWidget { + /// Constructor for reset password page + const ResetPassPage({super.key}); + + @override + State createState() => _ResetPasswordPageState(); +} + +class _ResetPasswordPageState extends State { + @override + Widget build(BuildContext context) => DerivResetPassLayout( + onResetPassError: AuthData().data.resetPassPageModel.onResetPassError, + ); +} diff --git a/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/reset_pass_success_page.dart b/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/reset_pass_success_page.dart new file mode 100644 index 000000000..cec69f638 --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/reset_pass_success_page.dart @@ -0,0 +1,42 @@ +import 'package:deriv_auth/deriv_auth.dart'; +import 'package:deriv_auth/features/single_entry/core/auth_data.dart'; +import 'package:deriv_auth/features/single_entry/features/login/pages/login_page.dart'; +import 'package:flutter/material.dart'; + +/// Reset Password success page +class ResetPassSuccessPage extends StatefulWidget { + /// Constructor [ResetPassSuccessPage] + const ResetPassSuccessPage({super.key}); + + @override + State createState() => _ResetPassSuccessPageState(); +} + +class _ResetPassSuccessPageState extends State { + static const Duration _successPageHoldDuration = Duration(seconds: 2); + + @override + void initState() { + super.initState(); + + // wait for either [_successPageHoldDuration] or logout to finish + // then navigate to loginPage + Future.wait( + >[ + Future.delayed(_successPageHoldDuration), + AuthData().data.derivAuthCubit.logout(), + ], + ).then( + (_) { + Navigator.of(context).push( + MaterialPageRoute( + builder: (BuildContext context) => const LoginPage(), + ), + ); + }, + ); + } + + @override + Widget build(BuildContext context) => const DerivSuccessPassChangeLayout(); +} diff --git a/packages/deriv_auth/lib/features/single_entry/features/settings/pages/settings_page.dart b/packages/deriv_auth/lib/features/single_entry/features/settings/pages/settings_page.dart new file mode 100644 index 000000000..149c3a540 --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/features/settings/pages/settings_page.dart @@ -0,0 +1,24 @@ +import 'package:deriv_auth/deriv_auth.dart'; +import 'package:deriv_auth/features/single_entry/core/auth_data.dart'; +import 'package:flutter/material.dart'; + +/// Setting page +class SettingsPage extends StatefulWidget { + /// Constructor for setting page + const SettingsPage({super.key}); + + @override + State createState() => _SettingsPageState(); +} + +class _SettingsPageState extends State { + @override + Widget build(BuildContext context) => DerivSettingLayout( + updateFlavorConfigs: + AuthData().data.settingPageModel.updateFlavorConfigs, + appLabel: AuthData().data.settingPageModel.appLabel, + saveValues: AuthData().data.settingPageModel.saveValues, + appId: AuthData().data.settingPageModel.appId.call(), + endpoint: AuthData().data.settingPageModel.endpoint.call(), + ); +} diff --git a/packages/deriv_auth/lib/features/single_entry/features/signup/pages/country_selection_page.dart b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/country_selection_page.dart new file mode 100644 index 000000000..a9b0f03fe --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/country_selection_page.dart @@ -0,0 +1,37 @@ +import 'package:deriv_auth/deriv_auth.dart'; +import 'package:deriv_auth/features/single_entry/core/auth_data.dart'; +import 'package:deriv_auth/features/single_entry/features/signup/pages/set_password_page.dart'; +import 'package:flutter/material.dart'; + +/// Country selection page +class CountrySelectionPage extends StatelessWidget { + /// + const CountrySelectionPage({ + required this.verificationCode, + this.affiliateToken, + super.key, + }); + + /// Verification code + final String verificationCode; + + /// + final String? affiliateToken; + + @override + Widget build(BuildContext context) => DerivCountrySelectionLayout( + onNextPressed: () { + Navigator.of(context).push( + MaterialPageRoute( + builder: (BuildContext context) => SetPasswordPage( + verificationCode: verificationCode, + affiliateToken: affiliateToken, + ), + ), + ); + }, + residences: AuthData().data.resetPassPageModel.residences, + verificationCode: verificationCode, + affiliateToken: affiliateToken, + ); +} diff --git a/packages/deriv_auth/lib/features/single_entry/features/signup/pages/set_password_page.dart b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/set_password_page.dart new file mode 100644 index 000000000..6950bcdb3 --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/set_password_page.dart @@ -0,0 +1,43 @@ +import 'package:deriv_auth/deriv_auth.dart'; +import 'package:deriv_auth/features/single_entry/core/auth_data.dart'; +import 'package:deriv_auth/features/single_entry/features/signup/pages/country_selection_page.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; + +/// Set password page +class SetPasswordPage extends StatelessWidget { + /// Constructor [SetPasswordPage] + const SetPasswordPage({ + required this.verificationCode, + this.affiliateToken, + super.key, + }); + + /// Verification code + final String verificationCode; + + /// + final String? affiliateToken; + + @override + Widget build(BuildContext context) => DerivSetPasswordLayout( + authErrorStateHandler: AuthErrorStateHandler(context: context), + onDerivSignupState: (BuildContext constext, DerivSignupState state) { + if (state is DerivSignupDoneState) { + context + .read() + .tokenLogin(state.account?.token ?? 'defaultToken'); + } + }, + onPreviousPressed: () => Navigator.of(context).push( + MaterialPageRoute( + builder: (BuildContext context) => CountrySelectionPage( + verificationCode: verificationCode, + affiliateToken: affiliateToken, + ), + ), + ), + residence: AuthData().data.resetPassPageModel.userResidence, + verificationCode: verificationCode, + ); +} diff --git a/packages/deriv_auth/lib/features/single_entry/features/signup/pages/signup_page.dart b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/signup_page.dart new file mode 100644 index 000000000..0a13d63fd --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/signup_page.dart @@ -0,0 +1,46 @@ +import 'package:deriv_auth/deriv_auth.dart'; +import 'package:deriv_auth/features/single_entry/core/auth_data.dart'; +import 'package:deriv_auth/features/single_entry/features/login/pages/login_page.dart'; +import 'package:deriv_auth/features/single_entry/features/signup/pages/verify_email_page.dart'; +import 'package:flutter/material.dart'; + +/// Sing up page +class SignupPage extends StatefulWidget { + /// Constructor for sign up page + const SignupPage({super.key}); + + @override + State createState() => _SignupPageState(); +} + +class _SignupPageState extends State { + @override + Widget build(BuildContext context) => DerivSignupLayout( + authErrorStateHandler: AuthErrorStateHandler(context: context), + signupPageLabel: AuthData().data.signupPageModel.signupPageLable, + signupPageDescription: + AuthData().data.signupPageModel.signupPageDescription, + onSocialAuthButtonPressed: + AuthData().data.signupPageModel.onSocialAuthButtonPressed, + onSingupError: AuthData().data.signupPageModel.onSingupError, + onSingupEmailSent: (String email) => Navigator.of(context).push( + MaterialPageRoute( + builder: (BuildContext context) => VerifyEmailPage( + email: email, + ), + ), + ), + onSignupPressed: AuthData().data.signupPageModel.onSignupPressed, + isSocialAuthEnabled: + AuthData().data.signupPageModel.isSocialAuthEnabled, + onLoginTapped: () => Navigator.of(context).pushReplacement( + MaterialPageRoute( + builder: (BuildContext context) => const LoginPage(), + ), + ), + socialAuthStateHandler: + AuthData().data.signupPageModel.socialAuthStateHandler, + redirectURL: AuthData().data.signupPageModel.redirectURL, + onWebViewError: AuthData().data.signupPageModel.onWebViewError, + ); +} diff --git a/packages/deriv_auth/lib/features/single_entry/features/signup/pages/verification_done_page.dart b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/verification_done_page.dart new file mode 100644 index 000000000..70e34d723 --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/verification_done_page.dart @@ -0,0 +1,35 @@ +import 'package:deriv_auth/deriv_auth.dart'; +import 'package:deriv_auth/features/single_entry/features/signup/pages/country_selection_page.dart'; +import 'package:flutter/material.dart'; + +/// Verification done page +class VerificationDonePage extends StatelessWidget { + /// + const VerificationDonePage({ + required this.verificationCode, + super.key, + this.affiliateToken, + }); + + /// verification code + final String verificationCode; + + /// + final String? affiliateToken; + + @override + Widget build(BuildContext context) => DerivVerificationDoneLayout( + onContinuePressed: () { + Navigator.of(context).push( + MaterialPageRoute( + builder: (BuildContext context) => CountrySelectionPage( + verificationCode: verificationCode, + affiliateToken: affiliateToken, + ), + ), + ); + }, + verificationCode: verificationCode, + affiliateToken: affiliateToken, + ); +} diff --git a/packages/deriv_auth/lib/features/single_entry/features/signup/pages/verify_email_page.dart b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/verify_email_page.dart new file mode 100644 index 000000000..d12203b6f --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/features/signup/pages/verify_email_page.dart @@ -0,0 +1,40 @@ +import 'package:deriv_auth/deriv_auth.dart'; +import 'package:deriv_auth/features/single_entry/features/signup/pages/signup_page.dart'; +import 'package:flutter/material.dart'; + +/// Verify email page +class VerifyEmailPage extends StatefulWidget { + /// Constructor for verify email page + const VerifyEmailPage({required this.email, super.key}); + + /// email + final String email; + + @override + State createState() => _VerifyEmailPageState(); +} + +class _VerifyEmailPageState extends State { + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) => DerivVerifyEmailLayout( + email: widget.email, + onEmailNotReceivedPressed: () => onEmailNotReceivedPressed(context), + ); + + void onEmailNotReceivedPressed(BuildContext context) { + Navigator.of(context).pushReplacement(MaterialPageRoute( + builder: (BuildContext context) => DerivEmailNotReceivedLayout( + onReEnterEmailPressed: () => Navigator.of(context).pushReplacement( + MaterialPageRoute( + builder: (BuildContext context) => const SignupPage(), + ), + ), + ), + )); + } +} diff --git a/packages/deriv_auth/lib/features/single_entry/features/signup/repositories/referral_repository.dart b/packages/deriv_auth/lib/features/single_entry/features/signup/repositories/referral_repository.dart new file mode 100644 index 000000000..f3a42d877 --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/features/signup/repositories/referral_repository.dart @@ -0,0 +1,8 @@ +import 'package:deriv_auth/core/services/referral/base_referral_code_service.dart'; + +/// Referral repository +class ReferralRepository implements BaseReferralCodeService { + @override + Future getReferralToken(String referralCode) => + Future.value('${referralCode}Token'); +} diff --git a/packages/deriv_auth/lib/features/single_entry/pages/auth_entry_page.dart b/packages/deriv_auth/lib/features/single_entry/pages/auth_entry_page.dart new file mode 100644 index 000000000..f15fcaa86 --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/pages/auth_entry_page.dart @@ -0,0 +1,15 @@ +import 'package:deriv_auth/deriv_auth.dart'; +import 'package:deriv_auth/features/single_entry/core/auth_data.dart'; +import 'package:deriv_auth/features/single_entry/features/get_started/pages/get_started_page.dart'; +import 'package:flutter/material.dart'; + +/// Auth entry page for single entry +class AuthEntryPage extends StatelessWidget { + /// Constructor [AuthEntryPage] + AuthEntryPage(AuthEntryModel entryData) { + AuthData().data = entryData; + } + + @override + Widget build(BuildContext context) => const GetStartedPage(); +} diff --git a/packages/deriv_auth/lib/features/single_entry/single_entry.dart b/packages/deriv_auth/lib/features/single_entry/single_entry.dart new file mode 100644 index 000000000..a3a619eae --- /dev/null +++ b/packages/deriv_auth/lib/features/single_entry/single_entry.dart @@ -0,0 +1,2 @@ +export 'core/models/models.dart'; +export 'pages/auth_entry_page.dart'; diff --git a/packages/deriv_auth/test/features/reset_password/presentation/layouts/deriv_reset_pass_layout_test.dart b/packages/deriv_auth/test/features/reset_password/presentation/layouts/deriv_reset_pass_layout_test.dart index 30c43f2a3..b2e69bca5 100644 --- a/packages/deriv_auth/test/features/reset_password/presentation/layouts/deriv_reset_pass_layout_test.dart +++ b/packages/deriv_auth/test/features/reset_password/presentation/layouts/deriv_reset_pass_layout_test.dart @@ -1,7 +1,6 @@ // ignore_for_file: always_specify_types import 'package:deriv_auth/deriv_auth.dart'; -import 'package:deriv_auth/features/reset_password/presentation/layouts/deriv_reset_pass_layout.dart'; import 'package:deriv_ui/deriv_ui.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -32,7 +31,10 @@ void main() { BlocProvider.value( value: mockResetPassCubit, child: DerivResetPassLayout( - onResetPassError: (String? error) {}, + onResetPassError: ({ + required bool isLinkExpired, + String? error, + }) {}, ), ), ); @@ -53,7 +55,10 @@ void main() { BlocProvider.value( value: mockResetPassCubit, child: DerivResetPassLayout( - onResetPassError: (String? error) {}, + onResetPassError: ({ + required bool isLinkExpired, + String? error, + }) {}, ), ), ); @@ -77,7 +82,10 @@ void main() { BlocProvider.value( value: mockResetPassCubit, child: DerivResetPassLayout( - onResetPassError: (String? error) {}, + onResetPassError: ({ + required bool isLinkExpired, + String? error, + }) {}, ), ), ); @@ -102,7 +110,10 @@ void main() { BlocProvider.value( value: mockResetPassCubit, child: DerivResetPassLayout( - onResetPassError: (String? error) {}, + onResetPassError: ({ + required bool isLinkExpired, + String? error, + }) {}, ), ), ); @@ -132,7 +143,10 @@ void main() { BlocProvider.value( value: mockResetPassCubit, child: DerivResetPassLayout( - onResetPassError: (String? error) {}, + onResetPassError: ({ + required bool isLinkExpired, + String? error, + }) {}, ), ), ); @@ -162,7 +176,10 @@ void main() { BlocProvider.value( value: mockResetPassCubit, child: DerivResetPassLayout( - onResetPassError: (String? error) { + onResetPassError: ({ + required bool isLinkExpired, + String? error, + }) { onResetPassErrorCalled = true; }, ), From 1e5ba63165ff214ec44e589daddb9566ec47b94a Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Mon, 4 Mar 2024 15:37:37 +0400 Subject: [PATCH 021/162] refactor(deriv_auth): linked onLoggedIn function in login_page --- .../single_entry/features/login/pages/login_page.dart | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/deriv_auth/lib/features/single_entry/features/login/pages/login_page.dart b/packages/deriv_auth/lib/features/single_entry/features/login/pages/login_page.dart index 7df28097f..034a06c15 100644 --- a/packages/deriv_auth/lib/features/single_entry/features/login/pages/login_page.dart +++ b/packages/deriv_auth/lib/features/single_entry/features/login/pages/login_page.dart @@ -27,12 +27,7 @@ class _LoginPageState extends State { Widget build(BuildContext context) => DerivLoginLayout( welcomeLabel: AuthData().data.loginPageModel.welcomeLabel, greetingLabel: AuthData().data.loginPageModel.greetingLabel, - onLoggedIn: (_) => Navigator.pushReplacement( - context, - MaterialPageRoute( - builder: (BuildContext context) => const HomePage(), - ), - ), + onLoggedIn: AuthData().data.loginPageModel.onLoggedIn, authErrorStateHandler: AuthData().data.loginPageModel.authErrorStateHandler, onLoginError: AuthData().data.loginPageModel.onLoginError, From c12a9ee43fcc321a9f2ca404215a4f15069e4a71 Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Mon, 4 Mar 2024 15:46:35 +0400 Subject: [PATCH 022/162] refactor(deriv_auth): updated `deriv_http_client` --- packages/deriv_auth/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index 368979052..d69a0778a 100644 --- a/packages/deriv_auth/pubspec.yaml +++ b/packages/deriv_auth/pubspec.yaml @@ -29,7 +29,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_http_client - ref: deriv_http_client-v1.0.0 + ref: deriv_http_client-v2.0.1 flutter_deriv_api: git: From c3187ba85494198bb3b11e568ad50ff714b69cfa Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Mon, 4 Mar 2024 15:59:55 +0400 Subject: [PATCH 023/162] refactor(deriv_auth): updated flutter_deriv_api --- packages/deriv_auth/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index d69a0778a..5f2a0ad56 100644 --- a/packages/deriv_auth/pubspec.yaml +++ b/packages/deriv_auth/pubspec.yaml @@ -67,7 +67,7 @@ dependency_overrides: flutter_deriv_api: git: url: git@github.com:deriv-com/flutter-deriv-api.git - ref: 64ad3673598ad807b43f751fc2ec7bc5ef01203e + ref: 82ddc3e22ca6ac85a6c7ff4bac082a1574a90c93 deriv_ui: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git From a3cce1fb5884592d0329e67de4a5a6ca9b55f694 Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Mon, 4 Mar 2024 16:09:30 +0400 Subject: [PATCH 024/162] fix(deriv_auth): fixed onPressed error. --- .../presentation/widgets/deriv_social_auth_panel.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 2d6184d96..386e8fffe 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 @@ -115,7 +115,7 @@ class _DerivSocialAuthPanelState extends State { ], ), ), - onPressed: widget.isEnabled + onTap: widget.isEnabled ? () async { final List? socialAuthProviders = await _socialAuthCubit.getSocialAuthProviders(); From c93046abadefeb4af75cb0a2996f69a37415b33e Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Mon, 4 Mar 2024 16:34:23 +0400 Subject: [PATCH 025/162] refactor(deriv_auth): added context to onLoggedIn --- .../token/services/deriv_token_service.dart | 3 ++- .../layouts/deriv_login_layout.dart | 4 ++-- .../core/models/login_page_model.dart | 3 ++- .../layouts/deriv_login_layout_test.dart | 20 +++++++++---------- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/packages/deriv_auth/lib/core/services/token/services/deriv_token_service.dart b/packages/deriv_auth/lib/core/services/token/services/deriv_token_service.dart index cac73be25..f516b7a96 100644 --- a/packages/deriv_auth/lib/core/services/token/services/deriv_token_service.dart +++ b/packages/deriv_auth/lib/core/services/token/services/deriv_token_service.dart @@ -3,6 +3,7 @@ import 'package:deriv_auth/core/services/token/models/login_request.dart'; import 'package:deriv_auth/core/services/token/models/login_response.dart'; import 'package:deriv_auth/core/services/token/services/base_token_service.dart'; import 'package:deriv_http_client/deriv_http_client.dart'; +import 'package:http/http.dart'; /// Deriv Implementation of a [BaseTokenService]. class DerivTokenService implements BaseTokenService { @@ -17,7 +18,7 @@ class DerivTokenService implements BaseTokenService { /// Extract login url from connection info. final String baseUrl = 'https://${connectionInfo.endpoint}/oauth2/api/v1'; final String loginUrl = '$baseUrl/login'; - final BaseHttpClient client = httpClient ?? ProxyAwareHttpClient(baseUrl); + final BaseHttpClient client = httpClient ?? HttpClient(); /// Call API. final Map jsonResponse = await client.post( 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 cebec3622..f6b8253ea 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 @@ -40,7 +40,7 @@ class DerivLoginLayout extends StatefulWidget { final Function(DerivAuthErrorState)? onLoginError; /// Callback to be called when user is logged in. - final Function(DerivAuthLoggedInState) onLoggedIn; + final Function(BuildContext, DerivAuthLoggedInState) onLoggedIn; /// Callback to be called when social auth button is tapped. /// Give access to [SocialAuthDto] for 2FA. @@ -309,7 +309,7 @@ class _DerivLoginLayoutState extends State { } if (state is DerivAuthLoggedInState) { - widget.onLoggedIn.call(state); + widget.onLoggedIn.call(context, state); } } diff --git a/packages/deriv_auth/lib/features/single_entry/core/models/login_page_model.dart b/packages/deriv_auth/lib/features/single_entry/core/models/login_page_model.dart index bfb98d9ef..3bac56864 100644 --- a/packages/deriv_auth/lib/features/single_entry/core/models/login_page_model.dart +++ b/packages/deriv_auth/lib/features/single_entry/core/models/login_page_model.dart @@ -1,4 +1,5 @@ import 'package:deriv_auth/deriv_auth.dart'; +import 'package:flutter/material.dart'; /// LoginPageModel class class LoginPageModel { @@ -25,7 +26,7 @@ class LoginPageModel { final Function(DerivAuthErrorState)? onLoginError; /// Callback to be called when user is logged in. - final Function(DerivAuthLoggedInState) onLoggedIn; + final Function(BuildContext, DerivAuthLoggedInState) onLoggedIn; /// Callback to be called when social auth button is tapped. /// Give access to [SocialAuthDto] for 2FA. diff --git a/packages/deriv_auth/test/features/login/presentation/layouts/deriv_login_layout_test.dart b/packages/deriv_auth/test/features/login/presentation/layouts/deriv_login_layout_test.dart index e2427526e..637305dc5 100644 --- a/packages/deriv_auth/test/features/login/presentation/layouts/deriv_login_layout_test.dart +++ b/packages/deriv_auth/test/features/login/presentation/layouts/deriv_login_layout_test.dart @@ -67,7 +67,7 @@ void main() { greetingLabel: greetingLabel, onResetPassTapped: () {}, onSignupTapped: () {}, - onLoggedIn: (_) {}, + onLoggedIn: (_, __) {}, onSocialAuthButtonPressed: (SocialAuthDto p0) {}, onLoginError: (_) {}, ), @@ -104,7 +104,7 @@ void main() { greetingLabel: greetingLabel, onResetPassTapped: () {}, onSignupTapped: () {}, - onLoggedIn: (_) {}, + onLoggedIn: (_, __) {}, onSocialAuthButtonPressed: (_) {}, onLoginError: (_) {}, ), @@ -143,7 +143,7 @@ void main() { greetingLabel: greetingLabel, onResetPassTapped: () {}, onSignupTapped: () {}, - onLoggedIn: (_) {}, + onLoggedIn: (_, __) {}, onSocialAuthButtonPressed: (_) {}, onLoginError: (_) {}, ), @@ -178,7 +178,7 @@ void main() { onSignupTapped: () { onSignupTappedCalled = true; }, - onLoggedIn: (_) {}, + onLoggedIn: (_, __) {}, onSocialAuthButtonPressed: (_) {}, onLoginError: (_) {}, ), @@ -222,7 +222,7 @@ void main() { greetingLabel: greetingLabel, onResetPassTapped: () {}, onSignupTapped: () {}, - onLoggedIn: (_) { + onLoggedIn: (_, __) { onLoggedInCalled = true; }, onSocialAuthButtonPressed: (_) {}, @@ -263,7 +263,7 @@ void main() { onLoginError: (_) { onLoginErrorCalled = true; }, - onLoggedIn: (_) {}, + onLoggedIn: (_, __) {}, onSocialAuthButtonPressed: (_) {}, ), )); @@ -298,7 +298,7 @@ void main() { onResetPassTapped: () {}, onSignupTapped: () {}, onLoginError: (_) {}, - onLoggedIn: (_) {}, + onLoggedIn: (_, __) {}, onSocialAuthButtonPressed: (_) {}, ), )); @@ -332,7 +332,7 @@ void main() { onResetPassTappedCalled = true; }, onSignupTapped: () {}, - onLoggedIn: (_) {}, + onLoggedIn: (_, __) {}, onSocialAuthButtonPressed: (_) {}, onLoginError: (_) {}, ), @@ -378,7 +378,7 @@ void main() { greetingLabel: greetingLabel, onResetPassTapped: () {}, onSignupTapped: () {}, - onLoggedIn: (_) {}, + onLoggedIn: (_, __) {}, onSocialAuthButtonPressed: (_) { onSocialAuthButtonPressedCalled = true; }, @@ -424,7 +424,7 @@ void main() { greetingLabel: greetingLabel, onResetPassTapped: () {}, onSignupTapped: () {}, - onLoggedIn: (_) {}, + onLoggedIn: (_, __) {}, onSocialAuthButtonPressed: (_) {}, onLoginError: (_) {}, ), From 5c19f3aee610bd3ff9e9c25edae4a558ae8a97b8 Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Mon, 4 Mar 2024 17:11:45 +0400 Subject: [PATCH 026/162] fix(deriv_auth): calling onLoggedIn correctly --- .../features/login/presentation/layouts/deriv_login_layout.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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..37e321ed0 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 @@ -309,7 +309,7 @@ class _DerivLoginLayoutState extends State { } if (state is DerivAuthLoggedInState) { - widget.onLoggedIn.call(context, state); + widget.onLoggedIn(context, state); } } From 7333af283e3e5e00970a2dd49930f243d7f1f558 Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Wed, 27 Mar 2024 16:14:20 +0400 Subject: [PATCH 027/162] feat(deriv_passkeys): connected passkeys functionality with deriv auth --- .../features/auth/cubit/deriv_auth_cubit.dart | 28 +++++++++++++++---- .../layouts/deriv_login_layout.dart | 23 ++++++--------- .../layouts/deriv_signup_layout.dart | 1 + .../core/models/auth_entry_model.dart | 5 ++++ .../features/login/pages/login_page.dart | 2 -- .../widgets/deriv_social_auth_panel.dart | 4 +-- packages/deriv_auth/pubspec.yaml | 14 ++++------ 7 files changed, 43 insertions(+), 34 deletions(-) diff --git a/packages/deriv_auth/lib/features/auth/cubit/deriv_auth_cubit.dart b/packages/deriv_auth/lib/features/auth/cubit/deriv_auth_cubit.dart index 481787c6d..1de3db414 100644 --- a/packages/deriv_auth/lib/features/auth/cubit/deriv_auth_cubit.dart +++ b/packages/deriv_auth/lib/features/auth/cubit/deriv_auth_cubit.dart @@ -10,6 +10,7 @@ import 'package:deriv_auth/core/services/token/models/login_request.dart'; import 'package:deriv_auth/features/auth/deriv_auth_io.dart'; import 'package:deriv_auth/features/auth/services/base_auth_service.dart'; import 'package:deriv_auth/features/social_auth/models/social_auth_dto.dart'; +import 'package:deriv_passkeys/deriv_passkeys.dart'; part 'deriv_auth_state.dart'; @@ -17,7 +18,19 @@ part 'deriv_auth_state.dart'; /// and it is responsible for all login functionality. class DerivAuthCubit extends Cubit implements DerivAuthIO { /// Initialize a [DerivAuthCubit]. - DerivAuthCubit({required this.authService}) : super(DerivAuthLoadingState()); + DerivAuthCubit({ + required this.authService, + DerivPasskeysBloc? derivPasskeysBloc, + }) : super(DerivAuthLoadingState()) { + if (derivPasskeysBloc != null) { + derivPasskeysBloc.stream.listen((DerivPasskeysState state) async { + if (state is DerivPasskeysCredentialVerifiedState) { + derivPasskeysBloc.add(const DerivPasskeysGetPasskeysListEvent()); + await tokenLogin(state.token); + } + }); + } + } /// [BaseAuthService] handles all login logic of cubit. final BaseAuthService authService; @@ -133,12 +146,15 @@ class DerivAuthCubit extends Cubit implements DerivAuthIO { final LandingCompanyEntity landingCompanyEntity = await authService.getLandingCompany(authorizeEntity.country); _isUserMigrated = _checkUserMigrated(authorizeEntity); - emit(DerivAuthLoggedInState( - DerivAuthModel( - authorizeEntity: authorizeEntity, - landingCompany: landingCompanyEntity, + + emit( + DerivAuthLoggedInState( + DerivAuthModel( + authorizeEntity: authorizeEntity, + landingCompany: landingCompanyEntity, + ), ), - )); + ); } on DerivAuthException catch (error) { emit(DerivAuthErrorState( message: error.message, 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 37e321ed0..8ea23af7c 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,5 +1,7 @@ import 'dart:async'; import 'package:deriv_auth/deriv_auth.dart'; +import 'package:deriv_auth/features/single_entry/core/auth_data.dart'; +import 'package:deriv_passkeys/deriv_passkeys.dart'; import 'package:deriv_theme/deriv_theme.dart'; import 'package:deriv_ui/deriv_ui.dart'; import 'package:flutter/material.dart'; @@ -13,7 +15,6 @@ class DerivLoginLayout extends StatefulWidget { required this.onSignupTapped, required this.onLoggedIn, required this.welcomeLabel, - required this.greetingLabel, required this.socialAuthStateHandler, required this.redirectURL, required this.onWebViewError, @@ -53,9 +54,6 @@ class DerivLoginLayout extends StatefulWidget { /// Welcome text to be displayed on login page. final String welcomeLabel; - /// Greeting text to be displayed on login page. - final String greetingLabel; - /// Whether to display social auth buttons. final bool isSocialAuthEnabled; @@ -122,8 +120,8 @@ class _DerivLoginLayoutState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ ..._buildTopSection(), - const SizedBox(height: ThemeProvider.margin24), - const SizedBox(height: ThemeProvider.margin24), + const SizedBox(height: ThemeProvider.margin14), + // const SizedBox(height: ThemeProvider.margin24), ..._buildTextFields( isEnabled: state is! DerivAuthLoadingState), const SizedBox(height: ThemeProvider.margin24), @@ -139,6 +137,9 @@ class _DerivLoginLayoutState extends State { ), if (widget.isSocialAuthEnabled) const SizedBox(height: ThemeProvider.margin24), + ContinueWithPasskeyButton( + derivPasskeysBloc: AuthData().data.derivPasskeysBloc, + ), DerivSocialAuthPanel( socialAuthStateHandler: widget.socialAuthStateHandler, redirectURL: widget.redirectURL, @@ -164,18 +165,10 @@ class _DerivLoginLayoutState extends State { Text( widget.welcomeLabel, style: context.theme.textStyle( - textStyle: TextStyles.title, + textStyle: TextStyles.subheading, color: context.theme.colors.prominent, ), ), - const SizedBox(height: ThemeProvider.margin08), - Text( - widget.greetingLabel, - style: context.theme.textStyle( - textStyle: TextStyles.body1, - color: context.theme.colors.general, - ), - ), ]; List _buildTextFields({required bool isEnabled}) => [ diff --git a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_signup_layout.dart b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_signup_layout.dart index c466189ed..d94f7ef15 100644 --- a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_signup_layout.dart +++ b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_signup_layout.dart @@ -1,4 +1,5 @@ import 'package:deriv_auth/deriv_auth.dart'; +import 'package:deriv_auth/features/single_entry/core/auth_data.dart'; import 'package:deriv_theme/deriv_theme.dart'; import 'package:deriv_ui/deriv_ui.dart'; import 'package:flutter/material.dart'; diff --git a/packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart b/packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart index 23b2a5336..54a93e146 100644 --- a/packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart +++ b/packages/deriv_auth/lib/features/single_entry/core/models/auth_entry_model.dart @@ -1,4 +1,5 @@ import 'package:deriv_auth/deriv_auth.dart'; +import 'package:deriv_passkeys/deriv_passkeys.dart'; /// Auth Entry Model class class AuthEntryModel { @@ -7,6 +8,7 @@ class AuthEntryModel { required this.getStartedPage, required this.loginPageModel, required this.derivAuthCubit, + required this.derivPasskeysBloc, required this.signupPageModel, required this.settingPageModel, required this.resetPassPageModel, @@ -21,6 +23,9 @@ class AuthEntryModel { /// DerivAuthCubit final DerivAuthCubit derivAuthCubit; + /// DerivAuthCubit + final DerivPasskeysBloc derivPasskeysBloc; + /// SignupPage data model final SignupPageModel signupPageModel; diff --git a/packages/deriv_auth/lib/features/single_entry/features/login/pages/login_page.dart b/packages/deriv_auth/lib/features/single_entry/features/login/pages/login_page.dart index 034a06c15..8697e40c0 100644 --- a/packages/deriv_auth/lib/features/single_entry/features/login/pages/login_page.dart +++ b/packages/deriv_auth/lib/features/single_entry/features/login/pages/login_page.dart @@ -1,7 +1,6 @@ import 'package:deriv_auth/features/auth/cubit/deriv_auth_cubit.dart'; import 'package:deriv_auth/features/login/presentation/layouts/deriv_login_layout.dart'; import 'package:deriv_auth/features/single_entry/core/auth_data.dart'; -import 'package:deriv_auth/features/single_entry/features/home/pages/home_page.dart'; import 'package:deriv_auth/features/single_entry/features/reset_pass/pages/reset_pass_page.dart'; import 'package:deriv_auth/features/single_entry/features/signup/pages/signup_page.dart'; import 'package:flutter/material.dart'; @@ -26,7 +25,6 @@ class _LoginPageState extends State { @override Widget build(BuildContext context) => DerivLoginLayout( welcomeLabel: AuthData().data.loginPageModel.welcomeLabel, - greetingLabel: AuthData().data.loginPageModel.greetingLabel, onLoggedIn: AuthData().data.loginPageModel.onLoggedIn, authErrorStateHandler: AuthData().data.loginPageModel.authErrorStateHandler, 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 386e8fffe..277fec995 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 @@ -1,5 +1,6 @@ import 'package:deriv_auth/deriv_auth.dart'; -import 'package:deriv_passkeys/presentation/widgets/continue_with_passkey_button.dart'; +import 'package:deriv_auth/features/single_entry/core/auth_data.dart'; +import 'package:deriv_passkeys/deriv_passkeys.dart'; import 'package:deriv_theme/deriv_theme.dart'; import 'package:deriv_ui/deriv_ui.dart'; import 'package:flutter/material.dart'; @@ -71,7 +72,6 @@ class _DerivSocialAuthPanelState extends State { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - const ContinueWithPasskeyButton(), const SizedBox(height: ThemeProvider.margin08), _buildSocialAuthButton(SocialAuthProvider.google), const SizedBox(height: ThemeProvider.margin08), diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index f70efa9e7..7a0655a37 100644 --- a/packages/deriv_auth/pubspec.yaml +++ b/packages/deriv_auth/pubspec.yaml @@ -48,10 +48,11 @@ dependencies: ref: deriv_localizations-v1.1.2 deriv_passkeys: - git: - url: git@github.com:regentmarkets/flutter-deriv-packages.git - path: packages/deriv_passkeys - ref: c9b906bc20edbc94d0ca99f2211b142efa3aaf2e + path: ../../../flutter-deriv-packages/packages/deriv_passkeys + # git: + # url: git@github.com:regentmarkets/flutter-deriv-packages.git + # path: packages/deriv_passkeys + # ref: c9b906bc20edbc94d0ca99f2211b142efa3aaf2e flutter_bloc: ^8.1.3 flutter_svg: ^2.0.7 @@ -67,11 +68,6 @@ dependency_overrides: git: url: git@github.com:deriv-com/flutter-deriv-api.git ref: 82ddc3e22ca6ac85a6c7ff4bac082a1574a90c93 - deriv_ui: - git: - url: git@github.com:regentmarkets/flutter-deriv-packages.git - path: packages/deriv_ui - ref: deriv_ui-v0.0.6+2 dev_dependencies: mocktail: ^1.0.3 From 45cbbb6c20274e84e4f932057d0816a3b4dc581c Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Thu, 28 Mar 2024 10:32:32 +0400 Subject: [PATCH 028/162] refactor(deriv_auth): integrating deriv_passkeys. --- .../deriv_auth/docs/deriv_auth_layouts.md | 2 - .../get_started/pages/get_started_page.dart | 6 +-- .../lib/features/login/pages/login_page.dart | 18 +++---- .../pages/choose_new_password_page.dart | 2 +- .../reset_pass/pages/reset_pass_page.dart | 34 +++++++++++-- .../pages/reset_pass_success_page.dart | 5 +- .../settings/pages/settings_page.dart | 7 +-- .../signup/pages/country_selection_page.dart | 2 +- .../signup/pages/set_password_page.dart | 4 +- .../features/signup/pages/signup_page.dart | 8 ++-- .../signup/pages/verification_done_page.dart | 2 +- .../signup/pages/verify_email_page.dart | 2 +- packages/deriv_auth/example/lib/main.dart | 33 +++++++------ packages/deriv_auth/example/pubspec.yaml | 19 ++------ .../core/extensions/context_extension.dart | 4 +- .../helpers/country_selection_helper.dart | 2 +- .../deriv_unavailable_country_layout.dart | 8 ++-- .../core/states/auth_error_state_handler.dart | 48 +++++++++---------- .../features/auth/cubit/deriv_auth_cubit.dart | 12 +---- .../layouts/deriv_get_started_layout.dart | 4 +- .../layouts/deriv_2fa_layout.dart | 10 ++-- .../layouts/deriv_login_layout.dart | 21 ++++---- .../layouts/deriv_choose_new_pass_layout.dart | 10 ++-- .../layouts/deriv_reset_pass_layout.dart | 16 +++---- .../deriv_success_pass_change_layout.dart | 6 +-- .../layouts/deriv_setting_layout.dart | 14 +++--- .../deriv_country_selection_layout.dart | 8 ++-- .../deriv_email_not_received_layout.dart | 12 ++--- .../layouts/deriv_set_password_layout.dart | 8 ++-- .../layouts/deriv_signup_layout.dart | 28 +++++------ .../deriv_verification_done_layout.dart | 8 ++-- .../layouts/deriv_verify_email_layout.dart | 9 ++-- .../country_selection_list_widget.dart | 4 +- .../password_policy_checker_widget.dart | 13 +++-- .../lib/features/single_entry/README.md | 2 - .../core/models/login_page_model.dart | 4 -- .../pages/choose_new_password_page.dart | 3 +- .../widgets/deriv_social_auth_panel.dart | 3 -- packages/deriv_auth/pubspec.yaml | 2 +- .../layouts/deriv_login_layout_test.dart | 11 ----- 40 files changed, 197 insertions(+), 217 deletions(-) diff --git a/packages/deriv_auth/docs/deriv_auth_layouts.md b/packages/deriv_auth/docs/deriv_auth_layouts.md index e2bb1f3f7..5c770edfd 100644 --- a/packages/deriv_auth/docs/deriv_auth_layouts.md +++ b/packages/deriv_auth/docs/deriv_auth_layouts.md @@ -18,8 +18,6 @@ ``` dart DerivLoginLayout( welcomeLabel: 'Welcome back!', - greetingLabel: - 'Log in to your Deriv account to start trading and investing.', onResetPassTapped: () { // Navigate to reset password page }, diff --git a/packages/deriv_auth/example/lib/features/get_started/pages/get_started_page.dart b/packages/deriv_auth/example/lib/features/get_started/pages/get_started_page.dart index 46b0dc703..586baf711 100644 --- a/packages/deriv_auth/example/lib/features/get_started/pages/get_started_page.dart +++ b/packages/deriv_auth/example/lib/features/get_started/pages/get_started_page.dart @@ -1,8 +1,8 @@ import 'package:deriv_auth/features/get_started/models/deriv_get_started_slide_model.dart'; import 'package:deriv_auth/features/get_started/presentation/layouts/deriv_get_started_layout.dart'; -import 'package:example/features/login/pages/login_page.dart'; -import 'package:example/features/settings/pages/settings_page.dart'; -import 'package:example/features/signup/pages/signup_page.dart'; +import 'package:deriv_auth/features/single_entry/features/login/pages/login_page.dart'; +import 'package:deriv_auth/features/single_entry/features/settings/pages/settings_page.dart'; +import 'package:deriv_auth/features/single_entry/features/signup/pages/signup_page.dart'; import 'package:flutter/material.dart'; class GetStartedPage extends StatelessWidget { diff --git a/packages/deriv_auth/example/lib/features/login/pages/login_page.dart b/packages/deriv_auth/example/lib/features/login/pages/login_page.dart index c8f7ea323..2bfcc77a1 100644 --- a/packages/deriv_auth/example/lib/features/login/pages/login_page.dart +++ b/packages/deriv_auth/example/lib/features/login/pages/login_page.dart @@ -1,10 +1,7 @@ import 'package:deriv_auth/deriv_auth.dart'; -import 'package:deriv_auth/features/auth/cubit/deriv_auth_cubit.dart'; -import 'package:deriv_auth/features/login/presentation/layouts/deriv_login_layout.dart'; -import 'package:example/core/example_auth_error_state_handler.dart'; -import 'package:example/features/home/pages/home_page.dart'; -import 'package:example/features/reset_pass/pages/reset_pass_page.dart'; -import 'package:example/features/signup/pages/signup_page.dart'; +import 'package:deriv_auth/features/single_entry/features/home/pages/home_page.dart'; +import 'package:deriv_auth/features/single_entry/features/reset_pass/pages/reset_pass_page.dart'; +import 'package:deriv_auth/features/single_entry/features/signup/pages/signup_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -25,19 +22,18 @@ class _LoginPageState extends State { @override Widget build(BuildContext context) { return DerivLoginLayout( - socialAuthStateHandler: (_){}, + socialAuthStateHandler: (_) {}, redirectURL: 'deriv://example', onWebViewError: (String error) {}, welcomeLabel: 'Welcome back!', - greetingLabel: - 'Log in to your Deriv account to start trading and investing.', - onLoggedIn: (_) => Navigator.pushReplacement( + onLoggedIn: (BuildContext context, DerivAuthLoggedInState state) => + Navigator.pushReplacement( context, MaterialPageRoute( builder: (context) => const HomePage(), ), ), - authErrorStateHandler: ExampleAuthErrorStateHandler(context: context), + authErrorStateHandler: AuthErrorStateHandler(context: context), onLoginError: (_) {}, onResetPassTapped: () => Navigator.push( context, diff --git a/packages/deriv_auth/example/lib/features/reset_pass/pages/choose_new_password_page.dart b/packages/deriv_auth/example/lib/features/reset_pass/pages/choose_new_password_page.dart index 8a73b6ae9..e83aa1d0e 100644 --- a/packages/deriv_auth/example/lib/features/reset_pass/pages/choose_new_password_page.dart +++ b/packages/deriv_auth/example/lib/features/reset_pass/pages/choose_new_password_page.dart @@ -1,6 +1,6 @@ import 'package:deriv_auth/features/reset_password/cubit/reset_password_cubit.dart'; import 'package:deriv_auth/features/reset_password/presentation/layouts/deriv_choose_new_pass_layout.dart'; -import 'package:example/features/reset_pass/pages/reset_pass_success_page.dart'; +import 'package:deriv_auth/features/single_entry/features/reset_pass/pages/reset_pass_success_page.dart'; import 'package:flutter/material.dart'; class ChooseNewPasswordPage extends StatelessWidget { diff --git a/packages/deriv_auth/example/lib/features/reset_pass/pages/reset_pass_page.dart b/packages/deriv_auth/example/lib/features/reset_pass/pages/reset_pass_page.dart index f63728f9c..07786e198 100644 --- a/packages/deriv_auth/example/lib/features/reset_pass/pages/reset_pass_page.dart +++ b/packages/deriv_auth/example/lib/features/reset_pass/pages/reset_pass_page.dart @@ -2,8 +2,8 @@ import 'dart:async'; import 'package:deriv_auth/deriv_auth.dart'; import 'package:deriv_auth/features/reset_password/presentation/layouts/deriv_reset_pass_layout.dart'; -import 'package:example/features/reset_pass/pages/choose_new_password_page.dart'; -import 'package:example/features/reset_pass/services/example_reset_pass_service.dart'; +import 'package:deriv_auth/features/reset_password/services/base_reset_password_service.dart'; +import 'package:deriv_auth/features/single_entry/features/reset_pass/pages/choose_new_password_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -14,6 +14,22 @@ class ResetPassPage extends StatefulWidget { State createState() => _ResetPassPageState(); } +class ExampleResetPasswordService extends BaseResetPasswordService { + @override + Future resetPassword( + {required String verificationCode, required String newPassword}) { + // TODO: implement resetPassword + throw UnimplementedError(); + } + + @override + Future sendVerificationEmail( + VerifyEmailRequestEntity request) { + // TODO: implement sendVerificationEmail + throw UnimplementedError(); + } +} + class _ResetPassPageState extends State { late final DerivResetPassCubit cubit; late final StreamSubscription _streamSubscription; @@ -22,7 +38,7 @@ class _ResetPassPageState extends State { void initState() { super.initState(); - cubit = DerivResetPassCubit(service: ExampleResetPassService()); + cubit = DerivResetPassCubit(service: ExampleResetPasswordService()); _streamSubscription = cubit.stream.listen((state) { if (state is DerivResetPassEmailSentState) { @@ -30,7 +46,11 @@ class _ResetPassPageState extends State { if (mounted) { Navigator.of(context).push(MaterialPageRoute( builder: (context) => BlocProvider.value( - value: cubit, child: ChooseNewPasswordPage(cubit: cubit)), + value: cubit, + child: ChooseNewPasswordPage( + token: '', + cubit: cubit, + )), )); } }); @@ -41,9 +61,13 @@ class _ResetPassPageState extends State { @override Widget build(BuildContext context) { return BlocProvider.value( - value: cubit, child: DerivResetPassLayout(onResetPassError: (_) {})); + value: cubit, + child: DerivResetPassLayout(onResetPassError: onResetPassError), + ); } + onResetPassError({required bool isLinkExpired, String? error}) {} + @override void dispose() { cubit.close(); diff --git a/packages/deriv_auth/example/lib/features/reset_pass/pages/reset_pass_success_page.dart b/packages/deriv_auth/example/lib/features/reset_pass/pages/reset_pass_success_page.dart index 71fc15a57..0857ba275 100644 --- a/packages/deriv_auth/example/lib/features/reset_pass/pages/reset_pass_success_page.dart +++ b/packages/deriv_auth/example/lib/features/reset_pass/pages/reset_pass_success_page.dart @@ -1,7 +1,6 @@ import 'package:deriv_auth/deriv_auth.dart'; -import 'package:deriv_auth/features/reset_password/presentation/layouts/deriv_success_pass_change_layout.dart'; -import 'package:example/features/get_started/pages/get_started_page.dart'; -import 'package:example/features/login/pages/login_page.dart'; +import 'package:deriv_auth/features/single_entry/features/get_started/pages/get_started_page.dart'; +import 'package:deriv_auth/features/single_entry/features/login/pages/login_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; diff --git a/packages/deriv_auth/example/lib/features/settings/pages/settings_page.dart b/packages/deriv_auth/example/lib/features/settings/pages/settings_page.dart index 70d990683..6f8054f71 100644 --- a/packages/deriv_auth/example/lib/features/settings/pages/settings_page.dart +++ b/packages/deriv_auth/example/lib/features/settings/pages/settings_page.dart @@ -11,8 +11,8 @@ class SettingsPage extends StatefulWidget { class _SettingsPageState extends State { @override - Widget build(BuildContext context) => DerivSettingLayout( - updateFlavorConfigs: _updateFlavorConfig(), + Widget build(BuildContext context) => const DerivSettingLayout( + updateFlavorConfigs: _updateFlavorConfig, appLabel: 'appLabel', saveValues: _saveValues, ); @@ -23,6 +23,7 @@ _saveValues({required String appId, required String endpoint}) { logger.log('endpoint is $endpoint'); } -Future _updateFlavorConfig() async { +Future _updateFlavorConfig( + {required String appId, required String endpoint}) async { logger.log('Flavor CONFIG is updated'); } diff --git a/packages/deriv_auth/example/lib/features/signup/pages/country_selection_page.dart b/packages/deriv_auth/example/lib/features/signup/pages/country_selection_page.dart index 678e579c2..838961327 100644 --- a/packages/deriv_auth/example/lib/features/signup/pages/country_selection_page.dart +++ b/packages/deriv_auth/example/lib/features/signup/pages/country_selection_page.dart @@ -1,6 +1,6 @@ import 'package:deriv_auth/features/signup/models/deriv_residence_model.dart'; import 'package:deriv_auth/features/signup/presentation/layouts/deriv_country_selection_layout.dart'; -import 'package:example/features/signup/pages/set_password_page.dart'; +import 'package:deriv_auth/features/single_entry/features/signup/pages/set_password_page.dart'; import 'package:flutter/material.dart'; class CountrySelectionPage extends StatelessWidget { diff --git a/packages/deriv_auth/example/lib/features/signup/pages/set_password_page.dart b/packages/deriv_auth/example/lib/features/signup/pages/set_password_page.dart index 7638a547e..4fe8b51d0 100644 --- a/packages/deriv_auth/example/lib/features/signup/pages/set_password_page.dart +++ b/packages/deriv_auth/example/lib/features/signup/pages/set_password_page.dart @@ -1,6 +1,4 @@ import 'package:deriv_auth/deriv_auth.dart'; -import 'package:deriv_auth/features/signup/presentation/layouts/deriv_set_password_layout.dart'; -import 'package:example/core/example_auth_error_state_handler.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -12,7 +10,7 @@ class SetPasswordPage extends StatelessWidget { @override Widget build(BuildContext context) { return DerivSetPasswordLayout( - authErrorStateHandler: ExampleAuthErrorStateHandler(context: context), + authErrorStateHandler: AuthErrorStateHandler(context: context), onDerivSignupState: (context, state) { if (state is DerivSignupDoneState) { context diff --git a/packages/deriv_auth/example/lib/features/signup/pages/signup_page.dart b/packages/deriv_auth/example/lib/features/signup/pages/signup_page.dart index 347d22b5d..cff86d63f 100644 --- a/packages/deriv_auth/example/lib/features/signup/pages/signup_page.dart +++ b/packages/deriv_auth/example/lib/features/signup/pages/signup_page.dart @@ -1,8 +1,6 @@ import 'package:deriv_auth/deriv_auth.dart'; -import 'package:deriv_auth/features/signup/presentation/layouts/deriv_signup_layout.dart'; -import 'package:example/core/example_auth_error_state_handler.dart'; -import 'package:example/features/login/pages/login_page.dart'; -import 'package:example/features/signup/pages/verify_email_page.dart'; +import 'package:deriv_auth/features/single_entry/features/login/pages/login_page.dart'; +import 'package:deriv_auth/features/single_entry/features/signup/pages/verify_email_page.dart'; import 'package:flutter/material.dart'; class SignupPage extends StatefulWidget { @@ -18,7 +16,7 @@ class _SignupPageState extends State { socialAuthStateHandler: (_) => {}, redirectURL: 'deriv://example', onWebViewError: (String error) {}, - authErrorStateHandler: ExampleAuthErrorStateHandler(context: context), + authErrorStateHandler: AuthErrorStateHandler(context: context), signupPageLabel: 'Start trading with Deriv', signupPageDescription: 'Join over 1 million traders worldwide who loves trading at Deriv.', diff --git a/packages/deriv_auth/example/lib/features/signup/pages/verification_done_page.dart b/packages/deriv_auth/example/lib/features/signup/pages/verification_done_page.dart index 123d0aac3..e7b1a42c2 100644 --- a/packages/deriv_auth/example/lib/features/signup/pages/verification_done_page.dart +++ b/packages/deriv_auth/example/lib/features/signup/pages/verification_done_page.dart @@ -1,5 +1,5 @@ import 'package:deriv_auth/features/signup/presentation/layouts/deriv_verification_done_layout.dart'; -import 'package:example/features/signup/pages/country_selection_page.dart'; +import 'package:deriv_auth/features/single_entry/features/signup/pages/country_selection_page.dart'; import 'package:flutter/material.dart'; class VerificationDonePage extends StatelessWidget { diff --git a/packages/deriv_auth/example/lib/features/signup/pages/verify_email_page.dart b/packages/deriv_auth/example/lib/features/signup/pages/verify_email_page.dart index a0973cbd3..cbd5a43a5 100644 --- a/packages/deriv_auth/example/lib/features/signup/pages/verify_email_page.dart +++ b/packages/deriv_auth/example/lib/features/signup/pages/verify_email_page.dart @@ -2,7 +2,7 @@ import 'dart:async'; import 'package:deriv_auth/features/signup/presentation/layouts/deriv_email_not_received_layout.dart'; import 'package:deriv_auth/features/signup/presentation/layouts/deriv_verify_email_layout.dart'; -import 'package:example/features/signup/pages/verification_done_page.dart'; +import 'package:deriv_auth/features/single_entry/features/signup/pages/verification_done_page.dart'; import 'package:flutter/material.dart'; class VerifyEmailPage extends StatefulWidget { diff --git a/packages/deriv_auth/example/lib/main.dart b/packages/deriv_auth/example/lib/main.dart index ed6115f68..f16ee0fa0 100644 --- a/packages/deriv_auth/example/lib/main.dart +++ b/packages/deriv_auth/example/lib/main.dart @@ -1,13 +1,9 @@ import 'package:deriv_auth/deriv_auth.dart'; import 'package:deriv_http_client/deriv_http_client.dart'; -import 'package:deriv_passkeys/data/data_sources/deriv_passkeys_data_source.dart'; -import 'package:deriv_passkeys/data/mappers/deriv_passkeys_mapper.dart'; -import 'package:deriv_passkeys/data/repositories/deriv_passkeys_repository.dart'; -import 'package:deriv_passkeys/interactor/services/deriv_passkeys_service.dart'; -import 'package:deriv_passkeys/presentation/states/bloc/deriv_passkeys_bloc.dart'; +import 'package:deriv_passkeys/deriv_passkeys.dart'; import 'package:deriv_theme/deriv_theme.dart'; -import 'package:device_preview/device_preview.dart'; import 'package:deriv_localizations/l10n/generated/deriv_auth/deriv_auth_localizations.dart'; +import 'package:device_preview/device_preview.dart'; import 'package:example/features/get_started/pages/get_started_page.dart'; import 'package:example/features/login/repositories/example_login_repository.dart'; import 'package:example/features/signup/repositories/example_referral_repository.dart'; @@ -58,15 +54,22 @@ class MyApp extends StatelessWidget { ), ), BlocProvider( - create: (context) => DerivPasskeysBloc( - DerivPasskeysService( - DerivPasskeysRepository( - DerivPasskeysDataSource( - DerivPasskeysMapper(), - ), - ), - ), - )), + create: (context) => DerivPasskeysBloc( + getJwtToken: () async => "jwtToken", + derivPasskeysService: DerivPasskeysService( + DerivPasskeysRepository( + DerivPasskeysDataSource( + mapper: DerivPasskeysMapper(), + client: HttpClient(), + ), + ), + ), + connectionInfo: PasskeysConnectionInfoEntity( + appId: DerivAuthConnectionInfo().appId, + endpoint: DerivAuthConnectionInfo().endpoint, + ), + ), + ), ], child: DerivThemeProvider.builder( initialTheme: ThemeMode.dark, diff --git a/packages/deriv_auth/example/pubspec.yaml b/packages/deriv_auth/example/pubspec.yaml index 5185e1257..cf8589ebd 100644 --- a/packages/deriv_auth/example/pubspec.yaml +++ b/packages/deriv_auth/example/pubspec.yaml @@ -13,10 +13,7 @@ dependencies: sdk: flutter cupertino_icons: ^1.0.2 deriv_auth: - git: - url: git@github.com:regentmarkets/flutter-deriv-packages.git - path: packages/deriv_auth - ref: deriv_auth-v6.2.0 + path: .././ flutter_bloc: ^8.1.3 http: ^0.13.6 @@ -25,23 +22,13 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_http_client - ref: deriv_http_client-v1.0.0 - deriv_passkeys: - git: - url: git@github.com:regentmarkets/flutter-deriv-packages.git - path: packages/deriv_passkeys - ref: c9b906bc20edbc94d0ca99f2211b142efa3aaf2e + ref: deriv_http_client-v2.0.1 dependency_overrides: flutter_deriv_api: git: url: git@github.com:deriv-com/flutter-deriv-api.git - ref: 64ad3673598ad807b43f751fc2ec7bc5ef01203e - deriv_ui: - git: - url: git@github.com:regentmarkets/flutter-deriv-packages.git - path: packages/deriv_ui - ref: deriv_ui-v0.0.6+2 + ref: 82ddc3e22ca6ac85a6c7ff4bac082a1574a90c93 dev_dependencies: flutter_test: diff --git a/packages/deriv_auth/lib/core/extensions/context_extension.dart b/packages/deriv_auth/lib/core/extensions/context_extension.dart index a4e731bb5..7c9089c44 100644 --- a/packages/deriv_auth/lib/core/extensions/context_extension.dart +++ b/packages/deriv_auth/lib/core/extensions/context_extension.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; /// Extension methods for [BuildContext]. extension ContextExtension on BuildContext { - /// Gets [DerivAuthUILocalization]. - DerivAuthLocalizations get derivAuthLocalization => + /// Gets [DerivAuthLocalizations]. + DerivAuthLocalizations? get derivAuthLocalization => DerivAuthLocalizations.of(this); } diff --git a/packages/deriv_auth/lib/core/helpers/country_selection_helper.dart b/packages/deriv_auth/lib/core/helpers/country_selection_helper.dart index 06664331c..f442d3ff3 100644 --- a/packages/deriv_auth/lib/core/helpers/country_selection_helper.dart +++ b/packages/deriv_auth/lib/core/helpers/country_selection_helper.dart @@ -32,7 +32,7 @@ String getCountryConsentMessage( } final Map consentMessages = { - 'br': context.derivAuthLocalization.labelCountryConsentBrazil, + 'br': context.derivAuthLocalization!.labelCountryConsentBrazil, // Add more countries and consent messages here. }; diff --git a/packages/deriv_auth/lib/core/layouts/deriv_unavailable_country_layout.dart b/packages/deriv_auth/lib/core/layouts/deriv_unavailable_country_layout.dart index b00eedf59..f4a877d65 100644 --- a/packages/deriv_auth/lib/core/layouts/deriv_unavailable_country_layout.dart +++ b/packages/deriv_auth/lib/core/layouts/deriv_unavailable_country_layout.dart @@ -28,7 +28,7 @@ class DerivUnavailableCountryLayout extends StatelessWidget { Widget build(BuildContext context) => Scaffold( appBar: AppBar( elevation: ThemeProvider.zeroMargin, - title: Text(context.derivAuthLocalization.labelNotAvailable), + title: Text(context.derivAuthLocalization!.labelNotAvailable), ), body: Container( padding: @@ -50,7 +50,7 @@ class DerivUnavailableCountryLayout extends StatelessWidget { children: [ const SizedBox(height: ThemeProvider.margin16), Text( - context.derivAuthLocalization + context.derivAuthLocalization! .warnNotAvailableCountriesTitle(appName), style: TextStyles.title, textAlign: TextAlign.center, @@ -58,7 +58,7 @@ class DerivUnavailableCountryLayout extends StatelessWidget { const SizedBox(height: ThemeProvider.margin08), RichText( text: TextSpan( - text: context.derivAuthLocalization.warnNotAvailableCountries, + text: context.derivAuthLocalization!.warnNotAvailableCountries, style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.general, @@ -66,7 +66,7 @@ class DerivUnavailableCountryLayout extends StatelessWidget { children: [ buildTextSpanHyperlink( context: context, - label: context.derivAuthLocalization.labelLiveChat, + label: context.derivAuthLocalization!.labelLiveChat, onTap: onLiveChatPressed, style: context.theme.textStyle( textStyle: TextStyles.body1Bold, diff --git a/packages/deriv_auth/lib/core/states/auth_error_state_handler.dart b/packages/deriv_auth/lib/core/states/auth_error_state_handler.dart index e473dfcc8..b01469d26 100644 --- a/packages/deriv_auth/lib/core/states/auth_error_state_handler.dart +++ b/packages/deriv_auth/lib/core/states/auth_error_state_handler.dart @@ -20,8 +20,8 @@ base class AuthErrorStateHandler { void invalid2faCode(DerivAuthErrorState state) { showErrorDialog( context: context, - errorMessage: context.derivAuthLocalization.informInvalid2FACode, - actionLabel: context.derivAuthLocalization.actionTryAgain, + errorMessage: context.derivAuthLocalization!.informInvalid2FACode, + actionLabel: context.derivAuthLocalization!.actionTryAgain, ); } @@ -29,8 +29,8 @@ base class AuthErrorStateHandler { void onAccountUnavailable(DerivAuthErrorState state) { showErrorDialog( context: context, - errorMessage: context.derivAuthLocalization.informDeactivatedAccount, - actionLabel: context.derivAuthLocalization.actionTryAgain, + errorMessage: context.derivAuthLocalization!.informDeactivatedAccount, + actionLabel: context.derivAuthLocalization!.actionTryAgain, ); } @@ -38,8 +38,8 @@ base class AuthErrorStateHandler { void onExpiredAccount(DerivAuthErrorState state) { showErrorDialog( context: context, - errorMessage: context.derivAuthLocalization.informExpiredAccount, - actionLabel: context.derivAuthLocalization.actionTryAgain, + errorMessage: context.derivAuthLocalization!.informExpiredAccount, + actionLabel: context.derivAuthLocalization!.actionTryAgain, ); } @@ -47,8 +47,8 @@ base class AuthErrorStateHandler { void onFailedAuthorization(DerivAuthErrorState state) { showErrorDialog( context: context, - errorMessage: context.derivAuthLocalization.informFailedAuthorization, - actionLabel: context.derivAuthLocalization.actionTryAgain, + errorMessage: context.derivAuthLocalization!.informFailedAuthorization, + actionLabel: context.derivAuthLocalization!.actionTryAgain, ); } @@ -56,8 +56,8 @@ base class AuthErrorStateHandler { void onInvalidResidence(DerivAuthErrorState state) { showErrorDialog( context: context, - errorMessage: context.derivAuthLocalization.informInvalidResidence, - actionLabel: context.derivAuthLocalization.actionTryAgain, + errorMessage: context.derivAuthLocalization!.informInvalidResidence, + actionLabel: context.derivAuthLocalization!.actionTryAgain, ); } @@ -65,8 +65,8 @@ base class AuthErrorStateHandler { void onInvalidCredentials(DerivAuthErrorState state) { showErrorDialog( context: context, - errorMessage: context.derivAuthLocalization.informInvalidCredentials, - actionLabel: context.derivAuthLocalization.actionTryAgain, + errorMessage: context.derivAuthLocalization!.informInvalidCredentials, + actionLabel: context.derivAuthLocalization!.actionTryAgain, ); } @@ -74,8 +74,8 @@ base class AuthErrorStateHandler { void onMissingOtp(DerivAuthErrorState state) { showErrorDialog( context: context, - errorMessage: context.derivAuthLocalization.informMissingOtp, - actionLabel: context.derivAuthLocalization.actionTryAgain, + errorMessage: context.derivAuthLocalization!.informMissingOtp, + actionLabel: context.derivAuthLocalization!.actionTryAgain, ); } @@ -83,8 +83,8 @@ base class AuthErrorStateHandler { void onSelfClosed(DerivAuthErrorState state) { showErrorDialog( context: context, - errorMessage: context.derivAuthLocalization.informSelfClosed, - actionLabel: context.derivAuthLocalization.actionTryAgain, + errorMessage: context.derivAuthLocalization!.informSelfClosed, + actionLabel: context.derivAuthLocalization!.actionTryAgain, ); } @@ -92,8 +92,8 @@ base class AuthErrorStateHandler { void onUnexpectedError(DerivAuthErrorState state) { showErrorDialog( context: context, - errorMessage: context.derivAuthLocalization.informUnexpectedError, - actionLabel: context.derivAuthLocalization.actionTryAgain, + errorMessage: context.derivAuthLocalization!.informUnexpectedError, + actionLabel: context.derivAuthLocalization!.actionTryAgain, ); } @@ -101,8 +101,8 @@ base class AuthErrorStateHandler { void onUnsupportedCountry(DerivAuthErrorState state) { showErrorDialog( context: context, - errorMessage: context.derivAuthLocalization.informUnsupportedCountry, - actionLabel: context.derivAuthLocalization.actionTryAgain, + errorMessage: context.derivAuthLocalization!.informUnsupportedCountry, + actionLabel: context.derivAuthLocalization!.actionTryAgain, ); } @@ -110,8 +110,8 @@ base class AuthErrorStateHandler { void onConnectionError(DerivAuthErrorState state) { showErrorDialog( context: context, - errorMessage: context.derivAuthLocalization.informConnectionError, - actionLabel: context.derivAuthLocalization.actionTryAgain, + errorMessage: context.derivAuthLocalization!.informConnectionError, + actionLabel: context.derivAuthLocalization!.actionTryAgain, ); } @@ -119,8 +119,8 @@ base class AuthErrorStateHandler { void onSwitchAccountError(DerivAuthErrorState state) { showErrorDialog( context: context, - errorMessage: context.derivAuthLocalization.informSwitchAccountError, - actionLabel: context.derivAuthLocalization.actionTryAgain, + errorMessage: context.derivAuthLocalization!.informSwitchAccountError, + actionLabel: context.derivAuthLocalization!.actionTryAgain, ); } } diff --git a/packages/deriv_auth/lib/features/auth/cubit/deriv_auth_cubit.dart b/packages/deriv_auth/lib/features/auth/cubit/deriv_auth_cubit.dart index 1de3db414..4ea017900 100644 --- a/packages/deriv_auth/lib/features/auth/cubit/deriv_auth_cubit.dart +++ b/packages/deriv_auth/lib/features/auth/cubit/deriv_auth_cubit.dart @@ -20,17 +20,7 @@ class DerivAuthCubit extends Cubit implements DerivAuthIO { /// Initialize a [DerivAuthCubit]. DerivAuthCubit({ required this.authService, - DerivPasskeysBloc? derivPasskeysBloc, - }) : super(DerivAuthLoadingState()) { - if (derivPasskeysBloc != null) { - derivPasskeysBloc.stream.listen((DerivPasskeysState state) async { - if (state is DerivPasskeysCredentialVerifiedState) { - derivPasskeysBloc.add(const DerivPasskeysGetPasskeysListEvent()); - await tokenLogin(state.token); - } - }); - } - } + }) : super(DerivAuthLoadingState()); /// [BaseAuthService] handles all login logic of cubit. final BaseAuthService authService; 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..eec5f9a06 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 @@ -147,7 +147,7 @@ class _DerivGetStartedLayoutState extends State { onPressed: widget.onSignupTapped, child: Center( child: Text( - context.derivAuthLocalization.actionGetAFreeAccount, + context.derivAuthLocalization!.actionGetAFreeAccount, style: context.theme.textStyle( textStyle: TextStyles.body2, color: context.theme.colors.prominent, @@ -163,7 +163,7 @@ class _DerivGetStartedLayoutState extends State { onPressed: widget.onLoginTapped, child: Center( child: Text( - context.derivAuthLocalization.actionLogin, + context.derivAuthLocalization!.actionLogin, style: context.theme.textStyle( textStyle: TextStyles.body2, color: context.theme.colors.prominent, diff --git a/packages/deriv_auth/lib/features/login/presentation/layouts/deriv_2fa_layout.dart b/packages/deriv_auth/lib/features/login/presentation/layouts/deriv_2fa_layout.dart index 86c688214..451f87dfc 100644 --- a/packages/deriv_auth/lib/features/login/presentation/layouts/deriv_2fa_layout.dart +++ b/packages/deriv_auth/lib/features/login/presentation/layouts/deriv_2fa_layout.dart @@ -50,7 +50,7 @@ class _Deriv2FALayoutState extends State { appBar: AppBar( elevation: ThemeProvider.zeroMargin, title: Text( - context.derivAuthLocalization.labelLogIn, + context.derivAuthLocalization!.labelLogIn, style: TextStyles.title, ), ), @@ -65,13 +65,13 @@ class _Deriv2FALayoutState extends State { children: [ SvgPicture.asset(Assets.twoFactorAuthIcon), Text( - context.derivAuthLocalization.labelTwoFactorAuth, + context.derivAuthLocalization!.labelTwoFactorAuth, style: context.theme.textStyle(textStyle: TextStyles.title), textAlign: TextAlign.center, ), const SizedBox(height: ThemeProvider.margin08), Text( - context.derivAuthLocalization.informEnterTwoFactorAuthCode, + context.derivAuthLocalization!.informEnterTwoFactorAuthCode, style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.general, @@ -82,7 +82,7 @@ class _Deriv2FALayoutState extends State { BaseTextField( controller: _otpController, labelText: context - .derivAuthLocalization.labelTwoFactorAuthenticationCode, + .derivAuthLocalization!.labelTwoFactorAuthenticationCode, labelColor: context.theme.colors.disabled, focusNode: _otpFocusNode, enabled: !_isLoading(), @@ -112,7 +112,7 @@ class _Deriv2FALayoutState extends State { width: ThemeProvider.iconSize16, ) : Text( - context.derivAuthLocalization.actionProceed, + context.derivAuthLocalization!.actionProceed, style: TextStyles.body2.copyWith( color: context.theme.colors.prominent, ), 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 8ea23af7c..0264a096c 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 @@ -99,7 +99,7 @@ class _DerivLoginLayoutState extends State { appBar: AppBar( elevation: ThemeProvider.zeroMargin, title: Text( - context.derivAuthLocalization.labelLogIn, + context.derivAuthLocalization!.labelLogIn, style: TextStyles.title, ), backgroundColor: context.theme.colors.secondary, @@ -132,7 +132,8 @@ class _DerivLoginLayoutState extends State { _buildLoginButton(), const SizedBox(height: ThemeProvider.margin24), DerivSocialAuthDivider( - label: context.derivAuthLocalization.informLoginOptions, + label: + context.derivAuthLocalization!.informLoginOptions, isVisible: widget.isSocialAuthEnabled, ), if (widget.isSocialAuthEnabled) @@ -176,7 +177,7 @@ class _DerivLoginLayoutState extends State { semanticLabel: SemanticsLabels.loginEmailFieldSemantic, controller: _emailController, focusNode: _emailFocusNode, - labelText: context.derivAuthLocalization.labelEmail, + labelText: context.derivAuthLocalization!.labelEmail, borderColor: context.theme.colors.hover, focusedBorderColor: context.theme.colors.blue, keyboardType: TextInputType.emailAddress, @@ -191,7 +192,7 @@ class _DerivLoginLayoutState extends State { semanticLabel: SemanticsLabels.loginPasswordFieldSemantic, controller: _passwordController, focusNode: _passwordFocusNode, - labelText: context.derivAuthLocalization.labelPassword, + labelText: context.derivAuthLocalization!.labelPassword, obscureText: !_isPasswordVisible, enabled: isEnabled, suffixIcon: IconButton( @@ -217,7 +218,7 @@ class _DerivLoginLayoutState extends State { child: InkWell( onTap: widget.onResetPassTapped, child: Text( - context.derivAuthLocalization.actionForgotPassword, + context.derivAuthLocalization!.actionForgotPassword, style: context.theme.textStyle( textStyle: TextStyles.body2, color: context.theme.colors.coral, @@ -250,7 +251,7 @@ class _DerivLoginLayoutState extends State { width: ThemeProvider.iconSize16, ) : Text( - context.derivAuthLocalization.actionLogin, + context.derivAuthLocalization!.actionLogin, style: context.theme.textStyle( textStyle: TextStyles.body2, color: context.theme.colors.prominent.withOpacity( @@ -267,7 +268,7 @@ class _DerivLoginLayoutState extends State { mainAxisSize: MainAxisSize.min, children: [ Text( - context.derivAuthLocalization.labelDontHaveAnAccountYet, + context.derivAuthLocalization!.labelDontHaveAnAccountYet, style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.general, @@ -278,7 +279,7 @@ class _DerivLoginLayoutState extends State { child: Padding( padding: const EdgeInsets.all(ThemeProvider.margin04), child: Text( - context.derivAuthLocalization.actionCreateANewAccount, + context.derivAuthLocalization!.actionCreateANewAccount, style: context.theme.textStyle( textStyle: TextStyles.body2, color: context.theme.colors.coral, @@ -315,7 +316,7 @@ class _DerivLoginLayoutState extends State { return null; } - return context.derivAuthLocalization.informInvalidEmailFormat; + return context.derivAuthLocalization!.informInvalidEmailFormat; } String? _passwordValidator(String? input) { @@ -323,7 +324,7 @@ class _DerivLoginLayoutState extends State { return null; } - return context.derivAuthLocalization.warnPasswordLength; + return context.derivAuthLocalization!.warnPasswordLength; } Future _onLoginTapped() async { diff --git a/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_choose_new_pass_layout.dart b/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_choose_new_pass_layout.dart index 68dafc6cf..a9aefe63c 100644 --- a/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_choose_new_pass_layout.dart +++ b/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_choose_new_pass_layout.dart @@ -50,7 +50,7 @@ class _DerivChooseNewPassLayoutState extends State { appBar: AppBar( elevation: ThemeProvider.zeroMargin, title: Text( - context.derivAuthLocalization.labelResetPassword, + context.derivAuthLocalization!.labelResetPassword, style: TextStyles.title, ), ), @@ -110,14 +110,14 @@ class _DerivChooseNewPassLayoutState extends State { ), const SizedBox(height: ThemeProvider.margin48), Text( - context.derivAuthLocalization.labelChooseNewPass, + context.derivAuthLocalization!.labelChooseNewPass, style: TextStyles.title, ), const SizedBox(height: ThemeProvider.margin24), BaseTextField( controller: _passController, focusNode: _passFocusNode, - labelText: context.derivAuthLocalization.labelCreatePass, + labelText: context.derivAuthLocalization!.labelCreatePass, obscureText: !_isPasswordVisible, suffixIcon: IconButton( icon: Icon( @@ -162,7 +162,7 @@ class _DerivChooseNewPassLayoutState extends State { width: ThemeProvider.iconSize16, ) : Text( - context.derivAuthLocalization.actionResetPass, + context.derivAuthLocalization!.actionResetPass, style: context.theme.textStyle( textStyle: TextStyles.body2, color: context.theme.colors.prominent.withOpacity( @@ -193,7 +193,7 @@ class _DerivChooseNewPassLayoutState extends State { return null; } - return context.derivAuthLocalization.informInvalidPasswordFormat; + return context.derivAuthLocalization!.informInvalidPasswordFormat; } bool isFormValid() => _passwordValidator(_passController.text) == null; diff --git a/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_reset_pass_layout.dart b/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_reset_pass_layout.dart index e5406a496..72deda390 100644 --- a/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_reset_pass_layout.dart +++ b/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_reset_pass_layout.dart @@ -44,7 +44,7 @@ class _DerivResetPassLayoutState extends State { appBar: AppBar( elevation: ThemeProvider.zeroMargin, title: Text( - context.derivAuthLocalization.labelResetPassword, + context.derivAuthLocalization!.labelResetPassword, style: TextStyles.title, ), ), @@ -87,12 +87,12 @@ class _DerivResetPassLayoutState extends State { ), const SizedBox(height: ThemeProvider.margin24), Text( - context.derivAuthLocalization.labelCheckEmail, + context.derivAuthLocalization!.labelCheckEmail, style: TextStyles.title, ), const SizedBox(height: ThemeProvider.margin08), Text( - context.derivAuthLocalization + context.derivAuthLocalization! .informSendResetPasswordEmail(_emailController.text), textAlign: TextAlign.center, style: context.theme.textStyle( @@ -121,14 +121,14 @@ class _DerivResetPassLayoutState extends State { ), const SizedBox(height: ThemeProvider.margin16), Text( - context.derivAuthLocalization.labelResetPassword, + context.derivAuthLocalization!.labelResetPassword, style: TextStyles.title, textAlign: TextAlign.center, ), const SizedBox(height: ThemeProvider.margin08), Center( child: Text( - context.derivAuthLocalization.informResetPassByEmail, + context.derivAuthLocalization!.informResetPassByEmail, textAlign: TextAlign.center, style: context.theme.textStyle( textStyle: TextStyles.body1, @@ -141,7 +141,7 @@ class _DerivResetPassLayoutState extends State { semanticLabel: SemanticsLabels.resetPasswordEmailFieldSemantic, controller: _emailController, focusNode: _emailFocusNode, - labelText: context.derivAuthLocalization.labelEmail, + labelText: context.derivAuthLocalization!.labelEmail, keyboardType: TextInputType.emailAddress, borderColor: context.theme.colors.hover, validator: _emailValidator, @@ -177,7 +177,7 @@ class _DerivResetPassLayoutState extends State { width: ThemeProvider.margin16, ) : Text( - context.derivAuthLocalization.actionResetPass, + context.derivAuthLocalization!.actionResetPass, style: context.theme.textStyle( textStyle: TextStyles.body2, color: context.theme.colors.prominent.withOpacity( @@ -213,7 +213,7 @@ class _DerivResetPassLayoutState extends State { return null; } - return context.derivAuthLocalization.informInvalidEmailFormat; + return context.derivAuthLocalization!.informInvalidEmailFormat; } String _getEmailValue() => _emailController.text.trim(); diff --git a/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_success_pass_change_layout.dart b/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_success_pass_change_layout.dart index 4d6cd57ec..18d39d155 100644 --- a/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_success_pass_change_layout.dart +++ b/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_success_pass_change_layout.dart @@ -14,7 +14,7 @@ class DerivSuccessPassChangeLayout extends StatelessWidget { appBar: AppBar( elevation: ThemeProvider.zeroMargin, title: Text( - context.derivAuthLocalization.labelResetPassword, + context.derivAuthLocalization!.labelResetPassword, style: TextStyles.title, ), ), @@ -37,14 +37,14 @@ class DerivSuccessPassChangeLayout extends StatelessWidget { height: ThemeProvider.margin16, ), Text( - context.derivAuthLocalization.informYourPassHasBeenReset, + context.derivAuthLocalization!.informYourPassHasBeenReset, style: TextStyles.title, ), const SizedBox( height: ThemeProvider.margin08, ), Text( - context.derivAuthLocalization.informRedirectLogin, + context.derivAuthLocalization!.informRedirectLogin, textAlign: TextAlign.center, style: context.theme.textStyle( textStyle: TextStyles.body1, diff --git a/packages/deriv_auth/lib/features/setting_page/presentation/layouts/deriv_setting_layout.dart b/packages/deriv_auth/lib/features/setting_page/presentation/layouts/deriv_setting_layout.dart index e61f0d754..27b3fc266 100644 --- a/packages/deriv_auth/lib/features/setting_page/presentation/layouts/deriv_setting_layout.dart +++ b/packages/deriv_auth/lib/features/setting_page/presentation/layouts/deriv_setting_layout.dart @@ -155,7 +155,7 @@ class _SettingsPageState extends State { top: ThemeProvider.margin24, ), child: Text( - context.derivAuthLocalization.labelDeveloper, + context.derivAuthLocalization!.labelDeveloper, style: context.theme.textStyle( textStyle: TextStyles.body1Bold, color: context.theme.colors.coral, @@ -164,21 +164,21 @@ class _SettingsPageState extends State { ); Widget get _endpoint => _buildTextInputField( - label: context.derivAuthLocalization.labelEndpoint, - semantic: context.derivAuthLocalization.semanticEndpoint, + label: context.derivAuthLocalization!.labelEndpoint, + semantic: context.derivAuthLocalization!.semanticEndpoint, controller: _endpointController, validator: (String? value) => hasOnlySmallLettersAndNumberInput(value!) ? null - : context.derivAuthLocalization.warnInvalidEndpoint, + : context.derivAuthLocalization!.warnInvalidEndpoint, ); Widget get _appId => _buildTextInputField( - label: context.derivAuthLocalization.labelApplicationID, - semantic: context.derivAuthLocalization.semanticApplicationID, + label: context.derivAuthLocalization!.labelApplicationID, + semantic: context.derivAuthLocalization!.semanticApplicationID, controller: _appIdController, validator: (String? value) => hasOnlyNumberInput(value!) ? null - : context.derivAuthLocalization.warnInvalidApplicationID, + : context.derivAuthLocalization!.warnInvalidApplicationID, ); Widget _buildTextInputField({ diff --git a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_country_selection_layout.dart b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_country_selection_layout.dart index 60c564e59..682ebb9a9 100644 --- a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_country_selection_layout.dart +++ b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_country_selection_layout.dart @@ -100,7 +100,7 @@ class _DerivCountrySelectionLayoutState SvgPicture.asset(Assets.locationIcon, package: 'deriv_auth'), const SizedBox(height: ThemeProvider.margin16), Text( - context.derivAuthLocalization.labelSelectCountry, + context.derivAuthLocalization!.labelSelectCountry, style: TextStyles.title, ), const SizedBox(height: ThemeProvider.margin24), @@ -127,7 +127,7 @@ class _DerivCountrySelectionLayoutState key: _formKey, child: BaseTextField( controller: _textController, - labelText: context.derivAuthLocalization.labelChooseCountry, + labelText: context.derivAuthLocalization!.labelChooseCountry, labelColor: context.theme.colors.disabled, focusNode: _focusNode, focusedLabelColor: context.theme.colors.blue, @@ -157,7 +157,7 @@ class _DerivCountrySelectionLayoutState onPressed: widget.onNextPressed, child: Center( child: Text( - context.derivAuthLocalization.actionNext, + context.derivAuthLocalization!.actionNext, style: TextStyles.button .copyWith(color: context.theme.colors.prominent), ), @@ -225,7 +225,7 @@ class _DerivCountrySelectionLayoutState DerivResidenceModel? selectedCountry, }) { if (selectedCountry != null && selectedCountry.isDisabled) { - return context.derivAuthLocalization.warnCountryNotAvailable; + return context.derivAuthLocalization!.warnCountryNotAvailable; } return null; diff --git a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_email_not_received_layout.dart b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_email_not_received_layout.dart index 115beb538..93cfe423d 100644 --- a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_email_not_received_layout.dart +++ b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_email_not_received_layout.dart @@ -42,7 +42,7 @@ class DerivEmailNotReceivedLayout extends StatelessWidget { child: Column( children: [ Text( - context.derivAuthLocalization.labelEmailIssueHeader, + context.derivAuthLocalization!.labelEmailIssueHeader, style: context.theme.textStyle( textStyle: TextStyles.body2, color: context.theme.colors.general, @@ -55,7 +55,7 @@ class DerivEmailNotReceivedLayout extends StatelessWidget { const SizedBox(width: ThemeProvider.margin24), Flexible( child: Text( - context.derivAuthLocalization.labelEmailIssueSpam, + context.derivAuthLocalization!.labelEmailIssueSpam, style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.general, @@ -71,7 +71,7 @@ class DerivEmailNotReceivedLayout extends StatelessWidget { const SizedBox(width: ThemeProvider.margin24), Flexible( child: Text( - context.derivAuthLocalization.labelEmailIssueWrongEmail, + context.derivAuthLocalization!.labelEmailIssueWrongEmail, style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.general, @@ -87,7 +87,7 @@ class DerivEmailNotReceivedLayout extends StatelessWidget { const SizedBox(width: ThemeProvider.margin24), Flexible( child: Text( - context.derivAuthLocalization.labelEmailIssueTypo, + context.derivAuthLocalization!.labelEmailIssueTypo, style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.general, @@ -103,7 +103,7 @@ class DerivEmailNotReceivedLayout extends StatelessWidget { const SizedBox(width: ThemeProvider.margin24), Flexible( child: Text( - context.derivAuthLocalization.labelEmailIssueFirewall, + context.derivAuthLocalization!.labelEmailIssueFirewall, style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.general, @@ -127,7 +127,7 @@ class DerivEmailNotReceivedLayout extends StatelessWidget { onPressed: onReEnterEmailPressed, child: Center( child: Text( - context.derivAuthLocalization.actionReenterEmail, + context.derivAuthLocalization!.actionReenterEmail, style: context.theme.textStyle( textStyle: TextStyles.button .copyWith(color: context.theme.colors.prominent), diff --git a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_set_password_layout.dart b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_set_password_layout.dart index d989c1306..63455a325 100644 --- a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_set_password_layout.dart +++ b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_set_password_layout.dart @@ -97,7 +97,7 @@ class _DerivSetPasswordLayoutState extends State { SvgPicture.asset(Assets.passwordIcon, package: 'deriv_auth'), const SizedBox(height: ThemeProvider.margin16), Text( - context.derivAuthLocalization.labelKeepPassword, + context.derivAuthLocalization!.labelKeepPassword, style: TextStyles.title, textAlign: TextAlign.center, ), @@ -140,7 +140,7 @@ class _DerivSetPasswordLayoutState extends State { focusNode: _passwordFocusNode, controller: _passwordTextController, obscureText: !_isPasswordVisible, - labelText: context.derivAuthLocalization.labelCreatePassword, + labelText: context.derivAuthLocalization!.labelCreatePassword, labelColor: context.theme.colors.disabled, focusedLabelColor: context.theme.colors.blue, suffixIcon: IconButton( @@ -166,7 +166,7 @@ class _DerivSetPasswordLayoutState extends State { strokeWidth: 3, ) : Text( - context.derivAuthLocalization.actionStartTrading, + context.derivAuthLocalization!.actionStartTrading, style: TextStyles.button .copyWith(color: context.theme.colors.prominent), ), @@ -181,7 +181,7 @@ class _DerivSetPasswordLayoutState extends State { onPressed: widget.onPreviousPressed, child: Center( child: Text( - context.derivAuthLocalization.actionPrevious, + context.derivAuthLocalization!.actionPrevious, style: context.theme.textStyle( textStyle: TextStyles.button, ), diff --git a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_signup_layout.dart b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_signup_layout.dart index d94f7ef15..3e3bb9b9f 100644 --- a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_signup_layout.dart +++ b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_signup_layout.dart @@ -96,7 +96,7 @@ class _DerivSignupLayoutState extends State { backgroundColor: context.theme.colors.primary, appBar: AppBar( elevation: ThemeProvider.zeroMargin, - title: Text(context.derivAuthLocalization.labelSignUp, + title: Text(context.derivAuthLocalization!.labelSignUp, style: TextStyles.title), backgroundColor: context.theme.colors.secondary, ), @@ -125,7 +125,7 @@ class _DerivSignupLayoutState extends State { _buildSignUpButton(), const SizedBox(height: ThemeProvider.margin24), DerivSocialAuthDivider( - label: context.derivAuthLocalization.labelOrSignUpWith, + label: context.derivAuthLocalization!.labelOrSignUpWith, isVisible: widget.isSocialAuthEnabled, ), if (widget.isSocialAuthEnabled) @@ -167,16 +167,16 @@ class _DerivSignupLayoutState extends State { children: [ InfoIconButton( dialogTitle: - context.derivAuthLocalization.labelReferralInfoTitle, - dialogDescription: - context.derivAuthLocalization.infoReferralInfoDescription, - positiveActionLabel: context.derivAuthLocalization.actionOk, + context.derivAuthLocalization!.labelReferralInfoTitle, + dialogDescription: context + .derivAuthLocalization!.infoReferralInfoDescription, + positiveActionLabel: context.derivAuthLocalization!.actionOk, iconSize: ThemeProvider.iconSize24, ), const SizedBox(width: ThemeProvider.margin08), Expanded( child: Text( - context.derivAuthLocalization.labelGotReferralCode, + context.derivAuthLocalization!.labelGotReferralCode, style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.prominent, @@ -231,7 +231,7 @@ class _DerivSignupLayoutState extends State { } }, focusNode: referralFocusNode, - labelText: context.derivAuthLocalization.labelReferralCode, + labelText: context.derivAuthLocalization!.labelReferralCode, borderColor: context.theme.colors.hover, focusedBorderColor: context.theme.colors.blue, textInputAction: TextInputAction.done, @@ -264,7 +264,7 @@ class _DerivSignupLayoutState extends State { mainAxisSize: MainAxisSize.min, children: [ Text( - context.derivAuthLocalization.labelHaveAccount, + context.derivAuthLocalization!.labelHaveAccount, style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.general, @@ -275,7 +275,7 @@ class _DerivSignupLayoutState extends State { child: Padding( padding: const EdgeInsets.all(ThemeProvider.margin04), child: Text( - context.derivAuthLocalization.actionLogin, + context.derivAuthLocalization!.actionLogin, style: context.theme.textStyle( textStyle: TextStyles.body2, color: context.theme.colors.coral, @@ -291,7 +291,7 @@ class _DerivSignupLayoutState extends State { semanticLabel: SemanticsLabels.signupEmailFieldSemantic, controller: emailController, focusNode: emailFocusNode, - labelText: context.derivAuthLocalization.labelEmail, + labelText: context.derivAuthLocalization!.labelEmail, borderColor: context.theme.colors.hover, focusedBorderColor: context.theme.colors.blue, keyboardType: TextInputType.emailAddress, @@ -319,7 +319,7 @@ class _DerivSignupLayoutState extends State { width: ThemeProvider.iconSize16, ) : Text( - context.derivAuthLocalization.actionCreateAccount, + context.derivAuthLocalization!.actionCreateAccount, style: context.theme.textStyle( textStyle: TextStyles.body2, color: context.theme.colors.prominent, @@ -349,7 +349,7 @@ class _DerivSignupLayoutState extends State { return null; } - return context.derivAuthLocalization.informInvalidEmailFormat; + return context.derivAuthLocalization!.informInvalidEmailFormat; } String? _referralValidator(String? input) { @@ -357,7 +357,7 @@ class _DerivSignupLayoutState extends State { return null; } - return context.derivAuthLocalization.informInvalidReferralCode; + return context.derivAuthLocalization!.informInvalidReferralCode; } Future _onSignupTapped() async { diff --git a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_verification_done_layout.dart b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_verification_done_layout.dart index 1e30b4649..a85145886 100644 --- a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_verification_done_layout.dart +++ b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_verification_done_layout.dart @@ -29,7 +29,7 @@ class DerivVerificationDoneLayout extends StatelessWidget { backgroundColor: context.theme.colors.primary, appBar: AppBar( elevation: ThemeProvider.zeroMargin, - title: Text(context.derivAuthLocalization.labelVerifyYourEmail), + title: Text(context.derivAuthLocalization!.labelVerifyYourEmail), ), body: SafeArea( child: Column( @@ -56,12 +56,12 @@ class DerivVerificationDoneLayout extends StatelessWidget { ), const SizedBox(height: ThemeProvider.margin16), Text( - context.derivAuthLocalization.labelThanksEmail, + context.derivAuthLocalization!.labelThanksEmail, style: TextStyles.title, ), const SizedBox(height: ThemeProvider.margin08), Text( - context.derivAuthLocalization.informLetsContinue, + context.derivAuthLocalization!.informLetsContinue, style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.general, @@ -80,7 +80,7 @@ class DerivVerificationDoneLayout extends StatelessWidget { onPressed: onContinuePressed, child: Center( child: Text( - context.derivAuthLocalization.actionContinue, + context.derivAuthLocalization!.actionContinue, style: context.theme.textStyle( textStyle: TextStyles.button .copyWith(color: context.theme.colors.prominent), diff --git a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_verify_email_layout.dart b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_verify_email_layout.dart index eb2996d7d..c89461053 100644 --- a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_verify_email_layout.dart +++ b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_verify_email_layout.dart @@ -26,7 +26,7 @@ class DerivVerifyEmailLayout extends StatelessWidget { appBar: AppBar( elevation: ThemeProvider.zeroMargin, title: Text( - context.derivAuthLocalization.labelVerifyYourEmail, + context.derivAuthLocalization!.labelVerifyYourEmail, style: TextStyles.title, ), backgroundColor: context.theme.colors.secondary, @@ -56,12 +56,13 @@ class DerivVerifyEmailLayout extends StatelessWidget { ), const SizedBox(height: ThemeProvider.margin16), Text( - context.derivAuthLocalization.labelCheckEmail, + context.derivAuthLocalization!.labelCheckEmail, style: TextStyles.title, ), const SizedBox(height: ThemeProvider.margin08), Text( - context.derivAuthLocalization.informVerificationEmailSent(email!), + context.derivAuthLocalization! + .informVerificationEmailSent(email!), style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.general, @@ -81,7 +82,7 @@ class DerivVerifyEmailLayout extends StatelessWidget { onPressed: onEmailNotReceivedPressed, child: Center( child: Text( - context.derivAuthLocalization.actionEmailNotReceived, + context.derivAuthLocalization!.actionEmailNotReceived, style: context.theme.textStyle( textStyle: TextStyles.button, ), diff --git a/packages/deriv_auth/lib/features/signup/presentation/widgets/country_selection_list_widget.dart b/packages/deriv_auth/lib/features/signup/presentation/widgets/country_selection_list_widget.dart index 5b72f3fc0..9896a0264 100644 --- a/packages/deriv_auth/lib/features/signup/presentation/widgets/country_selection_list_widget.dart +++ b/packages/deriv_auth/lib/features/signup/presentation/widgets/country_selection_list_widget.dart @@ -102,7 +102,7 @@ class _CountrySelectionListWidgetState children: [ const SizedBox(width: ThemeProvider.margin48), Text( - context.derivAuthLocalization.labelChooseCountry, + context.derivAuthLocalization!.labelChooseCountry, style: TextStyles.subheading, ), ], @@ -128,7 +128,7 @@ class _CountrySelectionListWidgetState onPressed: () => _searchController.clear(), ), contentPadding: const EdgeInsets.only(top: ThemeProvider.margin08), - hintText: context.derivAuthLocalization.labelSearchCountry, + hintText: context.derivAuthLocalization!.labelSearchCountry, hintStyle: context.theme.textStyle( textStyle: TextStyles.subheading, color: context.theme.colors.active, diff --git a/packages/deriv_auth/lib/features/signup/presentation/widgets/password_policy_checker_widget.dart b/packages/deriv_auth/lib/features/signup/presentation/widgets/password_policy_checker_widget.dart index 2bb6c1b5b..377a17173 100644 --- a/packages/deriv_auth/lib/features/signup/presentation/widgets/password_policy_checker_widget.dart +++ b/packages/deriv_auth/lib/features/signup/presentation/widgets/password_policy_checker_widget.dart @@ -40,20 +40,23 @@ class PasswordPolicyCheckerWidget extends StatelessWidget { BuildContext context) => [ DerivPasswordPolicyModel( - description: context.derivAuthLocalization.informPasswordPolicyLength, + description: + context.derivAuthLocalization!.informPasswordPolicyLength, regex: validPasswordLengthRegex, ), DerivPasswordPolicyModel( description: - context.derivAuthLocalization.informPasswordPolicyLowerAndUpper, + context.derivAuthLocalization!.informPasswordPolicyLowerAndUpper, regex: validPasswordWithUppercaseRegex, ), DerivPasswordPolicyModel( - description: context.derivAuthLocalization.informPasswordPolicyNumber, + description: + context.derivAuthLocalization!.informPasswordPolicyNumber, regex: validPasswordWithNumberRegex, ), DerivPasswordPolicyModel( - description: context.derivAuthLocalization.warnPasswordContainsSymbol, + description: + context.derivAuthLocalization!.warnPasswordContainsSymbol, regex: validPasswordWithSymbols, isOptional: true, ), @@ -67,7 +70,7 @@ class PasswordPolicyCheckerWidget extends StatelessWidget { mainAxisSize: MainAxisSize.min, children: [ Text( - context.derivAuthLocalization.informPasswordPolicy, + context.derivAuthLocalization!.informPasswordPolicy, style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.general, diff --git a/packages/deriv_auth/lib/features/single_entry/README.md b/packages/deriv_auth/lib/features/single_entry/README.md index a595a6bfb..7068bfb36 100644 --- a/packages/deriv_auth/lib/features/single_entry/README.md +++ b/packages/deriv_auth/lib/features/single_entry/README.md @@ -28,8 +28,6 @@ AuthEntryPage( ), loginPageModel: LoginPageModel( welcomeLabel: 'Welcome back testing!', - greetingLabel: - 'Log in to your Deriv account to start trading and investing.', onLoggedIn: (_) => HomePageRoute().go(context), authErrorStateHandler: AuthErrorStateHandler(context: context), diff --git a/packages/deriv_auth/lib/features/single_entry/core/models/login_page_model.dart b/packages/deriv_auth/lib/features/single_entry/core/models/login_page_model.dart index 3bac56864..1075da51b 100644 --- a/packages/deriv_auth/lib/features/single_entry/core/models/login_page_model.dart +++ b/packages/deriv_auth/lib/features/single_entry/core/models/login_page_model.dart @@ -8,7 +8,6 @@ class LoginPageModel { required this.onLoggedIn, required this.onSocialAuthButtonPressed, required this.welcomeLabel, - required this.greetingLabel, required this.socialAuthStateHandler, required this.redirectURL, required this.onWebViewError, @@ -35,9 +34,6 @@ class LoginPageModel { /// Welcome text to be displayed on login page. final String welcomeLabel; - /// Greeting text to be displayed on login page. - final String greetingLabel; - /// Whether to display social auth buttons. final bool isSocialAuthEnabled; diff --git a/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/choose_new_password_page.dart b/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/choose_new_password_page.dart index 7b1ed804b..90234fe08 100644 --- a/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/choose_new_password_page.dart +++ b/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/choose_new_password_page.dart @@ -6,7 +6,8 @@ import 'package:flutter/material.dart'; /// Choose new password page class ChooseNewPasswordPage extends StatelessWidget { /// Constructor [ChooseNewPasswordPage] - const ChooseNewPasswordPage({required this.token, super.key}); + const ChooseNewPasswordPage( + {required this.token, super.key, required DerivResetPassCubit cubit}); /// Token final String token; 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 277fec995..a1492ce45 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 @@ -1,8 +1,5 @@ import 'package:deriv_auth/deriv_auth.dart'; -import 'package:deriv_auth/features/single_entry/core/auth_data.dart'; -import 'package:deriv_passkeys/deriv_passkeys.dart'; import 'package:deriv_theme/deriv_theme.dart'; -import 'package:deriv_ui/deriv_ui.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_svg/flutter_svg.dart'; diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index 7a0655a37..e17a02045 100644 --- a/packages/deriv_auth/pubspec.yaml +++ b/packages/deriv_auth/pubspec.yaml @@ -45,7 +45,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_localizations - ref: deriv_localizations-v1.1.2 + ref: 9a91d879a5ffd371a46dcbf70e4f3a295bc7b7e1 deriv_passkeys: path: ../../../flutter-deriv-packages/packages/deriv_passkeys diff --git a/packages/deriv_auth/test/features/login/presentation/layouts/deriv_login_layout_test.dart b/packages/deriv_auth/test/features/login/presentation/layouts/deriv_login_layout_test.dart index 637305dc5..5eefd27af 100644 --- a/packages/deriv_auth/test/features/login/presentation/layouts/deriv_login_layout_test.dart +++ b/packages/deriv_auth/test/features/login/presentation/layouts/deriv_login_layout_test.dart @@ -18,7 +18,6 @@ void main() { late MockSocialAuthCubit socialAuthCubit; const String welcomeLabel = 'Welcome Back'; - const String greetingLabel = 'Let\'s start trading.'; setUpAll(() { authCubit = MockAuthCubit(); @@ -64,7 +63,6 @@ void main() { redirectURL: 'deriv://example', onWebViewError: (String error) {}, welcomeLabel: welcomeLabel, - greetingLabel: greetingLabel, onResetPassTapped: () {}, onSignupTapped: () {}, onLoggedIn: (_, __) {}, @@ -101,7 +99,6 @@ void main() { redirectURL: 'deriv://example', onWebViewError: (String error) {}, welcomeLabel: welcomeLabel, - greetingLabel: greetingLabel, onResetPassTapped: () {}, onSignupTapped: () {}, onLoggedIn: (_, __) {}, @@ -140,7 +137,6 @@ void main() { redirectURL: 'deriv://example', onWebViewError: (String error) {}, welcomeLabel: welcomeLabel, - greetingLabel: greetingLabel, onResetPassTapped: () {}, onSignupTapped: () {}, onLoggedIn: (_, __) {}, @@ -173,7 +169,6 @@ void main() { redirectURL: 'deriv://example', onWebViewError: (String error) {}, welcomeLabel: welcomeLabel, - greetingLabel: greetingLabel, onResetPassTapped: () {}, onSignupTapped: () { onSignupTappedCalled = true; @@ -219,7 +214,6 @@ void main() { redirectURL: 'deriv://example', onWebViewError: (String error) {}, welcomeLabel: welcomeLabel, - greetingLabel: greetingLabel, onResetPassTapped: () {}, onSignupTapped: () {}, onLoggedIn: (_, __) { @@ -257,7 +251,6 @@ void main() { redirectURL: 'deriv://example', onWebViewError: (String error) {}, welcomeLabel: welcomeLabel, - greetingLabel: greetingLabel, onResetPassTapped: () {}, onSignupTapped: () {}, onLoginError: (_) { @@ -294,7 +287,6 @@ void main() { redirectURL: 'deriv://example', onWebViewError: (String error) {}, welcomeLabel: welcomeLabel, - greetingLabel: greetingLabel, onResetPassTapped: () {}, onSignupTapped: () {}, onLoginError: (_) {}, @@ -327,7 +319,6 @@ void main() { redirectURL: 'deriv://example', onWebViewError: (String error) {}, welcomeLabel: welcomeLabel, - greetingLabel: greetingLabel, onResetPassTapped: () { onResetPassTappedCalled = true; }, @@ -375,7 +366,6 @@ void main() { redirectURL: 'deriv://example', onWebViewError: (String error) {}, welcomeLabel: welcomeLabel, - greetingLabel: greetingLabel, onResetPassTapped: () {}, onSignupTapped: () {}, onLoggedIn: (_, __) {}, @@ -421,7 +411,6 @@ void main() { redirectURL: 'deriv://example', onWebViewError: (String error) {}, welcomeLabel: welcomeLabel, - greetingLabel: greetingLabel, onResetPassTapped: () {}, onSignupTapped: () {}, onLoggedIn: (_, __) {}, From 607eca127e5a394dbb58abe82a5d5d4b4f811156 Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Thu, 28 Mar 2024 11:46:39 +0400 Subject: [PATCH 029/162] fix(deriv_auth): fixed deriv_passkeys dependency. --- packages/deriv_auth/pubspec.yaml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index fc0fb9dc5..c3794f88c 100644 --- a/packages/deriv_auth/pubspec.yaml +++ b/packages/deriv_auth/pubspec.yaml @@ -49,11 +49,10 @@ dependencies: ref: 9a91d879a5ffd371a46dcbf70e4f3a295bc7b7e1 deriv_passkeys: - path: ../../../flutter-deriv-packages/packages/deriv_passkeys - # git: - # url: git@github.com:regentmarkets/flutter-deriv-packages.git - # path: packages/deriv_passkeys - # ref: c9b906bc20edbc94d0ca99f2211b142efa3aaf2e + git: + url: git@github.com:regentmarkets/flutter-deriv-packages.git + path: packages/deriv_passkeys + ref: 5b89caefd68fcc4f33b1dbe1ae217f6b3558394a flutter_bloc: ^8.1.3 flutter_svg: ^2.0.7 From 7bb5f71b4a3c364b3ee4455fe1c97b8ac5e83dea Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Thu, 28 Mar 2024 12:28:06 +0400 Subject: [PATCH 030/162] refactor(deriv_auth): new deriv_passkeys commit hash ref. --- .../features/login/presentation/layouts/deriv_login_layout.dart | 1 - packages/deriv_auth/pubspec.yaml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) 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 0264a096c..4f8c088fc 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 @@ -121,7 +121,6 @@ class _DerivLoginLayoutState extends State { children: [ ..._buildTopSection(), const SizedBox(height: ThemeProvider.margin14), - // const SizedBox(height: ThemeProvider.margin24), ..._buildTextFields( isEnabled: state is! DerivAuthLoadingState), const SizedBox(height: ThemeProvider.margin24), diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index c3794f88c..f8725716e 100644 --- a/packages/deriv_auth/pubspec.yaml +++ b/packages/deriv_auth/pubspec.yaml @@ -52,7 +52,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: 5b89caefd68fcc4f33b1dbe1ae217f6b3558394a + ref: 568ecf2acdd9d415ef40c73f8caf6f136e752f33 flutter_bloc: ^8.1.3 flutter_svg: ^2.0.7 From e433266664f23b28134fe82263cdb97dcc4775c2 Mon Sep 17 00:00:00 2001 From: Illya Tsai Date: Thu, 28 Mar 2024 14:42:51 +0300 Subject: [PATCH 031/162] add event tracking to sign up --- .../lib/deriv_rudderstack.dart | 120 ++++++++++++++++++ 1 file changed, 120 insertions(+) diff --git a/packages/deriv_rudderstack/lib/deriv_rudderstack.dart b/packages/deriv_rudderstack/lib/deriv_rudderstack.dart index 368fa701f..76a158dc8 100644 --- a/packages/deriv_rudderstack/lib/deriv_rudderstack.dart +++ b/packages/deriv_rudderstack/lib/deriv_rudderstack.dart @@ -165,4 +165,124 @@ class DerivRudderstack { return false; } + + /// Captures app_open event when the app is opened. + void logAppOpened() { + DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { + 'action': 'open', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + }); + } + + /// Captures user tap on Log in button on sign up screen. + void logUserTappedLoginButton() { + DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { + 'action': 'go_to_login', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + }); + } + + /// Captures user tap on Get free account button on sign up screen. + void logAppGetFreeAccount(String slideName) { + DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { + 'action': 'get_free_account', + 'form_source': 'mobile_derivgo', + 'getstarted_slide_name': + '${slideName.substring(slideName.indexOf('.') + 1, slideName.length)}', + 'form_name': 'virtual_signup_derivgo' + }); + } + + /// Tracks when user turns on or off Refferal toggle switcher. + void logReferralToggleSwitched() { + DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { + 'action': 'tab_referral_toggle', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + }); + } + + /// Tracks when user gets Invalid referral code pop up with Try again button. + void logTryAgainReferralCode() { + DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { + 'action': 'try_again_referral_code', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + }); + } + + /// Tracks when Email confirmation is sent to a user. + void logEmailConfirmationSent() { + DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { + 'action': 'email_confirmation_sent', + 'signup_provider': 'email', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + }); + } + + /// Tracks when user land on Successfull email verification screen. + void logEmailConfirmed() { + DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { + 'action': 'email_confirmed', + 'signup_provider': 'email', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + }); + } + + /// Tracks when user taps Continue button on Successfull email verification screen. + void logSignupContinued() { + DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { + 'action': 'signup_continued', + 'signup_provider': 'email', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + }); + } + + /// Tracks when user lands on Country selection screen. + void logCountrySelectionPageOpened() { + DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { + 'action': 'country_selection_screen_opened', + 'signup_provider': 'email', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + }); + } + + /// Tracks when user lands on Create password page while creating demo account. + void logSetPasswordPageOpened() { + DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { + 'action': 'password_screen_opened', + 'signup_provider': 'email', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + }); + } + + /// Tracks when user's sign up is finished. + void logSignUpDone(String signupProvider) { + DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { + 'action': 'signup_done', + 'signup_provider': '$signupProvider', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + }); + } + + /// Tracks when user taps 'Create free demo account' or social log in button. + void logSignUpPageAction(String signupProvider, + [bool? isToggleOn, String? referralCode]) { + DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { + 'action': 'started', + 'signup_provider': '$signupProvider', + 'referral_toggle_mode': '${isToggleOn ?? false} ', + 'referral_code': '$referralCode', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + }); + } } From 14b85c22c7edbd8046eb9f2feef68aa49aff8df2 Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Fri, 29 Mar 2024 12:18:57 +0400 Subject: [PATCH 032/162] refactor(deriv_auth): updated deriv_passkeys and deriv_localizations versions. --- .../reset_pass/pages/reset_pass_page.dart | 6 +-- packages/deriv_auth/example/pubspec.yaml | 6 --- .../core/extensions/context_extension.dart | 2 +- .../helpers/country_selection_helper.dart | 2 +- .../deriv_unavailable_country_layout.dart | 8 ++-- .../token/services/deriv_token_service.dart | 1 - .../core/states/auth_error_state_handler.dart | 48 +++++++++---------- .../features/auth/cubit/deriv_auth_cubit.dart | 1 - .../layouts/deriv_get_started_layout.dart | 4 +- .../layouts/deriv_2fa_layout.dart | 10 ++-- .../layouts/deriv_login_layout.dart | 21 ++++---- .../layouts/deriv_choose_new_pass_layout.dart | 10 ++-- .../layouts/deriv_reset_pass_layout.dart | 16 +++---- .../deriv_success_pass_change_layout.dart | 6 +-- .../layouts/deriv_setting_layout.dart | 14 +++--- .../deriv_country_selection_layout.dart | 8 ++-- .../deriv_email_not_received_layout.dart | 12 ++--- .../layouts/deriv_set_password_layout.dart | 9 ++-- .../layouts/deriv_signup_layout.dart | 29 ++++++----- .../deriv_verification_done_layout.dart | 8 ++-- .../layouts/deriv_verify_email_layout.dart | 9 ++-- .../country_selection_list_widget.dart | 4 +- .../password_policy_checker_widget.dart | 13 ++--- .../pages/choose_new_password_page.dart | 3 +- .../repositories/referral_repository.dart | 2 +- packages/deriv_auth/pubspec.yaml | 6 +-- .../core/helpers/account_helper_test.dart | 1 - .../states/auth_error_state_mapper_test.dart | 1 - .../core/states/auth_state_listener_test.dart | 1 - .../deriv_choose_new_pass_layout_test.dart | 1 - .../cubit/social_auth_cubit_test.dart | 1 - 31 files changed, 119 insertions(+), 144 deletions(-) diff --git a/packages/deriv_auth/example/lib/features/reset_pass/pages/reset_pass_page.dart b/packages/deriv_auth/example/lib/features/reset_pass/pages/reset_pass_page.dart index 07786e198..71f6f3384 100644 --- a/packages/deriv_auth/example/lib/features/reset_pass/pages/reset_pass_page.dart +++ b/packages/deriv_auth/example/lib/features/reset_pass/pages/reset_pass_page.dart @@ -46,11 +46,7 @@ class _ResetPassPageState extends State { if (mounted) { Navigator.of(context).push(MaterialPageRoute( builder: (context) => BlocProvider.value( - value: cubit, - child: ChooseNewPasswordPage( - token: '', - cubit: cubit, - )), + value: cubit, child: const ChooseNewPasswordPage(token: '')), )); } }); diff --git a/packages/deriv_auth/example/pubspec.yaml b/packages/deriv_auth/example/pubspec.yaml index cf8589ebd..c2481a12a 100644 --- a/packages/deriv_auth/example/pubspec.yaml +++ b/packages/deriv_auth/example/pubspec.yaml @@ -24,12 +24,6 @@ dependencies: path: packages/deriv_http_client ref: deriv_http_client-v2.0.1 -dependency_overrides: - flutter_deriv_api: - git: - url: git@github.com:deriv-com/flutter-deriv-api.git - ref: 82ddc3e22ca6ac85a6c7ff4bac082a1574a90c93 - dev_dependencies: flutter_test: sdk: flutter diff --git a/packages/deriv_auth/lib/core/extensions/context_extension.dart b/packages/deriv_auth/lib/core/extensions/context_extension.dart index 7c9089c44..a3dd6c184 100644 --- a/packages/deriv_auth/lib/core/extensions/context_extension.dart +++ b/packages/deriv_auth/lib/core/extensions/context_extension.dart @@ -4,6 +4,6 @@ import 'package:flutter/material.dart'; /// Extension methods for [BuildContext]. extension ContextExtension on BuildContext { /// Gets [DerivAuthLocalizations]. - DerivAuthLocalizations? get derivAuthLocalization => + DerivAuthLocalizations get derivAuthLocalization => DerivAuthLocalizations.of(this); } diff --git a/packages/deriv_auth/lib/core/helpers/country_selection_helper.dart b/packages/deriv_auth/lib/core/helpers/country_selection_helper.dart index f442d3ff3..06664331c 100644 --- a/packages/deriv_auth/lib/core/helpers/country_selection_helper.dart +++ b/packages/deriv_auth/lib/core/helpers/country_selection_helper.dart @@ -32,7 +32,7 @@ String getCountryConsentMessage( } final Map consentMessages = { - 'br': context.derivAuthLocalization!.labelCountryConsentBrazil, + 'br': context.derivAuthLocalization.labelCountryConsentBrazil, // Add more countries and consent messages here. }; diff --git a/packages/deriv_auth/lib/core/layouts/deriv_unavailable_country_layout.dart b/packages/deriv_auth/lib/core/layouts/deriv_unavailable_country_layout.dart index f4a877d65..b00eedf59 100644 --- a/packages/deriv_auth/lib/core/layouts/deriv_unavailable_country_layout.dart +++ b/packages/deriv_auth/lib/core/layouts/deriv_unavailable_country_layout.dart @@ -28,7 +28,7 @@ class DerivUnavailableCountryLayout extends StatelessWidget { Widget build(BuildContext context) => Scaffold( appBar: AppBar( elevation: ThemeProvider.zeroMargin, - title: Text(context.derivAuthLocalization!.labelNotAvailable), + title: Text(context.derivAuthLocalization.labelNotAvailable), ), body: Container( padding: @@ -50,7 +50,7 @@ class DerivUnavailableCountryLayout extends StatelessWidget { children: [ const SizedBox(height: ThemeProvider.margin16), Text( - context.derivAuthLocalization! + context.derivAuthLocalization .warnNotAvailableCountriesTitle(appName), style: TextStyles.title, textAlign: TextAlign.center, @@ -58,7 +58,7 @@ class DerivUnavailableCountryLayout extends StatelessWidget { const SizedBox(height: ThemeProvider.margin08), RichText( text: TextSpan( - text: context.derivAuthLocalization!.warnNotAvailableCountries, + text: context.derivAuthLocalization.warnNotAvailableCountries, style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.general, @@ -66,7 +66,7 @@ class DerivUnavailableCountryLayout extends StatelessWidget { children: [ buildTextSpanHyperlink( context: context, - label: context.derivAuthLocalization!.labelLiveChat, + label: context.derivAuthLocalization.labelLiveChat, onTap: onLiveChatPressed, style: context.theme.textStyle( textStyle: TextStyles.body1Bold, diff --git a/packages/deriv_auth/lib/core/services/token/services/deriv_token_service.dart b/packages/deriv_auth/lib/core/services/token/services/deriv_token_service.dart index a2178048b..a2fa5129d 100644 --- a/packages/deriv_auth/lib/core/services/token/services/deriv_token_service.dart +++ b/packages/deriv_auth/lib/core/services/token/services/deriv_token_service.dart @@ -3,7 +3,6 @@ import 'package:deriv_auth/core/services/token/models/login_request.dart'; import 'package:deriv_auth/core/services/token/models/login_response.dart'; import 'package:deriv_auth/core/services/token/services/base_token_service.dart'; import 'package:deriv_http_client/deriv_http_client.dart'; -import 'package:http/http.dart'; /// Deriv Implementation of a [BaseTokenService]. class DerivTokenService implements BaseTokenService { diff --git a/packages/deriv_auth/lib/core/states/auth_error_state_handler.dart b/packages/deriv_auth/lib/core/states/auth_error_state_handler.dart index b01469d26..e473dfcc8 100644 --- a/packages/deriv_auth/lib/core/states/auth_error_state_handler.dart +++ b/packages/deriv_auth/lib/core/states/auth_error_state_handler.dart @@ -20,8 +20,8 @@ base class AuthErrorStateHandler { void invalid2faCode(DerivAuthErrorState state) { showErrorDialog( context: context, - errorMessage: context.derivAuthLocalization!.informInvalid2FACode, - actionLabel: context.derivAuthLocalization!.actionTryAgain, + errorMessage: context.derivAuthLocalization.informInvalid2FACode, + actionLabel: context.derivAuthLocalization.actionTryAgain, ); } @@ -29,8 +29,8 @@ base class AuthErrorStateHandler { void onAccountUnavailable(DerivAuthErrorState state) { showErrorDialog( context: context, - errorMessage: context.derivAuthLocalization!.informDeactivatedAccount, - actionLabel: context.derivAuthLocalization!.actionTryAgain, + errorMessage: context.derivAuthLocalization.informDeactivatedAccount, + actionLabel: context.derivAuthLocalization.actionTryAgain, ); } @@ -38,8 +38,8 @@ base class AuthErrorStateHandler { void onExpiredAccount(DerivAuthErrorState state) { showErrorDialog( context: context, - errorMessage: context.derivAuthLocalization!.informExpiredAccount, - actionLabel: context.derivAuthLocalization!.actionTryAgain, + errorMessage: context.derivAuthLocalization.informExpiredAccount, + actionLabel: context.derivAuthLocalization.actionTryAgain, ); } @@ -47,8 +47,8 @@ base class AuthErrorStateHandler { void onFailedAuthorization(DerivAuthErrorState state) { showErrorDialog( context: context, - errorMessage: context.derivAuthLocalization!.informFailedAuthorization, - actionLabel: context.derivAuthLocalization!.actionTryAgain, + errorMessage: context.derivAuthLocalization.informFailedAuthorization, + actionLabel: context.derivAuthLocalization.actionTryAgain, ); } @@ -56,8 +56,8 @@ base class AuthErrorStateHandler { void onInvalidResidence(DerivAuthErrorState state) { showErrorDialog( context: context, - errorMessage: context.derivAuthLocalization!.informInvalidResidence, - actionLabel: context.derivAuthLocalization!.actionTryAgain, + errorMessage: context.derivAuthLocalization.informInvalidResidence, + actionLabel: context.derivAuthLocalization.actionTryAgain, ); } @@ -65,8 +65,8 @@ base class AuthErrorStateHandler { void onInvalidCredentials(DerivAuthErrorState state) { showErrorDialog( context: context, - errorMessage: context.derivAuthLocalization!.informInvalidCredentials, - actionLabel: context.derivAuthLocalization!.actionTryAgain, + errorMessage: context.derivAuthLocalization.informInvalidCredentials, + actionLabel: context.derivAuthLocalization.actionTryAgain, ); } @@ -74,8 +74,8 @@ base class AuthErrorStateHandler { void onMissingOtp(DerivAuthErrorState state) { showErrorDialog( context: context, - errorMessage: context.derivAuthLocalization!.informMissingOtp, - actionLabel: context.derivAuthLocalization!.actionTryAgain, + errorMessage: context.derivAuthLocalization.informMissingOtp, + actionLabel: context.derivAuthLocalization.actionTryAgain, ); } @@ -83,8 +83,8 @@ base class AuthErrorStateHandler { void onSelfClosed(DerivAuthErrorState state) { showErrorDialog( context: context, - errorMessage: context.derivAuthLocalization!.informSelfClosed, - actionLabel: context.derivAuthLocalization!.actionTryAgain, + errorMessage: context.derivAuthLocalization.informSelfClosed, + actionLabel: context.derivAuthLocalization.actionTryAgain, ); } @@ -92,8 +92,8 @@ base class AuthErrorStateHandler { void onUnexpectedError(DerivAuthErrorState state) { showErrorDialog( context: context, - errorMessage: context.derivAuthLocalization!.informUnexpectedError, - actionLabel: context.derivAuthLocalization!.actionTryAgain, + errorMessage: context.derivAuthLocalization.informUnexpectedError, + actionLabel: context.derivAuthLocalization.actionTryAgain, ); } @@ -101,8 +101,8 @@ base class AuthErrorStateHandler { void onUnsupportedCountry(DerivAuthErrorState state) { showErrorDialog( context: context, - errorMessage: context.derivAuthLocalization!.informUnsupportedCountry, - actionLabel: context.derivAuthLocalization!.actionTryAgain, + errorMessage: context.derivAuthLocalization.informUnsupportedCountry, + actionLabel: context.derivAuthLocalization.actionTryAgain, ); } @@ -110,8 +110,8 @@ base class AuthErrorStateHandler { void onConnectionError(DerivAuthErrorState state) { showErrorDialog( context: context, - errorMessage: context.derivAuthLocalization!.informConnectionError, - actionLabel: context.derivAuthLocalization!.actionTryAgain, + errorMessage: context.derivAuthLocalization.informConnectionError, + actionLabel: context.derivAuthLocalization.actionTryAgain, ); } @@ -119,8 +119,8 @@ base class AuthErrorStateHandler { void onSwitchAccountError(DerivAuthErrorState state) { showErrorDialog( context: context, - errorMessage: context.derivAuthLocalization!.informSwitchAccountError, - actionLabel: context.derivAuthLocalization!.actionTryAgain, + errorMessage: context.derivAuthLocalization.informSwitchAccountError, + actionLabel: context.derivAuthLocalization.actionTryAgain, ); } } diff --git a/packages/deriv_auth/lib/features/auth/cubit/deriv_auth_cubit.dart b/packages/deriv_auth/lib/features/auth/cubit/deriv_auth_cubit.dart index 4ea017900..8d83d5a56 100644 --- a/packages/deriv_auth/lib/features/auth/cubit/deriv_auth_cubit.dart +++ b/packages/deriv_auth/lib/features/auth/cubit/deriv_auth_cubit.dart @@ -10,7 +10,6 @@ import 'package:deriv_auth/core/services/token/models/login_request.dart'; import 'package:deriv_auth/features/auth/deriv_auth_io.dart'; import 'package:deriv_auth/features/auth/services/base_auth_service.dart'; import 'package:deriv_auth/features/social_auth/models/social_auth_dto.dart'; -import 'package:deriv_passkeys/deriv_passkeys.dart'; part 'deriv_auth_state.dart'; 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 eec5f9a06..4543a1ce9 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 @@ -147,7 +147,7 @@ class _DerivGetStartedLayoutState extends State { onPressed: widget.onSignupTapped, child: Center( child: Text( - context.derivAuthLocalization!.actionGetAFreeAccount, + context.derivAuthLocalization.actionGetAFreeAccount, style: context.theme.textStyle( textStyle: TextStyles.body2, color: context.theme.colors.prominent, @@ -163,7 +163,7 @@ class _DerivGetStartedLayoutState extends State { onPressed: widget.onLoginTapped, child: Center( child: Text( - context.derivAuthLocalization!.actionLogin, + context.derivAuthLocalization.actionLogin, style: context.theme.textStyle( textStyle: TextStyles.body2, color: context.theme.colors.prominent, diff --git a/packages/deriv_auth/lib/features/login/presentation/layouts/deriv_2fa_layout.dart b/packages/deriv_auth/lib/features/login/presentation/layouts/deriv_2fa_layout.dart index 451f87dfc..86c688214 100644 --- a/packages/deriv_auth/lib/features/login/presentation/layouts/deriv_2fa_layout.dart +++ b/packages/deriv_auth/lib/features/login/presentation/layouts/deriv_2fa_layout.dart @@ -50,7 +50,7 @@ class _Deriv2FALayoutState extends State { appBar: AppBar( elevation: ThemeProvider.zeroMargin, title: Text( - context.derivAuthLocalization!.labelLogIn, + context.derivAuthLocalization.labelLogIn, style: TextStyles.title, ), ), @@ -65,13 +65,13 @@ class _Deriv2FALayoutState extends State { children: [ SvgPicture.asset(Assets.twoFactorAuthIcon), Text( - context.derivAuthLocalization!.labelTwoFactorAuth, + context.derivAuthLocalization.labelTwoFactorAuth, style: context.theme.textStyle(textStyle: TextStyles.title), textAlign: TextAlign.center, ), const SizedBox(height: ThemeProvider.margin08), Text( - context.derivAuthLocalization!.informEnterTwoFactorAuthCode, + context.derivAuthLocalization.informEnterTwoFactorAuthCode, style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.general, @@ -82,7 +82,7 @@ class _Deriv2FALayoutState extends State { BaseTextField( controller: _otpController, labelText: context - .derivAuthLocalization!.labelTwoFactorAuthenticationCode, + .derivAuthLocalization.labelTwoFactorAuthenticationCode, labelColor: context.theme.colors.disabled, focusNode: _otpFocusNode, enabled: !_isLoading(), @@ -112,7 +112,7 @@ class _Deriv2FALayoutState extends State { width: ThemeProvider.iconSize16, ) : Text( - context.derivAuthLocalization!.actionProceed, + context.derivAuthLocalization.actionProceed, style: TextStyles.body2.copyWith( color: context.theme.colors.prominent, ), 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 4f8c088fc..5076d0d0c 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 @@ -99,7 +99,7 @@ class _DerivLoginLayoutState extends State { appBar: AppBar( elevation: ThemeProvider.zeroMargin, title: Text( - context.derivAuthLocalization!.labelLogIn, + context.derivAuthLocalization.labelLogIn, style: TextStyles.title, ), backgroundColor: context.theme.colors.secondary, @@ -131,8 +131,7 @@ class _DerivLoginLayoutState extends State { _buildLoginButton(), const SizedBox(height: ThemeProvider.margin24), DerivSocialAuthDivider( - label: - context.derivAuthLocalization!.informLoginOptions, + label: context.derivAuthLocalization.informLoginOptions, isVisible: widget.isSocialAuthEnabled, ), if (widget.isSocialAuthEnabled) @@ -176,7 +175,7 @@ class _DerivLoginLayoutState extends State { semanticLabel: SemanticsLabels.loginEmailFieldSemantic, controller: _emailController, focusNode: _emailFocusNode, - labelText: context.derivAuthLocalization!.labelEmail, + labelText: context.derivAuthLocalization.labelEmail, borderColor: context.theme.colors.hover, focusedBorderColor: context.theme.colors.blue, keyboardType: TextInputType.emailAddress, @@ -191,7 +190,7 @@ class _DerivLoginLayoutState extends State { semanticLabel: SemanticsLabels.loginPasswordFieldSemantic, controller: _passwordController, focusNode: _passwordFocusNode, - labelText: context.derivAuthLocalization!.labelPassword, + labelText: context.derivAuthLocalization.labelPassword, obscureText: !_isPasswordVisible, enabled: isEnabled, suffixIcon: IconButton( @@ -217,7 +216,7 @@ class _DerivLoginLayoutState extends State { child: InkWell( onTap: widget.onResetPassTapped, child: Text( - context.derivAuthLocalization!.actionForgotPassword, + context.derivAuthLocalization.actionForgotPassword, style: context.theme.textStyle( textStyle: TextStyles.body2, color: context.theme.colors.coral, @@ -250,7 +249,7 @@ class _DerivLoginLayoutState extends State { width: ThemeProvider.iconSize16, ) : Text( - context.derivAuthLocalization!.actionLogin, + context.derivAuthLocalization.actionLogin, style: context.theme.textStyle( textStyle: TextStyles.body2, color: context.theme.colors.prominent.withOpacity( @@ -267,7 +266,7 @@ class _DerivLoginLayoutState extends State { mainAxisSize: MainAxisSize.min, children: [ Text( - context.derivAuthLocalization!.labelDontHaveAnAccountYet, + context.derivAuthLocalization.labelDontHaveAnAccountYet, style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.general, @@ -278,7 +277,7 @@ class _DerivLoginLayoutState extends State { child: Padding( padding: const EdgeInsets.all(ThemeProvider.margin04), child: Text( - context.derivAuthLocalization!.actionCreateANewAccount, + context.derivAuthLocalization.actionCreateANewAccount, style: context.theme.textStyle( textStyle: TextStyles.body2, color: context.theme.colors.coral, @@ -315,7 +314,7 @@ class _DerivLoginLayoutState extends State { return null; } - return context.derivAuthLocalization!.informInvalidEmailFormat; + return context.derivAuthLocalization.informInvalidEmailFormat; } String? _passwordValidator(String? input) { @@ -323,7 +322,7 @@ class _DerivLoginLayoutState extends State { return null; } - return context.derivAuthLocalization!.warnPasswordLength; + return context.derivAuthLocalization.warnPasswordLength; } Future _onLoginTapped() async { diff --git a/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_choose_new_pass_layout.dart b/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_choose_new_pass_layout.dart index a9aefe63c..68dafc6cf 100644 --- a/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_choose_new_pass_layout.dart +++ b/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_choose_new_pass_layout.dart @@ -50,7 +50,7 @@ class _DerivChooseNewPassLayoutState extends State { appBar: AppBar( elevation: ThemeProvider.zeroMargin, title: Text( - context.derivAuthLocalization!.labelResetPassword, + context.derivAuthLocalization.labelResetPassword, style: TextStyles.title, ), ), @@ -110,14 +110,14 @@ class _DerivChooseNewPassLayoutState extends State { ), const SizedBox(height: ThemeProvider.margin48), Text( - context.derivAuthLocalization!.labelChooseNewPass, + context.derivAuthLocalization.labelChooseNewPass, style: TextStyles.title, ), const SizedBox(height: ThemeProvider.margin24), BaseTextField( controller: _passController, focusNode: _passFocusNode, - labelText: context.derivAuthLocalization!.labelCreatePass, + labelText: context.derivAuthLocalization.labelCreatePass, obscureText: !_isPasswordVisible, suffixIcon: IconButton( icon: Icon( @@ -162,7 +162,7 @@ class _DerivChooseNewPassLayoutState extends State { width: ThemeProvider.iconSize16, ) : Text( - context.derivAuthLocalization!.actionResetPass, + context.derivAuthLocalization.actionResetPass, style: context.theme.textStyle( textStyle: TextStyles.body2, color: context.theme.colors.prominent.withOpacity( @@ -193,7 +193,7 @@ class _DerivChooseNewPassLayoutState extends State { return null; } - return context.derivAuthLocalization!.informInvalidPasswordFormat; + return context.derivAuthLocalization.informInvalidPasswordFormat; } bool isFormValid() => _passwordValidator(_passController.text) == null; diff --git a/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_reset_pass_layout.dart b/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_reset_pass_layout.dart index 72deda390..e5406a496 100644 --- a/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_reset_pass_layout.dart +++ b/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_reset_pass_layout.dart @@ -44,7 +44,7 @@ class _DerivResetPassLayoutState extends State { appBar: AppBar( elevation: ThemeProvider.zeroMargin, title: Text( - context.derivAuthLocalization!.labelResetPassword, + context.derivAuthLocalization.labelResetPassword, style: TextStyles.title, ), ), @@ -87,12 +87,12 @@ class _DerivResetPassLayoutState extends State { ), const SizedBox(height: ThemeProvider.margin24), Text( - context.derivAuthLocalization!.labelCheckEmail, + context.derivAuthLocalization.labelCheckEmail, style: TextStyles.title, ), const SizedBox(height: ThemeProvider.margin08), Text( - context.derivAuthLocalization! + context.derivAuthLocalization .informSendResetPasswordEmail(_emailController.text), textAlign: TextAlign.center, style: context.theme.textStyle( @@ -121,14 +121,14 @@ class _DerivResetPassLayoutState extends State { ), const SizedBox(height: ThemeProvider.margin16), Text( - context.derivAuthLocalization!.labelResetPassword, + context.derivAuthLocalization.labelResetPassword, style: TextStyles.title, textAlign: TextAlign.center, ), const SizedBox(height: ThemeProvider.margin08), Center( child: Text( - context.derivAuthLocalization!.informResetPassByEmail, + context.derivAuthLocalization.informResetPassByEmail, textAlign: TextAlign.center, style: context.theme.textStyle( textStyle: TextStyles.body1, @@ -141,7 +141,7 @@ class _DerivResetPassLayoutState extends State { semanticLabel: SemanticsLabels.resetPasswordEmailFieldSemantic, controller: _emailController, focusNode: _emailFocusNode, - labelText: context.derivAuthLocalization!.labelEmail, + labelText: context.derivAuthLocalization.labelEmail, keyboardType: TextInputType.emailAddress, borderColor: context.theme.colors.hover, validator: _emailValidator, @@ -177,7 +177,7 @@ class _DerivResetPassLayoutState extends State { width: ThemeProvider.margin16, ) : Text( - context.derivAuthLocalization!.actionResetPass, + context.derivAuthLocalization.actionResetPass, style: context.theme.textStyle( textStyle: TextStyles.body2, color: context.theme.colors.prominent.withOpacity( @@ -213,7 +213,7 @@ class _DerivResetPassLayoutState extends State { return null; } - return context.derivAuthLocalization!.informInvalidEmailFormat; + return context.derivAuthLocalization.informInvalidEmailFormat; } String _getEmailValue() => _emailController.text.trim(); diff --git a/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_success_pass_change_layout.dart b/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_success_pass_change_layout.dart index 18d39d155..4d6cd57ec 100644 --- a/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_success_pass_change_layout.dart +++ b/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_success_pass_change_layout.dart @@ -14,7 +14,7 @@ class DerivSuccessPassChangeLayout extends StatelessWidget { appBar: AppBar( elevation: ThemeProvider.zeroMargin, title: Text( - context.derivAuthLocalization!.labelResetPassword, + context.derivAuthLocalization.labelResetPassword, style: TextStyles.title, ), ), @@ -37,14 +37,14 @@ class DerivSuccessPassChangeLayout extends StatelessWidget { height: ThemeProvider.margin16, ), Text( - context.derivAuthLocalization!.informYourPassHasBeenReset, + context.derivAuthLocalization.informYourPassHasBeenReset, style: TextStyles.title, ), const SizedBox( height: ThemeProvider.margin08, ), Text( - context.derivAuthLocalization!.informRedirectLogin, + context.derivAuthLocalization.informRedirectLogin, textAlign: TextAlign.center, style: context.theme.textStyle( textStyle: TextStyles.body1, diff --git a/packages/deriv_auth/lib/features/setting_page/presentation/layouts/deriv_setting_layout.dart b/packages/deriv_auth/lib/features/setting_page/presentation/layouts/deriv_setting_layout.dart index 27b3fc266..e61f0d754 100644 --- a/packages/deriv_auth/lib/features/setting_page/presentation/layouts/deriv_setting_layout.dart +++ b/packages/deriv_auth/lib/features/setting_page/presentation/layouts/deriv_setting_layout.dart @@ -155,7 +155,7 @@ class _SettingsPageState extends State { top: ThemeProvider.margin24, ), child: Text( - context.derivAuthLocalization!.labelDeveloper, + context.derivAuthLocalization.labelDeveloper, style: context.theme.textStyle( textStyle: TextStyles.body1Bold, color: context.theme.colors.coral, @@ -164,21 +164,21 @@ class _SettingsPageState extends State { ); Widget get _endpoint => _buildTextInputField( - label: context.derivAuthLocalization!.labelEndpoint, - semantic: context.derivAuthLocalization!.semanticEndpoint, + label: context.derivAuthLocalization.labelEndpoint, + semantic: context.derivAuthLocalization.semanticEndpoint, controller: _endpointController, validator: (String? value) => hasOnlySmallLettersAndNumberInput(value!) ? null - : context.derivAuthLocalization!.warnInvalidEndpoint, + : context.derivAuthLocalization.warnInvalidEndpoint, ); Widget get _appId => _buildTextInputField( - label: context.derivAuthLocalization!.labelApplicationID, - semantic: context.derivAuthLocalization!.semanticApplicationID, + label: context.derivAuthLocalization.labelApplicationID, + semantic: context.derivAuthLocalization.semanticApplicationID, controller: _appIdController, validator: (String? value) => hasOnlyNumberInput(value!) ? null - : context.derivAuthLocalization!.warnInvalidApplicationID, + : context.derivAuthLocalization.warnInvalidApplicationID, ); Widget _buildTextInputField({ diff --git a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_country_selection_layout.dart b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_country_selection_layout.dart index 682ebb9a9..60c564e59 100644 --- a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_country_selection_layout.dart +++ b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_country_selection_layout.dart @@ -100,7 +100,7 @@ class _DerivCountrySelectionLayoutState SvgPicture.asset(Assets.locationIcon, package: 'deriv_auth'), const SizedBox(height: ThemeProvider.margin16), Text( - context.derivAuthLocalization!.labelSelectCountry, + context.derivAuthLocalization.labelSelectCountry, style: TextStyles.title, ), const SizedBox(height: ThemeProvider.margin24), @@ -127,7 +127,7 @@ class _DerivCountrySelectionLayoutState key: _formKey, child: BaseTextField( controller: _textController, - labelText: context.derivAuthLocalization!.labelChooseCountry, + labelText: context.derivAuthLocalization.labelChooseCountry, labelColor: context.theme.colors.disabled, focusNode: _focusNode, focusedLabelColor: context.theme.colors.blue, @@ -157,7 +157,7 @@ class _DerivCountrySelectionLayoutState onPressed: widget.onNextPressed, child: Center( child: Text( - context.derivAuthLocalization!.actionNext, + context.derivAuthLocalization.actionNext, style: TextStyles.button .copyWith(color: context.theme.colors.prominent), ), @@ -225,7 +225,7 @@ class _DerivCountrySelectionLayoutState DerivResidenceModel? selectedCountry, }) { if (selectedCountry != null && selectedCountry.isDisabled) { - return context.derivAuthLocalization!.warnCountryNotAvailable; + return context.derivAuthLocalization.warnCountryNotAvailable; } return null; diff --git a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_email_not_received_layout.dart b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_email_not_received_layout.dart index 93cfe423d..115beb538 100644 --- a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_email_not_received_layout.dart +++ b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_email_not_received_layout.dart @@ -42,7 +42,7 @@ class DerivEmailNotReceivedLayout extends StatelessWidget { child: Column( children: [ Text( - context.derivAuthLocalization!.labelEmailIssueHeader, + context.derivAuthLocalization.labelEmailIssueHeader, style: context.theme.textStyle( textStyle: TextStyles.body2, color: context.theme.colors.general, @@ -55,7 +55,7 @@ class DerivEmailNotReceivedLayout extends StatelessWidget { const SizedBox(width: ThemeProvider.margin24), Flexible( child: Text( - context.derivAuthLocalization!.labelEmailIssueSpam, + context.derivAuthLocalization.labelEmailIssueSpam, style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.general, @@ -71,7 +71,7 @@ class DerivEmailNotReceivedLayout extends StatelessWidget { const SizedBox(width: ThemeProvider.margin24), Flexible( child: Text( - context.derivAuthLocalization!.labelEmailIssueWrongEmail, + context.derivAuthLocalization.labelEmailIssueWrongEmail, style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.general, @@ -87,7 +87,7 @@ class DerivEmailNotReceivedLayout extends StatelessWidget { const SizedBox(width: ThemeProvider.margin24), Flexible( child: Text( - context.derivAuthLocalization!.labelEmailIssueTypo, + context.derivAuthLocalization.labelEmailIssueTypo, style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.general, @@ -103,7 +103,7 @@ class DerivEmailNotReceivedLayout extends StatelessWidget { const SizedBox(width: ThemeProvider.margin24), Flexible( child: Text( - context.derivAuthLocalization!.labelEmailIssueFirewall, + context.derivAuthLocalization.labelEmailIssueFirewall, style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.general, @@ -127,7 +127,7 @@ class DerivEmailNotReceivedLayout extends StatelessWidget { onPressed: onReEnterEmailPressed, child: Center( child: Text( - context.derivAuthLocalization!.actionReenterEmail, + context.derivAuthLocalization.actionReenterEmail, style: context.theme.textStyle( textStyle: TextStyles.button .copyWith(color: context.theme.colors.prominent), diff --git a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_set_password_layout.dart b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_set_password_layout.dart index 63455a325..69f4e3110 100644 --- a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_set_password_layout.dart +++ b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_set_password_layout.dart @@ -1,5 +1,4 @@ import 'package:deriv_auth/core/helpers/assets.dart'; -import 'package:deriv_auth/core/states/auth_state_listener.dart'; import 'package:deriv_auth/deriv_auth.dart'; import 'package:deriv_auth/features/signup/presentation/widgets/password_policy_checker_widget.dart'; import 'package:deriv_theme/deriv_theme.dart'; @@ -97,7 +96,7 @@ class _DerivSetPasswordLayoutState extends State { SvgPicture.asset(Assets.passwordIcon, package: 'deriv_auth'), const SizedBox(height: ThemeProvider.margin16), Text( - context.derivAuthLocalization!.labelKeepPassword, + context.derivAuthLocalization.labelKeepPassword, style: TextStyles.title, textAlign: TextAlign.center, ), @@ -140,7 +139,7 @@ class _DerivSetPasswordLayoutState extends State { focusNode: _passwordFocusNode, controller: _passwordTextController, obscureText: !_isPasswordVisible, - labelText: context.derivAuthLocalization!.labelCreatePassword, + labelText: context.derivAuthLocalization.labelCreatePassword, labelColor: context.theme.colors.disabled, focusedLabelColor: context.theme.colors.blue, suffixIcon: IconButton( @@ -166,7 +165,7 @@ class _DerivSetPasswordLayoutState extends State { strokeWidth: 3, ) : Text( - context.derivAuthLocalization!.actionStartTrading, + context.derivAuthLocalization.actionStartTrading, style: TextStyles.button .copyWith(color: context.theme.colors.prominent), ), @@ -181,7 +180,7 @@ class _DerivSetPasswordLayoutState extends State { onPressed: widget.onPreviousPressed, child: Center( child: Text( - context.derivAuthLocalization!.actionPrevious, + context.derivAuthLocalization.actionPrevious, style: context.theme.textStyle( textStyle: TextStyles.button, ), diff --git a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_signup_layout.dart b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_signup_layout.dart index 3e3bb9b9f..c466189ed 100644 --- a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_signup_layout.dart +++ b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_signup_layout.dart @@ -1,5 +1,4 @@ import 'package:deriv_auth/deriv_auth.dart'; -import 'package:deriv_auth/features/single_entry/core/auth_data.dart'; import 'package:deriv_theme/deriv_theme.dart'; import 'package:deriv_ui/deriv_ui.dart'; import 'package:flutter/material.dart'; @@ -96,7 +95,7 @@ class _DerivSignupLayoutState extends State { backgroundColor: context.theme.colors.primary, appBar: AppBar( elevation: ThemeProvider.zeroMargin, - title: Text(context.derivAuthLocalization!.labelSignUp, + title: Text(context.derivAuthLocalization.labelSignUp, style: TextStyles.title), backgroundColor: context.theme.colors.secondary, ), @@ -125,7 +124,7 @@ class _DerivSignupLayoutState extends State { _buildSignUpButton(), const SizedBox(height: ThemeProvider.margin24), DerivSocialAuthDivider( - label: context.derivAuthLocalization!.labelOrSignUpWith, + label: context.derivAuthLocalization.labelOrSignUpWith, isVisible: widget.isSocialAuthEnabled, ), if (widget.isSocialAuthEnabled) @@ -167,16 +166,16 @@ class _DerivSignupLayoutState extends State { children: [ InfoIconButton( dialogTitle: - context.derivAuthLocalization!.labelReferralInfoTitle, - dialogDescription: context - .derivAuthLocalization!.infoReferralInfoDescription, - positiveActionLabel: context.derivAuthLocalization!.actionOk, + context.derivAuthLocalization.labelReferralInfoTitle, + dialogDescription: + context.derivAuthLocalization.infoReferralInfoDescription, + positiveActionLabel: context.derivAuthLocalization.actionOk, iconSize: ThemeProvider.iconSize24, ), const SizedBox(width: ThemeProvider.margin08), Expanded( child: Text( - context.derivAuthLocalization!.labelGotReferralCode, + context.derivAuthLocalization.labelGotReferralCode, style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.prominent, @@ -231,7 +230,7 @@ class _DerivSignupLayoutState extends State { } }, focusNode: referralFocusNode, - labelText: context.derivAuthLocalization!.labelReferralCode, + labelText: context.derivAuthLocalization.labelReferralCode, borderColor: context.theme.colors.hover, focusedBorderColor: context.theme.colors.blue, textInputAction: TextInputAction.done, @@ -264,7 +263,7 @@ class _DerivSignupLayoutState extends State { mainAxisSize: MainAxisSize.min, children: [ Text( - context.derivAuthLocalization!.labelHaveAccount, + context.derivAuthLocalization.labelHaveAccount, style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.general, @@ -275,7 +274,7 @@ class _DerivSignupLayoutState extends State { child: Padding( padding: const EdgeInsets.all(ThemeProvider.margin04), child: Text( - context.derivAuthLocalization!.actionLogin, + context.derivAuthLocalization.actionLogin, style: context.theme.textStyle( textStyle: TextStyles.body2, color: context.theme.colors.coral, @@ -291,7 +290,7 @@ class _DerivSignupLayoutState extends State { semanticLabel: SemanticsLabels.signupEmailFieldSemantic, controller: emailController, focusNode: emailFocusNode, - labelText: context.derivAuthLocalization!.labelEmail, + labelText: context.derivAuthLocalization.labelEmail, borderColor: context.theme.colors.hover, focusedBorderColor: context.theme.colors.blue, keyboardType: TextInputType.emailAddress, @@ -319,7 +318,7 @@ class _DerivSignupLayoutState extends State { width: ThemeProvider.iconSize16, ) : Text( - context.derivAuthLocalization!.actionCreateAccount, + context.derivAuthLocalization.actionCreateAccount, style: context.theme.textStyle( textStyle: TextStyles.body2, color: context.theme.colors.prominent, @@ -349,7 +348,7 @@ class _DerivSignupLayoutState extends State { return null; } - return context.derivAuthLocalization!.informInvalidEmailFormat; + return context.derivAuthLocalization.informInvalidEmailFormat; } String? _referralValidator(String? input) { @@ -357,7 +356,7 @@ class _DerivSignupLayoutState extends State { return null; } - return context.derivAuthLocalization!.informInvalidReferralCode; + return context.derivAuthLocalization.informInvalidReferralCode; } Future _onSignupTapped() async { diff --git a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_verification_done_layout.dart b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_verification_done_layout.dart index a85145886..1e30b4649 100644 --- a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_verification_done_layout.dart +++ b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_verification_done_layout.dart @@ -29,7 +29,7 @@ class DerivVerificationDoneLayout extends StatelessWidget { backgroundColor: context.theme.colors.primary, appBar: AppBar( elevation: ThemeProvider.zeroMargin, - title: Text(context.derivAuthLocalization!.labelVerifyYourEmail), + title: Text(context.derivAuthLocalization.labelVerifyYourEmail), ), body: SafeArea( child: Column( @@ -56,12 +56,12 @@ class DerivVerificationDoneLayout extends StatelessWidget { ), const SizedBox(height: ThemeProvider.margin16), Text( - context.derivAuthLocalization!.labelThanksEmail, + context.derivAuthLocalization.labelThanksEmail, style: TextStyles.title, ), const SizedBox(height: ThemeProvider.margin08), Text( - context.derivAuthLocalization!.informLetsContinue, + context.derivAuthLocalization.informLetsContinue, style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.general, @@ -80,7 +80,7 @@ class DerivVerificationDoneLayout extends StatelessWidget { onPressed: onContinuePressed, child: Center( child: Text( - context.derivAuthLocalization!.actionContinue, + context.derivAuthLocalization.actionContinue, style: context.theme.textStyle( textStyle: TextStyles.button .copyWith(color: context.theme.colors.prominent), diff --git a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_verify_email_layout.dart b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_verify_email_layout.dart index c89461053..eb2996d7d 100644 --- a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_verify_email_layout.dart +++ b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_verify_email_layout.dart @@ -26,7 +26,7 @@ class DerivVerifyEmailLayout extends StatelessWidget { appBar: AppBar( elevation: ThemeProvider.zeroMargin, title: Text( - context.derivAuthLocalization!.labelVerifyYourEmail, + context.derivAuthLocalization.labelVerifyYourEmail, style: TextStyles.title, ), backgroundColor: context.theme.colors.secondary, @@ -56,13 +56,12 @@ class DerivVerifyEmailLayout extends StatelessWidget { ), const SizedBox(height: ThemeProvider.margin16), Text( - context.derivAuthLocalization!.labelCheckEmail, + context.derivAuthLocalization.labelCheckEmail, style: TextStyles.title, ), const SizedBox(height: ThemeProvider.margin08), Text( - context.derivAuthLocalization! - .informVerificationEmailSent(email!), + context.derivAuthLocalization.informVerificationEmailSent(email!), style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.general, @@ -82,7 +81,7 @@ class DerivVerifyEmailLayout extends StatelessWidget { onPressed: onEmailNotReceivedPressed, child: Center( child: Text( - context.derivAuthLocalization!.actionEmailNotReceived, + context.derivAuthLocalization.actionEmailNotReceived, style: context.theme.textStyle( textStyle: TextStyles.button, ), diff --git a/packages/deriv_auth/lib/features/signup/presentation/widgets/country_selection_list_widget.dart b/packages/deriv_auth/lib/features/signup/presentation/widgets/country_selection_list_widget.dart index 9896a0264..5b72f3fc0 100644 --- a/packages/deriv_auth/lib/features/signup/presentation/widgets/country_selection_list_widget.dart +++ b/packages/deriv_auth/lib/features/signup/presentation/widgets/country_selection_list_widget.dart @@ -102,7 +102,7 @@ class _CountrySelectionListWidgetState children: [ const SizedBox(width: ThemeProvider.margin48), Text( - context.derivAuthLocalization!.labelChooseCountry, + context.derivAuthLocalization.labelChooseCountry, style: TextStyles.subheading, ), ], @@ -128,7 +128,7 @@ class _CountrySelectionListWidgetState onPressed: () => _searchController.clear(), ), contentPadding: const EdgeInsets.only(top: ThemeProvider.margin08), - hintText: context.derivAuthLocalization!.labelSearchCountry, + hintText: context.derivAuthLocalization.labelSearchCountry, hintStyle: context.theme.textStyle( textStyle: TextStyles.subheading, color: context.theme.colors.active, diff --git a/packages/deriv_auth/lib/features/signup/presentation/widgets/password_policy_checker_widget.dart b/packages/deriv_auth/lib/features/signup/presentation/widgets/password_policy_checker_widget.dart index 377a17173..2bb6c1b5b 100644 --- a/packages/deriv_auth/lib/features/signup/presentation/widgets/password_policy_checker_widget.dart +++ b/packages/deriv_auth/lib/features/signup/presentation/widgets/password_policy_checker_widget.dart @@ -40,23 +40,20 @@ class PasswordPolicyCheckerWidget extends StatelessWidget { BuildContext context) => [ DerivPasswordPolicyModel( - description: - context.derivAuthLocalization!.informPasswordPolicyLength, + description: context.derivAuthLocalization.informPasswordPolicyLength, regex: validPasswordLengthRegex, ), DerivPasswordPolicyModel( description: - context.derivAuthLocalization!.informPasswordPolicyLowerAndUpper, + context.derivAuthLocalization.informPasswordPolicyLowerAndUpper, regex: validPasswordWithUppercaseRegex, ), DerivPasswordPolicyModel( - description: - context.derivAuthLocalization!.informPasswordPolicyNumber, + description: context.derivAuthLocalization.informPasswordPolicyNumber, regex: validPasswordWithNumberRegex, ), DerivPasswordPolicyModel( - description: - context.derivAuthLocalization!.warnPasswordContainsSymbol, + description: context.derivAuthLocalization.warnPasswordContainsSymbol, regex: validPasswordWithSymbols, isOptional: true, ), @@ -70,7 +67,7 @@ class PasswordPolicyCheckerWidget extends StatelessWidget { mainAxisSize: MainAxisSize.min, children: [ Text( - context.derivAuthLocalization!.informPasswordPolicy, + context.derivAuthLocalization.informPasswordPolicy, style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.general, diff --git a/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/choose_new_password_page.dart b/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/choose_new_password_page.dart index 90234fe08..7b1ed804b 100644 --- a/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/choose_new_password_page.dart +++ b/packages/deriv_auth/lib/features/single_entry/features/reset_pass/pages/choose_new_password_page.dart @@ -6,8 +6,7 @@ import 'package:flutter/material.dart'; /// Choose new password page class ChooseNewPasswordPage extends StatelessWidget { /// Constructor [ChooseNewPasswordPage] - const ChooseNewPasswordPage( - {required this.token, super.key, required DerivResetPassCubit cubit}); + const ChooseNewPasswordPage({required this.token, super.key}); /// Token final String token; diff --git a/packages/deriv_auth/lib/features/single_entry/features/signup/repositories/referral_repository.dart b/packages/deriv_auth/lib/features/single_entry/features/signup/repositories/referral_repository.dart index f3a42d877..f2e6ec693 100644 --- a/packages/deriv_auth/lib/features/single_entry/features/signup/repositories/referral_repository.dart +++ b/packages/deriv_auth/lib/features/single_entry/features/signup/repositories/referral_repository.dart @@ -4,5 +4,5 @@ import 'package:deriv_auth/core/services/referral/base_referral_code_service.dar class ReferralRepository implements BaseReferralCodeService { @override Future getReferralToken(String referralCode) => - Future.value('${referralCode}Token'); + Future.value('${referralCode}Token'); } diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index f8725716e..6548e4770 100644 --- a/packages/deriv_auth/pubspec.yaml +++ b/packages/deriv_auth/pubspec.yaml @@ -46,13 +46,13 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_localizations - ref: 9a91d879a5ffd371a46dcbf70e4f3a295bc7b7e1 + ref: 47cd664bbc415b3e5c1808ec373f954348c19298 deriv_passkeys: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: 568ecf2acdd9d415ef40c73f8caf6f136e752f33 + ref: 719122d0b8d3e94d2d6ce357ac76538a572947c2 flutter_bloc: ^8.1.3 flutter_svg: ^2.0.7 @@ -67,7 +67,7 @@ dependency_overrides: flutter_deriv_api: git: url: git@github.com:deriv-com/flutter-deriv-api.git - ref: 82ddc3e22ca6ac85a6c7ff4bac082a1574a90c93 + ref: dev dev_dependencies: mocktail: ^1.0.3 diff --git a/packages/deriv_auth/test/core/helpers/account_helper_test.dart b/packages/deriv_auth/test/core/helpers/account_helper_test.dart index 52f01e24c..de0f64887 100644 --- a/packages/deriv_auth/test/core/helpers/account_helper_test.dart +++ b/packages/deriv_auth/test/core/helpers/account_helper_test.dart @@ -1,4 +1,3 @@ -import 'package:deriv_auth/core/helpers/helpers.dart'; import 'package:deriv_auth/deriv_auth.dart'; import 'package:test/test.dart'; diff --git a/packages/deriv_auth/test/core/states/auth_error_state_mapper_test.dart b/packages/deriv_auth/test/core/states/auth_error_state_mapper_test.dart index 0cf52897c..b0daac89b 100644 --- a/packages/deriv_auth/test/core/states/auth_error_state_mapper_test.dart +++ b/packages/deriv_auth/test/core/states/auth_error_state_mapper_test.dart @@ -1,4 +1,3 @@ -import 'package:deriv_auth/core/states/states.dart'; import 'package:flutter/material.dart'; import 'package:mocktail/mocktail.dart'; import 'package:test/test.dart'; diff --git a/packages/deriv_auth/test/core/states/auth_state_listener_test.dart b/packages/deriv_auth/test/core/states/auth_state_listener_test.dart index 674380f99..b86f1aea7 100644 --- a/packages/deriv_auth/test/core/states/auth_state_listener_test.dart +++ b/packages/deriv_auth/test/core/states/auth_state_listener_test.dart @@ -1,5 +1,4 @@ import 'package:deriv_auth/core/models/landig_comany_model.dart'; -import 'package:deriv_auth/core/states/auth_state_listener.dart'; import 'package:deriv_auth/deriv_auth.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; diff --git a/packages/deriv_auth/test/features/reset_password/presentation/layouts/deriv_choose_new_pass_layout_test.dart b/packages/deriv_auth/test/features/reset_password/presentation/layouts/deriv_choose_new_pass_layout_test.dart index 1f58aba0d..90cbc2566 100644 --- a/packages/deriv_auth/test/features/reset_password/presentation/layouts/deriv_choose_new_pass_layout_test.dart +++ b/packages/deriv_auth/test/features/reset_password/presentation/layouts/deriv_choose_new_pass_layout_test.dart @@ -1,7 +1,6 @@ // ignore_for_file: always_specify_types import 'package:deriv_auth/deriv_auth.dart'; -import 'package:deriv_auth/features/reset_password/presentation/layouts/deriv_choose_new_pass_layout.dart'; import 'package:deriv_ui/deriv_ui.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; diff --git a/packages/deriv_auth/test/features/social_auth/cubit/social_auth_cubit_test.dart b/packages/deriv_auth/test/features/social_auth/cubit/social_auth_cubit_test.dart index 2325dbc36..39efc4363 100644 --- a/packages/deriv_auth/test/features/social_auth/cubit/social_auth_cubit_test.dart +++ b/packages/deriv_auth/test/features/social_auth/cubit/social_auth_cubit_test.dart @@ -1,6 +1,5 @@ import 'package:bloc_test/bloc_test.dart'; import 'package:deriv_auth/deriv_auth.dart'; -import 'package:deriv_auth/features/social_auth/services/base_social_web_view_service.dart'; import 'package:deriv_http_client/deriv_http_client.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mocktail/mocktail.dart'; From 02f390b2cb4736993f876fe60f6513490682837a Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Mon, 1 Apr 2024 12:51:06 +0400 Subject: [PATCH 033/162] refactor(deriv_passkeys): removed context parameter from onLoggedIn callback --- .../lib/features/login/pages/login_page.dart | 3 +-- .../layouts/deriv_login_layout.dart | 4 ++-- .../core/models/login_page_model.dart | 2 +- .../layouts/deriv_login_layout_test.dart | 20 +++++++++---------- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/packages/deriv_auth/example/lib/features/login/pages/login_page.dart b/packages/deriv_auth/example/lib/features/login/pages/login_page.dart index 2bfcc77a1..03d64f5b9 100644 --- a/packages/deriv_auth/example/lib/features/login/pages/login_page.dart +++ b/packages/deriv_auth/example/lib/features/login/pages/login_page.dart @@ -26,8 +26,7 @@ class _LoginPageState extends State { redirectURL: 'deriv://example', onWebViewError: (String error) {}, welcomeLabel: 'Welcome back!', - onLoggedIn: (BuildContext context, DerivAuthLoggedInState state) => - Navigator.pushReplacement( + onLoggedIn: (DerivAuthLoggedInState state) => Navigator.pushReplacement( context, MaterialPageRoute( builder: (context) => const HomePage(), 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 5076d0d0c..e9ec1b0dc 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 @@ -41,7 +41,7 @@ class DerivLoginLayout extends StatefulWidget { final Function(DerivAuthErrorState)? onLoginError; /// Callback to be called when user is logged in. - final Function(BuildContext, DerivAuthLoggedInState) onLoggedIn; + final Function(DerivAuthLoggedInState) onLoggedIn; /// Callback to be called when social auth button is tapped. /// Give access to [SocialAuthDto] for 2FA. @@ -301,7 +301,7 @@ class _DerivLoginLayoutState extends State { } if (state is DerivAuthLoggedInState) { - widget.onLoggedIn(context, state); + widget.onLoggedIn(state); } } diff --git a/packages/deriv_auth/lib/features/single_entry/core/models/login_page_model.dart b/packages/deriv_auth/lib/features/single_entry/core/models/login_page_model.dart index 1075da51b..76115e911 100644 --- a/packages/deriv_auth/lib/features/single_entry/core/models/login_page_model.dart +++ b/packages/deriv_auth/lib/features/single_entry/core/models/login_page_model.dart @@ -25,7 +25,7 @@ class LoginPageModel { final Function(DerivAuthErrorState)? onLoginError; /// Callback to be called when user is logged in. - final Function(BuildContext, DerivAuthLoggedInState) onLoggedIn; + final Function(DerivAuthLoggedInState) onLoggedIn; /// Callback to be called when social auth button is tapped. /// Give access to [SocialAuthDto] for 2FA. diff --git a/packages/deriv_auth/test/features/login/presentation/layouts/deriv_login_layout_test.dart b/packages/deriv_auth/test/features/login/presentation/layouts/deriv_login_layout_test.dart index 5eefd27af..7fb8322c4 100644 --- a/packages/deriv_auth/test/features/login/presentation/layouts/deriv_login_layout_test.dart +++ b/packages/deriv_auth/test/features/login/presentation/layouts/deriv_login_layout_test.dart @@ -65,7 +65,7 @@ void main() { welcomeLabel: welcomeLabel, onResetPassTapped: () {}, onSignupTapped: () {}, - onLoggedIn: (_, __) {}, + onLoggedIn: (_) {}, onSocialAuthButtonPressed: (SocialAuthDto p0) {}, onLoginError: (_) {}, ), @@ -101,7 +101,7 @@ void main() { welcomeLabel: welcomeLabel, onResetPassTapped: () {}, onSignupTapped: () {}, - onLoggedIn: (_, __) {}, + onLoggedIn: (_) {}, onSocialAuthButtonPressed: (_) {}, onLoginError: (_) {}, ), @@ -139,7 +139,7 @@ void main() { welcomeLabel: welcomeLabel, onResetPassTapped: () {}, onSignupTapped: () {}, - onLoggedIn: (_, __) {}, + onLoggedIn: (_) {}, onSocialAuthButtonPressed: (_) {}, onLoginError: (_) {}, ), @@ -173,7 +173,7 @@ void main() { onSignupTapped: () { onSignupTappedCalled = true; }, - onLoggedIn: (_, __) {}, + onLoggedIn: (_) {}, onSocialAuthButtonPressed: (_) {}, onLoginError: (_) {}, ), @@ -216,7 +216,7 @@ void main() { welcomeLabel: welcomeLabel, onResetPassTapped: () {}, onSignupTapped: () {}, - onLoggedIn: (_, __) { + onLoggedIn: (_) { onLoggedInCalled = true; }, onSocialAuthButtonPressed: (_) {}, @@ -256,7 +256,7 @@ void main() { onLoginError: (_) { onLoginErrorCalled = true; }, - onLoggedIn: (_, __) {}, + onLoggedIn: (_) {}, onSocialAuthButtonPressed: (_) {}, ), )); @@ -290,7 +290,7 @@ void main() { onResetPassTapped: () {}, onSignupTapped: () {}, onLoginError: (_) {}, - onLoggedIn: (_, __) {}, + onLoggedIn: (_) {}, onSocialAuthButtonPressed: (_) {}, ), )); @@ -323,7 +323,7 @@ void main() { onResetPassTappedCalled = true; }, onSignupTapped: () {}, - onLoggedIn: (_, __) {}, + onLoggedIn: (_) {}, onSocialAuthButtonPressed: (_) {}, onLoginError: (_) {}, ), @@ -368,7 +368,7 @@ void main() { welcomeLabel: welcomeLabel, onResetPassTapped: () {}, onSignupTapped: () {}, - onLoggedIn: (_, __) {}, + onLoggedIn: (_) {}, onSocialAuthButtonPressed: (_) { onSocialAuthButtonPressedCalled = true; }, @@ -413,7 +413,7 @@ void main() { welcomeLabel: welcomeLabel, onResetPassTapped: () {}, onSignupTapped: () {}, - onLoggedIn: (_, __) {}, + onLoggedIn: (_) {}, onSocialAuthButtonPressed: (_) {}, onLoginError: (_) {}, ), From 572aa5fd54241d09b9993b102c0eceb117594821 Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Tue, 2 Apr 2024 12:22:13 +0400 Subject: [PATCH 034/162] refactor(deriv_auth): replaced deriv_localizations commit hash ref with tag ref --- packages/deriv_auth/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index adf5bf5ab..fbb9e1607 100644 --- a/packages/deriv_auth/pubspec.yaml +++ b/packages/deriv_auth/pubspec.yaml @@ -46,7 +46,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_localizations - ref: 47cd664bbc415b3e5c1808ec373f954348c19298 + ref: deriv_localizations-v1.2.0 deriv_passkeys: git: From 6a2708eb6cb8a3b343fd8688a27ab038fd3c1acb Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Tue, 2 Apr 2024 12:40:43 +0400 Subject: [PATCH 035/162] refactor(deriv_auth): updated deriv_passkeys commit hash --- .../layouts/deriv_login_layout.dart | 2 +- .../core/models/login_page_model.dart | 2 +- packages/deriv_auth/pubspec.yaml | 2 +- .../layouts/deriv_login_layout_test.dart | 20 +++++++++---------- 4 files changed, 13 insertions(+), 13 deletions(-) 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 abc7d46cc..e9ec1b0dc 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 @@ -41,7 +41,7 @@ class DerivLoginLayout extends StatefulWidget { final Function(DerivAuthErrorState)? onLoginError; /// Callback to be called when user is logged in. - final Function(BuildContext, DerivAuthLoggedInState) onLoggedIn; + final Function(DerivAuthLoggedInState) onLoggedIn; /// Callback to be called when social auth button is tapped. /// Give access to [SocialAuthDto] for 2FA. diff --git a/packages/deriv_auth/lib/features/single_entry/core/models/login_page_model.dart b/packages/deriv_auth/lib/features/single_entry/core/models/login_page_model.dart index 1075da51b..76115e911 100644 --- a/packages/deriv_auth/lib/features/single_entry/core/models/login_page_model.dart +++ b/packages/deriv_auth/lib/features/single_entry/core/models/login_page_model.dart @@ -25,7 +25,7 @@ class LoginPageModel { final Function(DerivAuthErrorState)? onLoginError; /// Callback to be called when user is logged in. - final Function(BuildContext, DerivAuthLoggedInState) onLoggedIn; + final Function(DerivAuthLoggedInState) onLoggedIn; /// Callback to be called when social auth button is tapped. /// Give access to [SocialAuthDto] for 2FA. diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index fbb9e1607..cf2aa5dbb 100644 --- a/packages/deriv_auth/pubspec.yaml +++ b/packages/deriv_auth/pubspec.yaml @@ -52,7 +52,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: 719122d0b8d3e94d2d6ce357ac76538a572947c2 + ref: 89dcd570165a053cf0ec89b4c7faf0801869e861 flutter_bloc: ^8.1.3 flutter_svg: ^2.0.7 diff --git a/packages/deriv_auth/test/features/login/presentation/layouts/deriv_login_layout_test.dart b/packages/deriv_auth/test/features/login/presentation/layouts/deriv_login_layout_test.dart index 3f009caaa..7fb8322c4 100644 --- a/packages/deriv_auth/test/features/login/presentation/layouts/deriv_login_layout_test.dart +++ b/packages/deriv_auth/test/features/login/presentation/layouts/deriv_login_layout_test.dart @@ -65,7 +65,7 @@ void main() { welcomeLabel: welcomeLabel, onResetPassTapped: () {}, onSignupTapped: () {}, - onLoggedIn: (BuildContext context, _) {}, + onLoggedIn: (_) {}, onSocialAuthButtonPressed: (SocialAuthDto p0) {}, onLoginError: (_) {}, ), @@ -101,7 +101,7 @@ void main() { welcomeLabel: welcomeLabel, onResetPassTapped: () {}, onSignupTapped: () {}, - onLoggedIn: (BuildContext context, _) {}, + onLoggedIn: (_) {}, onSocialAuthButtonPressed: (_) {}, onLoginError: (_) {}, ), @@ -139,7 +139,7 @@ void main() { welcomeLabel: welcomeLabel, onResetPassTapped: () {}, onSignupTapped: () {}, - onLoggedIn: (BuildContext context, _) {}, + onLoggedIn: (_) {}, onSocialAuthButtonPressed: (_) {}, onLoginError: (_) {}, ), @@ -173,7 +173,7 @@ void main() { onSignupTapped: () { onSignupTappedCalled = true; }, - onLoggedIn: (BuildContext context, _) {}, + onLoggedIn: (_) {}, onSocialAuthButtonPressed: (_) {}, onLoginError: (_) {}, ), @@ -216,7 +216,7 @@ void main() { welcomeLabel: welcomeLabel, onResetPassTapped: () {}, onSignupTapped: () {}, - onLoggedIn: (BuildContext context, _) { + onLoggedIn: (_) { onLoggedInCalled = true; }, onSocialAuthButtonPressed: (_) {}, @@ -256,7 +256,7 @@ void main() { onLoginError: (_) { onLoginErrorCalled = true; }, - onLoggedIn: (BuildContext context, _) {}, + onLoggedIn: (_) {}, onSocialAuthButtonPressed: (_) {}, ), )); @@ -290,7 +290,7 @@ void main() { onResetPassTapped: () {}, onSignupTapped: () {}, onLoginError: (_) {}, - onLoggedIn: (BuildContext context, _) {}, + onLoggedIn: (_) {}, onSocialAuthButtonPressed: (_) {}, ), )); @@ -323,7 +323,7 @@ void main() { onResetPassTappedCalled = true; }, onSignupTapped: () {}, - onLoggedIn: (BuildContext context, _) {}, + onLoggedIn: (_) {}, onSocialAuthButtonPressed: (_) {}, onLoginError: (_) {}, ), @@ -368,7 +368,7 @@ void main() { welcomeLabel: welcomeLabel, onResetPassTapped: () {}, onSignupTapped: () {}, - onLoggedIn: (BuildContext context, _) {}, + onLoggedIn: (_) {}, onSocialAuthButtonPressed: (_) { onSocialAuthButtonPressedCalled = true; }, @@ -413,7 +413,7 @@ void main() { welcomeLabel: welcomeLabel, onResetPassTapped: () {}, onSignupTapped: () {}, - onLoggedIn: (BuildContext context, _) {}, + onLoggedIn: (_) {}, onSocialAuthButtonPressed: (_) {}, onLoginError: (_) {}, ), From 608dcf4b812945efa605ae5c553afa06e6a9f8db Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Tue, 2 Apr 2024 12:52:40 +0400 Subject: [PATCH 036/162] refactor(deriv_auth): updated deriv_passkeys commit hash --- packages/deriv_auth/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index cf2aa5dbb..c34cd8742 100644 --- a/packages/deriv_auth/pubspec.yaml +++ b/packages/deriv_auth/pubspec.yaml @@ -52,7 +52,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: 89dcd570165a053cf0ec89b4c7faf0801869e861 + ref: 0a61540e0d2e0477ce21f5fad78489d9f51d3a3f flutter_bloc: ^8.1.3 flutter_svg: ^2.0.7 From 87ff83bbc8050c3893186b86003345ca3ed739bd Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Tue, 2 Apr 2024 13:01:26 +0400 Subject: [PATCH 037/162] refactor(deriv_auth): updated deriv_passkeys commit hash --- packages/deriv_auth/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index c34cd8742..8a8018283 100644 --- a/packages/deriv_auth/pubspec.yaml +++ b/packages/deriv_auth/pubspec.yaml @@ -52,7 +52,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: 0a61540e0d2e0477ce21f5fad78489d9f51d3a3f + ref: 0c8dc95f005cc251d7221d557c0b6f75c2c22d1a flutter_bloc: ^8.1.3 flutter_svg: ^2.0.7 From dcda848bb014f72e138e907c84c258be1a7c5c63 Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Tue, 2 Apr 2024 15:04:15 +0400 Subject: [PATCH 038/162] refactor(deriv_auth): updated deriv_passkeys commit hash --- packages/deriv_auth/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index 8a8018283..da24ce6b0 100644 --- a/packages/deriv_auth/pubspec.yaml +++ b/packages/deriv_auth/pubspec.yaml @@ -52,7 +52,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: 0c8dc95f005cc251d7221d557c0b6f75c2c22d1a + ref: dbec09ab8a0174e28e684d3b49c16a228185c839 flutter_bloc: ^8.1.3 flutter_svg: ^2.0.7 From d813bd0c5e3dae00675c329f19a81255c41308d5 Mon Sep 17 00:00:00 2001 From: Illya Tsai Date: Tue, 2 Apr 2024 15:13:08 +0300 Subject: [PATCH 039/162] add rudderstack events --- .../events/rudderstack_events.dart | 135 ++++++++++++++++++ .../sdk/deriv_rudderstack_sdk.dart | 7 +- 2 files changed, 140 insertions(+), 2 deletions(-) create mode 100644 packages/analytics/lib/sdk/rudderstack/events/rudderstack_events.dart diff --git a/packages/analytics/lib/sdk/rudderstack/events/rudderstack_events.dart b/packages/analytics/lib/sdk/rudderstack/events/rudderstack_events.dart new file mode 100644 index 000000000..01d132418 --- /dev/null +++ b/packages/analytics/lib/sdk/rudderstack/events/rudderstack_events.dart @@ -0,0 +1,135 @@ +import 'package:analytics/sdk/rudderstack/core/rudderstack_configuration.dart'; +import 'package:analytics/sdk/rudderstack/sdk/deriv_rudderstack_sdk.dart'; + +/// Class which hold events which should be monitored. +class DerivRudderstackEvents { + /// Constructor for [DerivRudderstackEvents]. + const DerivRudderstackEvents(); + + ///Set ups Rudderstack connection. + void setup({required String dataPlaneUrl, required String writeKey}) { + DerivRudderstack().setup( + RudderstackConfiguration(dataPlaneUrl: dataPlaneUrl, writeKey: writeKey), + ); + } + + /// Captures app_open event when the app is opened. + void logAppOpened() { + DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { + 'action': 'open', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + }); + } + + /// Captures user tap on Log in button on sign up screen. + void logUserTappedLoginButton() { + DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { + 'action': 'go_to_login', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + }); + } + + /// Captures user tap on Get free account button on sign up screen. + void logAppGetFreeAccount(String slideName) { + DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { + 'action': 'get_free_account', + 'form_source': 'mobile_derivgo', + 'getstarted_slide_name': + '${slideName.substring(slideName.indexOf('.') + 1, slideName.length)}', + 'form_name': 'virtual_signup_derivgo' + }); + } + + /// Tracks when user turns on or off Refferal toggle switcher. + void logReferralToggleSwitched() { + DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { + 'action': 'tab_referral_toggle', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + }); + } + + /// Tracks when user gets Invalid referral code pop up with Try again button. + void logTryAgainReferralCode() { + DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { + 'action': 'try_again_referral_code', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + }); + } + + /// Tracks when Email confirmation is sent to a user. + void logEmailConfirmationSent() { + DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { + 'action': 'email_confirmation_sent', + 'signup_provider': 'email', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + }); + } + + /// Tracks when user land on Successfull email verification screen. + void logEmailConfirmed() { + DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { + 'action': 'email_confirmed', + 'signup_provider': 'email', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + }); + } + + /// Tracks when user taps Continue button on Successfull email verification screen. + void logSignupContinued() { + DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { + 'action': 'signup_continued', + 'signup_provider': 'email', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + }); + } + + /// Tracks when user lands on Country selection screen. + void logCountrySelectionPageOpened() { + DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { + 'action': 'country_selection_screen_opened', + 'signup_provider': 'email', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + }); + } + + /// Tracks when user lands on Create password page while creating demo account. + void logSetPasswordPageOpened() { + DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { + 'action': 'password_screen_opened', + 'signup_provider': 'email', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + }); + } + + /// Tracks when user's sign up is finished. + void logSignUpDone(String signupProvider) { + DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { + 'action': 'signup_done', + 'signup_provider': '$signupProvider', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + }); + } + + /// Tracks when user taps 'Create free demo account' or social log in button. + void logSignUpPageAction(String signupProvider, + [bool? isToggleOn, String? referralCode]) { + DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { + 'action': 'started', + 'signup_provider': '$signupProvider', + 'referral_toggle_mode': '${isToggleOn ?? false} ', + 'referral_code': '$referralCode', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + }); + } +} diff --git a/packages/analytics/lib/sdk/rudderstack/sdk/deriv_rudderstack_sdk.dart b/packages/analytics/lib/sdk/rudderstack/sdk/deriv_rudderstack_sdk.dart index 06f366130..d46a5e711 100644 --- a/packages/analytics/lib/sdk/rudderstack/sdk/deriv_rudderstack_sdk.dart +++ b/packages/analytics/lib/sdk/rudderstack/sdk/deriv_rudderstack_sdk.dart @@ -53,8 +53,11 @@ class DerivRudderstack implements BaseAnalytics { _execute(() => rudderClient.identify(userId)); /// Tracks an event with the given [eventName]. - Future track({required String eventName}) async => - _execute(() => rudderClient.track(eventName)); + Future track( + {required String eventName, + Map? properties}) async => + _execute(() => rudderClient.track(eventName, + properties: RudderProperty.fromMap(properties!))); /// Logs a screen view with the given [screenName]. Future screen({required String screenName}) async => From 485428fb85098e25e69bc6e0ea59958e457e663a Mon Sep 17 00:00:00 2001 From: Illya Tsai Date: Tue, 2 Apr 2024 15:39:42 +0300 Subject: [PATCH 040/162] refactor --- .../lib/deriv_rudderstack.dart | 120 ------------------ 1 file changed, 120 deletions(-) diff --git a/packages/deriv_rudderstack/lib/deriv_rudderstack.dart b/packages/deriv_rudderstack/lib/deriv_rudderstack.dart index 76a158dc8..368fa701f 100644 --- a/packages/deriv_rudderstack/lib/deriv_rudderstack.dart +++ b/packages/deriv_rudderstack/lib/deriv_rudderstack.dart @@ -165,124 +165,4 @@ class DerivRudderstack { return false; } - - /// Captures app_open event when the app is opened. - void logAppOpened() { - DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { - 'action': 'open', - 'form_source': 'mobile_derivgo', - 'form_name': 'virtual_signup_derivgo' - }); - } - - /// Captures user tap on Log in button on sign up screen. - void logUserTappedLoginButton() { - DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { - 'action': 'go_to_login', - 'form_source': 'mobile_derivgo', - 'form_name': 'virtual_signup_derivgo' - }); - } - - /// Captures user tap on Get free account button on sign up screen. - void logAppGetFreeAccount(String slideName) { - DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { - 'action': 'get_free_account', - 'form_source': 'mobile_derivgo', - 'getstarted_slide_name': - '${slideName.substring(slideName.indexOf('.') + 1, slideName.length)}', - 'form_name': 'virtual_signup_derivgo' - }); - } - - /// Tracks when user turns on or off Refferal toggle switcher. - void logReferralToggleSwitched() { - DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { - 'action': 'tab_referral_toggle', - 'form_source': 'mobile_derivgo', - 'form_name': 'virtual_signup_derivgo' - }); - } - - /// Tracks when user gets Invalid referral code pop up with Try again button. - void logTryAgainReferralCode() { - DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { - 'action': 'try_again_referral_code', - 'form_source': 'mobile_derivgo', - 'form_name': 'virtual_signup_derivgo' - }); - } - - /// Tracks when Email confirmation is sent to a user. - void logEmailConfirmationSent() { - DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { - 'action': 'email_confirmation_sent', - 'signup_provider': 'email', - 'form_source': 'mobile_derivgo', - 'form_name': 'virtual_signup_derivgo' - }); - } - - /// Tracks when user land on Successfull email verification screen. - void logEmailConfirmed() { - DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { - 'action': 'email_confirmed', - 'signup_provider': 'email', - 'form_source': 'mobile_derivgo', - 'form_name': 'virtual_signup_derivgo' - }); - } - - /// Tracks when user taps Continue button on Successfull email verification screen. - void logSignupContinued() { - DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { - 'action': 'signup_continued', - 'signup_provider': 'email', - 'form_source': 'mobile_derivgo', - 'form_name': 'virtual_signup_derivgo' - }); - } - - /// Tracks when user lands on Country selection screen. - void logCountrySelectionPageOpened() { - DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { - 'action': 'country_selection_screen_opened', - 'signup_provider': 'email', - 'form_source': 'mobile_derivgo', - 'form_name': 'virtual_signup_derivgo' - }); - } - - /// Tracks when user lands on Create password page while creating demo account. - void logSetPasswordPageOpened() { - DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { - 'action': 'password_screen_opened', - 'signup_provider': 'email', - 'form_source': 'mobile_derivgo', - 'form_name': 'virtual_signup_derivgo' - }); - } - - /// Tracks when user's sign up is finished. - void logSignUpDone(String signupProvider) { - DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { - 'action': 'signup_done', - 'signup_provider': '$signupProvider', - 'form_source': 'mobile_derivgo', - 'form_name': 'virtual_signup_derivgo' - }); - } - - /// Tracks when user taps 'Create free demo account' or social log in button. - void logSignUpPageAction(String signupProvider, - [bool? isToggleOn, String? referralCode]) { - DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { - 'action': 'started', - 'signup_provider': '$signupProvider', - 'referral_toggle_mode': '${isToggleOn ?? false} ', - 'referral_code': '$referralCode', - 'form_source': 'mobile_derivgo', - 'form_name': 'virtual_signup_derivgo' - }); - } } From 5900d6a4dcb215cae628a8ddf3dd5afc71687cc0 Mon Sep 17 00:00:00 2001 From: Illya Tsai Date: Tue, 9 Apr 2024 14:09:06 +0300 Subject: [PATCH 041/162] add error flow event --- .../sdk/rudderstack/events/rudderstack_events.dart | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/analytics/lib/sdk/rudderstack/events/rudderstack_events.dart b/packages/analytics/lib/sdk/rudderstack/events/rudderstack_events.dart index 01d132418..0b084d0d8 100644 --- a/packages/analytics/lib/sdk/rudderstack/events/rudderstack_events.dart +++ b/packages/analytics/lib/sdk/rudderstack/events/rudderstack_events.dart @@ -132,4 +132,15 @@ class DerivRudderstackEvents { 'form_name': 'virtual_signup_derivgo' }); } + + /// Tracks any error is happening and shown to the user (validation, API communication, social providers errors). + void logSignUpFlowError(String? errorText, [String? signupProvider]) { + DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { + 'action': 'signup_flow_error', + 'signup_provider': '$signupProvider', + 'error_message': '$errorText', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + }); + } } From 82de161098d7cd698dcf465a4ad4a2cdac1fdd75 Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Mon, 15 Apr 2024 07:39:36 +0400 Subject: [PATCH 042/162] refactor(deriv_auth): updated deriv_passkeys commit hash --- packages/deriv_auth/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index da24ce6b0..bda7f12df 100644 --- a/packages/deriv_auth/pubspec.yaml +++ b/packages/deriv_auth/pubspec.yaml @@ -52,7 +52,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: dbec09ab8a0174e28e684d3b49c16a228185c839 + ref: 14c421fa006da601441e7ab20e2d4caf1e044ee7 flutter_bloc: ^8.1.3 flutter_svg: ^2.0.7 From ed0f005785991a0c166edaf4f93e03922826ee91 Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Thu, 18 Apr 2024 15:08:52 +0400 Subject: [PATCH 043/162] refactor(deriv_auth): updated deriv_passkeys commit hash --- packages/deriv_auth/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index bda7f12df..8017ccbda 100644 --- a/packages/deriv_auth/pubspec.yaml +++ b/packages/deriv_auth/pubspec.yaml @@ -52,7 +52,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: 14c421fa006da601441e7ab20e2d4caf1e044ee7 + ref: c00a7ce73cbb6c0b97f6262f7df6bd2b15324337 flutter_bloc: ^8.1.3 flutter_svg: ^2.0.7 From a3acdf1ad34bdbba464d866273e165709d908159 Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Mon, 22 Apr 2024 07:26:59 +0400 Subject: [PATCH 044/162] refactor(deriv_auth): updated deriv_passkeys and deriv_localizations versions. --- packages/deriv_auth/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index 8017ccbda..6554af305 100644 --- a/packages/deriv_auth/pubspec.yaml +++ b/packages/deriv_auth/pubspec.yaml @@ -52,7 +52,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: c00a7ce73cbb6c0b97f6262f7df6bd2b15324337 + ref: 22c6f7ad191e3f33fad6f5264ceb0f20b1ba31d8 flutter_bloc: ^8.1.3 flutter_svg: ^2.0.7 From 4d43e258d72e71da6c53f1bf2b241f95d4ba4c67 Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Mon, 29 Apr 2024 13:59:20 +0400 Subject: [PATCH 045/162] refactor(deriv_auth): Updated deriv_localizations --- .../deriv_auth/lib/core/extensions/context_extension.dart | 2 +- packages/deriv_auth/pubspec.yaml | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/deriv_auth/lib/core/extensions/context_extension.dart b/packages/deriv_auth/lib/core/extensions/context_extension.dart index a3dd6c184..d239c5090 100644 --- a/packages/deriv_auth/lib/core/extensions/context_extension.dart +++ b/packages/deriv_auth/lib/core/extensions/context_extension.dart @@ -5,5 +5,5 @@ import 'package:flutter/material.dart'; extension ContextExtension on BuildContext { /// Gets [DerivAuthLocalizations]. DerivAuthLocalizations get derivAuthLocalization => - DerivAuthLocalizations.of(this); + DerivAuthLocalizations.of(this)!; } diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index 6554af305..cfbbb1431 100644 --- a/packages/deriv_auth/pubspec.yaml +++ b/packages/deriv_auth/pubspec.yaml @@ -46,7 +46,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_localizations - ref: deriv_localizations-v1.2.0 + ref: da897013ecd1f993ad4e696c1d0856d7ebf3758c deriv_passkeys: git: @@ -68,6 +68,11 @@ dependency_overrides: git: url: git@github.com:deriv-com/flutter-deriv-api.git ref: dev + deriv_localizations: + git: + url: git@github.com:regentmarkets/flutter-deriv-packages.git + path: packages/deriv_localizations + ref: da897013ecd1f993ad4e696c1d0856d7ebf3758c dev_dependencies: mocktail: ^1.0.3 From ca7d8ee3556c44ee819dab41dd2605cdbf024743 Mon Sep 17 00:00:00 2001 From: Illya Tsai Date: Tue, 7 May 2024 10:02:41 +0300 Subject: [PATCH 046/162] test --- .../sdk/deriv_rudderstack_sdk.dart | 12 +++++----- .../sdk/deriv_rudderstack_sdk_test.dart | 24 +++++++++++-------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/packages/analytics/lib/sdk/rudderstack/sdk/deriv_rudderstack_sdk.dart b/packages/analytics/lib/sdk/rudderstack/sdk/deriv_rudderstack_sdk.dart index d46a5e711..70d38834c 100644 --- a/packages/analytics/lib/sdk/rudderstack/sdk/deriv_rudderstack_sdk.dart +++ b/packages/analytics/lib/sdk/rudderstack/sdk/deriv_rudderstack_sdk.dart @@ -52,12 +52,12 @@ class DerivRudderstack implements BaseAnalytics { Future identify({required String userId}) async => _execute(() => rudderClient.identify(userId)); - /// Tracks an event with the given [eventName]. - Future track( - {required String eventName, - Map? properties}) async => - _execute(() => rudderClient.track(eventName, - properties: RudderProperty.fromMap(properties!))); + /// Tracks an event with the given [eventName] and [properties]. + Future track({ + required String eventName, + RudderProperty? properties, // Change the parameter type to RudderProperty + }) async => + _execute(() => rudderClient.track(eventName, properties: properties)); /// Logs a screen view with the given [screenName]. Future screen({required String screenName}) async => diff --git a/packages/analytics/test/rudderstack/sdk/deriv_rudderstack_sdk_test.dart b/packages/analytics/test/rudderstack/sdk/deriv_rudderstack_sdk_test.dart index 09804da8c..df856b864 100644 --- a/packages/analytics/test/rudderstack/sdk/deriv_rudderstack_sdk_test.dart +++ b/packages/analytics/test/rudderstack/sdk/deriv_rudderstack_sdk_test.dart @@ -4,6 +4,7 @@ import 'package:analytics/sdk/rudderstack/sdk/deriv_rudderstack_sdk.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mocktail/mocktail.dart'; import 'package:rudder_sdk_flutter/RudderController.dart'; +import 'package:rudder_sdk_flutter_platform_interface/platform.dart'; class MockRudderController extends Mock implements RudderController {} @@ -34,20 +35,23 @@ void main() { test('track calls rudderClient.track', () async { const String eventName = 'test_event_name'; + const Map properties = {'action': 'open'}; - final bool result = await derivRudderstack.track(eventName: eventName); + // Convert properties to RudderProperty + final rudderProperties = RudderProperty.fromMap(properties); - expect(result, isTrue); - verify(() => mockRudderController.track(eventName)).called(1); - }); - - test('track calls rudderClient.track', () async { - const String eventName = 'test_event_name'; - - final bool result = await derivRudderstack.track(eventName: eventName); + final bool result = await derivRudderstack.track( + eventName: eventName, + properties: rudderProperties, // Pass RudderProperty directly + ); expect(result, isTrue); - verify(() => mockRudderController.track(eventName)).called(1); + // Verify that the track method is called with the correct parameters + verify(() => mockRudderController.track( + eventName, + properties: rudderProperties, // Pass RudderProperty directly + options: null // Assuming options is not used in this case + )).called(1); }); test('screen calls rudderClient.screen', () async { From 4fa276718bd6e742437654ca12f649e7dabd26b5 Mon Sep 17 00:00:00 2001 From: Illya Tsai Date: Tue, 7 May 2024 10:18:27 +0300 Subject: [PATCH 047/162] refactor events --- .../events/rudderstack_events.dart | 183 ++++++++++-------- 1 file changed, 105 insertions(+), 78 deletions(-) diff --git a/packages/analytics/lib/sdk/rudderstack/events/rudderstack_events.dart b/packages/analytics/lib/sdk/rudderstack/events/rudderstack_events.dart index 0b084d0d8..2470b8758 100644 --- a/packages/analytics/lib/sdk/rudderstack/events/rudderstack_events.dart +++ b/packages/analytics/lib/sdk/rudderstack/events/rudderstack_events.dart @@ -1,5 +1,6 @@ import 'package:analytics/sdk/rudderstack/core/rudderstack_configuration.dart'; import 'package:analytics/sdk/rudderstack/sdk/deriv_rudderstack_sdk.dart'; +import 'package:rudder_sdk_flutter_platform_interface/platform.dart'; /// Class which hold events which should be monitored. class DerivRudderstackEvents { @@ -15,132 +16,158 @@ class DerivRudderstackEvents { /// Captures app_open event when the app is opened. void logAppOpened() { - DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { - 'action': 'open', - 'form_source': 'mobile_derivgo', - 'form_name': 'virtual_signup_derivgo' - }); + DerivRudderstack().track( + eventName: 'ce_virtual_signup_form', + properties: RudderProperty.fromMap({ + 'action': 'open', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + })); } /// Captures user tap on Log in button on sign up screen. void logUserTappedLoginButton() { - DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { - 'action': 'go_to_login', - 'form_source': 'mobile_derivgo', - 'form_name': 'virtual_signup_derivgo' - }); + DerivRudderstack().track( + eventName: 'ce_virtual_signup_form', + properties: RudderProperty.fromMap({ + 'action': 'go_to_login', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + })); } /// Captures user tap on Get free account button on sign up screen. void logAppGetFreeAccount(String slideName) { - DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { - 'action': 'get_free_account', - 'form_source': 'mobile_derivgo', - 'getstarted_slide_name': - '${slideName.substring(slideName.indexOf('.') + 1, slideName.length)}', - 'form_name': 'virtual_signup_derivgo' - }); + DerivRudderstack().track( + eventName: 'ce_virtual_signup_form', + properties: RudderProperty.fromMap({ + 'action': 'get_free_account', + 'form_source': 'mobile_derivgo', + 'getstarted_slide_name': + '${slideName.substring(slideName.indexOf('.') + 1, slideName.length)}', + 'form_name': 'virtual_signup_derivgo' + })); } /// Tracks when user turns on or off Refferal toggle switcher. void logReferralToggleSwitched() { - DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { - 'action': 'tab_referral_toggle', - 'form_source': 'mobile_derivgo', - 'form_name': 'virtual_signup_derivgo' - }); + DerivRudderstack().track( + eventName: 'ce_virtual_signup_form', + properties: RudderProperty.fromMap({ + 'action': 'tab_referral_toggle', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + })); } /// Tracks when user gets Invalid referral code pop up with Try again button. void logTryAgainReferralCode() { - DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { - 'action': 'try_again_referral_code', - 'form_source': 'mobile_derivgo', - 'form_name': 'virtual_signup_derivgo' - }); + DerivRudderstack().track( + eventName: 'ce_virtual_signup_form', + properties: RudderProperty.fromMap({ + 'action': 'try_again_referral_code', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + })); } /// Tracks when Email confirmation is sent to a user. void logEmailConfirmationSent() { - DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { - 'action': 'email_confirmation_sent', - 'signup_provider': 'email', - 'form_source': 'mobile_derivgo', - 'form_name': 'virtual_signup_derivgo' - }); + DerivRudderstack().track( + eventName: 'ce_virtual_signup_form', + properties: RudderProperty.fromMap({ + 'action': 'email_confirmation_sent', + 'signup_provider': 'email', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + })); } /// Tracks when user land on Successfull email verification screen. void logEmailConfirmed() { - DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { - 'action': 'email_confirmed', - 'signup_provider': 'email', - 'form_source': 'mobile_derivgo', - 'form_name': 'virtual_signup_derivgo' - }); + DerivRudderstack().track( + eventName: 'ce_virtual_signup_form', + properties: RudderProperty.fromMap({ + 'action': 'email_confirmed', + 'signup_provider': 'email', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + })); } /// Tracks when user taps Continue button on Successfull email verification screen. void logSignupContinued() { - DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { - 'action': 'signup_continued', - 'signup_provider': 'email', - 'form_source': 'mobile_derivgo', - 'form_name': 'virtual_signup_derivgo' - }); + DerivRudderstack().track( + eventName: 'ce_virtual_signup_form', + properties: RudderProperty.fromMap({ + 'action': 'signup_continued', + 'signup_provider': 'email', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + })); } /// Tracks when user lands on Country selection screen. void logCountrySelectionPageOpened() { - DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { - 'action': 'country_selection_screen_opened', - 'signup_provider': 'email', - 'form_source': 'mobile_derivgo', - 'form_name': 'virtual_signup_derivgo' - }); + DerivRudderstack().track( + eventName: 'ce_virtual_signup_form', + properties: RudderProperty.fromMap({ + 'action': 'country_selection_screen_opened', + 'signup_provider': 'email', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + })); } /// Tracks when user lands on Create password page while creating demo account. void logSetPasswordPageOpened() { - DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { - 'action': 'password_screen_opened', - 'signup_provider': 'email', - 'form_source': 'mobile_derivgo', - 'form_name': 'virtual_signup_derivgo' - }); + DerivRudderstack().track( + eventName: 'ce_virtual_signup_form', + properties: RudderProperty.fromMap({ + 'action': 'password_screen_opened', + 'signup_provider': 'email', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + })); } /// Tracks when user's sign up is finished. void logSignUpDone(String signupProvider) { - DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { - 'action': 'signup_done', - 'signup_provider': '$signupProvider', - 'form_source': 'mobile_derivgo', - 'form_name': 'virtual_signup_derivgo' - }); + DerivRudderstack().track( + eventName: 'ce_virtual_signup_form', + properties: RudderProperty.fromMap({ + 'action': 'signup_done', + 'signup_provider': '$signupProvider', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + })); } /// Tracks when user taps 'Create free demo account' or social log in button. void logSignUpPageAction(String signupProvider, [bool? isToggleOn, String? referralCode]) { - DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { - 'action': 'started', - 'signup_provider': '$signupProvider', - 'referral_toggle_mode': '${isToggleOn ?? false} ', - 'referral_code': '$referralCode', - 'form_source': 'mobile_derivgo', - 'form_name': 'virtual_signup_derivgo' - }); + DerivRudderstack().track( + eventName: 'ce_virtual_signup_form', + properties: RudderProperty.fromMap({ + 'action': 'started', + 'signup_provider': '$signupProvider', + 'referral_toggle_mode': '${isToggleOn ?? false} ', + 'referral_code': '$referralCode', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + })); } /// Tracks any error is happening and shown to the user (validation, API communication, social providers errors). void logSignUpFlowError(String? errorText, [String? signupProvider]) { - DerivRudderstack().track(eventName: 'ce_virtual_signup_form', properties: { - 'action': 'signup_flow_error', - 'signup_provider': '$signupProvider', - 'error_message': '$errorText', - 'form_source': 'mobile_derivgo', - 'form_name': 'virtual_signup_derivgo' - }); + DerivRudderstack().track( + eventName: 'ce_virtual_signup_form', + properties: RudderProperty.fromMap({ + 'action': 'signup_flow_error', + 'signup_provider': '$signupProvider', + 'error_message': '$errorText', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + })); } } From 41fa9ed899462b0eeef34fa3971ffe82e937ce91 Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Tue, 7 May 2024 12:39:36 +0400 Subject: [PATCH 048/162] refactor: update deriv_passkeys --- packages/deriv_auth/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index cfbbb1431..9dfd0b148 100644 --- a/packages/deriv_auth/pubspec.yaml +++ b/packages/deriv_auth/pubspec.yaml @@ -52,7 +52,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: 22c6f7ad191e3f33fad6f5264ceb0f20b1ba31d8 + ref: d065248fd304918977c6523d5fe5959ad1ef85cc flutter_bloc: ^8.1.3 flutter_svg: ^2.0.7 From cd545c74f7076010d7153d74c20288b2b8db016b Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Tue, 7 May 2024 12:52:36 +0400 Subject: [PATCH 049/162] refactor: update deriv_passkeys --- .../login/presentation/layouts/deriv_login_layout.dart | 4 +--- packages/deriv_auth/pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) 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 e9ec1b0dc..c1a4bc76a 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 @@ -136,9 +136,7 @@ class _DerivLoginLayoutState extends State { ), if (widget.isSocialAuthEnabled) const SizedBox(height: ThemeProvider.margin24), - ContinueWithPasskeyButton( - derivPasskeysBloc: AuthData().data.derivPasskeysBloc, - ), + ContinueWithPasskeyButton(), DerivSocialAuthPanel( socialAuthStateHandler: widget.socialAuthStateHandler, redirectURL: widget.redirectURL, diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index 9dfd0b148..af8c4afdd 100644 --- a/packages/deriv_auth/pubspec.yaml +++ b/packages/deriv_auth/pubspec.yaml @@ -52,7 +52,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: d065248fd304918977c6523d5fe5959ad1ef85cc + ref: 4cb6ab174fc11aac2799475ce4cd874612f7e2da flutter_bloc: ^8.1.3 flutter_svg: ^2.0.7 From 2a32fcbb770d96df74ad8299bd0f9013c17386c8 Mon Sep 17 00:00:00 2001 From: Illya Tsai Date: Tue, 7 May 2024 12:15:43 +0300 Subject: [PATCH 050/162] fix comment --- .../events/rudderstack_events.dart | 195 ++++++++++-------- 1 file changed, 104 insertions(+), 91 deletions(-) diff --git a/packages/analytics/lib/sdk/rudderstack/events/rudderstack_events.dart b/packages/analytics/lib/sdk/rudderstack/events/rudderstack_events.dart index 2470b8758..4840b0e90 100644 --- a/packages/analytics/lib/sdk/rudderstack/events/rudderstack_events.dart +++ b/packages/analytics/lib/sdk/rudderstack/events/rudderstack_events.dart @@ -17,157 +17,170 @@ class DerivRudderstackEvents { /// Captures app_open event when the app is opened. void logAppOpened() { DerivRudderstack().track( - eventName: 'ce_virtual_signup_form', - properties: RudderProperty.fromMap({ - 'action': 'open', - 'form_source': 'mobile_derivgo', - 'form_name': 'virtual_signup_derivgo' - })); + eventName: 'ce_virtual_signup_form', + properties: RudderProperty.fromMap({ + 'action': 'open', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + }), + ); } /// Captures user tap on Log in button on sign up screen. void logUserTappedLoginButton() { DerivRudderstack().track( - eventName: 'ce_virtual_signup_form', - properties: RudderProperty.fromMap({ - 'action': 'go_to_login', - 'form_source': 'mobile_derivgo', - 'form_name': 'virtual_signup_derivgo' - })); + eventName: 'ce_virtual_signup_form', + properties: RudderProperty.fromMap({ + 'action': 'go_to_login', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + }), + ); } /// Captures user tap on Get free account button on sign up screen. void logAppGetFreeAccount(String slideName) { DerivRudderstack().track( - eventName: 'ce_virtual_signup_form', - properties: RudderProperty.fromMap({ - 'action': 'get_free_account', - 'form_source': 'mobile_derivgo', - 'getstarted_slide_name': - '${slideName.substring(slideName.indexOf('.') + 1, slideName.length)}', - 'form_name': 'virtual_signup_derivgo' - })); + eventName: 'ce_virtual_signup_form', + properties: RudderProperty.fromMap({ + 'action': 'get_free_account', + 'form_source': 'mobile_derivgo', + 'getstarted_slide_name': + '${slideName.substring(slideName.indexOf('.') + 1, slideName.length)}', + 'form_name': 'virtual_signup_derivgo' + }), + ); } /// Tracks when user turns on or off Refferal toggle switcher. void logReferralToggleSwitched() { DerivRudderstack().track( - eventName: 'ce_virtual_signup_form', - properties: RudderProperty.fromMap({ - 'action': 'tab_referral_toggle', - 'form_source': 'mobile_derivgo', - 'form_name': 'virtual_signup_derivgo' - })); + eventName: 'ce_virtual_signup_form', + properties: RudderProperty.fromMap({ + 'action': 'tab_referral_toggle', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + }), + ); } /// Tracks when user gets Invalid referral code pop up with Try again button. void logTryAgainReferralCode() { DerivRudderstack().track( - eventName: 'ce_virtual_signup_form', - properties: RudderProperty.fromMap({ - 'action': 'try_again_referral_code', - 'form_source': 'mobile_derivgo', - 'form_name': 'virtual_signup_derivgo' - })); + eventName: 'ce_virtual_signup_form', + properties: RudderProperty.fromMap({ + 'action': 'try_again_referral_code', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + }), + ); } /// Tracks when Email confirmation is sent to a user. void logEmailConfirmationSent() { DerivRudderstack().track( - eventName: 'ce_virtual_signup_form', - properties: RudderProperty.fromMap({ - 'action': 'email_confirmation_sent', - 'signup_provider': 'email', - 'form_source': 'mobile_derivgo', - 'form_name': 'virtual_signup_derivgo' - })); + eventName: 'ce_virtual_signup_form', + properties: RudderProperty.fromMap({ + 'action': 'email_confirmation_sent', + 'signup_provider': 'email', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + }), + ); } /// Tracks when user land on Successfull email verification screen. void logEmailConfirmed() { DerivRudderstack().track( - eventName: 'ce_virtual_signup_form', - properties: RudderProperty.fromMap({ - 'action': 'email_confirmed', - 'signup_provider': 'email', - 'form_source': 'mobile_derivgo', - 'form_name': 'virtual_signup_derivgo' - })); + eventName: 'ce_virtual_signup_form', + properties: RudderProperty.fromMap({ + 'action': 'email_confirmed', + 'signup_provider': 'email', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + }), + ); } /// Tracks when user taps Continue button on Successfull email verification screen. void logSignupContinued() { DerivRudderstack().track( - eventName: 'ce_virtual_signup_form', - properties: RudderProperty.fromMap({ - 'action': 'signup_continued', - 'signup_provider': 'email', - 'form_source': 'mobile_derivgo', - 'form_name': 'virtual_signup_derivgo' - })); + eventName: 'ce_virtual_signup_form', + properties: RudderProperty.fromMap({ + 'action': 'signup_continued', + 'signup_provider': 'email', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + }), + ); } /// Tracks when user lands on Country selection screen. void logCountrySelectionPageOpened() { DerivRudderstack().track( - eventName: 'ce_virtual_signup_form', - properties: RudderProperty.fromMap({ - 'action': 'country_selection_screen_opened', - 'signup_provider': 'email', - 'form_source': 'mobile_derivgo', - 'form_name': 'virtual_signup_derivgo' - })); + eventName: 'ce_virtual_signup_form', + properties: RudderProperty.fromMap({ + 'action': 'country_selection_screen_opened', + 'signup_provider': 'email', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + }), + ); } /// Tracks when user lands on Create password page while creating demo account. void logSetPasswordPageOpened() { DerivRudderstack().track( - eventName: 'ce_virtual_signup_form', - properties: RudderProperty.fromMap({ - 'action': 'password_screen_opened', - 'signup_provider': 'email', - 'form_source': 'mobile_derivgo', - 'form_name': 'virtual_signup_derivgo' - })); + eventName: 'ce_virtual_signup_form', + properties: RudderProperty.fromMap({ + 'action': 'password_screen_opened', + 'signup_provider': 'email', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + }), + ); } /// Tracks when user's sign up is finished. void logSignUpDone(String signupProvider) { DerivRudderstack().track( - eventName: 'ce_virtual_signup_form', - properties: RudderProperty.fromMap({ - 'action': 'signup_done', - 'signup_provider': '$signupProvider', - 'form_source': 'mobile_derivgo', - 'form_name': 'virtual_signup_derivgo' - })); + eventName: 'ce_virtual_signup_form', + properties: RudderProperty.fromMap({ + 'action': 'signup_done', + 'signup_provider': '$signupProvider', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + }), + ); } /// Tracks when user taps 'Create free demo account' or social log in button. void logSignUpPageAction(String signupProvider, [bool? isToggleOn, String? referralCode]) { DerivRudderstack().track( - eventName: 'ce_virtual_signup_form', - properties: RudderProperty.fromMap({ - 'action': 'started', - 'signup_provider': '$signupProvider', - 'referral_toggle_mode': '${isToggleOn ?? false} ', - 'referral_code': '$referralCode', - 'form_source': 'mobile_derivgo', - 'form_name': 'virtual_signup_derivgo' - })); + eventName: 'ce_virtual_signup_form', + properties: RudderProperty.fromMap({ + 'action': 'started', + 'signup_provider': '$signupProvider', + 'referral_toggle_mode': '${isToggleOn ?? false} ', + 'referral_code': '$referralCode', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + }), + ); } /// Tracks any error is happening and shown to the user (validation, API communication, social providers errors). void logSignUpFlowError(String? errorText, [String? signupProvider]) { DerivRudderstack().track( - eventName: 'ce_virtual_signup_form', - properties: RudderProperty.fromMap({ - 'action': 'signup_flow_error', - 'signup_provider': '$signupProvider', - 'error_message': '$errorText', - 'form_source': 'mobile_derivgo', - 'form_name': 'virtual_signup_derivgo' - })); + eventName: 'ce_virtual_signup_form', + properties: RudderProperty.fromMap({ + 'action': 'signup_flow_error', + 'signup_provider': '$signupProvider', + 'error_message': '$errorText', + 'form_source': 'mobile_derivgo', + 'form_name': 'virtual_signup_derivgo' + }), + ); } } From 3c8cabd11fdfd302f129ed8a53e73c0c7e3fd7b5 Mon Sep 17 00:00:00 2001 From: Bassam El Obeid <127500305+bassam-deriv@users.noreply.github.com> Date: Tue, 7 May 2024 13:45:53 +0400 Subject: [PATCH 051/162] refactor(deriv_localizations): [UPM-925] Updating passkeys strings in deriv localizations (#568) --- packages/deriv_localizations/l10n.sh | 2 +- .../lib/l10n/deriv_passkeys/app_en.arb | 31 ++-- .../deriv_auth/deriv_auth_localizations.dart | 100 ++++++++---- .../deriv_passkeys_localizations.dart | 145 ++++++++++++------ .../deriv_passkeys_localizations_en.dart | 49 ++++-- 5 files changed, 229 insertions(+), 98 deletions(-) diff --git a/packages/deriv_localizations/l10n.sh b/packages/deriv_localizations/l10n.sh index 7781220e9..b825291b8 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_passkeys/app_en.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_en.arb index 0bb0779e4..024da7ec6 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_en.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_en.arb @@ -13,21 +13,25 @@ "unexpectedError": "An unexpected error occurred!", "unexpectedErrorDescription": "Please try again later.", "ok": "Ok", - "createPassKey": "Create Passkey", "experienceSaferLogins": "Experience safer logins", - "enhanceSecurity": "To enhance your security, tap Create passkey", + "enhanceSecurity": "Enhanced security is just a tap away.", "here": "here", "effortlessLogin": "Effortless login with passkeys", "whatArePasskeys": "What are passkeys?", - "whatArePasskeysDescription": "Passkeys are a security measure that lets you log in the same way you unlock your device: with a fingerprint, a face scan, or a screen lock PIN.", + "whatArePasskeysDescriptionPoint1": "Secure alternative to passwords.", + "whatArePasskeysDescriptionPoint2": "Unlock your account like your phone - with biometrics, face scan or PIN.", "whyPasskeys": "Why passkeys?", - "whyPasskeysDescription": "Passkeys are an added layer of security that protects your account against unauthorised access and phishing attacks.", + "whyPasskeysDescription1": "Extra security layer.", + "whyPasskeysDescription2": "Shields against unauthorised access and phishing.", "howToCreatePasskey": "How to create a passkey?", - "howToCreatePasskeyDescription": "Go to ‘Account Settings’ to set up your passkey. Each device can only save one passkey; however, iOS users may still see the \"Create passkey\" button due to iOS’s ability to save passkeys on other devices.", + "howToCreatePasskeyDescription1": "Go to ‘Account Settings’ on Deriv.", + "howToCreatePasskeyDescription2": "You can create one passkey per device.", "whereArePasskeysSaved": "Where are passkeys saved?", - "whereArePasskeysSavedDescription": "Passkeys are saved in your Google password manager for Android devices and in iCloud keychain on iOS devices to help you sign in on other devices.", + "whereArePasskeysSavedDescriptionAndroid": "Android: Google password manager.", + "whereArePasskeysSavedDescriptionIOS": "iOS: iCloud keychain.", "whatHappensIfEmailChanged": "What happens if my Deriv account email is changed?", - "whatHappensIfEmailChangedDescription": "Even if you change your email address, you can still continue to log in to your Deriv account with the same passkey.", + "whatHappensIfEmailChangedDescription1": "No problem! Your passkey still works.", + "whatHappensIfEmailChangedDescription2": "Sign in to Deriv with your existing passkey.", "tips": "Tips", "beforeUsingPasskeys": "Before using passkeys", "enableScreenLock": "Enable screen lock on your device.", @@ -40,11 +44,16 @@ "learnMoreAboutPasskeys": "Learn more about passkeys", "noNeedToRememberPassword": "No need to remember a password", "useYourBiometrics": "Enhanced security with biometrics or screen lock", - "syncAcrossAllDevices": "Sync across all devices", - "createPasskey": "Create Passkey", + "syncAcrossDevices": "Sync across devices", + "createPasskey": "Create passkey", "unsupportedPlatform": "Unsupported Platform", "storedOn": "Stored on", "lastUsed": "Last used", "rename": "Rename", - "revoke": "Revoke" -} \ No newline at end of file + "revoke": "Revoke", + "continueTradingButtonText": "Continue Trading", + "addMorePasskeysButtonText": "Add More Passkeys", + "unableToSetupPasskey": "Unable to setup passkey", + "unableToSetupPasskeyDescription": "We encountered an issue while setting up your passkey. The process might have been interrupted, or the session timed out. Please try again.", + "passkeysOffErrorTitle": "The Passkeys service is unavailable" +} 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 4612318cd..a742191e9 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,15 +75,18 @@ 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. @@ -95,7 +98,8 @@ 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, @@ -652,49 +656,83 @@ abstract class DerivAuthLocalizations { 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_passkeys/deriv_passkeys_localizations.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations.dart index b6dd424fb..905611466 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,15 +59,18 @@ 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. @@ -79,7 +82,8 @@ 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, @@ -87,9 +91,7 @@ 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. /// @@ -127,12 +129,6 @@ abstract class DerivPasskeysLocalizations { /// **'Ok'** String get ok; - /// No description provided for @createPassKey. - /// - /// In en, this message translates to: - /// **'Create Passkey'** - String get createPassKey; - /// No description provided for @experienceSaferLogins. /// /// In en, this message translates to: @@ -142,7 +138,7 @@ abstract class DerivPasskeysLocalizations { /// No description provided for @enhanceSecurity. /// /// In en, this message translates to: - /// **'To enhance your security, tap Create passkey'** + /// **'Enhanced security is just a tap away.'** String get enhanceSecurity; /// No description provided for @here. @@ -163,11 +159,17 @@ abstract class DerivPasskeysLocalizations { /// **'What are passkeys?'** String get whatArePasskeys; - /// No description provided for @whatArePasskeysDescription. + /// No description provided for @whatArePasskeysDescriptionPoint1. /// /// In en, this message translates to: - /// **'Passkeys are a security measure that lets you log in the same way you unlock your device: with a fingerprint, a face scan, or a screen lock PIN.'** - String get whatArePasskeysDescription; + /// **'Secure alternative to passwords.'** + String get whatArePasskeysDescriptionPoint1; + + /// No description provided for @whatArePasskeysDescriptionPoint2. + /// + /// In en, this message translates to: + /// **'Unlock your account like your phone - with biometrics, face scan or PIN.'** + String get whatArePasskeysDescriptionPoint2; /// No description provided for @whyPasskeys. /// @@ -175,11 +177,17 @@ abstract class DerivPasskeysLocalizations { /// **'Why passkeys?'** String get whyPasskeys; - /// No description provided for @whyPasskeysDescription. + /// No description provided for @whyPasskeysDescription1. + /// + /// In en, this message translates to: + /// **'Extra security layer.'** + String get whyPasskeysDescription1; + + /// No description provided for @whyPasskeysDescription2. /// /// In en, this message translates to: - /// **'Passkeys are an added layer of security that protects your account against unauthorised access and phishing attacks.'** - String get whyPasskeysDescription; + /// **'Shields against unauthorised access and phishing.'** + String get whyPasskeysDescription2; /// No description provided for @howToCreatePasskey. /// @@ -187,11 +195,17 @@ abstract class DerivPasskeysLocalizations { /// **'How to create a passkey?'** String get howToCreatePasskey; - /// No description provided for @howToCreatePasskeyDescription. + /// No description provided for @howToCreatePasskeyDescription1. /// /// In en, this message translates to: - /// **'Go to ‘Account Settings’ to set up your passkey. Each device can only save one passkey; however, iOS users may still see the \"Create passkey\" button due to iOS’s ability to save passkeys on other devices.'** - String get howToCreatePasskeyDescription; + /// **'Go to ‘Account Settings’ on Deriv.'** + String get howToCreatePasskeyDescription1; + + /// No description provided for @howToCreatePasskeyDescription2. + /// + /// In en, this message translates to: + /// **'You can create one passkey per device.'** + String get howToCreatePasskeyDescription2; /// No description provided for @whereArePasskeysSaved. /// @@ -199,11 +213,17 @@ abstract class DerivPasskeysLocalizations { /// **'Where are passkeys saved?'** String get whereArePasskeysSaved; - /// No description provided for @whereArePasskeysSavedDescription. + /// No description provided for @whereArePasskeysSavedDescriptionAndroid. /// /// In en, this message translates to: - /// **'Passkeys are saved in your Google password manager for Android devices and in iCloud keychain on iOS devices to help you sign in on other devices.'** - String get whereArePasskeysSavedDescription; + /// **'Android: Google password manager.'** + String get whereArePasskeysSavedDescriptionAndroid; + + /// No description provided for @whereArePasskeysSavedDescriptionIOS. + /// + /// In en, this message translates to: + /// **'iOS: iCloud keychain.'** + String get whereArePasskeysSavedDescriptionIOS; /// No description provided for @whatHappensIfEmailChanged. /// @@ -211,11 +231,17 @@ abstract class DerivPasskeysLocalizations { /// **'What happens if my Deriv account email is changed?'** String get whatHappensIfEmailChanged; - /// No description provided for @whatHappensIfEmailChangedDescription. + /// No description provided for @whatHappensIfEmailChangedDescription1. + /// + /// In en, this message translates to: + /// **'No problem! Your passkey still works.'** + String get whatHappensIfEmailChangedDescription1; + + /// No description provided for @whatHappensIfEmailChangedDescription2. /// /// In en, this message translates to: - /// **'Even if you change your email address, you can still continue to log in to your Deriv account with the same passkey.'** - String get whatHappensIfEmailChangedDescription; + /// **'Sign in to Deriv with your existing passkey.'** + String get whatHappensIfEmailChangedDescription2; /// No description provided for @tips. /// @@ -289,16 +315,16 @@ abstract class DerivPasskeysLocalizations { /// **'Enhanced security with biometrics or screen lock'** String get useYourBiometrics; - /// No description provided for @syncAcrossAllDevices. + /// No description provided for @syncAcrossDevices. /// /// In en, this message translates to: - /// **'Sync across all devices'** - String get syncAcrossAllDevices; + /// **'Sync across devices'** + String get syncAcrossDevices; /// No description provided for @createPasskey. /// /// In en, this message translates to: - /// **'Create Passkey'** + /// **'Create passkey'** String get createPasskey; /// No description provided for @unsupportedPlatform. @@ -330,35 +356,66 @@ abstract class DerivPasskeysLocalizations { /// In en, this message translates to: /// **'Revoke'** String get revoke; + + /// No description provided for @continueTradingButtonText. + /// + /// In en, this message translates to: + /// **'Continue Trading'** + String get continueTradingButtonText; + + /// No description provided for @addMorePasskeysButtonText. + /// + /// In en, this message translates to: + /// **'Add More Passkeys'** + String get addMorePasskeysButtonText; + + /// No description provided for @unableToSetupPasskey. + /// + /// In en, this message translates to: + /// **'Unable to setup passkey'** + String get unableToSetupPasskey; + + /// No description provided for @unableToSetupPasskeyDescription. + /// + /// In en, this message translates to: + /// **'We encountered an issue while setting up your passkey. The process might have been interrupted, or the session timed out. Please try again.'** + String get unableToSetupPasskeyDescription; + + /// No description provided for @passkeysOffErrorTitle. + /// + /// In en, this message translates to: + /// **'The Passkeys service is unavailable'** + String get passkeysOffErrorTitle; } -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/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_en.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_en.dart index f95a09f3a..18a6fc2c4 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_en.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_en.dart @@ -24,14 +24,11 @@ class DerivPasskeysLocalizationsEn extends DerivPasskeysLocalizations { @override String get ok => 'Ok'; - @override - String get createPassKey => 'Create Passkey'; - @override String get experienceSaferLogins => 'Experience safer logins'; @override - String get enhanceSecurity => 'To enhance your security, tap Create passkey'; + String get enhanceSecurity => 'Enhanced security is just a tap away.'; @override String get here => 'here'; @@ -43,31 +40,46 @@ class DerivPasskeysLocalizationsEn extends DerivPasskeysLocalizations { String get whatArePasskeys => 'What are passkeys?'; @override - String get whatArePasskeysDescription => 'Passkeys are a security measure that lets you log in the same way you unlock your device: with a fingerprint, a face scan, or a screen lock PIN.'; + String get whatArePasskeysDescriptionPoint1 => 'Secure alternative to passwords.'; + + @override + String get whatArePasskeysDescriptionPoint2 => 'Unlock your account like your phone - with biometrics, face scan or PIN.'; @override String get whyPasskeys => 'Why passkeys?'; @override - String get whyPasskeysDescription => 'Passkeys are an added layer of security that protects your account against unauthorised access and phishing attacks.'; + String get whyPasskeysDescription1 => 'Extra security layer.'; + + @override + String get whyPasskeysDescription2 => 'Shields against unauthorised access and phishing.'; @override String get howToCreatePasskey => 'How to create a passkey?'; @override - String get howToCreatePasskeyDescription => 'Go to ‘Account Settings’ to set up your passkey. Each device can only save one passkey; however, iOS users may still see the \"Create passkey\" button due to iOS’s ability to save passkeys on other devices.'; + String get howToCreatePasskeyDescription1 => 'Go to ‘Account Settings’ on Deriv.'; + + @override + String get howToCreatePasskeyDescription2 => 'You can create one passkey per device.'; @override String get whereArePasskeysSaved => 'Where are passkeys saved?'; @override - String get whereArePasskeysSavedDescription => 'Passkeys are saved in your Google password manager for Android devices and in iCloud keychain on iOS devices to help you sign in on other devices.'; + String get whereArePasskeysSavedDescriptionAndroid => 'Android: Google password manager.'; + + @override + String get whereArePasskeysSavedDescriptionIOS => 'iOS: iCloud keychain.'; @override String get whatHappensIfEmailChanged => 'What happens if my Deriv account email is changed?'; @override - String get whatHappensIfEmailChangedDescription => 'Even if you change your email address, you can still continue to log in to your Deriv account with the same passkey.'; + String get whatHappensIfEmailChangedDescription1 => 'No problem! Your passkey still works.'; + + @override + String get whatHappensIfEmailChangedDescription2 => 'Sign in to Deriv with your existing passkey.'; @override String get tips => 'Tips'; @@ -106,10 +118,10 @@ class DerivPasskeysLocalizationsEn extends DerivPasskeysLocalizations { String get useYourBiometrics => 'Enhanced security with biometrics or screen lock'; @override - String get syncAcrossAllDevices => 'Sync across all devices'; + String get syncAcrossDevices => 'Sync across devices'; @override - String get createPasskey => 'Create Passkey'; + String get createPasskey => 'Create passkey'; @override String get unsupportedPlatform => 'Unsupported Platform'; @@ -125,4 +137,19 @@ class DerivPasskeysLocalizationsEn extends DerivPasskeysLocalizations { @override String get revoke => 'Revoke'; + + @override + String get continueTradingButtonText => 'Continue Trading'; + + @override + String get addMorePasskeysButtonText => 'Add More Passkeys'; + + @override + String get unableToSetupPasskey => 'Unable to setup passkey'; + + @override + String get unableToSetupPasskeyDescription => 'We encountered an issue while setting up your passkey. The process might have been interrupted, or the session timed out. Please try again.'; + + @override + String get passkeysOffErrorTitle => 'The Passkeys service is unavailable'; } From 9d70584476291fc3f80a69bcc6f023a5ad52aeaa Mon Sep 17 00:00:00 2001 From: Ali Akbar <116874053+aliakbar-deriv@users.noreply.github.com> Date: Tue, 7 May 2024 16:51:51 +0400 Subject: [PATCH 052/162] chore(version): bump version and update changelog --- packages/analytics/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/analytics/pubspec.yaml b/packages/analytics/pubspec.yaml index 93035b79b..ff89733a0 100644 --- a/packages/analytics/pubspec.yaml +++ b/packages/analytics/pubspec.yaml @@ -1,6 +1,6 @@ name: analytics description: A new Flutter package for collecting and sending analytical information from the app. -version: 1.0.2 +version: 1.0.3 homepage: https://deriv.com/ publish_to: "none" From 27c193ba834c27072568d97ee2934cc0020b95aa Mon Sep 17 00:00:00 2001 From: Ali Akbar <116874053+aliakbar-deriv@users.noreply.github.com> Date: Tue, 7 May 2024 17:25:28 +0400 Subject: [PATCH 053/162] chore(version): bump analytics package version --- packages/analytics/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/analytics/pubspec.yaml b/packages/analytics/pubspec.yaml index ff89733a0..78fad43c4 100644 --- a/packages/analytics/pubspec.yaml +++ b/packages/analytics/pubspec.yaml @@ -1,6 +1,6 @@ name: analytics description: A new Flutter package for collecting and sending analytical information from the app. -version: 1.0.3 +version: 1.0.4 homepage: https://deriv.com/ publish_to: "none" From 276bd5d0d59580e6d6bf20635de8008d1a6a2f39 Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Wed, 8 May 2024 16:30:28 +0800 Subject: [PATCH 054/162] chore(version): bump version and update changelog (#575) --- CHANGELOG.md | 37 +++++++++++++++++++ packages/deriv_auth/CHANGELOG.md | 4 ++ packages/deriv_auth/pubspec.yaml | 6 +-- packages/deriv_language_selector/CHANGELOG.md | 4 ++ packages/deriv_language_selector/pubspec.yaml | 4 +- packages/deriv_localizations/CHANGELOG.md | 4 ++ packages/deriv_localizations/pubspec.yaml | 2 +- packages/deriv_ui/CHANGELOG.md | 4 ++ packages/deriv_ui/pubspec.yaml | 2 +- packages/deriv_widgetbook/CHANGELOG.md | 4 ++ packages/deriv_widgetbook/pubspec.yaml | 4 +- 11 files changed, 66 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2543adf57..e633b4700 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,43 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-05-07 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_localizations` - `v1.3.1`](#deriv_localizations---v131) + - [`deriv_ui` - `v0.0.7+4`](#deriv_ui---v0074) + - [`deriv_auth` - `v6.4.3`](#deriv_auth---v643) + - [`deriv_widgetbook` - `v0.0.2+4`](#deriv_widgetbook---v0024) + - [`deriv_language_selector` - `v0.0.2+2`](#deriv_language_selector---v0022) + +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.3` + - `deriv_widgetbook` - `v0.0.2+4` + - `deriv_language_selector` - `v0.0.2+2` + +--- + +#### `deriv_localizations` - `v1.3.1` + + - **REFACTOR**(deriv_localizations): [UPM-925] Updating passkeys strings in deriv localizations ([#568](https://github.com/regentmarkets/flutter-deriv-packages/issues/568)). ([3c8cabd1](https://github.com/regentmarkets/flutter-deriv-packages/commit/3c8cabd11fdfd302f129ed8a53e73c0c7e3fd7b5)) + +#### `deriv_ui` - `v0.0.7+4` + + - **FIX**(deriv_ui): add specific formatter for crypto and fiat currency ([#569](https://github.com/regentmarkets/flutter-deriv-packages/issues/569)). ([711abee1](https://github.com/regentmarkets/flutter-deriv-packages/commit/711abee199278b7f0fd7463de6f480d561e99d67)) + + ## 2024-04-26 ### Changes diff --git a/packages/deriv_auth/CHANGELOG.md b/packages/deriv_auth/CHANGELOG.md index 3bba4148c..ccd78b8bb 100644 --- a/packages/deriv_auth/CHANGELOG.md +++ b/packages/deriv_auth/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.4.3 + + - Update a dependency to the latest release. + ## 6.4.2 - Update a dependency to the latest release. diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index 8fe3910f7..5b667df4d 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.4.2 +version: 6.4.3 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+3 + ref: deriv_ui-v0.0.7+4 deriv_http_client: git: @@ -46,7 +46,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_localizations - ref: deriv_localizations-v1.3.0 + ref: deriv_localizations-v1.3.1 flutter_bloc: ^8.1.3 flutter_svg: ^2.0.7 diff --git a/packages/deriv_language_selector/CHANGELOG.md b/packages/deriv_language_selector/CHANGELOG.md index 8abf34b68..c9116727f 100644 --- a/packages/deriv_language_selector/CHANGELOG.md +++ b/packages/deriv_language_selector/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.2+2 + + - Update a dependency to the latest release. + ## 0.0.2+1 - Update a dependency to the latest release. diff --git a/packages/deriv_language_selector/pubspec.yaml b/packages/deriv_language_selector/pubspec.yaml index e5a21763b..a902e383d 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+1 +version: 0.0.2+2 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+3 + ref: deriv_ui-v0.0.7+4 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 5680decba..8f6c09204 100644 --- a/packages/deriv_localizations/CHANGELOG.md +++ b/packages/deriv_localizations/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.3.1 + + - **REFACTOR**(deriv_localizations): [UPM-925] Updating passkeys strings in deriv localizations ([#568](https://github.com/regentmarkets/flutter-deriv-packages/issues/568)). ([3c8cabd1](https://github.com/regentmarkets/flutter-deriv-packages/commit/3c8cabd11fdfd302f129ed8a53e73c0c7e3fd7b5)) + ## 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)) diff --git a/packages/deriv_localizations/pubspec.yaml b/packages/deriv_localizations/pubspec.yaml index a283c13ff..91cb1cdfb 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.3.0 +version: 1.3.1 environment: sdk: '>=3.0.2 <4.0.0' diff --git a/packages/deriv_ui/CHANGELOG.md b/packages/deriv_ui/CHANGELOG.md index 826d2edff..10c38b31a 100644 --- a/packages/deriv_ui/CHANGELOG.md +++ b/packages/deriv_ui/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.7+4 + + - **FIX**(deriv_ui): add specific formatter for crypto and fiat currency ([#569](https://github.com/regentmarkets/flutter-deriv-packages/issues/569)). ([711abee1](https://github.com/regentmarkets/flutter-deriv-packages/commit/711abee199278b7f0fd7463de6f480d561e99d67)) + ## 0.0.7+3 - Update a dependency to the latest release. diff --git a/packages/deriv_ui/pubspec.yaml b/packages/deriv_ui/pubspec.yaml index a0ff4e285..f2c2561d3 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+3 +version: 0.0.7+4 publish_to: none environment: diff --git a/packages/deriv_widgetbook/CHANGELOG.md b/packages/deriv_widgetbook/CHANGELOG.md index 4cb8fecb3..03b1a29fa 100644 --- a/packages/deriv_widgetbook/CHANGELOG.md +++ b/packages/deriv_widgetbook/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.2+4 + + - Update a dependency to the latest release. + ## 0.0.2+3 - Update a dependency to the latest release. diff --git a/packages/deriv_widgetbook/pubspec.yaml b/packages/deriv_widgetbook/pubspec.yaml index 42979e3e3..060265ab1 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+3 +version: 0.0.2+4 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+3 + ref: deriv_ui-v0.0.7+4 deriv_theme: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git From d6eccdcaf9fa37784ae3f9fb2bd13a98e874aae0 Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Mon, 13 May 2024 08:11:00 +0400 Subject: [PATCH 055/162] refactor(deriv_passkeys): updated deriv_passkeys and deriv_localizations --- .../features/login/presentation/layouts/deriv_login_layout.dart | 2 +- packages/deriv_auth/pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 c1a4bc76a..170a8fc90 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 @@ -136,7 +136,7 @@ class _DerivLoginLayoutState extends State { ), if (widget.isSocialAuthEnabled) const SizedBox(height: ThemeProvider.margin24), - ContinueWithPasskeyButton(), + const ContinueWithPasskeyButton(), DerivSocialAuthPanel( socialAuthStateHandler: widget.socialAuthStateHandler, redirectURL: widget.redirectURL, diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index af8c4afdd..1366a5974 100644 --- a/packages/deriv_auth/pubspec.yaml +++ b/packages/deriv_auth/pubspec.yaml @@ -46,7 +46,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_localizations - ref: da897013ecd1f993ad4e696c1d0856d7ebf3758c + ref: deriv_localizations-v1.3.1 deriv_passkeys: git: From cd3768ef2b6bd7420e7957277461e95e78eee545 Mon Sep 17 00:00:00 2001 From: ernest-deriv <120568427+ernest-deriv@users.noreply.github.com> Date: Wed, 15 May 2024 09:29:33 +0400 Subject: [PATCH 056/162] feat(deriv_auth): Add language selector in auth package (#576) --- .../layouts/deriv_get_started_layout.dart | 12 +++ .../single_entry/core/auth_provider.dart | 8 ++ packages/deriv_auth/pubspec.yaml | 6 ++ .../deriv_get_started_layout_test.dart | 98 ++++++++++++------- 4 files changed, 89 insertions(+), 35 deletions(-) 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 2924059d7..2c15b8dd3 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 @@ -6,6 +6,7 @@ import 'dart:math' as math; import 'package:deriv_auth/core/extensions/context_extension.dart'; import 'package:deriv_auth/core/helpers/semantic_labels.dart'; import 'package:deriv_auth/features/get_started/models/deriv_get_started_slide_model.dart'; +import 'package:deriv_language_selector/deriv_language_selector.dart'; import 'package:deriv_theme/deriv_theme.dart'; import 'package:deriv_ui/deriv_ui.dart'; import 'package:flutter/material.dart'; @@ -110,6 +111,17 @@ class _DerivGetStartedLayoutState extends State { title: AppSettingGestureDetector( onTapNavigation: widget.onTapNavigation, child: SvgPicture.asset(widget.appLogoIconPath)), + actions: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: ThemeProvider.margin16, + vertical: ThemeProvider.margin08, + ), + child: LanguageSelector.button( + bottomsheetTitle: context.derivAuthLocalization.labelLanguage, + ), + ), + ], ); Timer _buildNewScrollTimer() => Timer.periodic( diff --git a/packages/deriv_auth/lib/features/single_entry/core/auth_provider.dart b/packages/deriv_auth/lib/features/single_entry/core/auth_provider.dart index f6fb0adcb..20d6e6195 100644 --- a/packages/deriv_auth/lib/features/single_entry/core/auth_provider.dart +++ b/packages/deriv_auth/lib/features/single_entry/core/auth_provider.dart @@ -2,6 +2,7 @@ import 'package:deriv_auth/features/auth/cubit/deriv_auth_cubit.dart'; import 'package:deriv_auth/features/reset_password/cubit/reset_password_cubit.dart'; import 'package:deriv_auth/features/signup/cubit/signup_cubit.dart'; import 'package:deriv_auth/features/social_auth/cubit/social_auth_cubit.dart'; +import 'package:deriv_language_selector/deriv_language_selector.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -14,6 +15,7 @@ class AuthProvider extends StatelessWidget { required this.socialAuthCubit, required this.derivResetPassCubit, required this.derivSignupCubit, + required this.languageCubit, }); /// Child widget @@ -31,6 +33,9 @@ class AuthProvider extends StatelessWidget { /// Instance of Signup Cubit final DerivSignupCubit derivSignupCubit; + /// Instance of language Cubit + final LanguageCubit languageCubit; + Widget build(BuildContext context) => MultiBlocProvider( providers: [ BlocProvider.value( @@ -45,6 +50,9 @@ class AuthProvider extends StatelessWidget { BlocProvider.value( value: derivSignupCubit, ), + BlocProvider.value( + value: languageCubit, + ), ], child: widget, ); diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index 5b667df4d..1f4f471db 100644 --- a/packages/deriv_auth/pubspec.yaml +++ b/packages/deriv_auth/pubspec.yaml @@ -48,6 +48,12 @@ dependencies: path: packages/deriv_localizations ref: deriv_localizations-v1.3.1 + deriv_language_selector: + git: + url: git@github.com:regentmarkets/flutter-deriv-packages.git + path: packages/deriv_language_selector + ref: deriv_language_selector-v0.0.2+1 + flutter_bloc: ^8.1.3 flutter_svg: ^2.0.7 smooth_page_indicator: ^1.1.0 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 2f01f1bae..ca0c48003 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 @@ -1,9 +1,14 @@ // ignore_for_file: always_specify_types +import 'package:bloc_test/bloc_test.dart'; import 'package:deriv_auth/features/get_started/models/deriv_get_started_slide_model.dart'; import 'package:deriv_auth/features/get_started/presentation/layouts/deriv_get_started_layout.dart'; +import 'package:deriv_language_selector/deriv_language_selector.dart'; +import 'package:deriv_localizations/l10n/generated/deriv_auth/deriv_auth_localizations.dart'; +import 'package:deriv_localizations/l10n/generated/deriv_auth/deriv_auth_localizations_ar.dart'; import 'package:deriv_ui/deriv_ui.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mocktail/mocktail.dart'; import 'package:patrol_finders/patrol_finders.dart'; @@ -13,6 +18,9 @@ import '../../../../pump_app.dart'; class MockDerivGetStartedSlideModel extends Mock implements DerivGetStartedSlideModel {} +class MockLanguageCubit extends MockCubit + implements LanguageCubit {} + void main() { group('DerivGetStartedLayout', () { late MockDerivGetStartedSlideModel mockSlideModel; @@ -20,43 +28,52 @@ void main() { const String appLogoIconPath = 'assets/icons/ic_logo_extended.svg'; const String backgroundImagePath = 'assets/images/triangles.svg'; + final MockLanguageCubit mockLanguageCubit = MockLanguageCubit(); + setUpAll(() { mockSlideModel = MockDerivGetStartedSlideModel(); when(() => mockSlideModel.imagePath) .thenReturn('assets/images/charts.svg'); when(() => mockSlideModel.supportingText).thenReturn('Supporting text'); - }); - patrolWidgetTest('should render DerivGetStartedLayout', - (PatrolTester $) async { - await $.pumpApp(DerivGetStartedLayout( - onTapNavigation: (context) {}, - slides: [mockSlideModel], - appLogoIconPath: appLogoIconPath, - backgroundImagePath: backgroundImagePath, - onLoginTapped: () {}, - onSignupTapped: () {}, - )); - - expect($(DerivGetStartedLayout), findsOneWidget); - expect($(AppBar), findsOneWidget); - expect($(PrimaryButton), findsOneWidget); - expect($(SecondaryButton), findsOneWidget); + final LanguageModel languageModel = LanguageModel( + code: 'en', + flag: 'assets/icons/flags/ic_flag_en.png', + name: 'English', + ); + + when(() => mockLanguageCubit.state).thenReturn( + LanguageLoadedState( + activeLanguages: [ + languageModel, + ], + language: languageModel, + ), + ); }); patrolWidgetTest('should call onLoginTapped when login button is pressed', (PatrolTester $) async { bool loginTapped = false; - await $.pumpApp(DerivGetStartedLayout( - onTapNavigation: (context) {}, - slides: [mockSlideModel], - appLogoIconPath: appLogoIconPath, - backgroundImagePath: backgroundImagePath, - onLoginTapped: () { - loginTapped = true; - }, - onSignupTapped: () {}, + await $.pumpApp(BlocProvider( + create: (_) => mockLanguageCubit, + child: MaterialApp( + localizationsDelegates: const [DerivAuthLocalizations.delegate], + locale: const Locale('en'), + home: Scaffold( + body: DerivGetStartedLayout( + onTapNavigation: (context) {}, + slides: [mockSlideModel], + appLogoIconPath: appLogoIconPath, + backgroundImagePath: backgroundImagePath, + onLoginTapped: () { + loginTapped = true; + }, + onSignupTapped: () {}, + ), + ), + ), )); await $.tap($(SecondaryButton)); @@ -68,16 +85,27 @@ void main() { (PatrolTester $) async { bool signupTapped = false; - await $.pumpApp(DerivGetStartedLayout( - onTapNavigation: (context) {}, - slides: [mockSlideModel], - appLogoIconPath: appLogoIconPath, - backgroundImagePath: backgroundImagePath, - onLoginTapped: () {}, - onSignupTapped: () { - signupTapped = true; - }, - )); + await $.pumpApp( + BlocProvider( + create: (_) => mockLanguageCubit, + child: MaterialApp( + localizationsDelegates: const [DerivAuthLocalizations.delegate], + locale: const Locale('en'), + home: Scaffold( + body: DerivGetStartedLayout( + onTapNavigation: (context) {}, + slides: [mockSlideModel], + appLogoIconPath: appLogoIconPath, + backgroundImagePath: backgroundImagePath, + onLoginTapped: () {}, + onSignupTapped: () { + signupTapped = true; + }, + ), + ), + ), + ), + ); await $.tap($(PrimaryButton)); From 54770b7582631627c6e4bd2589de75022159811c Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Wed, 15 May 2024 13:48:51 +0800 Subject: [PATCH 057/162] chore(version): bump version and update changelog (#584) Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: sahani-deriv --- CHANGELOG.md | 21 +++++++++++++++++++++ README.md | 16 ++++++++-------- packages/deriv_auth/CHANGELOG.md | 4 ++++ packages/deriv_auth/pubspec.yaml | 2 +- 4 files changed, 34 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e633b4700..ed43c204f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,27 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-05-15 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_auth` - `v6.5.0`](#deriv_auth---v650) + +--- + +#### `deriv_auth` - `v6.5.0` + + - **FEAT**(deriv_auth): Add language selector in auth package ([#576](https://github.com/regentmarkets/flutter-deriv-packages/issues/576)). ([cd3768ef](https://github.com/regentmarkets/flutter-deriv-packages/commit/cd3768ef2b6bd7420e7957277461e95e78eee545)) + + ## 2024-05-07 ### Changes diff --git a/README.md b/README.md index 138d11478..9fcc445dd 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.4.2)`. 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.5.0)`. To use the package, add the following to your pubspec.yaml file: ```yaml @@ -12,15 +12,15 @@ deriv_ui: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.7+3 #your prefered version + ref: deriv_ui-v0.0.7+4 #your prefered version ``` ## Packages | 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.4.2 ](./packages/deriv_auth/CHANGELOG.md) | +| [analytics](./packages/analytics) | Used to collect and send analytical information to 'Firebase' and 'Segment'. | [v1.0.4](./packages/analytics/CHANGELOG.md) | +| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.5.0 ](./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.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_language_selector](./packages/deriv_language_selector) | A package to handle language change of the app. | [v0.0.2+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.3.1](./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+3](./packages/deriv_ui/CHANGELOG.md) | +| [deriv_ui](./packages/deriv_ui) | A package that contains the UI components used by Deriv products. | [v0.0.7+4](./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+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) | +| [deriv_widgetbook](./packages/deriv_widgetbook) |Storybook for Deriv UI Widgets and Components | [v0.0.2+4](./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/packages/deriv_auth/CHANGELOG.md b/packages/deriv_auth/CHANGELOG.md index ccd78b8bb..aba68a96a 100644 --- a/packages/deriv_auth/CHANGELOG.md +++ b/packages/deriv_auth/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.5.0 + + - **FEAT**(deriv_auth): Add language selector in auth package ([#576](https://github.com/regentmarkets/flutter-deriv-packages/issues/576)). ([cd3768ef](https://github.com/regentmarkets/flutter-deriv-packages/commit/cd3768ef2b6bd7420e7957277461e95e78eee545)) + ## 6.4.3 - Update a dependency to the latest release. diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index 1f4f471db..296870cac 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.4.3 +version: 6.5.0 environment: From 0bf743c3b7a65f70935b32b68b7062ed07a1ae72 Mon Sep 17 00:00:00 2001 From: Bassam El Obeid <127500305+bassam-deriv@users.noreply.github.com> Date: Fri, 17 May 2024 11:19:52 +0400 Subject: [PATCH 058/162] refactor(deriv_localizations): Updating deriv localizations for passkeys package (#581) --- .../lib/l10n/deriv_passkeys/app_en.arb | 5 ++++- .../deriv_passkeys_localizations.dart | 18 ++++++++++++++++++ .../deriv_passkeys_localizations_en.dart | 9 +++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_en.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_en.arb index 024da7ec6..e97a76898 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_en.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_en.arb @@ -55,5 +55,8 @@ "addMorePasskeysButtonText": "Add More Passkeys", "unableToSetupPasskey": "Unable to setup passkey", "unableToSetupPasskeyDescription": "We encountered an issue while setting up your passkey. The process might have been interrupted, or the session timed out. Please try again.", - "passkeysOffErrorTitle": "The Passkeys service is unavailable" + "passkeysOffErrorTitle": "The Passkeys service is unavailable", + "never": "Never", + "unable_to_process_your_request": "Unable to process your request", + "unable_to_process_your_request_description": "We’re experiencing a temporary issue in processing your request. Please try again later." } 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 905611466..def56fef1 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 @@ -386,6 +386,24 @@ abstract class DerivPasskeysLocalizations { /// In en, this message translates to: /// **'The Passkeys service is unavailable'** String get passkeysOffErrorTitle; + + /// No description provided for @never. + /// + /// In en, this message translates to: + /// **'Never'** + String get never; + + /// No description provided for @unable_to_process_your_request. + /// + /// In en, this message translates to: + /// **'Unable to process your request'** + String get unable_to_process_your_request; + + /// No description provided for @unable_to_process_your_request_description. + /// + /// In en, this message translates to: + /// **'We’re experiencing a temporary issue in processing your request. Please try again later.'** + String get unable_to_process_your_request_description; } class _DerivPasskeysLocalizationsDelegate diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_en.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_en.dart index 18a6fc2c4..991953ef4 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_en.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_en.dart @@ -152,4 +152,13 @@ class DerivPasskeysLocalizationsEn extends DerivPasskeysLocalizations { @override String get passkeysOffErrorTitle => 'The Passkeys service is unavailable'; + + @override + String get never => 'Never'; + + @override + String get unable_to_process_your_request => 'Unable to process your request'; + + @override + String get unable_to_process_your_request_description => 'We’re experiencing a temporary issue in processing your request. Please try again later.'; } From a0799752930407c50e0feadb9ce2e56cfc083867 Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Mon, 20 May 2024 15:13:46 +0800 Subject: [PATCH 059/162] chore(version): bump version and update changelog (#588) --- CHANGELOG.md | 28 +++++++++++++++++++++++ README.md | 6 ++--- packages/deriv_auth/CHANGELOG.md | 4 ++++ packages/deriv_auth/pubspec.yaml | 4 ++-- packages/deriv_localizations/CHANGELOG.md | 4 ++++ packages/deriv_localizations/pubspec.yaml | 2 +- 6 files changed, 42 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed43c204f..8493420f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,34 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-05-17 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_localizations` - `v1.3.2`](#deriv_localizations---v132) + - [`deriv_auth` - `v6.5.1`](#deriv_auth---v651) + +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.5.1` + +--- + +#### `deriv_localizations` - `v1.3.2` + + - **REFACTOR**(deriv_localizations): Updating deriv localizations for passkeys package ([#581](https://github.com/regentmarkets/flutter-deriv-packages/issues/581)). ([0bf743c3](https://github.com/regentmarkets/flutter-deriv-packages/commit/0bf743c3b7a65f70935b32b68b7062ed07a1ae72)) + + ## 2024-05-15 ### Changes diff --git a/README.md b/README.md index 9fcc445dd..99adb57bd 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.5.0)`. 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.5.1)`. To use the package, add the following to your pubspec.yaml file: ```yaml @@ -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.4](./packages/analytics/CHANGELOG.md) | -| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.5.0 ](./packages/deriv_auth/CHANGELOG.md) | +| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.5.1 ](./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) | @@ -32,7 +32,7 @@ deriv_ui: | [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.2+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.3.1](./packages/deriv_localizations/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.2](./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) | diff --git a/packages/deriv_auth/CHANGELOG.md b/packages/deriv_auth/CHANGELOG.md index aba68a96a..2d2fa8dde 100644 --- a/packages/deriv_auth/CHANGELOG.md +++ b/packages/deriv_auth/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.5.1 + + - Update a dependency to the latest release. + ## 6.5.0 - **FEAT**(deriv_auth): Add language selector in auth package ([#576](https://github.com/regentmarkets/flutter-deriv-packages/issues/576)). ([cd3768ef](https://github.com/regentmarkets/flutter-deriv-packages/commit/cd3768ef2b6bd7420e7957277461e95e78eee545)) diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index 296870cac..b9e4827b7 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.5.0 +version: 6.5.1 environment: @@ -46,7 +46,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_localizations - ref: deriv_localizations-v1.3.1 + ref: deriv_localizations-v1.3.2 deriv_language_selector: git: diff --git a/packages/deriv_localizations/CHANGELOG.md b/packages/deriv_localizations/CHANGELOG.md index 8f6c09204..987f65733 100644 --- a/packages/deriv_localizations/CHANGELOG.md +++ b/packages/deriv_localizations/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.3.2 + + - **REFACTOR**(deriv_localizations): Updating deriv localizations for passkeys package ([#581](https://github.com/regentmarkets/flutter-deriv-packages/issues/581)). ([0bf743c3](https://github.com/regentmarkets/flutter-deriv-packages/commit/0bf743c3b7a65f70935b32b68b7062ed07a1ae72)) + ## 1.3.1 - **REFACTOR**(deriv_localizations): [UPM-925] Updating passkeys strings in deriv localizations ([#568](https://github.com/regentmarkets/flutter-deriv-packages/issues/568)). ([3c8cabd1](https://github.com/regentmarkets/flutter-deriv-packages/commit/3c8cabd11fdfd302f129ed8a53e73c0c7e3fd7b5)) diff --git a/packages/deriv_localizations/pubspec.yaml b/packages/deriv_localizations/pubspec.yaml index 91cb1cdfb..a17f509c1 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.3.1 +version: 1.3.2 environment: sdk: '>=3.0.2 <4.0.0' From c5509175edb6a94122cce6fe6f63a43d44904dc9 Mon Sep 17 00:00:00 2001 From: Bassam El Obeid <127500305+bassam-deriv@users.noreply.github.com> Date: Mon, 20 May 2024 11:46:41 +0400 Subject: [PATCH 060/162] feat(deriv_passkeys): [UPM-547] Deriv passkeys package (#425) --- .gitignore | 2 + CHANGELOG.md | 28 + .../lib/l10n/deriv_auth/app_en.arb | 2 +- packages/deriv_passkeys/.gitignore | 30 + packages/deriv_passkeys/.metadata | 33 + packages/deriv_passkeys/CHANGELOG.md | 3 + packages/deriv_passkeys/LICENSE | 1 + packages/deriv_passkeys/README.md | 96 +++ packages/deriv_passkeys/analysis_options.yaml | 120 +++ packages/deriv_passkeys/android/.gitignore | 9 + packages/deriv_passkeys/android/build.gradle | 76 ++ .../deriv_passkeys/android/gradle.properties | 15 + .../deriv_passkeys/android/settings.gradle | 1 + .../android/src/main/AndroidManifest.xml | 7 + .../deriv_passkeys/DerivPasskeysPlugin.kt | 153 ++++ .../android/src/main/proguard-rules.pro | 4 + .../assets/svg/add_passkey_icon.svg | 28 + .../svg/effortless_login_passkey_icon.svg | 22 + .../deriv_passkeys/assets/svg/face_id.svg | 15 + .../assets/svg/fingerprint_icon.svg | 3 + .../assets/svg/learn_more_passkeys_icon.svg | 3 + .../assets/svg/light_bulb_icon.svg | 10 + .../deriv_passkeys/assets/svg/lock_icon.svg | 10 + .../svg/passkey_created_success_icon.svg | 28 + .../assets/svg/passkey_icon.svg | 3 + .../deriv_passkeys/assets/svg/sync_icon.svg | 6 + packages/deriv_passkeys/example/.gitignore | 44 ++ packages/deriv_passkeys/example/.metadata | 45 ++ packages/deriv_passkeys/example/README.md | 8 + .../example/analysis_options.yaml | 29 + .../deriv_passkeys/example/android/.gitignore | 13 + .../example/android/app/build.gradle | 72 ++ .../android/app/src/debug/AndroidManifest.xml | 7 + .../android/app/src/main/AndroidManifest.xml | 34 + .../com/example/passkeys_poc/MainActivity.kt | 5 + .../res/drawable-v21/launch_background.xml | 12 + .../main/res/drawable/launch_background.xml | 12 + .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 544 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 442 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 721 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 1031 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 1443 bytes .../app/src/main/res/values-night/styles.xml | 18 + .../app/src/main/res/values/styles.xml | 18 + .../app/src/profile/AndroidManifest.xml | 7 + .../example/android/build.gradle | 31 + .../example/android/gradle.properties | 3 + .../example/android/settings.gradle | 11 + .../example/devtools_options.yaml | 1 + .../deriv_passkeys/example/ios/.gitignore | 34 + .../ios/Flutter/AppFrameworkInfo.plist | 26 + .../example/ios/Flutter/Debug.xcconfig | 2 + .../example/ios/Flutter/Release.xcconfig | 2 + packages/deriv_passkeys/example/ios/Podfile | 43 + .../deriv_passkeys/example/ios/Podfile.lock | 85 ++ .../ios/Runner.xcodeproj/project.pbxproj | 747 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../xcshareddata/WorkspaceSettings.xcsettings | 8 + .../xcshareddata/xcschemes/Runner.xcscheme | 98 +++ .../contents.xcworkspacedata | 10 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../xcshareddata/WorkspaceSettings.xcsettings | 8 + .../example/ios/Runner/AppDelegate.swift | 13 + .../AppIcon.appiconset/Contents.json | 122 +++ .../Icon-App-1024x1024@1x.png | Bin 0 -> 10932 bytes .../AppIcon.appiconset/Icon-App-20x20@1x.png | Bin 0 -> 295 bytes .../AppIcon.appiconset/Icon-App-20x20@2x.png | Bin 0 -> 406 bytes .../AppIcon.appiconset/Icon-App-20x20@3x.png | Bin 0 -> 450 bytes .../AppIcon.appiconset/Icon-App-29x29@1x.png | Bin 0 -> 282 bytes .../AppIcon.appiconset/Icon-App-29x29@2x.png | Bin 0 -> 462 bytes .../AppIcon.appiconset/Icon-App-29x29@3x.png | Bin 0 -> 704 bytes .../AppIcon.appiconset/Icon-App-40x40@1x.png | Bin 0 -> 406 bytes .../AppIcon.appiconset/Icon-App-40x40@2x.png | Bin 0 -> 586 bytes .../AppIcon.appiconset/Icon-App-40x40@3x.png | Bin 0 -> 862 bytes .../AppIcon.appiconset/Icon-App-60x60@2x.png | Bin 0 -> 862 bytes .../AppIcon.appiconset/Icon-App-60x60@3x.png | Bin 0 -> 1674 bytes .../AppIcon.appiconset/Icon-App-76x76@1x.png | Bin 0 -> 762 bytes .../AppIcon.appiconset/Icon-App-76x76@2x.png | Bin 0 -> 1226 bytes .../Icon-App-83.5x83.5@2x.png | Bin 0 -> 1418 bytes .../LaunchImage.imageset/Contents.json | 23 + .../LaunchImage.imageset/LaunchImage.png | Bin 0 -> 68 bytes .../LaunchImage.imageset/LaunchImage@2x.png | Bin 0 -> 68 bytes .../LaunchImage.imageset/LaunchImage@3x.png | Bin 0 -> 68 bytes .../LaunchImage.imageset/README.md | 5 + .../Runner/Base.lproj/LaunchScreen.storyboard | 37 + .../ios/Runner/Base.lproj/Main.storyboard | 26 + .../example/ios/Runner/Info.plist | 49 ++ .../ios/Runner/Runner-Bridging-Header.h | 1 + .../example/ios/Runner/Runner.entitlements | 15 + .../example/ios/RunnerTests/RunnerTests.swift | 12 + packages/deriv_passkeys/example/lib/main.dart | 111 +++ packages/deriv_passkeys/example/pubspec.yaml | 77 ++ .../example/test/widget_test.dart | 30 + packages/deriv_passkeys/ios/.gitignore | 38 + .../ios/Classes/DerivPasskeysManager.swift | 388 +++++++++ .../ios/Classes/DerivPasskeysPlugin.swift | 72 ++ .../PublicKeyCredentialRequestOptions.swift | 215 +++++ .../deriv_passkeys/ios/deriv_passkeys.podspec | 23 + .../deriv_passkeys/lib/deriv_passkeys.dart | 6 + .../deriv_passkeys/lib/src/data/data.dart | 5 + .../base_deriv_passkeys_data_source.dart | 46 ++ .../deriv_passkeys_data_source.dart | 164 ++++ .../data/mappers/deriv_passkeys_mapper.dart | 63 ++ .../src/data/models/deriv_passkey_model.dart | 58 ++ .../models/deriv_passkeys_options_model.dart | 51 ++ ...deriv_passkeys_register_options_model.dart | 18 + ...verify_credentials_request_body_model.dart | 48 ++ ...eys_verify_credentials_response_model.dart | 15 + .../passkeys_connection_info_model.dart | 24 + .../deriv_passkeys_method_channel.dart | 71 ++ .../deriv_passkeys_repository.dart | 71 ++ .../base_deriv_passkeys_repository.dart | 35 + .../deriv_passkeys/lib/src/domain/domain.dart | 5 + .../domain/entities/deriv_passkey_entity.dart | 53 ++ .../deriv_passkeys_options_entity.dart | 60 ++ ..._passkeys_register_credentials_entity.dart | 25 + ...eriv_passkeys_register_options_entity.dart | 23 + ...erify_credentials_request_body_entity.dart | 40 + ...ys_verify_credentials_response_entity.dart | 15 + .../passkeys_connection_info_entity.dart | 14 + .../base_deriv_passkeys_method_channel.dart | 35 + .../src/exceptions/platform_exceptions.dart | 29 + .../lib/src/exceptions/server_exceptions.dart | 14 + .../src/extensions/context_extensions.dart | 9 + .../lib/src/interactor/interactor.dart | 3 + .../services/deriv_passkeys_service.dart | 111 +++ .../src/presentation/constants/assets.dart | 32 + .../pages/effortless_passkeys_login_page.dart | 213 +++++ .../pages/learn_more_passkeys_page.dart | 253 ++++++ .../pages/manage_passkeys_page.dart | 195 +++++ .../pages/passkey_created_page.dart | 78 ++ .../lib/src/presentation/presentation.dart | 6 + .../states/bloc/deriv_passkeys_bloc.dart | 151 ++++ .../states/bloc/deriv_passkeys_event.dart | 70 ++ .../states/bloc/deriv_passkeys_state.dart | 67 ++ .../presentation/utils/date_time_utils.dart | 10 + .../utils/handle_errors_utils.dart | 58 ++ .../presentation/utils/platform_utils.dart | 15 + .../widgets/continue_with_passkey_button.dart | 80 ++ .../widgets/icon_text_row_widget.dart | 29 + .../passkey_created_call_to_action.dart | 52 ++ .../presentation/widgets/passkey_widget.dart | 110 +++ .../widgets/section_title_and_content.dart | 42 + .../widgets/unordered_list_widget.dart | 88 +++ packages/deriv_passkeys/pubspec.yaml | 111 +++ ...deriv_passkeys_data_source_mock_setup.dart | 123 +++ .../data/deriv_passkeys_data_source_test.dart | 211 +++++ .../test/data/deriv_passkeys_mapper_test.dart | 132 ++++ .../deriv_passkeys_method_channel_test.dart | 147 ++++ .../data/deriv_passkeys_repository_test.dart | 189 +++++ .../deriv_passkeys_service_test.dart | 149 ++++ .../pages/learn_more_passkeys_page_test.dart | 104 +++ .../bloc/deriv_passkeys_bloc_setup.dart | 38 + .../states/bloc/deriv_passkeys_bloc_test.dart | 271 +++++++ .../bloc/deriv_passkeys_event_test.dart | 64 ++ .../bloc/deriv_passkeys_state_test.dart | 67 ++ .../utils/date_time_utils_test.dart | 22 + .../continue_with_passkey_button_test.dart | 158 ++++ .../widgets/icon_text_row_widget_test.dart | 37 + .../widgets/passkey_widget_test.dart | 37 + .../section_title_and_content_test.dart | 30 + .../widgets/unordered_list_widget_test.dart | 53 ++ 163 files changed, 8023 insertions(+), 1 deletion(-) create mode 100644 packages/deriv_passkeys/.gitignore create mode 100644 packages/deriv_passkeys/.metadata create mode 100644 packages/deriv_passkeys/CHANGELOG.md create mode 100644 packages/deriv_passkeys/LICENSE create mode 100644 packages/deriv_passkeys/README.md create mode 100644 packages/deriv_passkeys/analysis_options.yaml create mode 100644 packages/deriv_passkeys/android/.gitignore create mode 100644 packages/deriv_passkeys/android/build.gradle create mode 100644 packages/deriv_passkeys/android/gradle.properties create mode 100644 packages/deriv_passkeys/android/settings.gradle create mode 100644 packages/deriv_passkeys/android/src/main/AndroidManifest.xml create mode 100644 packages/deriv_passkeys/android/src/main/kotlin/com/deriv/passkeys/deriv_passkeys/DerivPasskeysPlugin.kt create mode 100644 packages/deriv_passkeys/android/src/main/proguard-rules.pro create mode 100644 packages/deriv_passkeys/assets/svg/add_passkey_icon.svg create mode 100644 packages/deriv_passkeys/assets/svg/effortless_login_passkey_icon.svg create mode 100644 packages/deriv_passkeys/assets/svg/face_id.svg create mode 100644 packages/deriv_passkeys/assets/svg/fingerprint_icon.svg create mode 100644 packages/deriv_passkeys/assets/svg/learn_more_passkeys_icon.svg create mode 100644 packages/deriv_passkeys/assets/svg/light_bulb_icon.svg create mode 100644 packages/deriv_passkeys/assets/svg/lock_icon.svg create mode 100644 packages/deriv_passkeys/assets/svg/passkey_created_success_icon.svg create mode 100644 packages/deriv_passkeys/assets/svg/passkey_icon.svg create mode 100644 packages/deriv_passkeys/assets/svg/sync_icon.svg create mode 100644 packages/deriv_passkeys/example/.gitignore create mode 100644 packages/deriv_passkeys/example/.metadata create mode 100644 packages/deriv_passkeys/example/README.md create mode 100644 packages/deriv_passkeys/example/analysis_options.yaml create mode 100644 packages/deriv_passkeys/example/android/.gitignore create mode 100644 packages/deriv_passkeys/example/android/app/build.gradle create mode 100644 packages/deriv_passkeys/example/android/app/src/debug/AndroidManifest.xml create mode 100644 packages/deriv_passkeys/example/android/app/src/main/AndroidManifest.xml create mode 100644 packages/deriv_passkeys/example/android/app/src/main/kotlin/com/example/passkeys_poc/MainActivity.kt create mode 100644 packages/deriv_passkeys/example/android/app/src/main/res/drawable-v21/launch_background.xml create mode 100644 packages/deriv_passkeys/example/android/app/src/main/res/drawable/launch_background.xml create mode 100644 packages/deriv_passkeys/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 packages/deriv_passkeys/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 packages/deriv_passkeys/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 packages/deriv_passkeys/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 packages/deriv_passkeys/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 packages/deriv_passkeys/example/android/app/src/main/res/values-night/styles.xml create mode 100644 packages/deriv_passkeys/example/android/app/src/main/res/values/styles.xml create mode 100644 packages/deriv_passkeys/example/android/app/src/profile/AndroidManifest.xml create mode 100644 packages/deriv_passkeys/example/android/build.gradle create mode 100644 packages/deriv_passkeys/example/android/gradle.properties create mode 100644 packages/deriv_passkeys/example/android/settings.gradle create mode 100644 packages/deriv_passkeys/example/devtools_options.yaml create mode 100644 packages/deriv_passkeys/example/ios/.gitignore create mode 100644 packages/deriv_passkeys/example/ios/Flutter/AppFrameworkInfo.plist create mode 100644 packages/deriv_passkeys/example/ios/Flutter/Debug.xcconfig create mode 100644 packages/deriv_passkeys/example/ios/Flutter/Release.xcconfig create mode 100644 packages/deriv_passkeys/example/ios/Podfile create mode 100644 packages/deriv_passkeys/example/ios/Podfile.lock create mode 100644 packages/deriv_passkeys/example/ios/Runner.xcodeproj/project.pbxproj create mode 100644 packages/deriv_passkeys/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 packages/deriv_passkeys/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 packages/deriv_passkeys/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings create mode 100644 packages/deriv_passkeys/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme create mode 100644 packages/deriv_passkeys/example/ios/Runner.xcworkspace/contents.xcworkspacedata create mode 100644 packages/deriv_passkeys/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 packages/deriv_passkeys/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings create mode 100644 packages/deriv_passkeys/example/ios/Runner/AppDelegate.swift create mode 100644 packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png create mode 100644 packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png create mode 100644 packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png create mode 100644 packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png create mode 100644 packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png create mode 100644 packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png create mode 100644 packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png create mode 100644 packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png create mode 100644 packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png create mode 100644 packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png create mode 100644 packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png create mode 100644 packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png create mode 100644 packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png create mode 100644 packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png create mode 100644 packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png create mode 100644 packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json create mode 100644 packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png create mode 100644 packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png create mode 100644 packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png create mode 100644 packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md create mode 100644 packages/deriv_passkeys/example/ios/Runner/Base.lproj/LaunchScreen.storyboard create mode 100644 packages/deriv_passkeys/example/ios/Runner/Base.lproj/Main.storyboard create mode 100644 packages/deriv_passkeys/example/ios/Runner/Info.plist create mode 100644 packages/deriv_passkeys/example/ios/Runner/Runner-Bridging-Header.h create mode 100644 packages/deriv_passkeys/example/ios/Runner/Runner.entitlements create mode 100644 packages/deriv_passkeys/example/ios/RunnerTests/RunnerTests.swift create mode 100644 packages/deriv_passkeys/example/lib/main.dart create mode 100644 packages/deriv_passkeys/example/pubspec.yaml create mode 100644 packages/deriv_passkeys/example/test/widget_test.dart create mode 100644 packages/deriv_passkeys/ios/.gitignore create mode 100644 packages/deriv_passkeys/ios/Classes/DerivPasskeysManager.swift create mode 100644 packages/deriv_passkeys/ios/Classes/DerivPasskeysPlugin.swift create mode 100644 packages/deriv_passkeys/ios/Classes/PublicKeyCredentialRequestOptions.swift create mode 100644 packages/deriv_passkeys/ios/deriv_passkeys.podspec create mode 100644 packages/deriv_passkeys/lib/deriv_passkeys.dart create mode 100644 packages/deriv_passkeys/lib/src/data/data.dart create mode 100644 packages/deriv_passkeys/lib/src/data/data_sources/base_deriv_passkeys_data_source.dart create mode 100644 packages/deriv_passkeys/lib/src/data/data_sources/deriv_passkeys_data_source.dart create mode 100644 packages/deriv_passkeys/lib/src/data/mappers/deriv_passkeys_mapper.dart create mode 100644 packages/deriv_passkeys/lib/src/data/models/deriv_passkey_model.dart create mode 100644 packages/deriv_passkeys/lib/src/data/models/deriv_passkeys_options_model.dart create mode 100644 packages/deriv_passkeys/lib/src/data/models/deriv_passkeys_register_options_model.dart create mode 100644 packages/deriv_passkeys/lib/src/data/models/deriv_passkeys_verify_credentials_request_body_model.dart create mode 100644 packages/deriv_passkeys/lib/src/data/models/deriv_passkeys_verify_credentials_response_model.dart create mode 100644 packages/deriv_passkeys/lib/src/data/models/passkeys_connection_info_model.dart create mode 100644 packages/deriv_passkeys/lib/src/data/platform/deriv_passkeys_method_channel.dart create mode 100644 packages/deriv_passkeys/lib/src/data/repositories/deriv_passkeys_repository.dart create mode 100644 packages/deriv_passkeys/lib/src/domain/base_repositories/base_deriv_passkeys_repository.dart create mode 100644 packages/deriv_passkeys/lib/src/domain/domain.dart create mode 100644 packages/deriv_passkeys/lib/src/domain/entities/deriv_passkey_entity.dart create mode 100644 packages/deriv_passkeys/lib/src/domain/entities/deriv_passkeys_options_entity.dart create mode 100644 packages/deriv_passkeys/lib/src/domain/entities/deriv_passkeys_register_credentials_entity.dart create mode 100644 packages/deriv_passkeys/lib/src/domain/entities/deriv_passkeys_register_options_entity.dart create mode 100644 packages/deriv_passkeys/lib/src/domain/entities/deriv_passkeys_verify_credentials_request_body_entity.dart create mode 100644 packages/deriv_passkeys/lib/src/domain/entities/deriv_passkeys_verify_credentials_response_entity.dart create mode 100644 packages/deriv_passkeys/lib/src/domain/entities/passkeys_connection_info_entity.dart create mode 100644 packages/deriv_passkeys/lib/src/domain/platform/base_deriv_passkeys_method_channel.dart create mode 100644 packages/deriv_passkeys/lib/src/exceptions/platform_exceptions.dart create mode 100644 packages/deriv_passkeys/lib/src/exceptions/server_exceptions.dart create mode 100644 packages/deriv_passkeys/lib/src/extensions/context_extensions.dart create mode 100644 packages/deriv_passkeys/lib/src/interactor/interactor.dart create mode 100644 packages/deriv_passkeys/lib/src/interactor/services/deriv_passkeys_service.dart create mode 100644 packages/deriv_passkeys/lib/src/presentation/constants/assets.dart create mode 100644 packages/deriv_passkeys/lib/src/presentation/pages/effortless_passkeys_login_page.dart create mode 100644 packages/deriv_passkeys/lib/src/presentation/pages/learn_more_passkeys_page.dart create mode 100644 packages/deriv_passkeys/lib/src/presentation/pages/manage_passkeys_page.dart create mode 100644 packages/deriv_passkeys/lib/src/presentation/pages/passkey_created_page.dart create mode 100644 packages/deriv_passkeys/lib/src/presentation/presentation.dart create mode 100644 packages/deriv_passkeys/lib/src/presentation/states/bloc/deriv_passkeys_bloc.dart create mode 100644 packages/deriv_passkeys/lib/src/presentation/states/bloc/deriv_passkeys_event.dart create mode 100644 packages/deriv_passkeys/lib/src/presentation/states/bloc/deriv_passkeys_state.dart create mode 100644 packages/deriv_passkeys/lib/src/presentation/utils/date_time_utils.dart create mode 100644 packages/deriv_passkeys/lib/src/presentation/utils/handle_errors_utils.dart create mode 100644 packages/deriv_passkeys/lib/src/presentation/utils/platform_utils.dart create mode 100644 packages/deriv_passkeys/lib/src/presentation/widgets/continue_with_passkey_button.dart create mode 100644 packages/deriv_passkeys/lib/src/presentation/widgets/icon_text_row_widget.dart create mode 100644 packages/deriv_passkeys/lib/src/presentation/widgets/passkey_created_call_to_action.dart create mode 100644 packages/deriv_passkeys/lib/src/presentation/widgets/passkey_widget.dart create mode 100644 packages/deriv_passkeys/lib/src/presentation/widgets/section_title_and_content.dart create mode 100644 packages/deriv_passkeys/lib/src/presentation/widgets/unordered_list_widget.dart create mode 100644 packages/deriv_passkeys/pubspec.yaml create mode 100644 packages/deriv_passkeys/test/data/deriv_passkeys_data_source_mock_setup.dart create mode 100644 packages/deriv_passkeys/test/data/deriv_passkeys_data_source_test.dart create mode 100644 packages/deriv_passkeys/test/data/deriv_passkeys_mapper_test.dart create mode 100644 packages/deriv_passkeys/test/data/deriv_passkeys_method_channel_test.dart create mode 100644 packages/deriv_passkeys/test/data/deriv_passkeys_repository_test.dart create mode 100644 packages/deriv_passkeys/test/interactor/deriv_passkeys_service_test.dart create mode 100644 packages/deriv_passkeys/test/presentation/pages/learn_more_passkeys_page_test.dart create mode 100644 packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_bloc_setup.dart create mode 100644 packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_bloc_test.dart create mode 100644 packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_event_test.dart create mode 100644 packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_state_test.dart create mode 100644 packages/deriv_passkeys/test/presentation/utils/date_time_utils_test.dart create mode 100644 packages/deriv_passkeys/test/presentation/widgets/continue_with_passkey_button_test.dart create mode 100644 packages/deriv_passkeys/test/presentation/widgets/icon_text_row_widget_test.dart create mode 100644 packages/deriv_passkeys/test/presentation/widgets/passkey_widget_test.dart create mode 100644 packages/deriv_passkeys/test/presentation/widgets/section_title_and_content_test.dart create mode 100644 packages/deriv_passkeys/test/presentation/widgets/unordered_list_widget_test.dart diff --git a/.gitignore b/.gitignore index 986f8f684..86f284979 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,8 @@ lib/basic_api/generated/*.json *.iws .idea/ +.fvm + # The .vscode folder contains launch configuration and tasks you configure in # VS Code which you may wish to be included in version control, so this line # is commented out by default. diff --git a/CHANGELOG.md b/CHANGELOG.md index 8493420f7..5c667901c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -632,6 +632,34 @@ Packages with dependency updates only: - **REFACTOR**(deriv_ui): update deriv_ui dependencies ([#499](https://github.com/regentmarkets/flutter-deriv-packages/issues/499)). ([2ade47f5](https://github.com/regentmarkets/flutter-deriv-packages/commit/2ade47f5f42a37325e4e4906c8c095fc26d777b6)) +## 2024-02-29 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_ui` - `v0.0.6+4`](#deriv_ui---v0064) + - [`deriv_auth` - `v6.0.2`](#deriv_auth---v602) + +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.0.2` + +--- + +#### `deriv_ui` - `v0.0.6+4` + + - **REFACTOR**(deriv_ui): update deriv_ui dependencies ([#499](https://github.com/regentmarkets/flutter-deriv-packages/issues/499)). ([2ade47f5](https://github.com/regentmarkets/flutter-deriv-packages/commit/2ade47f5f42a37325e4e4906c8c095fc26d777b6)) + + ## 2024-02-29 ### Changes 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 e3602bb49..8ac9be2bf 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_auth/app_en.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_auth/app_en.arb @@ -13,7 +13,7 @@ "actionOk": "OK", "warnNotAvailableCountries": "If you have any questions, contact us via ", "labelLiveChat": "Live chat", - "actionGetAFreeAccount": "Get a free account", + "actionSignUpForFree": "Sign up for free", "actionLogin": "Log in", "labelTwoFactorAuth": "Two-factor authentication", "informEnterTwoFactorAuthCode": "Enter the 6-digit code from the authenticator app on your phone.", diff --git a/packages/deriv_passkeys/.gitignore b/packages/deriv_passkeys/.gitignore new file mode 100644 index 000000000..96486fd93 --- /dev/null +++ b/packages/deriv_passkeys/.gitignore @@ -0,0 +1,30 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. +/pubspec.lock +**/doc/api/ +.dart_tool/ +.packages +build/ diff --git a/packages/deriv_passkeys/.metadata b/packages/deriv_passkeys/.metadata new file mode 100644 index 000000000..7e5bb4c81 --- /dev/null +++ b/packages/deriv_passkeys/.metadata @@ -0,0 +1,33 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "ead455963c12b453cdb2358cad34969c76daf180" + channel: "stable" + +project_type: plugin + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: ead455963c12b453cdb2358cad34969c76daf180 + base_revision: ead455963c12b453cdb2358cad34969c76daf180 + - platform: android + create_revision: ead455963c12b453cdb2358cad34969c76daf180 + base_revision: ead455963c12b453cdb2358cad34969c76daf180 + - platform: ios + create_revision: ead455963c12b453cdb2358cad34969c76daf180 + base_revision: ead455963c12b453cdb2358cad34969c76daf180 + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/packages/deriv_passkeys/CHANGELOG.md b/packages/deriv_passkeys/CHANGELOG.md new file mode 100644 index 000000000..41cc7d819 --- /dev/null +++ b/packages/deriv_passkeys/CHANGELOG.md @@ -0,0 +1,3 @@ +## 0.0.1 + +* TODO: Describe initial release. diff --git a/packages/deriv_passkeys/LICENSE b/packages/deriv_passkeys/LICENSE new file mode 100644 index 000000000..ba75c69f7 --- /dev/null +++ b/packages/deriv_passkeys/LICENSE @@ -0,0 +1 @@ +TODO: Add your license here. diff --git a/packages/deriv_passkeys/README.md b/packages/deriv_passkeys/README.md new file mode 100644 index 000000000..ef9c026b7 --- /dev/null +++ b/packages/deriv_passkeys/README.md @@ -0,0 +1,96 @@ +# Deriv Passkeys + +Deriv Passkeys is a Flutter plugin that allows you to generate passkeys for Deriv applications (based on WebAuthn). + +## Features + +This package contains everything you need to set up passkeys in your Deriv Flutter App: + +* Android and iOS support +* Login with passkeys +* Create passkeys +* List passkeys + +## Dependencies to Other Deriv Packages + +* [flutter_deriv_api](https://github.com/deriv-com/flutter-deriv-api) +* [deriv_theme](https://github.com/regentmarkets/flutter-deriv-packages/tree/master/packages/deriv_theme) +* [deriv_ui](https://github.com/regentmarkets/flutter-deriv-packages/tree/master/packages/deriv_ui) + +## Getting started + +To use this package, add `deriv_passkeys` as a dependency in your pubspec.yaml file: + +```yaml +dependencies: + deriv_passkeys: + git: + url: git@github.com:regentmarkets/flutter-deriv-packages.git + path: packages/deriv_passkeys + ref: deriv_passkeys-v0.0.1 +``` + +### Android + +No additional setup required. + +### iOS + +- Add the associated domains to your signing capabilities in Xcode: +- Add the following values to your associated domains: + - webcredentials:deriv.com + - applinks:deriv.com + + +## Usage + +### Import the package + +```dart +import 'package:deriv_passkeys/deriv_passkeys.dart'; +``` + +### DerivPasskeysBloc: + +```dart + final DerivPasskeysBloc derivPasskeysBloc = DerivPasskeysBloc( + getJwtToken: derivJwtService.getJwtToken, + derivPasskeysService: DerivPasskeysService( + DerivPasskeysRepository( + DerivPasskeysDataSource( + DerivPasskeysMapper(), + ), + ), + ), + connectionInfo: PasskeysConnectionInfoEntity( + appId: FlavorConfig.instance.flavorValues.appId!, + endpoint: FlavorConfig.instance.flavorValues.endPoint!, + ), + ); +``` + +### ContinueWithPasskeyButton + +```dart + ContinueWithPasskeyButton( + derivPasskeysBloc: context.read(), + ), +``` + +- This widget is used to continue with passkey. +- It requires `derivPasskeysBloc` as a parameter. +- It will return not show anything if the user's device does not support passkeys. +- When it's clicked it will either be successful or show an error message. +- in case of success the DerivPasskeysBloc will emit DerivPasskeysCredentialVerifiedState. +- The DerivPasskeysCredentialVerifiedState will contain the token which can be used to authenticate the user. + ```dart + DerivPasskeysCredentialVerifiedState( + token: token, + ), + ``` + + + + + + diff --git a/packages/deriv_passkeys/analysis_options.yaml b/packages/deriv_passkeys/analysis_options.yaml new file mode 100644 index 000000000..fb40ccd5d --- /dev/null +++ b/packages/deriv_passkeys/analysis_options.yaml @@ -0,0 +1,120 @@ +analyzer: + language: + strict-raw-types: true + +linter: + rules: + - always_declare_return_types + - always_put_control_body_on_new_line + - always_put_required_named_parameters_first + - always_require_non_null_named_parameters + - always_specify_types + - annotate_overrides + - avoid_bool_literals_in_conditional_expressions + - avoid_catches_without_on_clauses + - avoid_empty_else + - avoid_equals_and_hash_code_on_mutable_classes + - avoid_field_initializers_in_const_classes + - avoid_function_literals_in_foreach_calls + - avoid_init_to_null + - avoid_null_checks_in_equality_operators + - avoid_positional_boolean_parameters + - avoid_print + - avoid_redundant_argument_values + - avoid_relative_lib_imports + - avoid_renaming_method_parameters + - avoid_return_types_on_setters + - avoid_returning_null + - avoid_returning_null_for_future + - avoid_returning_null_for_void + - avoid_setters_without_getters + - avoid_shadowing_type_parameters + - avoid_single_cascade_in_expression_statements + - avoid_slow_async_io + - avoid_types_as_parameter_names + - avoid_unnecessary_containers + - avoid_unused_constructor_parameters + - avoid_void_async + - await_only_futures + - camel_case_types + - cancel_subscriptions + - cascade_invocations + - close_sinks + - constant_identifier_names + - control_flow_in_finally + - curly_braces_in_flow_control_structures + - empty_catches + - empty_constructor_bodies + - empty_statements + - file_names + - flutter_style_todos + - hash_and_equals + - implementation_imports + - join_return_with_assignment + - library_names + - library_prefixes + - no_adjacent_strings_in_list + - no_duplicate_case_values + - non_constant_identifier_names + - null_closures + - only_throw_errors + - overridden_fields + - package_api_docs + - package_names + - package_prefixed_library_names + - parameter_assignments + - prefer_adjacent_string_concatenation + - prefer_asserts_in_initializer_lists + - prefer_collection_literals + - prefer_conditional_assignment + - prefer_const_constructors + - prefer_const_constructors_in_immutables + - prefer_const_declarations + - prefer_const_literals_to_create_immutables + - prefer_constructors_over_static_methods + - prefer_contains + - prefer_expression_function_bodies + - prefer_final_fields + - prefer_final_in_for_each + - prefer_final_locals + - prefer_foreach + - prefer_function_declarations_over_variables + - prefer_generic_function_type_aliases + - prefer_initializing_formals + - prefer_int_literals + - prefer_interpolation_to_compose_strings + - prefer_is_empty + - prefer_is_not_empty + - prefer_iterable_whereType + - prefer_mixin + - prefer_single_quotes + - prefer_typing_uninitialized_variables + - prefer_void_to_null + - public_member_api_docs + - recursive_getters + - slash_for_doc_comments + - sort_constructors_first + - sort_unnamed_constructors_first + - test_types_in_equals + - throw_in_finally + - type_init_formals + - unawaited_futures + - unnecessary_await_in_return + - unnecessary_brace_in_string_interps + - unnecessary_const + - unnecessary_getters_setters + - unnecessary_new + - unnecessary_null_aware_assignments + - unnecessary_null_in_if_null_operators + - unnecessary_overrides + - unnecessary_parenthesis + - unnecessary_statements + - unnecessary_this + - unrelated_type_equality_checks + - use_function_type_syntax_for_parameters + - use_rethrow_when_possible + - use_setters_to_change_properties + - use_string_buffers + - use_to_and_as_if_applicable + - valid_regexps + - void_checks diff --git a/packages/deriv_passkeys/android/.gitignore b/packages/deriv_passkeys/android/.gitignore new file mode 100644 index 000000000..161bdcdaf --- /dev/null +++ b/packages/deriv_passkeys/android/.gitignore @@ -0,0 +1,9 @@ +*.iml +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures +.cxx diff --git a/packages/deriv_passkeys/android/build.gradle b/packages/deriv_passkeys/android/build.gradle new file mode 100644 index 000000000..935fccbf9 --- /dev/null +++ b/packages/deriv_passkeys/android/build.gradle @@ -0,0 +1,76 @@ +group 'com.deriv.passkeys.deriv_passkeys' +version '1.0-SNAPSHOT' + +buildscript { + ext.kotlin_version = '1.8.22' + repositories { + google() + mavenCentral() + } + + dependencies { + classpath 'com.android.tools.build:gradle:8.0.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +allprojects { + repositories { + google() + mavenCentral() + } +} + +apply plugin: 'com.android.library' +apply plugin: 'kotlin-android' + +android { + if (project.android.hasProperty("namespace")) { + namespace 'com.deriv.passkeys.deriv_passkeys' + } + + compileSdk 34 + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = '1.8' + } + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + test.java.srcDirs += 'src/test/kotlin' + } + + defaultConfig { + minSdkVersion 21 + } + + dependencies { + testImplementation 'org.jetbrains.kotlin:kotlin-test' + testImplementation 'org.mockito:mockito-core:5.0.0' + + implementation "androidx.credentials:credentials:1.2.2" + implementation "androidx.credentials:credentials-play-services-auth:1.2.2" + + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1" + + implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1" + + } + + testOptions { + unitTests.all { + useJUnitPlatform() + + testLogging { + events "passed", "skipped", "failed", "standardOut", "standardError" + outputs.upToDateWhen {false} + showStandardStreams = true + } + } + } +} diff --git a/packages/deriv_passkeys/android/gradle.properties b/packages/deriv_passkeys/android/gradle.properties new file mode 100644 index 000000000..fc53bee90 --- /dev/null +++ b/packages/deriv_passkeys/android/gradle.properties @@ -0,0 +1,15 @@ +## For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx1024m -XX:MaxPermSize=256m +# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 +# +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +#Tue Dec 26 15:23:43 GST 2023 +android.enableJetifier=true +android.useAndroidX=true diff --git a/packages/deriv_passkeys/android/settings.gradle b/packages/deriv_passkeys/android/settings.gradle new file mode 100644 index 000000000..dcd8a9248 --- /dev/null +++ b/packages/deriv_passkeys/android/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'deriv_passkeys' diff --git a/packages/deriv_passkeys/android/src/main/AndroidManifest.xml b/packages/deriv_passkeys/android/src/main/AndroidManifest.xml new file mode 100644 index 000000000..de887b8df --- /dev/null +++ b/packages/deriv_passkeys/android/src/main/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + + + diff --git a/packages/deriv_passkeys/android/src/main/kotlin/com/deriv/passkeys/deriv_passkeys/DerivPasskeysPlugin.kt b/packages/deriv_passkeys/android/src/main/kotlin/com/deriv/passkeys/deriv_passkeys/DerivPasskeysPlugin.kt new file mode 100644 index 000000000..0493071d1 --- /dev/null +++ b/packages/deriv_passkeys/android/src/main/kotlin/com/deriv/passkeys/deriv_passkeys/DerivPasskeysPlugin.kt @@ -0,0 +1,153 @@ +package com.deriv.passkeys.deriv_passkeys + +import android.app.Activity +import androidx.credentials.CreatePublicKeyCredentialRequest +import androidx.credentials.CreatePublicKeyCredentialResponse +import androidx.credentials.CredentialManager +import androidx.credentials.GetCredentialRequest +import androidx.credentials.GetPublicKeyCredentialOption +import androidx.credentials.PublicKeyCredential +import androidx.credentials.exceptions.publickeycredential.CreatePublicKeyCredentialDomException +import androidx.lifecycle.ViewModel +import androidx.lifecycle.viewModelScope +import io.flutter.embedding.engine.plugins.FlutterPlugin +import io.flutter.plugin.common.MethodCall +import io.flutter.plugin.common.MethodChannel +import io.flutter.plugin.common.MethodChannel.MethodCallHandler +import kotlinx.coroutines.launch +import org.json.JSONObject +import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding +import io.flutter.embedding.engine.plugins.activity.ActivityAware + +/// DerivPasskeysPlugin is a Flutter plugin that provides a way to create and get credentials using the WebAuthn API. +class DerivPasskeysPlugin: FlutterPlugin, MethodCallHandler, ActivityAware, ViewModel() { + /// The MethodChannel that will the communication between Flutter and native Android + /// + /// This local reference serves to register the plugin with the Flutter Engine and unregister it + /// when the Flutter Engine is detached from the Activity + private lateinit var channel: MethodChannel + private lateinit var activity: Activity + + + private fun createCredential(options: String, callback: (credential: String?, e: Exception?) -> Unit) { + JSONObject(options) + val createPublicKeyCredentialRequest = CreatePublicKeyCredentialRequest( + requestJson = options, + preferImmediatelyAvailableCredentials = false + ) + viewModelScope.launch { + try { + val credentialManager = CredentialManager.create(activity) + val result = credentialManager.createCredential( + context = activity, + request = createPublicKeyCredentialRequest, + ) + val credential = result as CreatePublicKeyCredentialResponse + callback(credential.registrationResponseJson, null) + } catch (e: Exception) { + callback(null, e) + } + } + } + + private fun getCredential(options: String, callback: (credential: String?, e: Exception?) -> Unit) { + JSONObject(options) + val getPublicKeyCredentialOption = GetPublicKeyCredentialOption( + requestJson = options + ) + viewModelScope.launch { + try { + val credentialManager = CredentialManager.create(activity) + val result = credentialManager.getCredential( + context = activity, + request = GetCredentialRequest(listOf(getPublicKeyCredentialOption)), + ) + val credential = result.credential as PublicKeyCredential + callback(credential.authenticationResponseJson, null) + } catch (e: Exception) { + callback(null, e) + } + } + } + + override fun onAttachedToEngine(flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { + channel = MethodChannel(flutterPluginBinding.binaryMessenger, "deriv_passkeys") + channel.setMethodCallHandler(this) + } + + override fun onAttachedToActivity(binding: ActivityPluginBinding) { + this.activity = binding.activity; + } + + override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) { + channel.setMethodCallHandler(null) + } + + override fun onDetachedFromActivity() { + } + + override fun onReattachedToActivityForConfigChanges(binding: ActivityPluginBinding) { + this.activity = binding.activity; + } + + override fun onDetachedFromActivityForConfigChanges() { + } + + override fun onMethodCall(call: MethodCall, result: MethodChannel.Result) { + when (call.method) { + "isPlatformSupported" -> { + val isSupported = android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.P + result.success(isSupported) + } + "createCredential" -> { + val options = call.argument("options") as String? + options?.let { + try { + createCredential(options) { credential, e -> + if (credential != null) { + result.success(credential) + } + else if (e != null) { + var exceptionType = e.javaClass.kotlin.simpleName + if (e is CreatePublicKeyCredentialDomException) { + exceptionType = "$exceptionType(${e.domError.javaClass.kotlin.simpleName ?: "DomError"})" + } + result.error(exceptionType ?: "Exception", e.message ?: "Exception occurred", null) + } + else { + result.error("Error", "Unknown error", null) + } + } + } catch (e: Exception) { + result.error(e.javaClass.kotlin.simpleName ?: "Exception", e.message ?: "Exception occurred", null) + } + } ?: run { + result.error("InvalidParameterException", "Options not found", null) + } + } + "getCredential" -> { + val options = call.argument("options") as String? + options?.let { + try { + getCredential(options) { credential, e -> + if (credential != null) { + result.success(credential) + } + else if (e != null) { + result.error(e.javaClass.kotlin.simpleName ?: "Exception", e.message ?: "Exception occurred", null) + } + else { + result.error("Error", "Unknown error", null) + } + } + } catch (e: Exception) { + result.error(e.javaClass.kotlin.simpleName ?: "Exception", e.message ?: "Exception occurred", null) + } + } ?: run { + result.error("InvalidParameterException", "Options not found", null) + } + } + else -> result.notImplemented() + } + } +} diff --git a/packages/deriv_passkeys/android/src/main/proguard-rules.pro b/packages/deriv_passkeys/android/src/main/proguard-rules.pro new file mode 100644 index 000000000..5bf7d0357 --- /dev/null +++ b/packages/deriv_passkeys/android/src/main/proguard-rules.pro @@ -0,0 +1,4 @@ +-if class androidx.credentials.CredentialManager +-keep class androidx.credentials.playservices.** { + *; +} diff --git a/packages/deriv_passkeys/assets/svg/add_passkey_icon.svg b/packages/deriv_passkeys/assets/svg/add_passkey_icon.svg new file mode 100644 index 000000000..8e9207994 --- /dev/null +++ b/packages/deriv_passkeys/assets/svg/add_passkey_icon.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/deriv_passkeys/assets/svg/effortless_login_passkey_icon.svg b/packages/deriv_passkeys/assets/svg/effortless_login_passkey_icon.svg new file mode 100644 index 000000000..d41e62fac --- /dev/null +++ b/packages/deriv_passkeys/assets/svg/effortless_login_passkey_icon.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/deriv_passkeys/assets/svg/face_id.svg b/packages/deriv_passkeys/assets/svg/face_id.svg new file mode 100644 index 000000000..eefdd4626 --- /dev/null +++ b/packages/deriv_passkeys/assets/svg/face_id.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/packages/deriv_passkeys/assets/svg/fingerprint_icon.svg b/packages/deriv_passkeys/assets/svg/fingerprint_icon.svg new file mode 100644 index 000000000..610bf2721 --- /dev/null +++ b/packages/deriv_passkeys/assets/svg/fingerprint_icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/deriv_passkeys/assets/svg/learn_more_passkeys_icon.svg b/packages/deriv_passkeys/assets/svg/learn_more_passkeys_icon.svg new file mode 100644 index 000000000..fd8279ecf --- /dev/null +++ b/packages/deriv_passkeys/assets/svg/learn_more_passkeys_icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/deriv_passkeys/assets/svg/light_bulb_icon.svg b/packages/deriv_passkeys/assets/svg/light_bulb_icon.svg new file mode 100644 index 000000000..c3c24b18a --- /dev/null +++ b/packages/deriv_passkeys/assets/svg/light_bulb_icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/packages/deriv_passkeys/assets/svg/lock_icon.svg b/packages/deriv_passkeys/assets/svg/lock_icon.svg new file mode 100644 index 000000000..c9ce9da67 --- /dev/null +++ b/packages/deriv_passkeys/assets/svg/lock_icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/packages/deriv_passkeys/assets/svg/passkey_created_success_icon.svg b/packages/deriv_passkeys/assets/svg/passkey_created_success_icon.svg new file mode 100644 index 000000000..af74a8fbe --- /dev/null +++ b/packages/deriv_passkeys/assets/svg/passkey_created_success_icon.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/deriv_passkeys/assets/svg/passkey_icon.svg b/packages/deriv_passkeys/assets/svg/passkey_icon.svg new file mode 100644 index 000000000..16812e500 --- /dev/null +++ b/packages/deriv_passkeys/assets/svg/passkey_icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/deriv_passkeys/assets/svg/sync_icon.svg b/packages/deriv_passkeys/assets/svg/sync_icon.svg new file mode 100644 index 000000000..4ba1b1be0 --- /dev/null +++ b/packages/deriv_passkeys/assets/svg/sync_icon.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/deriv_passkeys/example/.gitignore b/packages/deriv_passkeys/example/.gitignore new file mode 100644 index 000000000..24476c5d1 --- /dev/null +++ b/packages/deriv_passkeys/example/.gitignore @@ -0,0 +1,44 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/packages/deriv_passkeys/example/.metadata b/packages/deriv_passkeys/example/.metadata new file mode 100644 index 000000000..ab3e1c09c --- /dev/null +++ b/packages/deriv_passkeys/example/.metadata @@ -0,0 +1,45 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "ead455963c12b453cdb2358cad34969c76daf180" + channel: "stable" + +project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: ead455963c12b453cdb2358cad34969c76daf180 + base_revision: ead455963c12b453cdb2358cad34969c76daf180 + - platform: android + create_revision: ead455963c12b453cdb2358cad34969c76daf180 + base_revision: ead455963c12b453cdb2358cad34969c76daf180 + - platform: ios + create_revision: ead455963c12b453cdb2358cad34969c76daf180 + base_revision: ead455963c12b453cdb2358cad34969c76daf180 + - platform: linux + create_revision: ead455963c12b453cdb2358cad34969c76daf180 + base_revision: ead455963c12b453cdb2358cad34969c76daf180 + - platform: macos + create_revision: ead455963c12b453cdb2358cad34969c76daf180 + base_revision: ead455963c12b453cdb2358cad34969c76daf180 + - platform: web + create_revision: ead455963c12b453cdb2358cad34969c76daf180 + base_revision: ead455963c12b453cdb2358cad34969c76daf180 + - platform: windows + create_revision: ead455963c12b453cdb2358cad34969c76daf180 + base_revision: ead455963c12b453cdb2358cad34969c76daf180 + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/packages/deriv_passkeys/example/README.md b/packages/deriv_passkeys/example/README.md new file mode 100644 index 000000000..f121535bb --- /dev/null +++ b/packages/deriv_passkeys/example/README.md @@ -0,0 +1,8 @@ +# passkeys_poc + +Passkeys POC is a simple Flutter app that demonstrates how to use the `deriv_passkeys` package to authenticate a user in a Deriv app using the passkeys authentication method. + + +## Getting Started + +To make the example app work, you need to fill in the `appId` and `endpoint` in the `connectionInfo` object. Open the file `lib/main.dart` and locate the following code: diff --git a/packages/deriv_passkeys/example/analysis_options.yaml b/packages/deriv_passkeys/example/analysis_options.yaml new file mode 100644 index 000000000..61b6c4de1 --- /dev/null +++ b/packages/deriv_passkeys/example/analysis_options.yaml @@ -0,0 +1,29 @@ +# This file configures the analyzer, which statically analyzes Dart code to +# check for errors, warnings, and lints. +# +# The issues identified by the analyzer are surfaced in the UI of Dart-enabled +# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be +# invoked from the command line by running `flutter analyze`. + +# The following line activates a set of recommended lints for Flutter apps, +# packages, and plugins designed to encourage good coding practices. +include: package:flutter_lints/flutter.yaml + +linter: + # The lint rules applied to this project can be customized in the + # section below to disable rules from the `package:flutter_lints/flutter.yaml` + # included above or to enable additional rules. A list of all available lints + # and their documentation is published at + # https://dart-lang.github.io/linter/lints/index.html. + # + # Instead of disabling a lint rule for the entire project in the + # section below, it can also be suppressed for a single line of code + # or a specific dart file by using the `// ignore: name_of_lint` and + # `// ignore_for_file: name_of_lint` syntax on the line or in the file + # producing the lint. + rules: + # avoid_print: false # Uncomment to disable the `avoid_print` rule + # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/packages/deriv_passkeys/example/android/.gitignore b/packages/deriv_passkeys/example/android/.gitignore new file mode 100644 index 000000000..6f568019d --- /dev/null +++ b/packages/deriv_passkeys/example/android/.gitignore @@ -0,0 +1,13 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java + +# Remember to never publicly share your keystore. +# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +key.properties +**/*.keystore +**/*.jks diff --git a/packages/deriv_passkeys/example/android/app/build.gradle b/packages/deriv_passkeys/example/android/app/build.gradle new file mode 100644 index 000000000..63de18e36 --- /dev/null +++ b/packages/deriv_passkeys/example/android/app/build.gradle @@ -0,0 +1,72 @@ +def localProperties = new Properties() +def localPropertiesFile = rootProject.file('local.properties') +if (localPropertiesFile.exists()) { + localPropertiesFile.withReader('UTF-8') { reader -> + localProperties.load(reader) + } +} + +def flutterRoot = localProperties.getProperty('flutter.sdk') +if (flutterRoot == null) { + throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") +} + +def flutterVersionCode = localProperties.getProperty('flutter.versionCode') +if (flutterVersionCode == null) { + flutterVersionCode = '1' +} + +def flutterVersionName = localProperties.getProperty('flutter.versionName') +if (flutterVersionName == null) { + flutterVersionName = '1.0' +} + +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' +apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" + +android { + namespace "com.example.passkeys_poc" + compileSdk 34 + ndkVersion flutter.ndkVersion + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = '1.8' + } + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId "com.example.passkeys_poc" + // You can update the following values to match your application needs. + // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. + minSdkVersion 21 + targetSdkVersion flutter.targetSdkVersion + versionCode flutterVersionCode.toInteger() + versionName flutterVersionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig signingConfigs.debug + } + } +} + +flutter { + source '../..' +} + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" +} diff --git a/packages/deriv_passkeys/example/android/app/src/debug/AndroidManifest.xml b/packages/deriv_passkeys/example/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 000000000..399f6981d --- /dev/null +++ b/packages/deriv_passkeys/example/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/packages/deriv_passkeys/example/android/app/src/main/AndroidManifest.xml b/packages/deriv_passkeys/example/android/app/src/main/AndroidManifest.xml new file mode 100644 index 000000000..b6e879786 --- /dev/null +++ b/packages/deriv_passkeys/example/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + diff --git a/packages/deriv_passkeys/example/android/app/src/main/kotlin/com/example/passkeys_poc/MainActivity.kt b/packages/deriv_passkeys/example/android/app/src/main/kotlin/com/example/passkeys_poc/MainActivity.kt new file mode 100644 index 000000000..ede17fb8d --- /dev/null +++ b/packages/deriv_passkeys/example/android/app/src/main/kotlin/com/example/passkeys_poc/MainActivity.kt @@ -0,0 +1,5 @@ +package com.example.passkeys_poc + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() diff --git a/packages/deriv_passkeys/example/android/app/src/main/res/drawable-v21/launch_background.xml b/packages/deriv_passkeys/example/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 000000000..f74085f3f --- /dev/null +++ b/packages/deriv_passkeys/example/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/packages/deriv_passkeys/example/android/app/src/main/res/drawable/launch_background.xml b/packages/deriv_passkeys/example/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 000000000..304732f88 --- /dev/null +++ b/packages/deriv_passkeys/example/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/packages/deriv_passkeys/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/deriv_passkeys/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..db77bb4b7b0906d62b1847e87f15cdcacf6a4f29 GIT binary patch literal 544 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY3?!3`olAj~WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2!h8bpbvhu0Wd6uZuB!w&u2PAxD2eNXD>P5D~Wn-+_Wa#27Xc zC?Zj|6r#X(-D3u$NCt}(Ms06KgJ4FxJVv{GM)!I~&n8Bnc94O7-Hd)cjDZswgC;Qs zO=b+9!WcT8F?0rF7!Uys2bs@gozCP?z~o%U|N3vA*22NaGQG zlg@K`O_XuxvZ&Ks^m&R!`&1=spLvfx7oGDKDwpwW`#iqdw@AL`7MR}m`rwr|mZgU`8P7SBkL78fFf!WnuYWm$5Z0 zNXhDbCv&49sM544K|?c)WrFfiZvCi9h0O)B3Pgg&ebxsLQ05GG~ AQ2+n{ literal 0 HcmV?d00001 diff --git a/packages/deriv_passkeys/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/deriv_passkeys/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..17987b79bb8a35cc66c3c1fd44f5a5526c1b78be GIT binary patch literal 442 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-sk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5Xx&nMcT!A!W`0S9QKQy;}1Cl^CgaH=;G9cpY;r$Q>i*pfB zP2drbID<_#qf;rPZx^FqH)F_D#*k@@q03KywUtLX8Ua?`H+NMzkczFPK3lFz@i_kW%1NOn0|D2I9n9wzH8m|-tHjsw|9>@K=iMBhxvkv6m8Y-l zytQ?X=U+MF$@3 zt`~i=@j|6y)RWMK--}M|=T`o&^Ni>IoWKHEbBXz7?A@mgWoL>!*SXo`SZH-*HSdS+ yn*9;$7;m`l>wYBC5bq;=U}IMqLzqbYCidGC!)_gkIk_C@Uy!y&wkt5C($~2D>~)O*cj@FGjOCM)M>_ixfudOh)?xMu#Fs z#}Y=@YDTwOM)x{K_j*Q;dPdJ?Mz0n|pLRx{4n|)f>SXlmV)XB04CrSJn#dS5nK2lM zrZ9#~WelCp7&e13Y$jvaEXHskn$2V!!DN-nWS__6T*l;H&Fopn?A6HZ-6WRLFP=R` zqG+CE#d4|IbyAI+rJJ`&x9*T`+a=p|0O(+s{UBcyZdkhj=yS1>AirP+0R;mf2uMgM zC}@~JfByORAh4SyRgi&!(cja>F(l*O+nd+@4m$|6K6KDn_&uvCpV23&>G9HJp{xgg zoq1^2_p9@|WEo z*X_Uko@K)qYYv~>43eQGMdbiGbo>E~Q& zrYBH{QP^@Sti!`2)uG{irBBq@y*$B zi#&(U-*=fp74j)RyIw49+0MRPMRU)+a2r*PJ$L5roHt2$UjExCTZSbq%V!HeS7J$N zdG@vOZB4v_lF7Plrx+hxo7(fCV&}fHq)$ literal 0 HcmV?d00001 diff --git a/packages/deriv_passkeys/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/deriv_passkeys/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..d5f1c8d34e7a88e3f88bea192c3a370d44689c3c GIT binary patch literal 1031 zcmeAS@N?(olHy`uVBq!ia0vp^6F``Q8Ax83A=Cw=BuiW)N`mv#O3D+9QW+dm@{>{( zJaZG%Q-e|yQz{EjrrIztFa`(sgt!6~Yi|1%a`XoT0ojZ}lNrNjb9xjc(B0U1_% zz5^97Xt*%oq$rQy4?0GKNfJ44uvxI)gC`h-NZ|&0-7(qS@?b!5r36oQ}zyZrNO3 zMO=Or+<~>+A&uN&E!^Sl+>xE!QC-|oJv`ApDhqC^EWD|@=#J`=d#Xzxs4ah}w&Jnc z$|q_opQ^2TrnVZ0o~wh<3t%W&flvYGe#$xqda2bR_R zvPYgMcHgjZ5nSA^lJr%;<&0do;O^tDDh~=pIxA#coaCY>&N%M2^tq^U%3DB@ynvKo}b?yu-bFc-u0JHzced$sg7S3zqI(2 z#Km{dPr7I=pQ5>FuK#)QwK?Y`E`B?nP+}U)I#c1+FM*1kNvWG|a(TpksZQ3B@sD~b zpQ2)*V*TdwjFOtHvV|;OsiDqHi=6%)o4b!)x$)%9pGTsE z-JL={-Ffv+T87W(Xpooq<`r*VzWQcgBN$$`u}f>-ZQI1BB8ykN*=e4rIsJx9>z}*o zo~|9I;xof literal 0 HcmV?d00001 diff --git a/packages/deriv_passkeys/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/deriv_passkeys/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..4d6372eebdb28e45604e46eeda8dd24651419bc0 GIT binary patch literal 1443 zcmb`G{WsKk6vsdJTdFg%tJav9_E4vzrOaqkWF|A724Nly!y+?N9`YV6wZ}5(X(D_N(?!*n3`|_r0Hc?=PQw&*vnU?QTFY zB_MsH|!j$PP;I}?dppoE_gA(4uc!jV&0!l7_;&p2^pxNo>PEcNJv za5_RT$o2Mf!<+r?&EbHH6nMoTsDOa;mN(wv8RNsHpG)`^ymG-S5By8=l9iVXzN_eG%Xg2@Xeq76tTZ*dGh~Lo9vl;Zfs+W#BydUw zCkZ$o1LqWQO$FC9aKlLl*7x9^0q%0}$OMlp@Kk_jHXOjofdePND+j!A{q!8~Jn+s3 z?~~w@4?egS02}8NuulUA=L~QQfm;MzCGd)XhiftT;+zFO&JVyp2mBww?;QByS_1w! zrQlx%{^cMj0|Bo1FjwY@Q8?Hx0cIPF*@-ZRFpPc#bBw{5@tD(5%sClzIfl8WU~V#u zm5Q;_F!wa$BSpqhN>W@2De?TKWR*!ujY;Yylk_X5#~V!L*Gw~;$%4Q8~Mad z@`-kG?yb$a9cHIApZDVZ^U6Xkp<*4rU82O7%}0jjHlK{id@?-wpN*fCHXyXh(bLt* zPc}H-x0e4E&nQ>y%B-(EL=9}RyC%MyX=upHuFhAk&MLbsF0LP-q`XnH78@fT+pKPW zu72MW`|?8ht^tz$iC}ZwLp4tB;Q49K!QCF3@!iB1qOI=?w z7In!}F~ij(18UYUjnbmC!qKhPo%24?8U1x{7o(+?^Zu0Hx81|FuS?bJ0jgBhEMzf< zCgUq7r2OCB(`XkKcN-TL>u5y#dD6D!)5W?`O5)V^>jb)P)GBdy%t$uUMpf$SNV31$ zb||OojAbvMP?T@$h_ZiFLFVHDmbyMhJF|-_)HX3%m=CDI+ID$0^C>kzxprBW)hw(v zr!Gmda);ICoQyhV_oP5+C%?jcG8v+D@9f?Dk*!BxY}dazmrT@64UrP3hlslANK)bq z$67n83eh}OeW&SV@HG95P|bjfqJ7gw$e+`Hxo!4cx`jdK1bJ>YDSpGKLPZ^1cv$ek zIB?0S<#tX?SJCLWdMd{-ME?$hc7A$zBOdIJ)4!KcAwb=VMov)nK;9z>x~rfT1>dS+ zZ6#`2v@`jgbqq)P22H)Tx2CpmM^o1$B+xT6`(v%5xJ(?j#>Q$+rx_R|7TzDZe{J6q zG1*EcU%tE?!kO%^M;3aM6JN*LAKUVb^xz8-Pxo#jR5(-KBeLJvA@-gxNHx0M-ZJLl z;#JwQoh~9V?`UVo#}{6ka@II>++D@%KqGpMdlQ}?9E*wFcf5(#XQnP$Dk5~%iX^>f z%$y;?M0BLp{O3a(-4A?ewryHrrD%cx#Q^%KY1H zNre$ve+vceSLZcNY4U(RBX&)oZn*Py()h)XkE?PL$!bNb{N5FVI2Y%LKEm%yvpyTP z(1P?z~7YxD~Rf<(a@_y` literal 0 HcmV?d00001 diff --git a/packages/deriv_passkeys/example/android/app/src/main/res/values-night/styles.xml b/packages/deriv_passkeys/example/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 000000000..06952be74 --- /dev/null +++ b/packages/deriv_passkeys/example/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/packages/deriv_passkeys/example/android/app/src/main/res/values/styles.xml b/packages/deriv_passkeys/example/android/app/src/main/res/values/styles.xml new file mode 100644 index 000000000..cb1ef8805 --- /dev/null +++ b/packages/deriv_passkeys/example/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/packages/deriv_passkeys/example/android/app/src/profile/AndroidManifest.xml b/packages/deriv_passkeys/example/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 000000000..399f6981d --- /dev/null +++ b/packages/deriv_passkeys/example/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/packages/deriv_passkeys/example/android/build.gradle b/packages/deriv_passkeys/example/android/build.gradle new file mode 100644 index 000000000..f7eb7f63c --- /dev/null +++ b/packages/deriv_passkeys/example/android/build.gradle @@ -0,0 +1,31 @@ +buildscript { + ext.kotlin_version = '1.7.10' + repositories { + google() + mavenCentral() + } + + dependencies { + classpath 'com.android.tools.build:gradle:7.3.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +allprojects { + repositories { + google() + mavenCentral() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(':app') +} + +tasks.register("clean", Delete) { + delete rootProject.buildDir +} diff --git a/packages/deriv_passkeys/example/android/gradle.properties b/packages/deriv_passkeys/example/android/gradle.properties new file mode 100644 index 000000000..94adc3a3f --- /dev/null +++ b/packages/deriv_passkeys/example/android/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.jvmargs=-Xmx1536M +android.useAndroidX=true +android.enableJetifier=true diff --git a/packages/deriv_passkeys/example/android/settings.gradle b/packages/deriv_passkeys/example/android/settings.gradle new file mode 100644 index 000000000..44e62bcf0 --- /dev/null +++ b/packages/deriv_passkeys/example/android/settings.gradle @@ -0,0 +1,11 @@ +include ':app' + +def localPropertiesFile = new File(rootProject.projectDir, "local.properties") +def properties = new Properties() + +assert localPropertiesFile.exists() +localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + +def flutterSdkPath = properties.getProperty("flutter.sdk") +assert flutterSdkPath != null, "flutter.sdk not set in local.properties" +apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" diff --git a/packages/deriv_passkeys/example/devtools_options.yaml b/packages/deriv_passkeys/example/devtools_options.yaml new file mode 100644 index 000000000..7e7e7f67d --- /dev/null +++ b/packages/deriv_passkeys/example/devtools_options.yaml @@ -0,0 +1 @@ +extensions: diff --git a/packages/deriv_passkeys/example/ios/.gitignore b/packages/deriv_passkeys/example/ios/.gitignore new file mode 100644 index 000000000..7a7f9873a --- /dev/null +++ b/packages/deriv_passkeys/example/ios/.gitignore @@ -0,0 +1,34 @@ +**/dgph +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/ephemeral/ +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/packages/deriv_passkeys/example/ios/Flutter/AppFrameworkInfo.plist b/packages/deriv_passkeys/example/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 000000000..7c5696400 --- /dev/null +++ b/packages/deriv_passkeys/example/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 12.0 + + diff --git a/packages/deriv_passkeys/example/ios/Flutter/Debug.xcconfig b/packages/deriv_passkeys/example/ios/Flutter/Debug.xcconfig new file mode 100644 index 000000000..ec97fc6f3 --- /dev/null +++ b/packages/deriv_passkeys/example/ios/Flutter/Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "Generated.xcconfig" diff --git a/packages/deriv_passkeys/example/ios/Flutter/Release.xcconfig b/packages/deriv_passkeys/example/ios/Flutter/Release.xcconfig new file mode 100644 index 000000000..c4855bfe2 --- /dev/null +++ b/packages/deriv_passkeys/example/ios/Flutter/Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "Generated.xcconfig" diff --git a/packages/deriv_passkeys/example/ios/Podfile b/packages/deriv_passkeys/example/ios/Podfile new file mode 100644 index 000000000..9b392a5ea --- /dev/null +++ b/packages/deriv_passkeys/example/ios/Podfile @@ -0,0 +1,43 @@ +platform :ios, '12.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/packages/deriv_passkeys/example/ios/Podfile.lock b/packages/deriv_passkeys/example/ios/Podfile.lock new file mode 100644 index 000000000..81840226b --- /dev/null +++ b/packages/deriv_passkeys/example/ios/Podfile.lock @@ -0,0 +1,85 @@ +PODS: + - connectivity_plus (0.0.1): + - Flutter + - ReachabilitySwift + - deriv_passkeys (0.0.1): + - Flutter + - device_info_plus (0.0.1): + - Flutter + - Flutter (1.0.0) + - flutter_deriv_api (0.0.1): + - Flutter + - flutter_inappwebview_ios (0.0.1): + - Flutter + - flutter_inappwebview_ios/Core (= 0.0.1) + - OrderedSet (~> 5.0) + - flutter_inappwebview_ios/Core (0.0.1): + - Flutter + - OrderedSet (~> 5.0) + - flutter_system_proxy (0.0.1): + - Flutter + - OrderedSet (5.0.0) + - package_info_plus (0.4.5): + - Flutter + - ReachabilitySwift (5.0.0) + - url_launcher_ios (0.0.1): + - Flutter + - webview_flutter_wkwebview (0.0.1): + - Flutter + +DEPENDENCIES: + - connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`) + - deriv_passkeys (from `.symlinks/plugins/deriv_passkeys/ios`) + - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`) + - Flutter (from `Flutter`) + - flutter_deriv_api (from `.symlinks/plugins/flutter_deriv_api/ios`) + - flutter_inappwebview_ios (from `.symlinks/plugins/flutter_inappwebview_ios/ios`) + - flutter_system_proxy (from `.symlinks/plugins/flutter_system_proxy/ios`) + - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) + - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) + - webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`) + +SPEC REPOS: + trunk: + - OrderedSet + - ReachabilitySwift + +EXTERNAL SOURCES: + connectivity_plus: + :path: ".symlinks/plugins/connectivity_plus/ios" + deriv_passkeys: + :path: ".symlinks/plugins/deriv_passkeys/ios" + device_info_plus: + :path: ".symlinks/plugins/device_info_plus/ios" + Flutter: + :path: Flutter + flutter_deriv_api: + :path: ".symlinks/plugins/flutter_deriv_api/ios" + flutter_inappwebview_ios: + :path: ".symlinks/plugins/flutter_inappwebview_ios/ios" + flutter_system_proxy: + :path: ".symlinks/plugins/flutter_system_proxy/ios" + package_info_plus: + :path: ".symlinks/plugins/package_info_plus/ios" + url_launcher_ios: + :path: ".symlinks/plugins/url_launcher_ios/ios" + webview_flutter_wkwebview: + :path: ".symlinks/plugins/webview_flutter_wkwebview/ios" + +SPEC CHECKSUMS: + connectivity_plus: bf0076dd84a130856aa636df1c71ccaff908fa1d + deriv_passkeys: fadd039a48bae6f15ba8b955481a0f8f2b5bdede + device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed + Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 + flutter_deriv_api: 9e29abd7cc5091b72303f9c8be549618415f1437 + flutter_inappwebview_ios: 97215cf7d4677db55df76782dbd2930c5e1c1ea0 + flutter_system_proxy: 96eb97e3857a1d1bc533a6f7387a1f0dcb63d782 + OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c + package_info_plus: 115f4ad11e0698c8c1c5d8a689390df880f47e85 + ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825 + url_launcher_ios: bbd758c6e7f9fd7b5b1d4cde34d2b95fcce5e812 + webview_flutter_wkwebview: 4f3e50f7273d31e5500066ed267e3ae4309c5ae4 + +PODFILE CHECKSUM: 23c5db403a9f2d103e08afd68b26a1601b49de37 + +COCOAPODS: 1.15.2 diff --git a/packages/deriv_passkeys/example/ios/Runner.xcodeproj/project.pbxproj b/packages/deriv_passkeys/example/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 000000000..2aab18b65 --- /dev/null +++ b/packages/deriv_passkeys/example/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,747 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 747C8817C0330ABBFB890B14 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1C7398745361BCCB0E96EA4D /* Pods_Runner.framework */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 912B875A1A7FB5C581324BD6 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D7BD61FE28A65EBE1195EF83 /* Pods_RunnerTests.framework */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 97C146E61CF9000F007C117D /* Project object */; + proxyType = 1; + remoteGlobalIDString = 97C146ED1CF9000F007C117D; + remoteInfo = Runner; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 1C7398745361BCCB0E96EA4D /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 49A0B9C2519474E7D84EAC8C /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + 532A03FC307182502C1BD3CD /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + 5C02BF7919AD58348F432BF5 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 7D84192F82F1C69314508FE0 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; + 7F9ECC56F29EED37FD5095E7 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 9AFCD78B2B50133C003DE0AD /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = ""; }; + CBC9E18AB54CF7F16148E91E /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; + D7BD61FE28A65EBE1195EF83 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 29E5AF7624FE1A1191CC1B37 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 912B875A1A7FB5C581324BD6 /* Pods_RunnerTests.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 747C8817C0330ABBFB890B14 /* Pods_Runner.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 331C8082294A63A400263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C807B294A618700263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 845CB8412A1191B744F55060 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 1C7398745361BCCB0E96EA4D /* Pods_Runner.framework */, + D7BD61FE28A65EBE1195EF83 /* Pods_RunnerTests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 8669CBC0392B21497E31E534 /* Pods */ = { + isa = PBXGroup; + children = ( + 7F9ECC56F29EED37FD5095E7 /* Pods-Runner.debug.xcconfig */, + 49A0B9C2519474E7D84EAC8C /* Pods-Runner.release.xcconfig */, + 532A03FC307182502C1BD3CD /* Pods-Runner.profile.xcconfig */, + CBC9E18AB54CF7F16148E91E /* Pods-RunnerTests.debug.xcconfig */, + 5C02BF7919AD58348F432BF5 /* Pods-RunnerTests.release.xcconfig */, + 7D84192F82F1C69314508FE0 /* Pods-RunnerTests.profile.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + 331C8082294A63A400263BE5 /* RunnerTests */, + 8669CBC0392B21497E31E534 /* Pods */, + 845CB8412A1191B744F55060 /* Frameworks */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + 331C8081294A63A400263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 9AFCD78B2B50133C003DE0AD /* Runner.entitlements */, + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C8080294A63A400263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 78EBCC64ED315B282CABDF60 /* [CP] Check Pods Manifest.lock */, + 331C807D294A63A400263BE5 /* Sources */, + 331C807F294A63A400263BE5 /* Resources */, + 29E5AF7624FE1A1191CC1B37 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 331C8086294A63A400263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + BBFD2B46E15A0299A268D1AE /* [CP] Check Pods Manifest.lock */, + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + F0ABF9E044B3B98C9A697E0E /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 1430; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C8080294A63A400263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 97C146ED1CF9000F007C117D; + }; + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + 331C8080294A63A400263BE5 /* RunnerTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C807F294A63A400263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 78EBCC64ED315B282CABDF60 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; + BBFD2B46E15A0299A268D1AE /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + F0ABF9E044B3B98C9A697E0E /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C807D294A63A400263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C8086294A63A400263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 97C146ED1CF9000F007C117D /* Runner */; + targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; + CODE_SIGN_IDENTITY = "Apple Development"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Manual; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 36S5Q8S4V5; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.deriv.sample; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Deriv sample app development profile"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 331C8088294A63A400263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = CBC9E18AB54CF7F16148E91E /* Pods-RunnerTests.debug.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.deriv.sample.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Debug; + }; + 331C8089294A63A400263BE5 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 5C02BF7919AD58348F432BF5 /* Pods-RunnerTests.release.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.deriv.sample.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Release; + }; + 331C808A294A63A400263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7D84192F82F1C69314508FE0 /* Pods-RunnerTests.profile.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.deriv.sample.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; + CODE_SIGN_IDENTITY = "Apple Development"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Manual; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 36S5Q8S4V5; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.deriv.sample; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Deriv sample app development profile"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; + CODE_SIGN_IDENTITY = "Apple Development"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Manual; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 36S5Q8S4V5; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.deriv.sample; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Deriv sample app development profile"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C8088294A63A400263BE5 /* Debug */, + 331C8089294A63A400263BE5 /* Release */, + 331C808A294A63A400263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/packages/deriv_passkeys/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/deriv_passkeys/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..919434a62 --- /dev/null +++ b/packages/deriv_passkeys/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/packages/deriv_passkeys/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/deriv_passkeys/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000..18d981003 --- /dev/null +++ b/packages/deriv_passkeys/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/packages/deriv_passkeys/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/packages/deriv_passkeys/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 000000000..f9b0d7c5e --- /dev/null +++ b/packages/deriv_passkeys/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/packages/deriv_passkeys/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/deriv_passkeys/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 000000000..87131a09b --- /dev/null +++ b/packages/deriv_passkeys/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/deriv_passkeys/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/deriv_passkeys/example/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..21a3cc14c --- /dev/null +++ b/packages/deriv_passkeys/example/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/packages/deriv_passkeys/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/deriv_passkeys/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000..18d981003 --- /dev/null +++ b/packages/deriv_passkeys/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/packages/deriv_passkeys/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/packages/deriv_passkeys/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 000000000..f9b0d7c5e --- /dev/null +++ b/packages/deriv_passkeys/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/packages/deriv_passkeys/example/ios/Runner/AppDelegate.swift b/packages/deriv_passkeys/example/ios/Runner/AppDelegate.swift new file mode 100644 index 000000000..70693e4a8 --- /dev/null +++ b/packages/deriv_passkeys/example/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import UIKit +import Flutter + +@UIApplicationMain +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..d36b1fab2 --- /dev/null +++ b/packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 0000000000000000000000000000000000000000..dc9ada4725e9b0ddb1deab583e5b5102493aa332 GIT binary patch literal 10932 zcmeHN2~<R zh`|8`A_PQ1nSu(UMFx?8j8PC!!VDphaL#`F42fd#7Vlc`zIE4n%Y~eiz4y1j|NDpi z?<@|pSJ-HM`qifhf@m%MamgwK83`XpBA<+azdF#2QsT{X@z0A9Bq>~TVErigKH1~P zRX-!h-f0NJ4Mh++{D}J+K>~~rq}d%o%+4dogzXp7RxX4C>Km5XEI|PAFDmo;DFm6G zzjVoB`@qW98Yl0Kvc-9w09^PrsobmG*Eju^=3f?0o-t$U)TL1B3;sZ^!++3&bGZ!o-*6w?;oOhf z=A+Qb$scV5!RbG+&2S}BQ6YH!FKb0``VVX~T$dzzeSZ$&9=X$3)_7Z{SspSYJ!lGE z7yig_41zpQ)%5dr4ff0rh$@ky3-JLRk&DK)NEIHecf9c*?Z1bUB4%pZjQ7hD!A0r-@NF(^WKdr(LXj|=UE7?gBYGgGQV zidf2`ZT@pzXf7}!NH4q(0IMcxsUGDih(0{kRSez&z?CFA0RVXsVFw3^u=^KMtt95q z43q$b*6#uQDLoiCAF_{RFc{!H^moH_cmll#Fc^KXi{9GDl{>%+3qyfOE5;Zq|6#Hb zp^#1G+z^AXfRKaa9HK;%b3Ux~U@q?xg<2DXP%6k!3E)PA<#4$ui8eDy5|9hA5&{?v z(-;*1%(1~-NTQ`Is1_MGdQ{+i*ccd96ab$R$T3=% zw_KuNF@vI!A>>Y_2pl9L{9h1-C6H8<)J4gKI6{WzGBi<@u3P6hNsXG=bRq5c+z;Gc3VUCe;LIIFDmQAGy+=mRyF++u=drBWV8-^>0yE9N&*05XHZpPlE zxu@?8(ZNy7rm?|<+UNe0Vs6&o?l`Pt>P&WaL~M&#Eh%`rg@Mbb)J&@DA-wheQ>hRV z<(XhigZAT z>=M;URcdCaiO3d^?H<^EiEMDV+7HsTiOhoaMX%P65E<(5xMPJKxf!0u>U~uVqnPN7T!X!o@_gs3Ct1 zlZ_$5QXP4{Aj645wG_SNT&6m|O6~Tsl$q?nK*)(`{J4b=(yb^nOATtF1_aS978$x3 zx>Q@s4i3~IT*+l{@dx~Hst21fR*+5}S1@cf>&8*uLw-0^zK(+OpW?cS-YG1QBZ5q! zgTAgivzoF#`cSz&HL>Ti!!v#?36I1*l^mkrx7Y|K6L#n!-~5=d3;K<;Zqi|gpNUn_ z_^GaQDEQ*jfzh;`j&KXb66fWEk1K7vxQIMQ_#Wu_%3 z4Oeb7FJ`8I>Px;^S?)}2+4D_83gHEq>8qSQY0PVP?o)zAv3K~;R$fnwTmI-=ZLK`= zTm+0h*e+Yfr(IlH3i7gUclNH^!MU>id$Jw>O?2i0Cila#v|twub21@e{S2v}8Z13( zNDrTXZVgris|qYm<0NU(tAPouG!QF4ZNpZPkX~{tVf8xY690JqY1NVdiTtW+NqyRP zZ&;T0ikb8V{wxmFhlLTQ&?OP7 z;(z*<+?J2~z*6asSe7h`$8~Se(@t(#%?BGLVs$p``;CyvcT?7Y!{tIPva$LxCQ&4W z6v#F*);|RXvI%qnoOY&i4S*EL&h%hP3O zLsrFZhv&Hu5tF$Lx!8(hs&?!Kx5&L(fdu}UI5d*wn~A`nPUhG&Rv z2#ixiJdhSF-K2tpVL=)5UkXRuPAFrEW}7mW=uAmtVQ&pGE-&az6@#-(Te^n*lrH^m@X-ftVcwO_#7{WI)5v(?>uC9GG{lcGXYJ~Q8q zbMFl7;t+kV;|;KkBW2!P_o%Czhw&Q(nXlxK9ak&6r5t_KH8#1Mr-*0}2h8R9XNkr zto5-b7P_auqTJb(TJlmJ9xreA=6d=d)CVbYP-r4$hDn5|TIhB>SReMfh&OVLkMk-T zYf%$taLF0OqYF?V{+6Xkn>iX@TuqQ?&cN6UjC9YF&%q{Ut3zv{U2)~$>-3;Dp)*(? zg*$mu8^i=-e#acaj*T$pNowo{xiGEk$%DusaQiS!KjJH96XZ-hXv+jk%ard#fu=@Q z$AM)YWvE^{%tDfK%nD49=PI|wYu}lYVbB#a7wtN^Nml@CE@{Gv7+jo{_V?I*jkdLD zJE|jfdrmVbkfS>rN*+`#l%ZUi5_bMS<>=MBDNlpiSb_tAF|Zy`K7kcp@|d?yaTmB^ zo?(vg;B$vxS|SszusORgDg-*Uitzdi{dUV+glA~R8V(?`3GZIl^egW{a919!j#>f` znL1o_^-b`}xnU0+~KIFLQ)$Q6#ym%)(GYC`^XM*{g zv3AM5$+TtDRs%`2TyR^$(hqE7Y1b&`Jd6dS6B#hDVbJlUXcG3y*439D8MrK!2D~6gn>UD4Imctb z+IvAt0iaW73Iq$K?4}H`7wq6YkTMm`tcktXgK0lKPmh=>h+l}Y+pDtvHnG>uqBA)l zAH6BV4F}v$(o$8Gfo*PB>IuaY1*^*`OTx4|hM8jZ?B6HY;F6p4{`OcZZ(us-RVwDx zUzJrCQlp@mz1ZFiSZ*$yX3c_#h9J;yBE$2g%xjmGF4ca z&yL`nGVs!Zxsh^j6i%$a*I3ZD2SoNT`{D%mU=LKaEwbN(_J5%i-6Va?@*>=3(dQy` zOv%$_9lcy9+(t>qohkuU4r_P=R^6ME+wFu&LA9tw9RA?azGhjrVJKy&8=*qZT5Dr8g--d+S8zAyJ$1HlW3Olryt`yE zFIph~Z6oF&o64rw{>lgZISC6p^CBer9C5G6yq%?8tC+)7*d+ib^?fU!JRFxynRLEZ zj;?PwtS}Ao#9whV@KEmwQgM0TVP{hs>dg(1*DiMUOKHdQGIqa0`yZnHk9mtbPfoLx zo;^V6pKUJ!5#n`w2D&381#5#_t}AlTGEgDz$^;u;-vxDN?^#5!zN9ngytY@oTv!nc zp1Xn8uR$1Z;7vY`-<*?DfPHB;x|GUi_fI9@I9SVRv1)qETbNU_8{5U|(>Du84qP#7 z*l9Y$SgA&wGbj>R1YeT9vYjZuC@|{rajTL0f%N@>3$DFU=`lSPl=Iv;EjuGjBa$Gw zHD-;%YOE@<-!7-Mn`0WuO3oWuL6tB2cpPw~Nvuj|KM@))ixuDK`9;jGMe2d)7gHin zS<>k@!x;!TJEc#HdL#RF(`|4W+H88d4V%zlh(7#{q2d0OQX9*FW^`^_<3r$kabWAB z$9BONo5}*(%kx zOXi-yM_cmB3>inPpI~)duvZykJ@^^aWzQ=eQ&STUa}2uT@lV&WoRzkUoE`rR0)`=l zFT%f|LA9fCw>`enm$p7W^E@U7RNBtsh{_-7vVz3DtB*y#*~(L9+x9*wn8VjWw|Q~q zKFsj1Yl>;}%MG3=PY`$g$_mnyhuV&~O~u~)968$0b2!Jkd;2MtAP#ZDYw9hmK_+M$ zb3pxyYC&|CuAbtiG8HZjj?MZJBFbt`ryf+c1dXFuC z0*ZQhBzNBd*}s6K_G}(|Z_9NDV162#y%WSNe|FTDDhx)K!c(mMJh@h87@8(^YdK$&d*^WQe8Z53 z(|@MRJ$Lk-&ii74MPIs80WsOFZ(NX23oR-?As+*aq6b?~62@fSVmM-_*cb1RzZ)`5$agEiL`-E9s7{GM2?(KNPgK1(+c*|-FKoy}X(D_b#etO|YR z(BGZ)0Ntfv-7R4GHoXp?l5g#*={S1{u-QzxCGng*oWr~@X-5f~RA14b8~B+pLKvr4 zfgL|7I>jlak9>D4=(i(cqYf7#318!OSR=^`xxvI!bBlS??`xxWeg?+|>MxaIdH1U~#1tHu zB{QMR?EGRmQ_l4p6YXJ{o(hh-7Tdm>TAX380TZZZyVkqHNzjUn*_|cb?T? zt;d2s-?B#Mc>T-gvBmQZx(y_cfkXZO~{N zT6rP7SD6g~n9QJ)8F*8uHxTLCAZ{l1Y&?6v)BOJZ)=R-pY=Y=&1}jE7fQ>USS}xP#exo57uND0i*rEk@$;nLvRB@u~s^dwRf?G?_enN@$t* zbL%JO=rV(3Ju8#GqUpeE3l_Wu1lN9Y{D4uaUe`g>zlj$1ER$6S6@{m1!~V|bYkhZA z%CvrDRTkHuajMU8;&RZ&itnC~iYLW4DVkP<$}>#&(`UO>!n)Po;Mt(SY8Yb`AS9lt znbX^i?Oe9r_o=?})IHKHoQGKXsps_SE{hwrg?6dMI|^+$CeC&z@*LuF+P`7LfZ*yr+KN8B4{Nzv<`A(wyR@!|gw{zB6Ha ziwPAYh)oJ(nlqSknu(8g9N&1hu0$vFK$W#mp%>X~AU1ay+EKWcFdif{% z#4!4aoVVJ;ULmkQf!ke2}3hqxLK>eq|-d7Ly7-J9zMpT`?dxo6HdfJA|t)?qPEVBDv z{y_b?4^|YA4%WW0VZd8C(ZgQzRI5(I^)=Ub`Y#MHc@nv0w-DaJAqsbEHDWG8Ia6ju zo-iyr*sq((gEwCC&^TYBWt4_@|81?=B-?#P6NMff(*^re zYqvDuO`K@`mjm_Jd;mW_tP`3$cS?R$jR1ZN09$YO%_iBqh5ftzSpMQQtxKFU=FYmP zeY^jph+g<4>YO;U^O>-NFLn~-RqlHvnZl2yd2A{Yc1G@Ga$d+Q&(f^tnPf+Z7serIU};17+2DU_f4Z z@GaPFut27d?!YiD+QP@)T=77cR9~MK@bd~pY%X(h%L={{OIb8IQmf-!xmZkm8A0Ga zQSWONI17_ru5wpHg3jI@i9D+_Y|pCqVuHJNdHUauTD=R$JcD2K_liQisqG$(sm=k9;L* z!L?*4B~ql7uioSX$zWJ?;q-SWXRFhz2Jt4%fOHA=Bwf|RzhwqdXGr78y$J)LR7&3T zE1WWz*>GPWKZ0%|@%6=fyx)5rzUpI;bCj>3RKzNG_1w$fIFCZ&UR0(7S?g}`&Pg$M zf`SLsz8wK82Vyj7;RyKmY{a8G{2BHG%w!^T|Njr!h9TO2LaP^_f22Q1=l$QiU84ao zHe_#{S6;qrC6w~7{y(hs-?-j?lbOfgH^E=XcSgnwW*eEz{_Z<_xN#0001NP)t-s|Ns9~ z#rXRE|M&d=0au&!`~QyF`q}dRnBDt}*!qXo`c{v z{Djr|@Adh0(D_%#_&mM$D6{kE_x{oE{l@J5@%H*?%=t~i_`ufYOPkAEn!pfkr2$fs z652Tz0001XNklqeeKN4RM4i{jKqmiC$?+xN>3Apn^ z0QfuZLym_5b<*QdmkHjHlj811{If)dl(Z2K0A+ekGtrFJb?g|wt#k#pV-#A~bK=OT ts8>{%cPtyC${m|1#B1A6#u!Q;umknL1chzTM$P~L002ovPDHLkV1lTfnu!1a literal 0 HcmV?d00001 diff --git a/packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..797d452e458972bab9d994556c8305db4c827017 GIT binary patch literal 406 zcmV;H0crk;P))>cdjpWt&rLJgVp-t?DREyuq1A%0Z4)6_WsQ7{nzjN zo!X zGXV)2i3kcZIL~_j>uIKPK_zib+3T+Nt3Mb&Br)s)UIaA}@p{wDda>7=Q|mGRp7pqY zkJ!7E{MNz$9nOwoVqpFb)}$IP24Wn2JJ=Cw(!`OXJBr45rP>>AQr$6c7slJWvbpNW z@KTwna6d?PP>hvXCcp=4F;=GR@R4E7{4VU^0p4F>v^#A|>07*qoM6N<$f*5nx ACIA2c literal 0 HcmV?d00001 diff --git a/packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..6ed2d933e1120817fe9182483a228007b18ab6ae GIT binary patch literal 450 zcmV;z0X_bSP)iGWQ_5NJQ_~rNh*z)}eT%KUb z`7gNk0#AwF^#0T0?hIa^`~Ck;!}#m+_uT050aTR(J!bU#|IzRL%^UsMS#KsYnTF*!YeDOytlP4VhV?b} z%rz_<=#CPc)tU1MZTq~*2=8~iZ!lSa<{9b@2Jl;?IEV8)=fG217*|@)CCYgFze-x? zIFODUIA>nWKpE+bn~n7;-89sa>#DR>TSlqWk*!2hSN6D~Qb#VqbP~4Fk&m`@1$JGr zXPIdeRE&b2Thd#{MtDK$px*d3-Wx``>!oimf%|A-&-q*6KAH)e$3|6JV%HX{Hig)k suLT-RhftRq8b9;(V=235Wa|I=027H2wCDra;{X5v07*qoM6N<$f;9x^2LJ#7 literal 0 HcmV?d00001 diff --git a/packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 0000000000000000000000000000000000000000..4cd7b0099ca80c806f8fe495613e8d6c69460d76 GIT binary patch literal 282 zcmV+#0p(^bcu7P-R4C8Q z&e;xxFbF_Vrezo%_kH*OKhshZ6BFpG-Y1e10`QXJKbND7AMQ&cMj60B5TNObaZxYybcN07*qoM6N<$g3m;S%K!iX literal 0 HcmV?d00001 diff --git a/packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..fe730945a01f64a61e2235dbe3f45b08f7729182 GIT binary patch literal 462 zcmV;<0WtoGP)-}iV`2<;=$?g5M=KQbZ{F&YRNy7Nn@%_*5{gvDM0aKI4?ESmw z{NnZg)A0R`+4?NF_RZexyVB&^^ZvN!{I28tr{Vje;QNTz`dG&Jz0~Ek&f2;*Z7>B|cg}xYpxEFY+0YrKLF;^Q+-HreN0P{&i zK~zY`?b7ECf-n?@;d<&orQ*Q7KoR%4|C>{W^h6@&01>0SKS`dn{Q}GT%Qj_{PLZ_& zs`MFI#j-(>?bvdZ!8^xTwlY{qA)T4QLbY@j(!YJ7aXJervHy6HaG_2SB`6CC{He}f zHVw(fJWApwPq!6VY7r1w-Fs)@ox~N+q|w~e;JI~C4Vf^@d>Wvj=fl`^u9x9wd9 zR%3*Q+)t%S!MU_`id^@&Y{y7-r98lZX0?YrHlfmwb?#}^1b{8g&KzmkE(L>Z&)179 zp<)v6Y}pRl100G2FL_t(o!|l{-Q-VMg#&MKg7c{O0 z2wJImOS3Gy*Z2Qifdv~JYOp;v+U)a|nLoc7hNH;I$;lzDt$}rkaFw1mYK5_0Q(Sut zvbEloxON7$+HSOgC9Z8ltuC&0OSF!-mXv5caV>#bc3@hBPX@I$58-z}(ZZE!t-aOG zpjNkbau@>yEzH(5Yj4kZiMH32XI!4~gVXNnjAvRx;Sdg^`>2DpUEwoMhTs_st8pKG z(%SHyHdU&v%f36~uERh!bd`!T2dw;z6PrOTQ7Vt*#9F2uHlUVnb#ev_o^fh}Dzmq} zWtlk35}k=?xj28uO|5>>$yXadTUE@@IPpgH`gJ~Ro4>jd1IF|(+IX>8M4Ps{PNvmI zNj4D+XgN83gPt_Gm}`Ybv{;+&yu-C(Grdiahmo~BjG-l&mWM+{e5M1sm&=xduwgM9 z`8OEh`=F3r`^E{n_;%9weN{cf2%7=VzC@cYj+lg>+3|D|_1C@{hcU(DyQG_BvBWe? zvTv``=%b1zrol#=R`JB)>cdjpWt&rLJgVp-t?DREyuq1A%0Z4)6_WsQ7{nzjN zo!X zGXV)2i3kcZIL~_j>uIKPK_zib+3T+Nt3Mb&Br)s)UIaA}@p{wDda>7=Q|mGRp7pqY zkJ!7E{MNz$9nOwoVqpFb)}$IP24Wn2JJ=Cw(!`OXJBr45rP>>AQr$6c7slJWvbpNW z@KTwna6d?PP>hvXCcp=4F;=GR@R4E7{4VU^0p4F>v^#A|>07*qoM6N<$f*5nx ACIA2c literal 0 HcmV?d00001 diff --git a/packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..502f463a9bc882b461c96aadf492d1729e49e725 GIT binary patch literal 586 zcmV-Q0=4~#P)+}#`wDE{8-2Mebf5<{{PqV{TgVcv*r8?UZ3{-|G?_}T*&y;@cqf{ z{Q*~+qr%%p!1pS*_Uicl#q9lc(D`!D`LN62sNwq{oYw(Wmhk)k<@f$!$@ng~_5)Ru z0Z)trIA5^j{DIW^c+vT2%lW+2<(RtE2wR;4O@)Tm`Xr*?A(qYoM}7i5Yxw>D(&6ou zxz!_Xr~yNF+waPe00049Nkl*;a!v6h%{rlvIH#gW3s8p;bFr=l}mRqpW2h zw=OA%hdyL~z+UHOzl0eKhEr$YYOL-c-%Y<)=j?(bzDweB7{b+%_ypvm_cG{SvM=DK zhv{K@m>#Bw>2W$eUI#iU)Wdgs8Y3U+A$Gd&{+j)d)BmGKx+43U_!tik_YlN)>$7G! zhkE!s;%oku3;IwG3U^2kw?z+HM)jB{@zFhK8P#KMSytSthr+4!c(5c%+^UBn`0X*2 zy3(k600_CSZj?O$Qu%&$;|TGUJrptR(HzyIx>5E(2r{eA(<6t3e3I0B)7d6s7?Z5J zZ!rtKvA{MiEBm&KFtoifx>5P^Z=vl)95XJn()aS5%ad(s?4-=Tkis9IGu{`Fy8r+H07*qoM6N<$f20Z)wqMt%V?S?~D#06};F zA3KcL`Wb+>5ObvgQIG&ig8(;V04hz?@cqy3{mSh8o!|U|)cI!1_+!fWH@o*8vh^CU z^ws0;(c$gI+2~q^tO#GDHf@=;DncUw00J^eL_t(&-tE|HQ`%4vfZ;WsBqu-$0nu1R zq^Vj;p$clf^?twn|KHO+IGt^q#a3X?w9dXC@*yxhv&l}F322(8Y1&=P&I}~G@#h6; z1CV9ecD9ZEe87{{NtI*)_aJ<`kJa z?5=RBtFF50s;jQLFil-`)m2wrb=6h(&brpj%nG_U&ut~$?8Rokzxi8zJoWr#2dto5 zOX_URcc<1`Iky+jc;A%Vzx}1QU{2$|cKPom2Vf1{8m`vja4{F>HS?^Nc^rp}xo+Nh zxd}eOm`fm3@MQC1< zIk&aCjb~Yh%5+Yq0`)D;q{#-Uqlv*o+Oor zE!I71Z@ASH3grl8&P^L0WpavHoP|UX4e?!igT`4?AZk$hu*@%6WJ;zDOGlw7kj@ zY5!B-0ft0f?Lgb>C;$Ke07*qoM6N<$f~t1N9smFU literal 0 HcmV?d00001 diff --git a/packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..0ec303439225b78712f49115768196d8d76f6790 GIT binary patch literal 862 zcmV-k1EKthP)20Z)wqMt%V?S?~D#06};F zA3KcL`Wb+>5ObvgQIG&ig8(;V04hz?@cqy3{mSh8o!|U|)cI!1_+!fWH@o*8vh^CU z^ws0;(c$gI+2~q^tO#GDHf@=;DncUw00J^eL_t(&-tE|HQ`%4vfZ;WsBqu-$0nu1R zq^Vj;p$clf^?twn|KHO+IGt^q#a3X?w9dXC@*yxhv&l}F322(8Y1&=P&I}~G@#h6; z1CV9ecD9ZEe87{{NtI*)_aJ<`kJa z?5=RBtFF50s;jQLFil-`)m2wrb=6h(&brpj%nG_U&ut~$?8Rokzxi8zJoWr#2dto5 zOX_URcc<1`Iky+jc;A%Vzx}1QU{2$|cKPom2Vf1{8m`vja4{F>HS?^Nc^rp}xo+Nh zxd}eOm`fm3@MQC1< zIk&aCjb~Yh%5+Yq0`)D;q{#-Uqlv*o+Oor zE!I71Z@ASH3grl8&P^L0WpavHoP|UX4e?!igT`4?AZk$hu*@%6WJ;zDOGlw7kj@ zY5!B-0ft0f?Lgb>C;$Ke07*qoM6N<$f~t1N9smFU literal 0 HcmV?d00001 diff --git a/packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..e9f5fea27c705180eb716271f41b582e76dcbd90 GIT binary patch literal 1674 zcmV;526g#~P){YQnis^a@{&-nmRmq)<&%Mztj67_#M}W?l>kYSliK<%xAp;0j{!}J0!o7b zE>q9${Lb$D&h7k=+4=!ek^n+`0zq>LL1O?lVyea53S5x`Nqqo2YyeuIrQrJj9XjOp z{;T5qbj3}&1vg1VK~#9!?b~^C5-}JC@Pyrv-6dSEqJqT}#j9#dJ@GzT@B8}x zU&J@bBI>f6w6en+CeI)3^kC*U?}X%OD8$Fd$H&LV$H&LV$H&LV#|K5~mLYf|VqzOc zkc7qL~0sOYuM{tG`rYEDV{DWY`Z8&)kW*hc2VkBuY+^Yx&92j&StN}Wp=LD zxoGxXw6f&8sB^u})h@b@z0RBeD`K7RMR9deyL(ZJu#39Z>rT)^>v}Khq8U-IbIvT> z?4pV9qGj=2)TNH3d)=De<+^w;>S7m_eFKTvzeaBeir45xY!^m!FmxnljbSS_3o=g( z->^wC9%qkR{kbGnW8MfFew_o9h3(r55Is`L$8KI@d+*%{=Nx+FXJ98L0PjFIu;rGnnfY zn1R5Qnp<{Jq0M1vX=X&F8gtLmcWv$1*M@4ZfF^9``()#hGTeKeP`1!iED ztNE(TN}M5}3Bbc*d=FIv`DNv&@|C6yYj{sSqUj5oo$#*0$7pu|Dd2TLI>t5%I zIa4Dvr(iayb+5x=j*Vum9&irk)xV1`t509lnPO0%skL8_1c#Xbamh(2@f?4yUI zhhuT5<#8RJhGz4%b$`PJwKPAudsm|at?u;*hGgnA zU1;9gnxVBC)wA(BsB`AW54N{|qmikJR*%x0c`{LGsSfa|NK61pYH(r-UQ4_JXd!Rsz)=k zL{GMc5{h138)fF5CzHEDM>+FqY)$pdN3}Ml+riTgJOLN0F*Vh?{9ESR{SVVg>*>=# zix;VJHPtvFFCRY$Ks*F;VX~%*r9F)W`PmPE9F!(&s#x07n2<}?S{(ygpXgX-&B&OM zONY&BRQ(#%0%jeQs?oJ4P!p*R98>qCy5p8w>_gpuh39NcOlp)(wOoz0sY-Qz55eB~ z7OC-fKBaD1sE3$l-6QgBJO!n?QOTza`!S_YK z_v-lm^7{VO^8Q@M_^8F)09Ki6%=s?2_5eupee(w1FB%aqSweusQ-T+CH0Xt{` zFjMvW{@C&TB)k25()nh~_yJ9coBRL(0oO@HK~z}7?bm5j;y@69;bvlHb2tf!$ReA~x{22wTq550 z?f?Hnw(;m3ip30;QzdV~7pi!wyMYhDtXW#cO7T>|f=bdFhu+F!zMZ2UFj;GUKX7tI z;hv3{q~!*pMj75WP_c}>6)IWvg5_yyg<9Op()eD1hWC19M@?_9_MHec{Z8n3FaF{8 z;u`Mw0ly(uE>*CgQYv{be6ab2LWhlaH1^iLIM{olnag$78^Fd}%dR7;JECQ+hmk|o z!u2&!3MqPfP5ChDSkFSH8F2WVOEf0(E_M(JL17G}Y+fg0_IuW%WQ zG(mG&u?|->YSdk0;8rc{yw2@2Z&GA}z{Wb91Ooz9VhA{b2DYE7RmG zjL}?eq#iX%3#k;JWMx_{^2nNax`xPhByFiDX+a7uTGU|otOvIAUy|dEKkXOm-`aWS z27pUzD{a)Ct<6p{{3)+lq@i`t@%>-wT4r?*S}k)58e09WZYP0{{R3FC5Sl00039P)t-s|Ns9~ z#rP?<_5oL$Q^olD{r_0T`27C={r>*`|Nj71npVa5OTzc(_WfbW_({R{p56NV{r*M2 z_xt?)2V0#0NsfV0u>{42ctGP(8vQj-Btk1n|O0ZD=YLwd&R{Ko41Gr9H= zY@z@@bOAMB5Ltl$E>bJJ{>JP30ZxkmI%?eW{k`b?Wy<&gOo;dS`~CR$Vwb@XWtR|N zi~t=w02?-0&j0TD{>bb6sNwsK*!p?V`RMQUl(*DVjk-9Cx+-z1KXab|Ka2oXhX5f% z`$|e!000AhNklrxs)5QTeTVRiEmz~MKK1WAjCw(c-JK6eox;2O)?`? zTG`AHia671e^vgmp!llKp|=5sVHk#C7=~epA~VAf-~%aPC=%Qw01h8mnSZ|p?hz91 z7p83F3%LVu9;S$tSI$C^%^yud1dfTM_6p2|+5Ejp$bd`GDvbR|xit>i!ZD&F>@CJrPmu*UjD&?DfZs=$@e3FQA(vNiU+$A*%a} z?`XcG2jDxJ_ZQ#Md`H{4Lpf6QBDp81_KWZ6Tk#yCy1)32zO#3<7>b`eT7UyYH1eGz z;O(rH$=QR*L%%ZcBpc=eGua?N55nD^K(8<#gl2+pN_j~b2MHs4#mcLmv%DkspS-3< zpI1F=^9siI0s-;IN_IrA;5xm~3?3!StX}pUv0vkxMaqm+zxrg7X7(I&*N~&dEd0kD z-FRV|g=|QuUsuh>-xCI}vD2imzYIOIdcCVV=$Bz@*u0+Bs<|L^)32nN*=wu3n%Ynw z@1|eLG>!8ruU1pFXUfb`j>(=Gy~?Rn4QJ-c3%3T|(Frd!bI`9u&zAnyFYTqlG#&J7 zAkD(jpw|oZLNiA>;>hgp1KX7-wxC~31II47gc zHcehD6Uxlf%+M^^uN5Wc*G%^;>D5qT{>=uxUhX%WJu^Z*(_Wq9y}npFO{Hhb>s6<9 zNi0pHXWFaVZnb)1+RS&F)xOv6&aeILcI)`k#0YE+?e)5&#r7J#c`3Z7x!LpTc01dx zrdC3{Z;joZ^KN&))zB_i)I9fWedoN>Zl-6_Iz+^G&*ak2jpF07*qoM6N<$f;w%0(f|Me literal 0 HcmV?d00001 diff --git a/packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..0467bf12aa4d28f374bb26596605a46dcbb3e7c8 GIT binary patch literal 1418 zcmV;51$Fv~P)q zKfU)WzW*n(@|xWGCA9ScMt*e9`2kdxPQ&&>|-UCa7_51w+ zLUsW@ZzZSW0y$)Hp~e9%PvP|a03ks1`~K?q{u;6NC8*{AOqIUq{CL&;p56Lf$oQGq z^={4hPQv)y=I|4n+?>7Fim=dxt1 z2H+Dm+1+fh+IF>G0SjJMkQQre1x4|G*Z==(Ot&kCnUrL4I(rf(ucITwmuHf^hXiJT zkdTm&kdTm&kdTm&kdP`esgWG0BcWCVkVZ&2dUwN`cgM8QJb`Z7Z~e<&Yj2(}>Tmf` zm1{eLgw!b{bXkjWbF%dTkTZEJWyWOb##Lfw4EK2}<0d6%>AGS{po>WCOy&f$Tay_> z?NBlkpo@s-O;0V%Y_Xa-G#_O08q5LR*~F%&)}{}r&L%Sbs8AS4t7Y0NEx*{soY=0MZExqA5XHQkqi#4gW3 zqODM^iyZl;dvf)-bOXtOru(s)Uc7~BFx{w-FK;2{`VA?(g&@3z&bfLFyctOH!cVsF z7IL=fo-qBndRUm;kAdXR4e6>k-z|21AaN%ubeVrHl*<|s&Ax@W-t?LR(P-24A5=>a z*R9#QvjzF8n%@1Nw@?CG@6(%>+-0ASK~jEmCV|&a*7-GKT72W<(TbSjf)&Eme6nGE z>Gkj4Sq&2e+-G%|+NM8OOm5zVl9{Z8Dd8A5z3y8mZ=4Bv4%>as_{9cN#bm~;h>62( zdqY93Zy}v&c4n($Vv!UybR8ocs7#zbfX1IY-*w~)p}XyZ-SFC~4w>BvMVr`dFbelV{lLL0bx7@*ZZdebr3`sP;? zVImji)kG)(6Juv0lz@q`F!k1FE;CQ(D0iG$wchPbKZQELlsZ#~rt8#90Y_Xh&3U-< z{s<&cCV_1`^TD^ia9!*mQDq& zn2{r`j};V|uV%_wsP!zB?m%;FeaRe+X47K0e+KE!8C{gAWF8)lCd1u1%~|M!XNRvw zvtqy3iz0WSpWdhn6$hP8PaRBmp)q`#PCA`Vd#Tc$@f1tAcM>f_I@bC)hkI9|o(Iqv zo}Piadq!j76}004RBio<`)70k^`K1NK)q>w?p^C6J2ZC!+UppiK6&y3Kmbv&O!oYF z34$0Z;QO!JOY#!`qyGH<3Pd}Pt@q*A0V=3SVtWKRR8d8Z&@)3qLPA19LPA19LPEUC YUoZo%k(ykuW&i*H07*qoM6N<$f+CH{y8r+H literal 0 HcmV?d00001 diff --git a/packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 000000000..0bedcf2fd --- /dev/null +++ b/packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 0000000000000000000000000000000000000000..9da19eacad3b03bb08bbddbbf4ac48dd78b3d838 GIT binary patch literal 68 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx0wlM}@Gt=>Zci7-kcv6Uzs@r-FtIZ-&5|)J Q1PU{Fy85}Sb4q9e0B4a5jsO4v literal 0 HcmV?d00001 diff --git a/packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..9da19eacad3b03bb08bbddbbf4ac48dd78b3d838 GIT binary patch literal 68 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx0wlM}@Gt=>Zci7-kcv6Uzs@r-FtIZ-&5|)J Q1PU{Fy85}Sb4q9e0B4a5jsO4v literal 0 HcmV?d00001 diff --git a/packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..9da19eacad3b03bb08bbddbbf4ac48dd78b3d838 GIT binary patch literal 68 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx0wlM}@Gt=>Zci7-kcv6Uzs@r-FtIZ-&5|)J Q1PU{Fy85}Sb4q9e0B4a5jsO4v literal 0 HcmV?d00001 diff --git a/packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 000000000..89c2725b7 --- /dev/null +++ b/packages/deriv_passkeys/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/packages/deriv_passkeys/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/deriv_passkeys/example/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000..f2e259c7c --- /dev/null +++ b/packages/deriv_passkeys/example/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/deriv_passkeys/example/ios/Runner/Base.lproj/Main.storyboard b/packages/deriv_passkeys/example/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 000000000..f3c28516f --- /dev/null +++ b/packages/deriv_passkeys/example/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/deriv_passkeys/example/ios/Runner/Info.plist b/packages/deriv_passkeys/example/ios/Runner/Info.plist new file mode 100644 index 000000000..5458fc418 --- /dev/null +++ b/packages/deriv_passkeys/example/ios/Runner/Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Example + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + example + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + + + diff --git a/packages/deriv_passkeys/example/ios/Runner/Runner-Bridging-Header.h b/packages/deriv_passkeys/example/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 000000000..308a2a560 --- /dev/null +++ b/packages/deriv_passkeys/example/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/packages/deriv_passkeys/example/ios/Runner/Runner.entitlements b/packages/deriv_passkeys/example/ios/Runner/Runner.entitlements new file mode 100644 index 000000000..d96c26284 --- /dev/null +++ b/packages/deriv_passkeys/example/ios/Runner/Runner.entitlements @@ -0,0 +1,15 @@ + + + + + com.apple.developer.associated-domains + + webcredentials:qa163.deriv.dev + applinks:qa163.deriv.dev + applinks:pro-7837426045311437779.frontendapi.corbado.io + webcredentials:pro-7837426045311437779.frontendapi.corbado.io + webcredentials:24be-94-207-97-237.ngrok-free.app + applinks:24be-94-207-97-237.ngrok-free.app + + + diff --git a/packages/deriv_passkeys/example/ios/RunnerTests/RunnerTests.swift b/packages/deriv_passkeys/example/ios/RunnerTests/RunnerTests.swift new file mode 100644 index 000000000..86a7c3b1b --- /dev/null +++ b/packages/deriv_passkeys/example/ios/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Flutter +import UIKit +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/packages/deriv_passkeys/example/lib/main.dart b/packages/deriv_passkeys/example/lib/main.dart new file mode 100644 index 000000000..4baf1c3f8 --- /dev/null +++ b/packages/deriv_passkeys/example/lib/main.dart @@ -0,0 +1,111 @@ +import 'package:deriv_http_client/deriv_http_client.dart'; +import 'package:deriv_localizations/l10n/generated/deriv_passkeys/deriv_passkeys_localizations.dart'; +import 'package:deriv_passkeys/deriv_passkeys.dart'; +import 'package:deriv_theme/deriv_theme.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'dart:async'; + +Future main() async { + WidgetsFlutterBinding.ensureInitialized(); + + runApp(const MyApp()); +} + +class MyApp extends StatefulWidget { + const MyApp({super.key}); + + @override + State createState() => _MyAppState(); +} + +class _MyAppState extends State { + @override + Widget build(BuildContext context) { + return BlocProvider( + create: (context) => DerivPasskeysBloc( + derivPasskeysService: DerivPasskeysService( + DerivPasskeysRepository( + DerivPasskeysDataSource( + mapper: DerivPasskeysMapper(), client: HttpClient()), + ), + ), + connectionInfo: PasskeysConnectionInfoEntity( + appId: '', + endpoint: '', + ), + getJwtToken: () { + return Future.value(''); + }, + ), + child: MaterialApp( + localizationsDelegates: const >[ + DerivPasskeysLocalizations.delegate, + ], + theme: ThemeData( + primaryColor: context.theme.colors.secondary, + fontFamily: context.theme.fontFamily, + brightness: Brightness.dark, + bottomSheetTheme: BottomSheetThemeData( + backgroundColor: Colors.black.withOpacity(0), + modalBarrierColor: Colors.black.withOpacity(0.72), + ), + unselectedWidgetColor: context.theme.colors.lessProminent, + toggleButtonsTheme: ToggleButtonsThemeData( + textStyle: context.theme.textStyle( + textStyle: TextStyles.body2, + ), + ), + colorScheme: const ColorScheme.dark().copyWith( + primary: context.theme.colors.prominent, + secondary: context.theme.colors.coral, + ), + textSelectionTheme: TextSelectionThemeData( + cursorColor: context.theme.colors.lessProminent, + selectionHandleColor: context.theme.colors.lessProminent, + selectionColor: context.theme.colors.lessProminent, + ), + appBarTheme: AppBarTheme.of(context).copyWith( + backgroundColor: context.theme.colors.secondary, + centerTitle: false, + ), + ), + home: const MyPage(), + ), + ); + } +} + +class MyPage extends StatelessWidget { + const MyPage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: context.theme.colors.primary, + appBar: AppBar( + title: const Text('Deriv Passkeys example app'), + ), + body: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const ContinueWithPasskeyButton(), + SizedBox( + width: double.infinity, + child: Padding( + padding: const EdgeInsets.all(16), + child: TextButton( + onPressed: () { + context + .read() + .add(DerivPasskeysCreateCredentialEvent()); + }, + child: const Text('Create Passkey'), + ), + ), + ) + ], + ), + ); + } +} diff --git a/packages/deriv_passkeys/example/pubspec.yaml b/packages/deriv_passkeys/example/pubspec.yaml new file mode 100644 index 000000000..9b22b0acb --- /dev/null +++ b/packages/deriv_passkeys/example/pubspec.yaml @@ -0,0 +1,77 @@ +name: passkeys_poc +description: A new Flutter project. +# The following line prevents the package from being accidentally published to +# pub.dev using `flutter pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +# In Windows, build-name is used as the major, minor, and patch parts +# of the product and file versions while build-number is used as the build suffix. +version: 1.0.0+1 + +environment: + sdk: '>=3.0.0 <4.0.0' + +dependencies: + flutter: + sdk: flutter + + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + deriv_theme: + git: + url: git@github.com:regentmarkets/flutter-deriv-packages.git + path: packages/deriv_theme + ref: deriv_theme-v2.4.0 + deriv_http_client: + git: + url: git@github.com:regentmarkets/flutter-deriv-packages.git + path: packages/deriv_http_client + ref: deriv_http_client-v2.0.1 + deriv_localizations: + git: + url: git@github.com:regentmarkets/flutter-deriv-packages.git + path: packages/deriv_localizations + ref: deriv_localizations-v1.3.2 + deriv_passkeys: + path: ../ + + cupertino_icons: ^1.0.2 + dartz: ^0.10.1 + json_annotation: ^4.8.1 + http: ^1.1.0 + flutter_platform_widgets: ^3.3.5 + flutter_bloc: ^8.1.3 + equatable: ^2.0.5 + +dependency_overrides: + flutter_svg: ^2.0.9 + http: ^1.1.0 + +dev_dependencies: + flutter_test: + sdk: flutter + + + + # The "flutter_lints" package below contains a set of recommended lints to + # encourage good coding practices. The lint set provided by the package is + # activated in the `analysis_options.yaml` file located at the root of your + # package. See that file for information about deactivating specific lint + # rules and activating additional ones. + flutter_lints: ^2.0.0 + + + +flutter: + uses-material-design: true diff --git a/packages/deriv_passkeys/example/test/widget_test.dart b/packages/deriv_passkeys/example/test/widget_test.dart new file mode 100644 index 000000000..9468a3906 --- /dev/null +++ b/packages/deriv_passkeys/example/test/widget_test.dart @@ -0,0 +1,30 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility in the flutter_test package. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'package:passkeys_poc/main.dart'; + +void main() { + testWidgets('Counter increments smoke test', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(const MyApp()); + + // Verify that our counter starts at 0. + expect(find.text('0'), findsOneWidget); + expect(find.text('1'), findsNothing); + + // Tap the '+' icon and trigger a frame. + await tester.tap(find.byIcon(Icons.add)); + await tester.pump(); + + // Verify that our counter has incremented. + expect(find.text('0'), findsNothing); + expect(find.text('1'), findsOneWidget); + }); +} diff --git a/packages/deriv_passkeys/ios/.gitignore b/packages/deriv_passkeys/ios/.gitignore new file mode 100644 index 000000000..0c885071e --- /dev/null +++ b/packages/deriv_passkeys/ios/.gitignore @@ -0,0 +1,38 @@ +.idea/ +.vagrant/ +.sconsign.dblite +.svn/ + +.DS_Store +*.swp +profile + +DerivedData/ +build/ +GeneratedPluginRegistrant.h +GeneratedPluginRegistrant.m + +.generated/ + +*.pbxuser +*.mode1v3 +*.mode2v3 +*.perspectivev3 + +!default.pbxuser +!default.mode1v3 +!default.mode2v3 +!default.perspectivev3 + +xcuserdata + +*.moved-aside + +*.pyc +*sync/ +Icon? +.tags* + +/Flutter/Generated.xcconfig +/Flutter/ephemeral/ +/Flutter/flutter_export_environment.sh \ No newline at end of file diff --git a/packages/deriv_passkeys/ios/Classes/DerivPasskeysManager.swift b/packages/deriv_passkeys/ios/Classes/DerivPasskeysManager.swift new file mode 100644 index 000000000..cef52b6f8 --- /dev/null +++ b/packages/deriv_passkeys/ios/Classes/DerivPasskeysManager.swift @@ -0,0 +1,388 @@ +import Flutter +import UIKit +import AuthenticationServices + +@available(iOS 15.0, *) +public class DerivPasskeysManager{ + enum PluginError: Error { + case unknownError + case notFound(String) + case unknownCredentialType(AnyObject) + case excludedCredentialExists + } + + class AuthCtrlDelegate: NSObject, ASAuthorizationControllerDelegate { + private let semaphore = DispatchSemaphore(value: 0) + private var result: (controller: ASAuthorizationController, authorization: ASAuthorization?, error: Error?)? + + func getResult() throws -> (controller: ASAuthorizationController, authorization: ASAuthorization?, error: Error?) { + semaphore.wait() + guard let ret = result else { + throw PluginError.unknownError + } + return ret + } + + func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) { + result = (controller, authorization, nil) + semaphore.signal() + } + + func authorizationController(controller: ASAuthorizationController, didCompleteWithError error: Error) { + result = (controller, nil, error) + semaphore.signal() + } + } + + @available(iOS 15.0, *) + private func getPlatformPublicKeyCredentials() -> [String] { + return (UserDefaults.standard.object(forKey: "platformPublicKeyCredentials") as? [String]) ?? [] + } + + @available(iOS 15.0, *) + private func savePlatformPublicKeyCredential(_ credential: ASAuthorizationCredential) { + var credentialID = "" + if let credential = credential as? ASAuthorizationPlatformPublicKeyCredentialRegistration { + credentialID = credential.credentialID.base64url + } + else if let credential = credential as? ASAuthorizationPlatformPublicKeyCredentialAssertion { + credentialID = credential.credentialID.base64url + } + if credentialID.isEmpty { return } + + var credentials = getPlatformPublicKeyCredentials() + if !credentials.contains(credentialID) { + credentials.append(credentialID) + UserDefaults.standard.set(credentials, forKey: "platformPublicKeyCredentials") + } + } + + + @available(iOS 15.0, *) + private func handlePlatformExcludedCredentials(_ options: PublicKeyCredentialRequestOptions) throws { + let excludeCredentials = options.excludeCredentials + guard excludeCredentials.count > 0 else { return } + let credentials = getPlatformPublicKeyCredentials() + for credential in credentials { + for excludeCredential in excludeCredentials { + if excludeCredential.base64url == credential { + throw PluginError.excludedCredentialExists + } + } + } + } + + @available(iOS 15.0, *) + private func findPlatformCredentials(_ credentials: [Data]) -> [Data] { + guard credentials.count > 0 else { return [] } + var foundCredentials: [Data] = [] + let platformCredentials = getPlatformPublicKeyCredentials() + for credential in credentials { + for platformCredential in platformCredentials { + if credential.base64url == platformCredential { + foundCredentials.append(credential) + break + } + } + } + return foundCredentials + } + + @available(iOS 15.0, *) + private func createPlatformPublicKeyCredentialRegistrationRequest(_ options: PublicKeyCredentialRequestOptions) throws -> ASAuthorizationPlatformPublicKeyCredentialRegistrationRequest { + let rpId = try options.rpId + let challenge = try options.challenge + let userName = try options.userName + let userId = try options.userId + let platformProvider = ASAuthorizationPlatformPublicKeyCredentialProvider(relyingPartyIdentifier: rpId) + let registrationRequest = platformProvider.createCredentialRegistrationRequest(challenge: challenge, name: userName, userID: userId) + /*// Passkeys do not support attestation. + if let attestationPreference = options.attestation { + registrationRequest.attestationPreference = attestationPreference + } + */ + if let userVerificationPreference = options.userVerification { + registrationRequest.userVerificationPreference = userVerificationPreference + } + // ISSUE: Currently ASAuthorizationPlatformPublicKeyCredentialRegistrationRequest doesn't support excludedCredentials. + // WORKAROUND: Handling excludeCredentials by plugin self. + try handlePlatformExcludedCredentials(options) + return registrationRequest + } + + @available(iOS 15.0, *) + private func createSecurityKeyPublicKeyCredentialRegistrationRequest(_ options: PublicKeyCredentialRequestOptions) throws -> ASAuthorizationSecurityKeyPublicKeyCredentialRegistrationRequest { + let rpId = try options.rpId + let challenge = try options.challenge + let userName = try options.userName + let userId = try options.userId + let securityKeyProvider = ASAuthorizationSecurityKeyPublicKeyCredentialProvider(relyingPartyIdentifier: rpId) + let registrationRequest = securityKeyProvider.createCredentialRegistrationRequest(challenge: challenge, displayName: userName, name: userName, userID: userId) + registrationRequest.credentialParameters = options.pubKeyCredParams + if let attestationPreference = options.attestation { + registrationRequest.attestationPreference = attestationPreference + } + if let userVerificationPreference = options.userVerification { + registrationRequest.userVerificationPreference = userVerificationPreference + } + if let residentKeyPreference = options.residentKey { + registrationRequest.residentKeyPreference = residentKeyPreference + } + let excludedCredentials = options.excludeCredentials + if excludedCredentials.count > 0 { + registrationRequest.excludedCredentials = excludedCredentials.map { ASAuthorizationSecurityKeyPublicKeyCredentialDescriptor(credentialID: $0, transports: ASAuthorizationSecurityKeyPublicKeyCredentialDescriptor.Transport.allSupported) } + } + return registrationRequest + } + + @available(iOS 15.0, *) + private func createPlatformPublicKeyCredentialAssertionRequest(_ options: PublicKeyCredentialRequestOptions) throws -> ASAuthorizationPlatformPublicKeyCredentialAssertionRequest { + let rpId = try options.rpId + let challenge = try options.challenge + let platformProvider = ASAuthorizationPlatformPublicKeyCredentialProvider(relyingPartyIdentifier: rpId) + let assertionRequest = platformProvider.createCredentialAssertionRequest(challenge: challenge) + if let userVerificationPreference = options.userVerification { + assertionRequest.userVerificationPreference = userVerificationPreference + } + let allowedCredentials = options.allowCredentials + // ISSUE: if allowedCredentials are different from SecurityKeyPublicKeyCredentialAssertionRequest, iOS Passkeys will hang on processing in background. + if allowedCredentials.count > 0 { + assertionRequest.allowedCredentials = allowedCredentials.map { ASAuthorizationPlatformPublicKeyCredentialDescriptor(credentialID: $0) } + } + return assertionRequest + } + + @available(iOS 15.0, *) + private func createSecurityKeyPublicKeyCredentialAssertionRequest(_ options: PublicKeyCredentialRequestOptions) throws -> ASAuthorizationSecurityKeyPublicKeyCredentialAssertionRequest { + let rpId = try options.rpId + let challenge = try options.challenge + let securityKeyProvider = ASAuthorizationSecurityKeyPublicKeyCredentialProvider(relyingPartyIdentifier: rpId) + let assertionRequest = securityKeyProvider.createCredentialAssertionRequest(challenge: challenge) + if let userVerificationPreference = options.userVerification { + assertionRequest.userVerificationPreference = userVerificationPreference + } + let allowedCredentials = options.allowCredentials + if allowedCredentials.count > 0 { + assertionRequest.allowedCredentials = allowedCredentials.map { ASAuthorizationSecurityKeyPublicKeyCredentialDescriptor(credentialID: $0, transports: ASAuthorizationSecurityKeyPublicKeyCredentialDescriptor.Transport.allSupported) } + } + return assertionRequest + } + + @available(iOS 15.0, *) + private func getPresentationContextProvider() throws -> ASAuthorizationControllerPresentationContextProviding { + let keyWindow = UIApplication.shared.connectedScenes + .filter({$0.activationState == .foregroundActive}) + .map({$0 as? UIWindowScene}) + .compactMap({$0}) + .first?.windows + .filter({$0.isKeyWindow}).first + guard var topController = keyWindow?.rootViewController else { + throw PluginError.notFound("Root view controller") + } + while let presentedViewController = topController.presentedViewController { + topController = presentedViewController + } + if let nav = topController as? UINavigationController { + topController = nav.visibleViewController ?? topController + } + guard let contextProvider = topController as? ASAuthorizationControllerPresentationContextProviding else { + throw PluginError.notFound("Presentation context provider") + } + return contextProvider + } + + @available(iOS 15.0, *) + private func requestCredential(_ authorizationRequests: [ASAuthorizationRequest]) throws -> ASAuthorizationCredential { + let authController = ASAuthorizationController(authorizationRequests: authorizationRequests) + let authCtrlDelete = AuthCtrlDelegate() + let contextProvider = try getPresentationContextProvider() + authController.delegate = authCtrlDelete + authController.presentationContextProvider = contextProvider + authController.performRequests() + + let result = try authCtrlDelete.getResult() + guard result.error == nil else { + throw result.error! + } + guard let authorization = result.authorization else { + throw PluginError.notFound("Credential") + } + // ISSUE: Currently ASAuthorizationPlatformPublicKeyCredentialRegistrationRequest doesn't support excludedCredentials. + // WORKAROUND: Handling excludeCredentials by plugin self. + // SIDE-EFFECT: Assertions may come from another device by scanning QR code, in that case, the credential SHALL NOT be saved, but there is no way to know the assertion source. This leads that credential registration fails if excludedCredentials includes the credential. + savePlatformPublicKeyCredential(authorization.credential) + return authorization.credential + } + + @available(iOS 15.0, *) + private func generateCredentialRegistrationResponse(_ credentialID: Data, _ rawClientDataJSON: Data, _ rawAttestationObject: Data? = nil) throws -> [String: Any] { + let response = [ + "id": credentialID.base64url, + "rawId": credentialID.base64url, + "type": "public-key", + "response": [ + "clientDataJSON": rawClientDataJSON.base64url, + "attestationObject": rawAttestationObject?.base64url ?? "null", + "transports": ASAuthorizationSecurityKeyPublicKeyCredentialDescriptor.Transport.allSupported.map { $0.rawValue }, + ] as [String : Any], + "clientExtensionResults": [:] as [String : Any] + ] as [String : Any] + return response + } + + @available(iOS 15.0, *) + private func generateCredentialAssertionResponse(_ credentialID: Data, _ userID: Data, _ signature: Data, _ rawAuthenticatorData: Data, _ rawClientDataJSON: Data) throws -> [String: Any] { + let response = [ + "id": credentialID.base64url, + "rawId": credentialID.base64url, + "type": "public-key", + "response": [ + "authenticatorData": rawAuthenticatorData.base64url, + "signature": signature.base64url, + "userHandle": userID.base64url, + "clientDataJSON": rawClientDataJSON.base64url, + ] as [String : Any], + "clientExtensionResults": [:] as [String : Any] + ] as [String : Any] + return response + } + + @available(iOS 15.0, *) + private func generateCredentialResponse(_ credential: ASAuthorizationCredential) throws -> [String: Any] { + var response: [String: Any] = [:] + switch (credential) { + case is ASAuthorizationPlatformPublicKeyCredentialRegistration: + let credential = credential as! ASAuthorizationPlatformPublicKeyCredentialRegistration + response = try generateCredentialRegistrationResponse(credential.credentialID, credential.rawClientDataJSON, credential.rawAttestationObject) + case is ASAuthorizationSecurityKeyPublicKeyCredentialRegistration: + let credential = credential as! ASAuthorizationSecurityKeyPublicKeyCredentialRegistration + response = try generateCredentialRegistrationResponse(credential.credentialID, credential.rawClientDataJSON, credential.rawAttestationObject) + case is ASAuthorizationPlatformPublicKeyCredentialAssertion: + let credential = credential as! ASAuthorizationPlatformPublicKeyCredentialAssertion + response = try generateCredentialAssertionResponse(credential.credentialID, credential.userID, credential.signature, credential.rawAuthenticatorData, credential.rawClientDataJSON) + case is ASAuthorizationSecurityKeyPublicKeyCredentialAssertion: + let credential = credential as! ASAuthorizationSecurityKeyPublicKeyCredentialAssertion + response = try generateCredentialAssertionResponse(credential.credentialID, credential.userID, credential.signature, credential.rawAuthenticatorData, credential.rawClientDataJSON) + default: + throw PluginError.unknownCredentialType(credential) + } + return response + } + + @available(iOS 15.0, *) + private func requestCredentialRegistration(_ options: PublicKeyCredentialRequestOptions) throws -> String { + var authorizationRequests: [ASAuthorizationRequest] = [] + switch options.authenticatorAttachment { + case .platform: + authorizationRequests.append(try createPlatformPublicKeyCredentialRegistrationRequest(options)) + case .crossPlatform: + authorizationRequests.append(try createSecurityKeyPublicKeyCredentialRegistrationRequest(options)) + default: + authorizationRequests.append(try createPlatformPublicKeyCredentialRegistrationRequest(options)) + authorizationRequests.append(try createSecurityKeyPublicKeyCredentialRegistrationRequest(options)) + } + let credential = try requestCredential(authorizationRequests) + let response = try generateCredentialResponse(credential) + return try response.jsonString + } + + @available(iOS 15.0, *) + private func requestCredentialAssertion(_ options: PublicKeyCredentialRequestOptions) throws -> String { + var authorizationRequests: [ASAuthorizationRequest] = [] + switch options.authenticatorAttachment { + case .platform: + authorizationRequests.append(try createPlatformPublicKeyCredentialAssertionRequest(options)) + case .crossPlatform: + authorizationRequests.append(try createSecurityKeyPublicKeyCredentialAssertionRequest(options)) + default: + authorizationRequests.append(try createPlatformPublicKeyCredentialAssertionRequest(options)) + /* ISSUE: + * iOS(16.4.1) will show QR code for Passkeys if adding both PlatformPublicKeyCredentialAssertionRequest and + * SecurityKeyPublicKeyCredentialAssertionRequest into authorizationRequests and allowCredentials is not empty. + * It seems that allowCredentials cannot be found in the platform credeintials, but it will work if removing + * SecurityKeyPublicKeyCredentialAssertionRequest from authorizationRequests, that means allowCredentials can be found. + */ + // WORKAROUND: Adding SecurityKeyPublicKeyCredentialAssertionRequest if there is no any platform credeintial can be found in allowCredentials. But the saved platform credentials are not all on the device, due to there is no way can get all platform credentials from iOS. + if findPlatformCredentials(options.allowCredentials).count == 0 { + authorizationRequests.append(try createSecurityKeyPublicKeyCredentialAssertionRequest(options)) + } + } + let credential = try requestCredential(authorizationRequests) + let response = try generateCredentialResponse(credential) + return try response.jsonString + } + + @available(iOS 15.0, *) + public func createCredential(_ options: String, _ callback: @escaping (_ credential: String?, _ error: Error?) -> Void) { + Task { + do { + let credential = try requestCredentialRegistration(PublicKeyCredentialRequestOptions(options)) + callback(credential, nil) + } catch { + callback(nil, error) + } + } + } + + @available(iOS 15.0, *) + public func getCredential(_ options: String, _ callback: @escaping (_ credential: String?, _ error: Error?) -> Void) { + Task { + do { + let credential = try requestCredentialAssertion(PublicKeyCredentialRequestOptions(options)) + callback(credential, nil) + } catch { + callback(nil, error) + } + } + } +} + +@available(iOS 15.0, *) +extension DerivPasskeysManager.PluginError: CustomStringConvertible { + var description: String { + switch self { + case .unknownError: + return "Unknown error." + case .notFound(let name): + return "\(name) not found." + case .unknownCredentialType(let object): + return "Unknown credential type \(String(describing: type(of: object)))." + case .excludedCredentialExists: + return "One of the excluded credentials exists on the local device." + } + } +} + +@available(iOS 15.0, *) +extension DerivPasskeysManager.PluginError: LocalizedError { + private var errorDescription: String { + return self.description + } +} + +@available(iOS 15.0, *) +extension FlutterViewController: ASAuthorizationControllerPresentationContextProviding { + public func presentationAnchor(for controller: ASAuthorizationController) -> ASPresentationAnchor { + return self.view.window! + } +} + +@available(iOS 15.0, *) +extension Data { + var base64url: String { + self.base64EncodedString().replacingOccurrences(of: "+", with: "-").replacingOccurrences(of: "/", with: "_").replacingOccurrences(of: "=", with: "") + } +} + +@available(iOS 15.0, *) +extension Dictionary where Key == String { + var jsonString: String { + get throws { + let data = try JSONSerialization.data(withJSONObject: self) + guard let jsonString = String(data: data, encoding: .utf8) else { + throw DecodingError.dataCorrupted(DecodingError.Context(codingPath: [], debugDescription: "Invalid JSON data.", underlyingError: nil)) + } + return jsonString + } + } +} diff --git a/packages/deriv_passkeys/ios/Classes/DerivPasskeysPlugin.swift b/packages/deriv_passkeys/ios/Classes/DerivPasskeysPlugin.swift new file mode 100644 index 000000000..73b1c5af4 --- /dev/null +++ b/packages/deriv_passkeys/ios/Classes/DerivPasskeysPlugin.swift @@ -0,0 +1,72 @@ +import Flutter +import UIKit + +public class DerivPasskeysPlugin: NSObject, FlutterPlugin { + + public static func register(with registrar: FlutterPluginRegistrar) { + let channel = FlutterMethodChannel( + name: "deriv_passkeys", binaryMessenger: registrar.messenger()) + let instance = DerivPasskeysPlugin() + registrar.addMethodCallDelegate(instance, channel: channel) + } + + public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { + + switch call.method { + case "isPlatformSupported": + if #available(iOS 15.0, *) { + result(true) + } else { + result(false) + } + case "createCredential": + if #available(iOS 15.0, *) { + let derivPasskeysManager = DerivPasskeysManager() + if let args = call.arguments as? [String: Any], let options = args["options"] as? String { + derivPasskeysManager.createCredential(options) { credential, error in + if let err = error { + let errorCode = (err as NSError).code + result(FlutterError(code: String(errorCode), message: "\(err)", details: nil)) + return + } + result(credential!) + } + } else { + result( + FlutterError(code: "CreateCredentialError", message: "Options not found", details: nil)) + } + } else { + result( + FlutterError( + code: "UNAVAILABLE", + message: "Passkey creation not available on this iOS version", + details: nil)) + } + case "getCredential": + if #available(iOS 15.0, *) { + let derivPasskeysManager = DerivPasskeysManager() + if let args = call.arguments as? [String: Any], let options = args["options"] as? String { + derivPasskeysManager.getCredential(options) { credential, error in + if let err = error { + let errorCode = (err as NSError).code + result(FlutterError(code: String(errorCode), message: "\(err)", details: nil)) + return + } + result(credential!) + } + } else { + result( + FlutterError(code: "GetCredentialError", message: "Options not found", details: nil)) + } + } else { + result( + FlutterError( + code: "UNAVAILABLE", + message: "Passkey retrieval not available on this iOS version", + details: nil)) + } + default: + result(FlutterMethodNotImplemented) + } + } +} diff --git a/packages/deriv_passkeys/ios/Classes/PublicKeyCredentialRequestOptions.swift b/packages/deriv_passkeys/ios/Classes/PublicKeyCredentialRequestOptions.swift new file mode 100644 index 000000000..5cc387906 --- /dev/null +++ b/packages/deriv_passkeys/ios/Classes/PublicKeyCredentialRequestOptions.swift @@ -0,0 +1,215 @@ +import AuthenticationServices + +@available(iOS 15.0, *) +public class PublicKeyCredentialRequestOptions: NSObject { + + enum OptionError: Error { + case notFound(String) + case invalidValue(String) + } + + enum AuthenticatorAttachment: String { + case platform = "platform" + case crossPlatform = "cross-platform" + } + + let options: [String: Any] + + init(_ jsonObject: [String: Any]) { + self.options = jsonObject + } + + convenience init (_ jsonString: String) throws { + self.init(try jsonString.jsonObject) + } + + var challenge: Data { + get throws { + guard let challengeStr = self.options["challenge"] as? String, let challenge = challengeStr.base64urlDecoded else { + throw OptionError.notFound("challenge") + } + return challenge + } + } + + var rpId: String { + get throws { + var rpId = "" + if let rpObj = self.options["rp"] as? [String: Any], let id = rpObj["id"] as? String { rpId = id } + if let id = self.options["rpId"] as? String { rpId = id } + if rpId.isEmpty { + throw OptionError.notFound("rpId") + } + return rpId + } + } + + var userName: String { + get throws { + guard let userObj = self.options["user"] as? [String: Any], let userName = userObj["name"] as? String else { + throw OptionError.notFound("userName") + } + return userName + } + } + + var userId: Data { + get throws { + guard let userObj = self.options["user"] as? [String: Any], let id = userObj["id"] as? String, let userId = id.data(using: .utf8) else { + throw OptionError.notFound("userId") + } + return userId + } + } + + var pubKeyCredParams: [ASAuthorizationPublicKeyCredentialParameters] { + var _pubKeyCredParams: [ASAuthorizationPublicKeyCredentialParameters] = [] + if let pubKeyCredParamsObj = self.options["pubKeyCredParams"] as? [[String: Any]] { + for paramObj in pubKeyCredParamsObj { + if let alg = paramObj["alg"] as? Int { + _pubKeyCredParams.append(ASAuthorizationPublicKeyCredentialParameters(algorithm: ASCOSEAlgorithmIdentifier(alg))) + } + } + } + return _pubKeyCredParams + } + + var authenticatorAttachment: AuthenticatorAttachment? { + guard let authenticatorSelectionObj = self.options["authenticatorSelection"] as? [String: Any] else { return nil } + guard let _authenticatorAttachment = authenticatorSelectionObj["authenticatorAttachment"] as? String else { return nil } + switch _authenticatorAttachment { + case AuthenticatorAttachment.platform.rawValue: + return AuthenticatorAttachment.platform + case AuthenticatorAttachment.crossPlatform.rawValue: + return AuthenticatorAttachment.crossPlatform + default: + return nil + } + } + + var attestation: ASAuthorizationPublicKeyCredentialAttestationKind? { + switch self.options["attestation"] as? String { + case "none": + return ASAuthorizationPublicKeyCredentialAttestationKind.none + case "indirect": + return ASAuthorizationPublicKeyCredentialAttestationKind.indirect + case "direct": + return ASAuthorizationPublicKeyCredentialAttestationKind.direct + case "enterprise": + return ASAuthorizationPublicKeyCredentialAttestationKind.enterprise + default: + return nil + } + } + + var userVerification: ASAuthorizationPublicKeyCredentialUserVerificationPreference? { + var _userVerification = "" + if let authenticatorSelectionObj = self.options["authenticatorSelection"] as? [String: Any], let uv = authenticatorSelectionObj["userVerification"] as? String { + _userVerification = uv + } + else if let uv = self.options["authenticatorSelection"] as? String { + _userVerification = uv + } + switch _userVerification { + case "discouraged": + return ASAuthorizationPublicKeyCredentialUserVerificationPreference.discouraged + case "preferred": + return ASAuthorizationPublicKeyCredentialUserVerificationPreference.preferred + case "required": + return ASAuthorizationPublicKeyCredentialUserVerificationPreference.required + default: + return nil + } + } + + var residentKey: ASAuthorizationPublicKeyCredentialResidentKeyPreference? { + var _residentKey = "" + if let authenticatorSelectionObj = self.options["authenticatorSelection"] as? [String: Any] { + if let rk = authenticatorSelectionObj["residentKey"] as? String { + _residentKey = rk + } + else if (authenticatorSelectionObj["requireResidentKey"] as? Bool) == true { + _residentKey = "required" + } + } + switch _residentKey { + case "discouraged": + return ASAuthorizationPublicKeyCredentialResidentKeyPreference.discouraged + case "preferred": + return ASAuthorizationPublicKeyCredentialResidentKeyPreference.preferred + case "required": + return ASAuthorizationPublicKeyCredentialResidentKeyPreference.required + default: + return nil + } + } + + var excludeCredentials: [Data] { + get { + var _excludeCredentials: [Data] = [] + if let excludeCredentialsObj = self.options["excludeCredentials"] as? [[String: Any]] { + for credentialObj in excludeCredentialsObj { + if let id = credentialObj["id"] as? String, let data = id.base64urlDecoded { + _excludeCredentials.append(data) + } + } + } + return _excludeCredentials + } + } + + var allowCredentials: [Data] { + get { + var _allowCredentials: [Data] = [] + if let allowCredentialsObj = self.options["allowCredentials"] as? [[String: Any]] { + for credentialObj in allowCredentialsObj { + if let id = credentialObj["id"] as? String, let data = id.base64urlDecoded { + _allowCredentials.append(data) + } + } + } + return _allowCredentials + } + } +} + +@available(iOS 15.0, *) +extension PublicKeyCredentialRequestOptions.OptionError: CustomStringConvertible { + var description: String { + switch self { + case .notFound(let name): + return "\(name) not found." + case .invalidValue(let value): + return "Invalid value '\(value)'." + } + } +} + +@available(iOS 15.0, *) +extension PublicKeyCredentialRequestOptions.OptionError: LocalizedError { + private var errorDescription: String { + return self.description + } +} + +@available(iOS 15.0, *) +extension String { + var base64urlDecoded: Data? { + var base64 = self.replacingOccurrences(of: "-", with: "+").replacingOccurrences(of: "_", with: "/") + if base64.count % 4 != 0 { base64.append(String(repeating: "=", count: 4 - base64.count % 4)) } + return Data(base64Encoded: base64) + } + + var jsonObject: [String: Any] { + get throws { + guard let data = self.data(using: .utf8) else { + throw DecodingError.dataCorrupted(DecodingError.Context(codingPath: [], debugDescription: "Invalid JSON string.", underlyingError: nil)) + } + let object = try JSONSerialization.jsonObject(with: data) + guard let jsonObject = object as? [String: Any] else { + throw DecodingError.dataCorrupted(DecodingError.Context(codingPath: [], debugDescription: "Invalid JSON string.", underlyingError: nil)) + } + return jsonObject + } + } +} diff --git a/packages/deriv_passkeys/ios/deriv_passkeys.podspec b/packages/deriv_passkeys/ios/deriv_passkeys.podspec new file mode 100644 index 000000000..57554f425 --- /dev/null +++ b/packages/deriv_passkeys/ios/deriv_passkeys.podspec @@ -0,0 +1,23 @@ +# +# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. +# Run `pod lib lint deriv_passkeys.podspec` to validate before publishing. +# +Pod::Spec.new do |s| + s.name = 'deriv_passkeys' + s.version = '0.0.1' + s.summary = 'A new Flutter project.' + s.description = <<-DESC +A new Flutter project. + DESC + s.homepage = 'https://deriv.com' + s.license = { :file => '../LICENSE' } + s.author = { 'Deriv' => 'email@example.com' } + s.source = { :path => '.' } + s.source_files = 'Classes/**/*' + s.dependency 'Flutter' + s.platform = :ios, '13.0' + + # Flutter.framework does not contain a i386 slice. + s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } + s.swift_version = '5.0' +end diff --git a/packages/deriv_passkeys/lib/deriv_passkeys.dart b/packages/deriv_passkeys/lib/deriv_passkeys.dart new file mode 100644 index 000000000..ad3c95f9e --- /dev/null +++ b/packages/deriv_passkeys/lib/deriv_passkeys.dart @@ -0,0 +1,6 @@ +library deriv_passkeys; + +export './src/presentation/presentation.dart'; +export './src/domain/domain.dart'; +export './src/interactor/interactor.dart'; +export './src/data/data.dart'; diff --git a/packages/deriv_passkeys/lib/src/data/data.dart b/packages/deriv_passkeys/lib/src/data/data.dart new file mode 100644 index 000000000..450421bc6 --- /dev/null +++ b/packages/deriv_passkeys/lib/src/data/data.dart @@ -0,0 +1,5 @@ +library deriv_passkeys; + +export './repositories/deriv_passkeys_repository.dart'; +export './data_sources/deriv_passkeys_data_source.dart'; +export './mappers/deriv_passkeys_mapper.dart'; diff --git a/packages/deriv_passkeys/lib/src/data/data_sources/base_deriv_passkeys_data_source.dart b/packages/deriv_passkeys/lib/src/data/data_sources/base_deriv_passkeys_data_source.dart new file mode 100644 index 000000000..b1d63b90e --- /dev/null +++ b/packages/deriv_passkeys/lib/src/data/data_sources/base_deriv_passkeys_data_source.dart @@ -0,0 +1,46 @@ +import 'package:deriv_http_client/deriv_http_client.dart'; +import 'package:deriv_passkeys/src/data/mappers/deriv_passkeys_mapper.dart'; +import 'package:deriv_passkeys/src/data/models/passkeys_connection_info_model.dart'; +import 'package:deriv_passkeys/src/data/models/deriv_passkey_model.dart'; +import 'package:deriv_passkeys/src/data/models/deriv_passkeys_options_model.dart'; +import 'package:deriv_passkeys/src/data/models/deriv_passkeys_register_options_model.dart'; +import 'package:deriv_passkeys/src/data/models/deriv_passkeys_verify_credentials_request_body_model.dart'; +import 'package:deriv_passkeys/src/data/models/deriv_passkeys_verify_credentials_response_model.dart'; +import 'package:flutter_deriv_api/basic_api/generated/passkeys_register_send.dart'; + +/// [BaseDerivPasskeysDataSource] defines a contract for all DerivPasskeys data sources. +/// +/// All DerivPasskeys data sources should extend this class, and implement its abstract methods. +abstract class BaseDerivPasskeysDataSource { + /// Creates a [BaseDerivPasskeysDataSource]. + BaseDerivPasskeysDataSource({required this.mapper, required this.client}); + + /// The mapper used to map the data source to the domain. + final DerivPasskeysMapper mapper; + + /// The http client used to make http requests. + BaseHttpClient client; + + /// Get options for authentication with DerivPasskeys. + Future getOptions({ + required PasskeysConnectionInfoModel passkeysConnectionInfoModel, + }); + + /// Verify the user's DerivPasskeys credentials. + Future verifyCredentials({ + required DerivPasskeysVerifyCredentialsRequest requestBodyModel, + required String jwtToken, + required PasskeysConnectionInfoModel passkeysConnectionInfoModel, + String? userAgent, + }); + + /// Get options for registration with DerivPasskeys. + Future getRegisterOptions(); + + /// Register credentials with DerivPasskeys. + Future registerCredentials( + PasskeysRegisterRequest request); + + /// Get passkeys list. + Future> getPasskeysList(); +} diff --git a/packages/deriv_passkeys/lib/src/data/data_sources/deriv_passkeys_data_source.dart b/packages/deriv_passkeys/lib/src/data/data_sources/deriv_passkeys_data_source.dart new file mode 100644 index 000000000..45d1950a2 --- /dev/null +++ b/packages/deriv_passkeys/lib/src/data/data_sources/deriv_passkeys_data_source.dart @@ -0,0 +1,164 @@ +import 'dart:async'; +import 'dart:convert'; + +import 'package:deriv_http_client/deriv_http_client.dart'; +import 'package:flutter_deriv_api/api/exceptions/base_api_exception.dart'; +import 'package:flutter_deriv_api/api/response/passkeys_list_response_extended.dart'; +import 'package:flutter_deriv_api/api/response/passkeys_register_options_response_extended.dart'; +import 'package:flutter_deriv_api/api/response/passkeys_register_response_extended.dart'; +import 'package:flutter_deriv_api/basic_api/generated/passkeys_list_receive.dart'; +import 'package:flutter_deriv_api/basic_api/generated/passkeys_list_send.dart'; +import 'package:flutter_deriv_api/basic_api/generated/passkeys_register_options_receive.dart'; +import 'package:flutter_deriv_api/basic_api/generated/passkeys_register_options_send.dart'; +import 'package:flutter_deriv_api/basic_api/generated/passkeys_register_receive.dart'; +import 'package:flutter_deriv_api/basic_api/generated/passkeys_register_send.dart'; + +import 'package:http/http.dart' as http; + +import '../data_sources/base_deriv_passkeys_data_source.dart'; +import '../models/passkeys_connection_info_model.dart'; +import '../models/deriv_passkey_model.dart'; +import '../models/deriv_passkeys_options_model.dart'; +import '../models/deriv_passkeys_register_options_model.dart'; +import '../models/deriv_passkeys_verify_credentials_request_body_model.dart'; +import '../models/deriv_passkeys_verify_credentials_response_model.dart'; +import '../../exceptions/server_exceptions.dart'; + +/// [DerivPasskeysDataSource] extends and implements [BaseDerivPasskeysDataSource]. +class DerivPasskeysDataSource extends BaseDerivPasskeysDataSource { + /// Creates a [DerivPasskeysDataSource]. + DerivPasskeysDataSource({required super.mapper, required super.client}); + + @override + Future getOptions({ + required PasskeysConnectionInfoModel passkeysConnectionInfoModel, + }) async { + final String url = + 'https://${passkeysConnectionInfoModel.endpoint}/oauth2/api/v1/passkeys/login/options'; + final http.Response response = await client.get( + url, + ); + + if (response.statusCode == 200) { + return DerivPasskeysOptionsModel.fromJson(jsonDecode(response.body)); + } else { + final Map jsonDecodedResponse = + jsonDecode(response.body); + if (jsonDecodedResponse.containsKey('error_code')) { + throw ServerException( + errorCode: jsonDecodedResponse['error_code'], + message: jsonDecodedResponse['message'], + ); + } + throw Exception('Failed to load options!'); + } + } + + @override + Future verifyCredentials({ + required DerivPasskeysVerifyCredentialsRequest requestBodyModel, + required String jwtToken, + required PasskeysConnectionInfoModel passkeysConnectionInfoModel, + String? userAgent, + }) async { + try { + final String url = + 'https://${passkeysConnectionInfoModel.endpoint}/oauth2/api/v1/passkeys/login/verify'; + + final Map headers = { + 'Content-Type': 'application/json', + 'Authorization': 'Bearer $jwtToken', + 'User-Agent': userAgent ?? 'Dart/3.0 (dart:io)', + 'accept': 'application/json' + }; + final Map jsonDecodedResponse = await client.post( + url: url, + headers: headers, + jsonBody: requestBodyModel.toJson(), + ); + + if (jsonDecodedResponse.containsKey('error_code')) { + throw ServerException( + errorCode: jsonDecodedResponse['error_code'], + message: jsonDecodedResponse['message'], + ); + } + + return DerivPasskeysVerifyCredentialsResponseModel( + response: jsonDecodedResponse, + ); + } on HTTPClientException catch (e) { + throw ServerException( + errorCode: e.errorCode ?? '', + message: e.message, + ); + } + } + + @override + Future getRegisterOptions() async { + try { + final PasskeysRegisterOptionsReceive response = + await PasskeysRegisterOptionsResponseExtended.fetchRaw( + const PasskeysRegisterOptionsRequest()); + + if (response.passkeysRegisterOptions == null) { + throw Exception('Failed to load register options!'); + } + + return DerivPasskeysRegisterOptionsModel( + options: response.passkeysRegisterOptions!['publicKey']); + } on BaseAPIException catch (e) { + throw ServerException( + errorCode: e.code ?? '', + message: e.message ?? '', + ); + } + } + + @override + Future registerCredentials( + PasskeysRegisterRequest request) async { + try { + final PasskeysRegisterReceive response = + await PasskeysRegisterResponseExtended.fetchRaw(request); + + if (response.passkeysRegister == null) { + throw Exception('Failed to register credentials!'); + } + + return DerivPasskeyModel.fromJson( + response.passkeysRegister!['properties']); + } on BaseAPIException catch (e) { + throw ServerException( + errorCode: e.code ?? '', + message: e.message ?? '', + ); + } + } + + @override + Future> getPasskeysList() async { + try { + final PasskeysListReceive response = + await PasskeysListResponseExtended.fetchRaw( + const PasskeysListRequest()); + + if (response.passkeysList == null) { + throw Exception('Failed to load passkeys list!'); + } + + final List passkeys = []; + for (final Map passkey in response.passkeysList!) { + passkeys.add(DerivPasskeyModel.fromJson(passkey)); + } + + return passkeys; + } on BaseAPIException catch (e) { + throw ServerException( + errorCode: e.code ?? '', + message: e.message ?? '', + ); + } + } +} diff --git a/packages/deriv_passkeys/lib/src/data/mappers/deriv_passkeys_mapper.dart b/packages/deriv_passkeys/lib/src/data/mappers/deriv_passkeys_mapper.dart new file mode 100644 index 000000000..9404c3987 --- /dev/null +++ b/packages/deriv_passkeys/lib/src/data/mappers/deriv_passkeys_mapper.dart @@ -0,0 +1,63 @@ +import 'package:deriv_passkeys/src/data/models/passkeys_connection_info_model.dart'; +import 'package:deriv_passkeys/src/data/models/deriv_passkey_model.dart'; +import 'package:deriv_passkeys/src/data/models/deriv_passkeys_options_model.dart'; +import 'package:deriv_passkeys/src/data/models/deriv_passkeys_register_options_model.dart'; +import 'package:deriv_passkeys/src/data/models/deriv_passkeys_verify_credentials_request_body_model.dart'; +import 'package:deriv_passkeys/src/data/models/deriv_passkeys_verify_credentials_response_model.dart'; +import 'package:deriv_passkeys/src/domain/entities/passkeys_connection_info_entity.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkey_entity.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_options_entity.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_register_credentials_entity.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_register_options_entity.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_verify_credentials_request_body_entity.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_verify_credentials_response_entity.dart'; +import 'package:flutter_deriv_api/basic_api/generated/passkeys_register_send.dart'; + +/// [DerivPasskeysMapper] maps [DerivPasskeysOptionsModel] to [DerivPasskeysOptionsEntity]. +class DerivPasskeysMapper { + /// Maps [DerivPasskeysOptionsModel] to [DerivPasskeysOptionsEntity]. + DerivPasskeysOptionsEntity mapDerivPasskeysOptionsModel( + DerivPasskeysOptionsModel model) => + DerivPasskeysOptionsEntity.fromJson(model.toJson()); + + /// Maps [DerivPasskeysVerifyCredentialsRequest] to [DerivPasskeysVerifyCredentialsRequestBodyEntity]. + DerivPasskeysVerifyCredentialsRequest + mapDerivPasskeysVerifyCredentialsRequestBodyEntity( + DerivPasskeysVerifyCredentialsRequestBodyEntity entity) => + DerivPasskeysVerifyCredentialsRequest.fromJson(entity.toJson()); + + /// Maps [DerivPasskeysRegisterOptionsModel] to [DerivPasskeysRegisterOptionsEntity]. + DerivPasskeysRegisterOptionsEntity mapDerivPasskeysRegisterOptionsModel( + DerivPasskeysRegisterOptionsModel model) => + DerivPasskeysRegisterOptionsEntity.fromJson(model.toJson()); + + /// Maps [DerivPasskeyModel] to [DerivPasskeyEntity]. + DerivPasskeyEntity mapDerivPasskeyModel(DerivPasskeyModel model) => + DerivPasskeyEntity.fromJson( + model.toJson(), + ); + + /// Maps [DerivPasskeysRegisterCredentialsEntity] to [PasskeysRegisterRequest]. + PasskeysRegisterRequest mapDerivPasskeysRegisterCredentialsEntity( + DerivPasskeysRegisterCredentialsEntity entity) => + PasskeysRegisterRequest( + name: entity.name, + publicKeyCredential: entity.publicKeyCredential, + ); + + /// Maps [DerivPasskeysVerifyCredentialsResponseModel] to [DerivPasskeysVerifyCredentialsResponseEntity]. + DerivPasskeysVerifyCredentialsResponseEntity + mapDerivPasskeysVerifyCredentialsResponseModel( + DerivPasskeysVerifyCredentialsResponseModel model) => + DerivPasskeysVerifyCredentialsResponseEntity( + token: (model.response['tokens'] as List).first['token'], + ); + + /// Maps [ConnectionInfoEntity] to [PasskeysConnectionInfoModel]. + PasskeysConnectionInfoModel mapConnectionInfoEntity( + PasskeysConnectionInfoEntity entity) => + PasskeysConnectionInfoModel( + endpoint: entity.endpoint, + appId: entity.appId, + ); +} diff --git a/packages/deriv_passkeys/lib/src/data/models/deriv_passkey_model.dart b/packages/deriv_passkeys/lib/src/data/models/deriv_passkey_model.dart new file mode 100644 index 000000000..c0fc61836 --- /dev/null +++ b/packages/deriv_passkeys/lib/src/data/models/deriv_passkey_model.dart @@ -0,0 +1,58 @@ +import 'package:equatable/equatable.dart'; + +/// [DerivPasskeyModel] DTO for DerivPasskey data coming from the WebsocketAPI. +class DerivPasskeyModel extends Equatable { + /// Creates a [DerivPasskeyModel]. + const DerivPasskeyModel({ + required this.createdAt, + required this.id, + required this.lastUsed, + required this.name, + required this.passkeyId, + required this.storedOn, + }); + + /// Creates a [DerivPasskeyModel] from a JSON object. + factory DerivPasskeyModel.fromJson(Map json) => + DerivPasskeyModel( + createdAt: json['created_at'] as int, + id: json['id'].toString(), + lastUsed: + (json['last_used'] as int?) == 0 ? null : json['last_used'] as int?, + name: json['name'] as String, + passkeyId: json['passkey_id'] as String, + storedOn: json['stored_on'] as String, + ); + + /// Creates a JSON object from a [DerivPasskeyModel]. + Map toJson() => { + 'created_at': createdAt, + 'id': id, + 'last_used': lastUsed, + 'name': name, + 'passkey_id': passkeyId, + 'stored_on': storedOn, + }; + + /// [createdAt] is the creation date. + final int createdAt; + + /// [id] is the passkey ID. + final String id; + + /// [lastUsed] is the last used date. + final int? lastUsed; + + /// [name] is the passkey name. + final String name; + + /// [passkeyId] is the passkey ID. + final String passkeyId; + + /// [storedOn] is the device the passkey is stored on. + final String storedOn; + + @override + List get props => + [createdAt, id, lastUsed, name, passkeyId, storedOn]; +} diff --git a/packages/deriv_passkeys/lib/src/data/models/deriv_passkeys_options_model.dart b/packages/deriv_passkeys/lib/src/data/models/deriv_passkeys_options_model.dart new file mode 100644 index 000000000..55994a2ca --- /dev/null +++ b/packages/deriv_passkeys/lib/src/data/models/deriv_passkeys_options_model.dart @@ -0,0 +1,51 @@ +/// [DerivPasskeysOptionsModel] DTO for DerivPasskeysOptions data coming from the WebsocketAPI. +final class DerivPasskeysOptionsModel { + /// Creates a [DerivPasskeysOptionsModel]. + /// [challenge] is the challenge string. + /// [rpId] is the relying party ID. + /// [timeout] is the timeout in seconds. + /// [userVerification] is the user verification method. + DerivPasskeysOptionsModel({ + required this.challenge, + required this.rpId, + required this.timeout, + required this.userVerification, + required this.allowCredentials, + }); + + /// Creates a [DerivPasskeysOptionsModel] from a JSON object. + factory DerivPasskeysOptionsModel.fromJson(Map json) => + DerivPasskeysOptionsModel( + challenge: json['publicKey']['challenge'] as String, + rpId: json['publicKey']['rpId'] as String, + timeout: json['publicKey']['timeout'] as int, + userVerification: json['publicKey']['userVerification'] as String, + allowCredentials: + json['publicKey']['allowCredentials'] as List? ?? + [], + ); + + /// [challenge] is the challenge string. + final String challenge; + + /// [rpId] is the relying party ID. + final String rpId; + + /// [timeout] is the timeout in seconds. + final int timeout; + + /// [userVerification] is the user verification method. + final String userVerification; + + /// [allowCredentials] is the allowed credentials. + final List allowCredentials; + + /// Creates a JSON object from a [DerivPasskeysOptionsModel]. + Map toJson() => { + 'challenge': challenge, + 'rpId': rpId, + 'timeout': timeout, + 'userVerification': userVerification, + 'allowCredentials': allowCredentials, + }; +} diff --git a/packages/deriv_passkeys/lib/src/data/models/deriv_passkeys_register_options_model.dart b/packages/deriv_passkeys/lib/src/data/models/deriv_passkeys_register_options_model.dart new file mode 100644 index 000000000..3e2cf2028 --- /dev/null +++ b/packages/deriv_passkeys/lib/src/data/models/deriv_passkeys_register_options_model.dart @@ -0,0 +1,18 @@ +/// [DerivPasskeysRegisterOptionsModel] DTO for DerivPasskeysOptions data coming from the WebsocketAPI. +final class DerivPasskeysRegisterOptionsModel { + /// Creates a [DerivPasskeysRegisterOptionsModel]. + DerivPasskeysRegisterOptionsModel({ + required this.options, + }); + + /// Creates a [DerivPasskeysRegisterOptionsModel] from a JSON object. + factory DerivPasskeysRegisterOptionsModel.fromJson( + Map json) => + DerivPasskeysRegisterOptionsModel(options: json); + + /// [options] is the challenge string. + Map options; + + /// Creates a JSON object from a [DerivPasskeysRegisterOptionsModel]. + Map toJson() => options; +} diff --git a/packages/deriv_passkeys/lib/src/data/models/deriv_passkeys_verify_credentials_request_body_model.dart b/packages/deriv_passkeys/lib/src/data/models/deriv_passkeys_verify_credentials_request_body_model.dart new file mode 100644 index 000000000..f5cdaa133 --- /dev/null +++ b/packages/deriv_passkeys/lib/src/data/models/deriv_passkeys_verify_credentials_request_body_model.dart @@ -0,0 +1,48 @@ +/// A dart class that serves as a request body for the `DerivPasskeysVerifyCredentials` request. +final class DerivPasskeysVerifyCredentialsRequest { + /// Creates a [DerivPasskeysVerifyCredentialsRequest]. + DerivPasskeysVerifyCredentialsRequest({ + required this.appId, + required this.publicKeyCredential, + required this.type, + }); + + /// Creates a [DerivPasskeysVerifyCredentialsRequest] from a JSON object. + factory DerivPasskeysVerifyCredentialsRequest.fromJson( + Map json, + ) => + DerivPasskeysVerifyCredentialsRequest( + appId: json['app_id'] as String, + publicKeyCredential: + json['publicKeyCredential'] as Map, + type: json['type'] as String, + ); + + /// The app ID. + final String appId; + + /// The public key credential returned by the authenticator. + final Map publicKeyCredential; + + /// The type. + final String type; + + /// Converts the [DerivPasskeysVerifyCredentialsRequest] to a JSON object. + Map toJson() => { + 'app_id': appId, + 'publicKeyCredential': publicKeyCredential, + 'type': type, + }; + + /// Copies the [DerivPasskeysVerifyCredentialsRequest] with some new values. + DerivPasskeysVerifyCredentialsRequest copyWith({ + String? appId, + Map? publicKeyCredential, + String? type, + }) => + DerivPasskeysVerifyCredentialsRequest( + appId: appId ?? this.appId, + publicKeyCredential: publicKeyCredential ?? this.publicKeyCredential, + type: type ?? this.type, + ); +} diff --git a/packages/deriv_passkeys/lib/src/data/models/deriv_passkeys_verify_credentials_response_model.dart b/packages/deriv_passkeys/lib/src/data/models/deriv_passkeys_verify_credentials_response_model.dart new file mode 100644 index 000000000..3b6c29e2e --- /dev/null +++ b/packages/deriv_passkeys/lib/src/data/models/deriv_passkeys_verify_credentials_response_model.dart @@ -0,0 +1,15 @@ +import 'package:equatable/equatable.dart'; + +/// A Dart class that contains the response to verify credentials. +final class DerivPasskeysVerifyCredentialsResponseModel extends Equatable { + /// Creates a [DerivPasskeysVerifyCredentialsResponseModel]. + const DerivPasskeysVerifyCredentialsResponseModel({ + required this.response, + }); + + /// contains the response from the REST API to verify credentials. + final Map response; + + @override + List get props => [response]; +} diff --git a/packages/deriv_passkeys/lib/src/data/models/passkeys_connection_info_model.dart b/packages/deriv_passkeys/lib/src/data/models/passkeys_connection_info_model.dart new file mode 100644 index 000000000..238548ff0 --- /dev/null +++ b/packages/deriv_passkeys/lib/src/data/models/passkeys_connection_info_model.dart @@ -0,0 +1,24 @@ +/// Model to store connection info. +class PasskeysConnectionInfoModel { + /// Creates a new [PasskeysConnectionInfoModel] instance. + PasskeysConnectionInfoModel({ + required this.endpoint, + required this.appId, + }); + + /// Connection endpoint. + String endpoint; + + /// Deriv client app ID. + String appId; + + /// Copies the current instance with some new values. + PasskeysConnectionInfoModel copyWith({ + String? endpoint, + String? appId, + }) => + PasskeysConnectionInfoModel( + endpoint: endpoint ?? this.endpoint, + appId: appId ?? this.appId, + ); +} diff --git a/packages/deriv_passkeys/lib/src/data/platform/deriv_passkeys_method_channel.dart b/packages/deriv_passkeys/lib/src/data/platform/deriv_passkeys_method_channel.dart new file mode 100644 index 000000000..3742d9b9d --- /dev/null +++ b/packages/deriv_passkeys/lib/src/data/platform/deriv_passkeys_method_channel.dart @@ -0,0 +1,71 @@ +import 'package:deriv_passkeys/src/exceptions/platform_exceptions.dart'; +import 'package:deriv_passkeys/src/domain/platform/base_deriv_passkeys_method_channel.dart'; +import 'package:flutter/services.dart'; + +/// An implementation of [BaseDerivPasskeysMethodChannel] that uses method channels. +class MethodChannelDerivPasskeys extends BaseDerivPasskeysMethodChannel { + /// Constructs a [MethodChannelDerivPasskeys] with an optional [MethodChannel]; + MethodChannelDerivPasskeys({ + MethodChannel? channel, + }) : methodChannel = channel ?? const MethodChannel('deriv_passkeys'); + + /// The method channel used to interact with the native platform. + MethodChannel methodChannel; + + @override + Future isPlatformSupported() async => + methodChannel.invokeMethod('isPlatformSupported'); + + @override + Future createCredential(String options) => + methodChannel.invokeMethod( + 'createCredential', {'options': options}).catchError( + (Object error) { + if (error is PlatformException) { + if (error.code == '1001' || + error.code == 'CreateCredentialCancellationException') { + throw CanceledPlatformException( + code: error.code, + message: error.message ?? 'Error creating passkey', + details: error.details ?? error.toString(), + ); + } + } + throw PlatformException( + code: 'unhandled_error', + message: 'Unhandled error creating passkey', + details: error.toString(), + ); + }, + ); + + @override + Future getCredential(String options) => + methodChannel.invokeMethod( + 'getCredential', {'options': options}).catchError( + (Object error) { + if (error is PlatformException) { + if (error.code == '1001' || + error.code == 'GetCredentialCancellationException') { + throw CanceledPlatformException( + code: error.code, + message: error.message ?? 'Error creating passkey', + details: error.details ?? error.toString(), + ); + } + if (error.code == 'NoCredentialException') { + throw NoCredentialPlatformException( + code: error.code, + message: error.message ?? 'Error creating passkey', + details: error.details ?? error.toString(), + ); + } + } + throw PlatformException( + code: 'unhandled_error', + message: 'Unhandled error creating passkey', + details: error.toString(), + ); + }, + ); +} diff --git a/packages/deriv_passkeys/lib/src/data/repositories/deriv_passkeys_repository.dart b/packages/deriv_passkeys/lib/src/data/repositories/deriv_passkeys_repository.dart new file mode 100644 index 000000000..0e0a472a1 --- /dev/null +++ b/packages/deriv_passkeys/lib/src/data/repositories/deriv_passkeys_repository.dart @@ -0,0 +1,71 @@ +import 'package:deriv_passkeys/src/data/data_sources/base_deriv_passkeys_data_source.dart'; +import 'package:deriv_passkeys/src/data/models/deriv_passkey_model.dart'; +import 'package:deriv_passkeys/src/domain/base_repositories/base_deriv_passkeys_repository.dart'; +import 'package:deriv_passkeys/src/domain/entities/passkeys_connection_info_entity.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkey_entity.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_options_entity.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_register_credentials_entity.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_register_options_entity.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_verify_credentials_request_body_entity.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_verify_credentials_response_entity.dart'; + +/// [DerivPasskeysRepository] extends and implements [BaseDerivPasskeysRepository]. +/// +/// It is responsible for handling all DerivPasskeys data sources, and forwarding relavant data +/// to the services using it. +final class DerivPasskeysRepository extends BaseDerivPasskeysRepository { + /// Creates a [DerivPasskeysRepository]. + DerivPasskeysRepository(this.dataSource); + + /// The data source used to get data for Passkeys functionalities. + final BaseDerivPasskeysDataSource dataSource; + + @override + Future getOptions({ + required PasskeysConnectionInfoEntity passkeysConnectionInfoEntity, + }) => + dataSource + .getOptions( + passkeysConnectionInfoModel: dataSource.mapper + .mapConnectionInfoEntity(passkeysConnectionInfoEntity), + ) + .then(dataSource.mapper.mapDerivPasskeysOptionsModel); + + @override + Future verifyCredentials({ + required DerivPasskeysVerifyCredentialsRequestBodyEntity requestBodyEntity, + required String jwtToken, + required PasskeysConnectionInfoEntity passkeysConnectionInfoEntity, + String? userAgent, + }) => + dataSource + .verifyCredentials( + requestBodyModel: dataSource.mapper + .mapDerivPasskeysVerifyCredentialsRequestBodyEntity( + requestBodyEntity), + jwtToken: jwtToken, + passkeysConnectionInfoModel: dataSource.mapper + .mapConnectionInfoEntity(passkeysConnectionInfoEntity), + userAgent: userAgent, + ) + .then( + dataSource.mapper.mapDerivPasskeysVerifyCredentialsResponseModel); + + @override + Future getRegisterOptions() => dataSource + .getRegisterOptions() + .then(dataSource.mapper.mapDerivPasskeysRegisterOptionsModel); + + @override + Future registerCredentials( + DerivPasskeysRegisterCredentialsEntity entity) => + dataSource + .registerCredentials(dataSource.mapper + .mapDerivPasskeysRegisterCredentialsEntity(entity)) + .then(dataSource.mapper.mapDerivPasskeyModel); + + @override + Future> getPasskeysList() => + dataSource.getPasskeysList().then((List models) => + models.map(dataSource.mapper.mapDerivPasskeyModel).toList()); +} diff --git a/packages/deriv_passkeys/lib/src/domain/base_repositories/base_deriv_passkeys_repository.dart b/packages/deriv_passkeys/lib/src/domain/base_repositories/base_deriv_passkeys_repository.dart new file mode 100644 index 000000000..63a1f366b --- /dev/null +++ b/packages/deriv_passkeys/lib/src/domain/base_repositories/base_deriv_passkeys_repository.dart @@ -0,0 +1,35 @@ +import 'package:deriv_passkeys/src/domain/entities/passkeys_connection_info_entity.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkey_entity.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_options_entity.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_register_credentials_entity.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_register_options_entity.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_verify_credentials_request_body_entity.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_verify_credentials_response_entity.dart'; + +/// [BaseDerivPasskeysRepository] defines a contract for all DerivPasskeys repositories. +/// +/// All DerivPasskeys repositories should extend this class, and implement its abstract methods. +abstract base class BaseDerivPasskeysRepository { + /// Get options for authentication with DerivPasskeys. + Future getOptions({ + required PasskeysConnectionInfoEntity passkeysConnectionInfoEntity, + }); + + /// Verify the user's DerivPasskeys credentials. + Future verifyCredentials({ + required DerivPasskeysVerifyCredentialsRequestBodyEntity requestBodyEntity, + required String jwtToken, + required PasskeysConnectionInfoEntity passkeysConnectionInfoEntity, + String? userAgent, + }); + + /// Get options for registration with DerivPasskeys. + Future getRegisterOptions(); + + /// Register credentials with DerivPasskeys. + Future registerCredentials( + DerivPasskeysRegisterCredentialsEntity entity); + + /// Get passkeys list. + Future> getPasskeysList(); +} diff --git a/packages/deriv_passkeys/lib/src/domain/domain.dart b/packages/deriv_passkeys/lib/src/domain/domain.dart new file mode 100644 index 000000000..9fbf5dc74 --- /dev/null +++ b/packages/deriv_passkeys/lib/src/domain/domain.dart @@ -0,0 +1,5 @@ +library deriv_passkeys; + +export './entities/passkeys_connection_info_entity.dart'; +export './entities/deriv_passkeys_verify_credentials_response_entity.dart'; +export './entities/deriv_passkey_entity.dart'; diff --git a/packages/deriv_passkeys/lib/src/domain/entities/deriv_passkey_entity.dart b/packages/deriv_passkeys/lib/src/domain/entities/deriv_passkey_entity.dart new file mode 100644 index 000000000..e2f1f29a1 --- /dev/null +++ b/packages/deriv_passkeys/lib/src/domain/entities/deriv_passkey_entity.dart @@ -0,0 +1,53 @@ +import 'package:equatable/equatable.dart'; + +/// [DerivPasskeyEntity] DTO for DerivPasskey data coming from the WebsocketAPI. +class DerivPasskeyEntity extends Equatable { + /// Creates a [DerivPasskeyEntity]. + const DerivPasskeyEntity({ + required this.createdAt, + required this.id, + required this.lastUsed, + required this.name, + required this.passkeyId, + required this.storedOn, + }); + + /// Creates a [DerivPasskeyEntity] from a JSON object. + factory DerivPasskeyEntity.fromJson(Map json) => + DerivPasskeyEntity( + createdAt: json['created_at'] as int, + id: json['id'] as String, + lastUsed: json['last_used'] as int?, + name: json['name'] as String, + passkeyId: json['passkey_id'] as String, + storedOn: json['stored_on'] as String, + ); + + /// [createdAt] is the creation date. + final int createdAt; + + /// [id] is the passkey ID. + final String id; + + /// [lastUsed] is the last used date. + final int? lastUsed; + + /// [name] is the passkey name. + final String name; + + /// [passkeyId] is the passkey ID. + final String passkeyId; + + /// [storedOn] is the device the passkey is stored on. + final String storedOn; + + @override + List get props => [ + createdAt, + id, + lastUsed, + name, + passkeyId, + storedOn, + ]; +} diff --git a/packages/deriv_passkeys/lib/src/domain/entities/deriv_passkeys_options_entity.dart b/packages/deriv_passkeys/lib/src/domain/entities/deriv_passkeys_options_entity.dart new file mode 100644 index 000000000..6532faf99 --- /dev/null +++ b/packages/deriv_passkeys/lib/src/domain/entities/deriv_passkeys_options_entity.dart @@ -0,0 +1,60 @@ +import 'package:equatable/equatable.dart'; + +/// [DerivPasskeysOptionsEntity] represents a DerivPasskeysOptions entity. +final class DerivPasskeysOptionsEntity extends Equatable { + /// Creates a [DerivPasskeysOptionsEntity]. + /// [challenge] is the challenge string. + /// [rpId] is the relying party ID. + /// [timeout] is the timeout in seconds. + /// [userVerification] is the user verification method. + const DerivPasskeysOptionsEntity({ + required this.challenge, + required this.rpId, + required this.timeout, + required this.userVerification, + required this.allowCredentials, + }); + + /// Creates a [DerivPasskeysOptionsEntity] from a JSON object. + factory DerivPasskeysOptionsEntity.fromJson(Map json) => + DerivPasskeysOptionsEntity( + challenge: json['challenge'] as String, + rpId: json['rpId'] as String, + timeout: json['timeout'] as int, + userVerification: json['userVerification'] as String, + allowCredentials: json['allowCredentials'] as List, + ); + + /// [challenge] is the challenge string. + final String challenge; + + /// [rpId] is the relying party ID. + final String rpId; + + /// [timeout] is the timeout in seconds. + final int timeout; + + /// [userVerification] is the user verification method. + final String userVerification; + + /// [allowCredentials] is the allowed credentials. + final List allowCredentials; + + /// Creates a JSON object from a [DerivPasskeysOptionsEntity]. + Map toJson() => { + 'challenge': challenge, + 'rpId': rpId, + 'timeout': timeout, + 'userVerification': userVerification, + 'allowCredentials': allowCredentials, + }; + + @override + List get props => [ + challenge, + rpId, + timeout, + userVerification, + allowCredentials, + ]; +} diff --git a/packages/deriv_passkeys/lib/src/domain/entities/deriv_passkeys_register_credentials_entity.dart b/packages/deriv_passkeys/lib/src/domain/entities/deriv_passkeys_register_credentials_entity.dart new file mode 100644 index 000000000..5a95b4c9f --- /dev/null +++ b/packages/deriv_passkeys/lib/src/domain/entities/deriv_passkeys_register_credentials_entity.dart @@ -0,0 +1,25 @@ +import 'package:equatable/equatable.dart'; + +/// [DerivPasskeysRegisterCredentialsEntity] is the entity class for the register credentials. +final class DerivPasskeysRegisterCredentialsEntity extends Equatable { + /// Creates a [DerivPasskeysRegisterCredentialsEntity]. + const DerivPasskeysRegisterCredentialsEntity({ + required this.publicKeyCredential, + required this.name, + }); + + /// [publicKeyCredential] is the challenge string. + final Map publicKeyCredential; + + /// [name] is the name of the passkey. + final String name; + + /// Creates a JSON object from a [DerivPasskeysRegisterCredentialsEntity]. + Map toJson() => { + 'publicKeyCredential': publicKeyCredential, + 'name': name, + }; + + @override + List get props => [publicKeyCredential, name]; +} diff --git a/packages/deriv_passkeys/lib/src/domain/entities/deriv_passkeys_register_options_entity.dart b/packages/deriv_passkeys/lib/src/domain/entities/deriv_passkeys_register_options_entity.dart new file mode 100644 index 000000000..00b7fccb6 --- /dev/null +++ b/packages/deriv_passkeys/lib/src/domain/entities/deriv_passkeys_register_options_entity.dart @@ -0,0 +1,23 @@ +import 'package:equatable/equatable.dart'; + +/// [DerivPasskeysRegisterOptionsEntity] DTO for DerivPasskeysOptions data coming from the WebsocketAPI. +final class DerivPasskeysRegisterOptionsEntity extends Equatable { + /// Creates a [DerivPasskeysRegisterOptionsEntity]. + const DerivPasskeysRegisterOptionsEntity({ + required this.options, + }); + + /// Creates a [DerivPasskeysRegisterOptionsEntity] from a JSON object. + factory DerivPasskeysRegisterOptionsEntity.fromJson( + Map json) => + DerivPasskeysRegisterOptionsEntity(options: json); + + /// [options] is the challenge string. + final Map options; + + /// Creates a JSON object from a [DerivPasskeysRegisterOptionsEntity]. + Map toJson() => options; + + @override + List get props => [options]; +} diff --git a/packages/deriv_passkeys/lib/src/domain/entities/deriv_passkeys_verify_credentials_request_body_entity.dart b/packages/deriv_passkeys/lib/src/domain/entities/deriv_passkeys_verify_credentials_request_body_entity.dart new file mode 100644 index 000000000..4e6b06be8 --- /dev/null +++ b/packages/deriv_passkeys/lib/src/domain/entities/deriv_passkeys_verify_credentials_request_body_entity.dart @@ -0,0 +1,40 @@ +import 'package:equatable/equatable.dart'; + +/// A dart class that serves as a request body for the `DerivPasskeysVerifyCredentials` request. +final class DerivPasskeysVerifyCredentialsRequestBodyEntity extends Equatable { + /// Creates a [DerivPasskeysVerifyCredentialsRequestBodyEntity]. + const DerivPasskeysVerifyCredentialsRequestBodyEntity({ + required this.appId, + required this.publicKeyCredential, + required this.type, + }); + + /// Creates a [DerivPasskeysVerifyCredentialsRequestBodyEntity] from a JSON object. + factory DerivPasskeysVerifyCredentialsRequestBodyEntity.fromJson( + Map json) => + DerivPasskeysVerifyCredentialsRequestBodyEntity( + appId: json['app_id'] as String, + publicKeyCredential: + json['publicKeyCredential'] as Map, + type: json['type'] as String, + ); + + /// The app ID. + final String appId; + + /// The public key credential returned by the authenticator. + final Map publicKeyCredential; + + /// The type. + final String type; + + /// Converts the [DerivPasskeysVerifyCredentialsRequestBodyEntity] to a JSON object. + Map toJson() => { + 'app_id': appId, + 'publicKeyCredential': publicKeyCredential, + 'type': type, + }; + + @override + List get props => [appId, publicKeyCredential, type]; +} diff --git a/packages/deriv_passkeys/lib/src/domain/entities/deriv_passkeys_verify_credentials_response_entity.dart b/packages/deriv_passkeys/lib/src/domain/entities/deriv_passkeys_verify_credentials_response_entity.dart new file mode 100644 index 000000000..1e249d40a --- /dev/null +++ b/packages/deriv_passkeys/lib/src/domain/entities/deriv_passkeys_verify_credentials_response_entity.dart @@ -0,0 +1,15 @@ +import 'package:equatable/equatable.dart'; + +/// A Dart class that contains the response to verify credentials. +final class DerivPasskeysVerifyCredentialsResponseEntity extends Equatable { + /// Creates a [DerivPasskeysVerifyCredentialsResponseEntity]. + const DerivPasskeysVerifyCredentialsResponseEntity({ + required this.token, + }); + + /// contains the token from the REST API to verify credentials. + final String token; + + @override + List get props => [token]; +} diff --git a/packages/deriv_passkeys/lib/src/domain/entities/passkeys_connection_info_entity.dart b/packages/deriv_passkeys/lib/src/domain/entities/passkeys_connection_info_entity.dart new file mode 100644 index 000000000..213d42943 --- /dev/null +++ b/packages/deriv_passkeys/lib/src/domain/entities/passkeys_connection_info_entity.dart @@ -0,0 +1,14 @@ +/// Entity to store connection info. +class PasskeysConnectionInfoEntity { + /// Creates a new [PasskeysConnectionInfoEntity] instance. + PasskeysConnectionInfoEntity({ + required this.endpoint, + required this.appId, + }); + + /// Connection endpoint. + String endpoint; + + /// Deriv client app ID. + String appId; +} diff --git a/packages/deriv_passkeys/lib/src/domain/platform/base_deriv_passkeys_method_channel.dart b/packages/deriv_passkeys/lib/src/domain/platform/base_deriv_passkeys_method_channel.dart new file mode 100644 index 000000000..c145e6540 --- /dev/null +++ b/packages/deriv_passkeys/lib/src/domain/platform/base_deriv_passkeys_method_channel.dart @@ -0,0 +1,35 @@ +import 'package:deriv_passkeys/src/data/platform/deriv_passkeys_method_channel.dart'; +import 'package:plugin_platform_interface/plugin_platform_interface.dart'; + +/// The interface that implementations of deriv_passkeys must implement. +abstract class BaseDerivPasskeysMethodChannel extends PlatformInterface { + /// Constructs a BaseDerivPasskeysMethodChannel. + BaseDerivPasskeysMethodChannel() : super(token: _token); + + static final Object _token = Object(); + + static BaseDerivPasskeysMethodChannel _instance = + MethodChannelDerivPasskeys(); + + /// The default instance of [BaseDerivPasskeysMethodChannel] to use. + /// + /// Defaults to [MethodChannelDerivPasskeys]. + static BaseDerivPasskeysMethodChannel get instance => _instance; + + /// Platform-specific implementations should set this with their own + /// platform-specific class that extends [BaseDerivPasskeysMethodChannel] when + /// they register themselves. + static set instance(BaseDerivPasskeysMethodChannel instance) { + PlatformInterface.verifyToken(instance, _token); + _instance = instance; + } + + /// Returns the platform version. + Future isPlatformSupported(); + + /// Creates a passkey credential. + Future createCredential(String options); + + /// Gets a passkey credential. + Future getCredential(String options); +} diff --git a/packages/deriv_passkeys/lib/src/exceptions/platform_exceptions.dart b/packages/deriv_passkeys/lib/src/exceptions/platform_exceptions.dart new file mode 100644 index 000000000..6db77cf7c --- /dev/null +++ b/packages/deriv_passkeys/lib/src/exceptions/platform_exceptions.dart @@ -0,0 +1,29 @@ +import 'package:flutter/services.dart'; + +/// An exception that is thrown when the platform fails to create a passkey. +class CanceledPlatformException extends PlatformException { + /// Creates a [CanceledPlatformException]. + CanceledPlatformException({ + required String code, + required String message, + required String details, + }) : super( + code: code, + message: message, + details: details, + ); +} + +/// An exception that is thrown when the platform cannot find a matching credential. +class NoCredentialPlatformException extends PlatformException { + /// Creates a [NoCredentialPlatformException]. + NoCredentialPlatformException({ + required String code, + required String message, + required String details, + }) : super( + code: code, + message: message, + details: details, + ); +} diff --git a/packages/deriv_passkeys/lib/src/exceptions/server_exceptions.dart b/packages/deriv_passkeys/lib/src/exceptions/server_exceptions.dart new file mode 100644 index 000000000..b85a27380 --- /dev/null +++ b/packages/deriv_passkeys/lib/src/exceptions/server_exceptions.dart @@ -0,0 +1,14 @@ +/// Server exception +class ServerException implements Exception { + /// Creates a [ServerException]. + ServerException({ + required this.errorCode, + required this.message, + }); + + /// The error code. + String errorCode; + + /// The error message. + String message; +} diff --git a/packages/deriv_passkeys/lib/src/extensions/context_extensions.dart b/packages/deriv_passkeys/lib/src/extensions/context_extensions.dart new file mode 100644 index 000000000..767cb4060 --- /dev/null +++ b/packages/deriv_passkeys/lib/src/extensions/context_extensions.dart @@ -0,0 +1,9 @@ +import 'package:deriv_localizations/l10n/generated/deriv_passkeys/deriv_passkeys_localizations.dart'; +import 'package:flutter/widgets.dart'; + +/// Extension for [BuildContext] +extension ContextExtension on BuildContext { + /// Get derivPasskeysLocalizations. + DerivPasskeysLocalizations get derivPasskeysLocalizations => + DerivPasskeysLocalizations.of(this)!; +} diff --git a/packages/deriv_passkeys/lib/src/interactor/interactor.dart b/packages/deriv_passkeys/lib/src/interactor/interactor.dart new file mode 100644 index 000000000..c0db4ce94 --- /dev/null +++ b/packages/deriv_passkeys/lib/src/interactor/interactor.dart @@ -0,0 +1,3 @@ +library deriv_passkeys; + +export './services/deriv_passkeys_service.dart'; diff --git a/packages/deriv_passkeys/lib/src/interactor/services/deriv_passkeys_service.dart b/packages/deriv_passkeys/lib/src/interactor/services/deriv_passkeys_service.dart new file mode 100644 index 000000000..ec4809fc6 --- /dev/null +++ b/packages/deriv_passkeys/lib/src/interactor/services/deriv_passkeys_service.dart @@ -0,0 +1,111 @@ +import 'dart:convert'; + +import 'package:deriv_passkeys/src/domain/base_repositories/base_deriv_passkeys_repository.dart'; +import 'package:deriv_passkeys/src/domain/entities/passkeys_connection_info_entity.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkey_entity.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_register_credentials_entity.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_verify_credentials_request_body_entity.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_verify_credentials_response_entity.dart'; +import 'package:deriv_passkeys/src/domain/platform/base_deriv_passkeys_method_channel.dart'; +import 'package:flutter/services.dart'; + +/// A wrapper class that contains methods to interact with the native platform for passkey. +class DerivPasskeysService { + /// Constructs a [DerivPasskeysService] with [BaseDerivPasskeysRepository]. + DerivPasskeysService(this.repository); + + /// The repository used to get data for Passkeys functionalities. + final BaseDerivPasskeysRepository repository; + + /// Returns true if the device supports passkey. + Future isSupported() async { + final bool? isPlatformSupportedResult = + await BaseDerivPasskeysMethodChannel.instance.isPlatformSupported(); + return isPlatformSupportedResult ?? false; + } + + /// Creates a passkey credential. + Future createCredential() async { + final Map getRegisterOptionsResult = + (await repository.getRegisterOptions()).options; + final Map publicKeyCredentialUserEntityJson = + { + 'id': _base64UrlEncodeString( + getRegisterOptionsResult['user']['id'].toString()), + 'name': getRegisterOptionsResult['user']['name'], + 'displayName': getRegisterOptionsResult['user']['displayName'] + }; + + getRegisterOptionsResult['user'] = publicKeyCredentialUserEntityJson; + + final String options = jsonEncode(getRegisterOptionsResult); + + final String? credentials = + await BaseDerivPasskeysMethodChannel.instance.createCredential(options); + if (credentials == null) { + throw PlatformException( + code: 'null-response', + message: 'Unable to get response from Passkey.'); + } + final Map decodedCredentials = jsonDecode(credentials); + final DerivPasskeyEntity getRegisterPasskeysResult = + await repository.registerCredentials( + DerivPasskeysRegisterCredentialsEntity( + publicKeyCredential: decodedCredentials, + name: 'Passkey', + ), + ); + return getRegisterPasskeysResult; + } + + /// Gets a list of passkeys. + Future> getPasskeysList() async { + final List getPasskeysListResult = + await repository.getPasskeysList(); + return getPasskeysListResult; + } + + /// Gets a passkey credential. + Future verifyCredential({ + required String jwtToken, + required PasskeysConnectionInfoEntity passkeysConnectionInfoEntity, + String? userAgent, + }) async { + final Map getOptionsResult = (await repository.getOptions( + passkeysConnectionInfoEntity: passkeysConnectionInfoEntity, + )) + .toJson(); + final String options = jsonEncode(getOptionsResult); + + final String? response = + await BaseDerivPasskeysMethodChannel.instance.getCredential(options); + + if (response == null) { + throw PlatformException( + code: 'null-response', + message: 'Unable to get response from Passkey.'); + } + + final Map decodedResponse = jsonDecode(response); + + final DerivPasskeysVerifyCredentialsResponseEntity + getVerifyCredentialsResult = await repository.verifyCredentials( + requestBodyEntity: DerivPasskeysVerifyCredentialsRequestBodyEntity( + appId: passkeysConnectionInfoEntity.appId, + publicKeyCredential: decodedResponse, + type: 'passkeys', + ), + jwtToken: jwtToken, + passkeysConnectionInfoEntity: passkeysConnectionInfoEntity, + userAgent: userAgent, + ); + + return getVerifyCredentialsResult; + } +} + +String _base64UrlEncodeString(String input) { + final List bytes = utf8.encode(input); + final String base64Str = base64Url.encode(bytes); + return base64Str; +} diff --git a/packages/deriv_passkeys/lib/src/presentation/constants/assets.dart b/packages/deriv_passkeys/lib/src/presentation/constants/assets.dart new file mode 100644 index 000000000..9e7fd6cb3 --- /dev/null +++ b/packages/deriv_passkeys/lib/src/presentation/constants/assets.dart @@ -0,0 +1,32 @@ +/// [Assets] contains all the assets used in the deriv_passkeys plugin. +class Assets { + /// [passkeySvgIcon] is the svg icon used for passkey. + static const String passkeySvgIcon = 'assets/svg/passkey_icon.svg'; + + /// [effortlessPasskeysIcon] is the svg icon used for passkey. + static const String effortlessPasskeysIcon = + 'assets/svg/effortless_login_passkey_icon.svg'; + + /// [passkeyCreatedSuccessIcon] is the svg icon used for passkey. + static const String passkeyCreatedSuccessIcon = + 'assets/svg/passkey_created_success_icon.svg'; + + /// [fingerPrintIcon] is the svg icon used for passkey. + static const String fingerPrintIcon = 'assets/svg/fingerprint_icon.svg'; + + /// [syncIcon] is the svg icon used for passkey. + static const String syncIcon = 'assets/svg/sync_icon.svg'; + + /// [lockIcon] is the svg icon used for passkey. + static const String lockIcon = 'assets/svg/lock_icon.svg'; + + /// [lightBulbIcon] is the svg icon used for passkey. + static const String lightBulbIcon = 'assets/svg/light_bulb_icon.svg'; + + /// [learnMorePasskeysIcon] is the svg icon used for passkey. + static const String learnMorePasskeysIcon = + 'assets/svg/learn_more_passkeys_icon.svg'; + + /// [addPasskeyIcon] is the svg icon used for passkey. + static const String addPasskeyIcon = 'assets/svg/add_passkey_icon.svg'; +} diff --git a/packages/deriv_passkeys/lib/src/presentation/pages/effortless_passkeys_login_page.dart b/packages/deriv_passkeys/lib/src/presentation/pages/effortless_passkeys_login_page.dart new file mode 100644 index 000000000..3d9961d38 --- /dev/null +++ b/packages/deriv_passkeys/lib/src/presentation/pages/effortless_passkeys_login_page.dart @@ -0,0 +1,213 @@ +import 'package:deriv_passkeys/src/extensions/context_extensions.dart'; +import 'package:deriv_passkeys/src/presentation/constants/assets.dart'; +import 'package:deriv_passkeys/src/presentation/pages/learn_more_passkeys_page.dart'; +import 'package:deriv_passkeys/src/presentation/pages/passkey_created_page.dart'; +import 'package:deriv_passkeys/src/presentation/states/bloc/deriv_passkeys_bloc.dart'; +import 'package:deriv_passkeys/src/presentation/utils/handle_errors_utils.dart'; +import 'package:deriv_passkeys/src/presentation/widgets/icon_text_row_widget.dart'; +import 'package:deriv_passkeys/src/presentation/widgets/passkey_created_call_to_action.dart'; +import 'package:deriv_theme/deriv_theme.dart'; +import 'package:deriv_ui/deriv_ui.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_svg/svg.dart'; + +/// A stateless widget to build the Effortless Passkeys page. +class EffortlessPasskeysPage extends StatelessWidget { + /// Creates a [EffortlessPasskeysPage]. + const EffortlessPasskeysPage({ + required this.onPageClosed, + required this.addMorePasskeysNavigationCallback, + required this.continueTradingNavigationCallback, + super.key, + }); + + /// The route name for the effortless passkeys page. + static const String routeName = 'effortless_passkeys_page'; + + /// Callback to be called when the user wants to add more passkeys. + final void Function(BuildContext context) addMorePasskeysNavigationCallback; + + /// Callback to be called when the user wants to continue trading. + final void Function(BuildContext context) continueTradingNavigationCallback; + + /// Callback to be called when the flow is complete. + final void Function(BuildContext context) onPageClosed; + + /// + + @override + Widget build(BuildContext context) => + BlocListener( + listener: (BuildContext context, DerivPasskeysState state) { + if (state is DerivPasskeysCreatedSuccessfullyState) { + Navigator.pushReplacement( + context, + MaterialPageRoute( + builder: (BuildContext context) => PasskeyCreatedPage( + onPageClose: onPageClosed, + bottomCallToAction: PasskeysCreatedCallToAction( + addMorePasskeysNavigationCallback: + addMorePasskeysNavigationCallback, + continueTradingNavigationCallback: + continueTradingNavigationCallback, + ), + )), + ); + } else if (state is DerivPasskeysErrorState) { + handlePasskeysError(context, state); + } + }, + child: Scaffold( + body: SafeArea( + child: LayoutBuilder( + builder: (_, constraints) => SingleChildScrollView( + child: ConstrainedBox( + constraints: BoxConstraints( + minWidth: constraints.maxWidth, + minHeight: constraints.maxHeight), + child: IntrinsicHeight( + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + alignment: Alignment.topRight, + child: Padding( + padding: const EdgeInsets.all(16), + child: TextButton( + onPressed: () => onPageClosed(context), + child: Text( + context + .derivPasskeysLocalizations.maybeLater + .toUpperCase(), + style: TextStyle( + color: context.theme.colors.coral, + ), + ), + ), + ), + ), + Expanded( + child: Container( + padding: const EdgeInsets.symmetric( + horizontal: 24, vertical: 96), + child: Column( + mainAxisAlignment: + MainAxisAlignment.spaceEvenly, + children: [ + SvgPicture.asset( + Assets.effortlessPasskeysIcon, + package: 'deriv_passkeys', + ), + Text( + context.derivPasskeysLocalizations + .effortlessLoginWithPasskeys, + style: const TextStyle(fontSize: 20), + ), + const SizedBox( + height: 24, + ), + IconTextRowWidget( + assetName: Assets.fingerPrintIcon, + text: context.derivPasskeysLocalizations + .noNeedToRememberPassword, + ), + Divider( + color: context.theme.colors.hover, + ), + IconTextRowWidget( + assetName: Assets.syncIcon, + text: context.derivPasskeysLocalizations + .syncAcrossDevices, + ), + Divider( + color: context.theme.colors.hover, + ), + IconTextRowWidget( + assetName: Assets.lockIcon, + text: context.derivPasskeysLocalizations + .useYourBiometrics, + ), + Divider( + color: context.theme.colors.hover, + ), + SizedBox( + width: double.infinity, + child: RichText( + text: TextSpan( + children: [ + TextSpan( + text: + '${context.derivPasskeysLocalizations.learnMoreAboutPasskeys} ', + style: TextStyle( + color: context + .theme.colors.general, + )), + WidgetSpan( + alignment: + PlaceholderAlignment.middle, + child: InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (_) => + LearnMorePasskeysPage( + onPageClosed: + (BuildContext + context) { + Navigator.pop( + context); + }, + addMorePasskeysNavigationCallback: + addMorePasskeysNavigationCallback, + continueTradingNavigationCallback: + continueTradingNavigationCallback, + ), + ), + ); + }, + child: Text( + '${context.derivPasskeysLocalizations.here}.', + style: TextStyle( + color: context.theme + .colors.coral), + ), + ), + ), + ], + ), + ), + ) + ], + ), + ), + ), + Container( + width: double.infinity, + child: Padding( + padding: const EdgeInsets.all(16), + child: PrimaryButton( + onPressed: () { + context.read().add( + DerivPasskeysCreateCredentialEvent()); + }, + child: Text( + context.derivPasskeysLocalizations + .createPasskey, + style: TextStyle( + color: context.theme.colors.prominent, + ), + ), + ), + ), + ) + ], + ), + ), + ), + )), + ), + ), + ); +} diff --git a/packages/deriv_passkeys/lib/src/presentation/pages/learn_more_passkeys_page.dart b/packages/deriv_passkeys/lib/src/presentation/pages/learn_more_passkeys_page.dart new file mode 100644 index 000000000..cc308d638 --- /dev/null +++ b/packages/deriv_passkeys/lib/src/presentation/pages/learn_more_passkeys_page.dart @@ -0,0 +1,253 @@ +import 'package:deriv_passkeys/deriv_passkeys.dart'; +import 'package:deriv_passkeys/src/extensions/context_extensions.dart'; +import 'package:deriv_passkeys/src/presentation/constants/assets.dart'; +import 'package:deriv_passkeys/src/presentation/pages/passkey_created_page.dart'; +import 'package:deriv_passkeys/src/presentation/widgets/passkey_created_call_to_action.dart'; +import 'package:deriv_passkeys/src/presentation/widgets/section_title_and_content.dart'; +import 'package:deriv_passkeys/src/presentation/widgets/unordered_list_widget.dart'; +import 'package:deriv_theme/deriv_theme.dart'; +import 'package:deriv_ui/widgets/primary_button.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; + +/// A stateless widget to build the Learn More Passkeys page. +class LearnMorePasskeysPage extends StatelessWidget { + /// Creates a [LearnMorePasskeysPage]. + const LearnMorePasskeysPage({ + required this.onPageClosed, + required this.addMorePasskeysNavigationCallback, + required this.continueTradingNavigationCallback, + super.key, + }); + + /// Callback to be called when the flow is complete. + final void Function(BuildContext context) onPageClosed; + + /// Callback to be called when the user wants to add more passkeys. + final void Function(BuildContext context) addMorePasskeysNavigationCallback; + + /// Callback to be called when the user wants to continue trading. + final void Function(BuildContext context) continueTradingNavigationCallback; + + @override + Widget build(BuildContext context) => + BlocListener( + listener: (BuildContext context, DerivPasskeysState state) { + if (state is DerivPasskeysCreatedSuccessfullyState) { + Navigator.pop(context); + Navigator.pushReplacement( + context, + MaterialPageRoute( + builder: (BuildContext context) => PasskeyCreatedPage( + onPageClose: onPageClosed, + bottomCallToAction: PasskeysCreatedCallToAction( + addMorePasskeysNavigationCallback: + addMorePasskeysNavigationCallback, + continueTradingNavigationCallback: + continueTradingNavigationCallback, + ), + )), + ); + } + }, + child: Scaffold( + appBar: AppBar(), + body: Column( + children: [ + Expanded( + child: SingleChildScrollView( + child: SafeArea( + child: Padding( + padding: const EdgeInsets.all(24), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 14), + child: SvgPicture.asset( + Assets.effortlessPasskeysIcon, + package: 'deriv_passkeys', + ), + ), + Padding( + padding: const EdgeInsets.symmetric(vertical: 24), + child: Text( + context + .derivPasskeysLocalizations.effortlessLogin, + style: const TextStyle(fontSize: 20), + ), + ), + SectionTitleAndContent( + title: context + .derivPasskeysLocalizations.whatArePasskeys, + texts: [ + context.derivPasskeysLocalizations + .whatArePasskeysDescriptionPoint1, + context.derivPasskeysLocalizations + .whatArePasskeysDescriptionPoint2 + ], + ), + Padding( + padding: const EdgeInsets.symmetric(vertical: 16), + child: Divider( + color: context.theme.colors.hover, + ), + ), + SectionTitleAndContent( + title: + context.derivPasskeysLocalizations.whyPasskeys, + texts: [ + context.derivPasskeysLocalizations + .whyPasskeysDescription1, + context.derivPasskeysLocalizations + .whyPasskeysDescription2 + ], + ), + Padding( + padding: const EdgeInsets.symmetric(vertical: 16), + child: Divider( + color: context.theme.colors.hover, + ), + ), + SectionTitleAndContent( + title: context + .derivPasskeysLocalizations.howToCreatePasskey, + texts: [ + context.derivPasskeysLocalizations + .howToCreatePasskeyDescription1, + context.derivPasskeysLocalizations + .howToCreatePasskeyDescription2 + ], + ), + Padding( + padding: const EdgeInsets.symmetric(vertical: 16), + child: Divider( + color: context.theme.colors.hover, + ), + ), + SectionTitleAndContent( + title: context.derivPasskeysLocalizations + .whereArePasskeysSaved, + texts: [ + context.derivPasskeysLocalizations + .whereArePasskeysSavedDescriptionAndroid, + context.derivPasskeysLocalizations + .whereArePasskeysSavedDescriptionIOS + ], + ), + Padding( + padding: const EdgeInsets.symmetric(vertical: 16), + child: Divider( + color: context.theme.colors.hover, + ), + ), + SectionTitleAndContent( + title: context.derivPasskeysLocalizations + .whatHappensIfEmailChanged, + texts: [ + context.derivPasskeysLocalizations + .whatHappensIfEmailChangedDescription1, + context.derivPasskeysLocalizations + .whatHappensIfEmailChangedDescription2 + ], + ), + Container( + width: double.infinity, + padding: const EdgeInsets.all(16), + margin: const EdgeInsets.only(top: 16), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + border: Border.all( + color: context.theme.colors.active, + ), + ), + child: FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerLeft, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SvgPicture.asset( + Assets.lightBulbIcon, + package: 'deriv_passkeys', + ), + const SizedBox( + width: 8, + ), + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + '${context.derivPasskeysLocalizations.tips}:', + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w500, + color: context.theme.colors.prominent, + ), + ), + Text( + '${context.derivPasskeysLocalizations.beforeUsingPasskeys}:', + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w500, + color: context.theme.colors.general, + ), + ), + const SizedBox( + height: 4, + ), + UnorderedList( + texts: [ + context.derivPasskeysLocalizations + .enableScreenLock, + context.derivPasskeysLocalizations + .signInGoogleOrIcloud, + context.derivPasskeysLocalizations + .enableBluetooth + ], + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w500, + color: context.theme.colors.general, + ), + ), + ], + ), + ], + ), + ), + ), + ], + ), + ), + ), + ), + ), + Container( + color: context.theme.colors.secondary, + width: double.infinity, + child: Padding( + padding: const EdgeInsets.only( + left: 24, right: 24, bottom: 24, top: 16), + child: PrimaryButton( + onPressed: () { + context + .read() + .add(DerivPasskeysCreateCredentialEvent()); + }, + child: Text( + context.derivPasskeysLocalizations.createPasskey, + style: TextStyle( + color: context.theme.colors.prominent, + ), + ), + ), + ), + ), + ], + ), + ), + ); +} diff --git a/packages/deriv_passkeys/lib/src/presentation/pages/manage_passkeys_page.dart b/packages/deriv_passkeys/lib/src/presentation/pages/manage_passkeys_page.dart new file mode 100644 index 000000000..fa28503bb --- /dev/null +++ b/packages/deriv_passkeys/lib/src/presentation/pages/manage_passkeys_page.dart @@ -0,0 +1,195 @@ +import 'package:deriv_passkeys/src/extensions/context_extensions.dart'; +import 'package:deriv_passkeys/src/presentation/constants/assets.dart'; +import 'package:deriv_passkeys/src/presentation/pages/learn_more_passkeys_page.dart'; +import 'package:deriv_passkeys/src/presentation/pages/passkey_created_page.dart'; +import 'package:deriv_passkeys/src/presentation/states/bloc/deriv_passkeys_bloc.dart'; +import 'package:deriv_passkeys/src/presentation/utils/handle_errors_utils.dart'; +import 'package:deriv_passkeys/src/presentation/widgets/passkey_created_call_to_action.dart'; +import 'package:deriv_passkeys/src/presentation/widgets/passkey_widget.dart'; +import 'package:deriv_theme/deriv_theme.dart'; +import 'package:deriv_ui/deriv_ui.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_svg/svg.dart'; + +/// A stateless widget to build the Manage Passkeys page. +class ManagePasskeysPage extends StatefulWidget { + /// Creates a [ManagePasskeysPage]. + const ManagePasskeysPage({ + required this.addMorePasskeysNavigationCallback, + required this.continueTradingNavigationCallback, + super.key, + }); + + /// The route name for the manage passkeys page. + static const String routeName = 'manage_passkeys_page'; + + /// Callback to be called when the user wants to add more passkeys. + final void Function(BuildContext context) addMorePasskeysNavigationCallback; + + /// Callback to be called when the user wants to continue trading. + final void Function(BuildContext context) continueTradingNavigationCallback; + + @override + State createState() => _ManagePasskeysPageState(); +} + +class _ManagePasskeysPageState extends State { + @override + void initState() { + super.initState(); + context + .read() + .add(const DerivPasskeysGetPasskeysListEvent()); + } + + @override + Widget build(BuildContext context) => Scaffold( + backgroundColor: context.theme.colors.primary, + appBar: AppBar( + title: const Text('Passkeys', style: TextStyle(fontSize: 20)), + actions: [ + InkWell( + child: Padding( + padding: const EdgeInsets.all(16), + child: SvgPicture.asset( + Assets.learnMorePasskeysIcon, + package: 'deriv_passkeys', + ), + ), + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => LearnMorePasskeysPage( + onPageClosed: (BuildContext context) { + Navigator.pop(context); + }, + addMorePasskeysNavigationCallback: + widget.addMorePasskeysNavigationCallback, + continueTradingNavigationCallback: + widget.continueTradingNavigationCallback, + )), + ); + }, + ), + ], + ), + body: BlocConsumer( + listener: (BuildContext context, DerivPasskeysState state) { + if (state is DerivPasskeysCreatedSuccessfullyState) { + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => PasskeyCreatedPage( + onPageClose: (BuildContext context) { + Navigator.pop(context); + }, + bottomCallToAction: PasskeysCreatedCallToAction( + addMorePasskeysNavigationCallback: + widget.addMorePasskeysNavigationCallback, + continueTradingNavigationCallback: + widget.continueTradingNavigationCallback, + ), + )), + ); + } else if (state is DerivPasskeysErrorState) { + handlePasskeysError(context, state); + } + }, builder: (BuildContext context, DerivPasskeysState state) { + if (state is DerivPasskeysLoadedState) { + return SafeArea( + child: SizedBox( + width: double.infinity, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + _buildDerivPasskeysLoadedContent( + context, + state, + ), + Container( + width: double.infinity, + child: Padding( + padding: const EdgeInsets.all(16), + child: PrimaryButton( + onPressed: () { + context + .read() + .add(DerivPasskeysCreateCredentialEvent()); + }, + child: Text( + context.derivPasskeysLocalizations.createPasskey, + style: TextStyle( + color: context.theme.colors.prominent, + ), + ), + ), + ), + ) + ], + ), + ), + ); + } + return const SizedBox(); + }), + ); + + Widget _buildDerivPasskeysListContent( + BuildContext context, DerivPasskeysLoadedState state) => + Expanded( + child: Padding( + padding: const EdgeInsets.all(24), + child: ListView.separated( + separatorBuilder: (BuildContext context, int index) => + const Divider(), + itemCount: state.passkeysList.length, + itemBuilder: (BuildContext context, int index) => Padding( + padding: const EdgeInsets.only(bottom: 16), + child: PasskeyWidget(passkey: state.passkeysList[index]), + ), + ), + ), + ); + + Widget _buildDerivPasskeysEmptyContent(BuildContext context) => Expanded( + child: Padding( + padding: const EdgeInsets.all(24), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 14), + child: SvgPicture.asset( + Assets.addPasskeyIcon, + package: 'deriv_passkeys', + ), + ), + Padding( + padding: const EdgeInsets.symmetric(vertical: 24), + child: Text( + context.derivPasskeysLocalizations.experienceSaferLogins, + style: const TextStyle(fontSize: 20), + ), + ), + SizedBox( + width: double.infinity, + child: Text( + context.derivPasskeysLocalizations.enhanceSecurity, + textAlign: TextAlign.center, + ), + ) + ], + ), + ), + ); + + Widget _buildDerivPasskeysLoadedContent( + BuildContext context, DerivPasskeysLoadedState state) { + if (state.passkeysList.isEmpty) { + return _buildDerivPasskeysEmptyContent(context); + } + return _buildDerivPasskeysListContent(context, state); + } +} diff --git a/packages/deriv_passkeys/lib/src/presentation/pages/passkey_created_page.dart b/packages/deriv_passkeys/lib/src/presentation/pages/passkey_created_page.dart new file mode 100644 index 000000000..b9000812e --- /dev/null +++ b/packages/deriv_passkeys/lib/src/presentation/pages/passkey_created_page.dart @@ -0,0 +1,78 @@ +import 'package:deriv_passkeys/src/extensions/context_extensions.dart'; +import 'package:deriv_passkeys/src/presentation/constants/assets.dart'; +import 'package:deriv_passkeys/src/presentation/utils/platform_utils.dart'; +import 'package:deriv_theme/deriv_theme.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + +/// A stateless widget to build the passkey created successfully page. +class PasskeyCreatedPage extends StatelessWidget { + /// Creates a [PasskeyCreatedPage]. + const PasskeyCreatedPage({ + required this.onPageClose, + required this.bottomCallToAction, + super.key, + }); + + /// A callback function that will be called when the user clicks on the 'Continue' button. + final void Function(BuildContext context) onPageClose; + + /// The widget to be displayed at the bottom of the page. + final Widget bottomCallToAction; + + @override + Widget build(BuildContext context) => Scaffold( + appBar: AppBar( + leading: IconButton( + icon: const Icon(Icons.close), + onPressed: () => onPageClose(context), + ), + ), + body: SafeArea( + child: SizedBox( + width: double.infinity, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.all(24), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 14), + child: SvgPicture.asset( + Assets.passkeyCreatedSuccessIcon, + package: 'deriv_passkeys', + ), + ), + Padding( + padding: const EdgeInsets.symmetric(vertical: 24), + child: Text( + context.derivPasskeysLocalizations + .passkeyCreatedSuccessTitle, + style: const TextStyle(fontSize: 20), + ), + ), + Text( + context.derivPasskeysLocalizations + .passkeyCreatedSuccessMessage( + platformName(context)), + style: TextStyle( + fontSize: 14, + color: context.theme.colors.general, + ), + textAlign: TextAlign.center, + ), + ], + ), + ), + ), + bottomCallToAction, + ], + ), + ), + ), + ); +} diff --git a/packages/deriv_passkeys/lib/src/presentation/presentation.dart b/packages/deriv_passkeys/lib/src/presentation/presentation.dart new file mode 100644 index 000000000..d533211de --- /dev/null +++ b/packages/deriv_passkeys/lib/src/presentation/presentation.dart @@ -0,0 +1,6 @@ +library deriv_passkeys; + +export './pages/manage_passkeys_page.dart'; +export './pages/effortless_passkeys_login_page.dart'; +export './widgets/continue_with_passkey_button.dart'; +export './states/bloc/deriv_passkeys_bloc.dart'; diff --git a/packages/deriv_passkeys/lib/src/presentation/states/bloc/deriv_passkeys_bloc.dart b/packages/deriv_passkeys/lib/src/presentation/states/bloc/deriv_passkeys_bloc.dart new file mode 100644 index 000000000..a3dfe172d --- /dev/null +++ b/packages/deriv_passkeys/lib/src/presentation/states/bloc/deriv_passkeys_bloc.dart @@ -0,0 +1,151 @@ +import 'dart:io'; + +import 'package:deriv_passkeys/src/exceptions/platform_exceptions.dart'; +import 'package:deriv_passkeys/src/domain/entities/passkeys_connection_info_entity.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkey_entity.dart'; +import 'package:deriv_passkeys/src/exceptions/server_exceptions.dart'; +import 'package:deriv_passkeys/src/interactor/services/deriv_passkeys_service.dart'; +import 'package:equatable/equatable.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_verify_credentials_response_entity.dart'; + +part 'deriv_passkeys_state.dart'; +part 'deriv_passkeys_event.dart'; + +/// [DerivPasskeysBloc] handles the state within the DerivPasskeys flow. +class DerivPasskeysBloc extends Bloc { + /// Creates a [DerivPasskeysBloc]. + DerivPasskeysBloc({ + required DerivPasskeysService derivPasskeysService, + required PasskeysConnectionInfoEntity connectionInfo, + required Future Function() getJwtToken, + }) : super(DerivPasskeysLoadingState()) { + on( + (SetDerivPasskeysInitializedEvent event, + Emitter emit) async { + emit(DerivPasskeysInitializedState()); + }); + + on( + (SetDerivPasskeysNotSupportedEvent event, + Emitter emit) async { + emit(DerivPasskeysNotSupportedState()); + }); + + on( + (DerivPasskeysVerifyCredentialEvent event, + Emitter emit) async { + if (state is DerivPasskeysLoadingState) { + return; + } + + emit(DerivPasskeysLoadingState()); + + final String jwtToken = await getJwtToken(); + + await derivPasskeysService + .verifyCredential( + jwtToken: jwtToken, + passkeysConnectionInfoEntity: connectionInfo, + userAgent: WebSocket.userAgent, + ) + .then((DerivPasskeysVerifyCredentialsResponseEntity + derivPasskeysVerifyCredentialsResponseEntity) { + emit( + DerivPasskeysCredentialVerifiedState( + token: derivPasskeysVerifyCredentialsResponseEntity.token, + ), + ); + }).catchError((Object error) { + if (error is CanceledPlatformException) { + emit(DerivPasskeysLoadedState(passkeysList)); + } else if (error is NoCredentialPlatformException) { + emit(const NoCredentialErrorState()); + } else if (error is ServerException) { + emit( + DerivPasskeysErrorState( + error.message, + errorCode: error.errorCode, + ), + ); + } else { + emit(const DerivPasskeysErrorState('Error verifying passkey')); + } + }); + }); + + on( + (DerivPasskeysCreateCredentialEvent event, + Emitter emit) async { + if (state is DerivPasskeysLoadingState) { + return; + } + emit(DerivPasskeysLoadingState()); + await derivPasskeysService + .createCredential() + .then((DerivPasskeyEntity credential) async { + emit(DerivPasskeysCreatedSuccessfullyState()); + final DerivPasskeyEntity derivPasskeyEntity = credential; + passkeysList.add(derivPasskeyEntity); + emit(DerivPasskeysLoadedState(passkeysList)); + }).catchError((Object error) { + if (error is ServerException) { + emit( + DerivPasskeysErrorState( + error.message, + errorCode: error.errorCode, + ), + ); + } else { + emit(const DerivPasskeysErrorState('Error creating passkey')); + } + emit(DerivPasskeysLoadedState(passkeysList)); + }); + }); + + on( + (DerivPasskeysGetPasskeysListEvent event, + Emitter emit) async { + emit(DerivPasskeysLoadingState()); + + await derivPasskeysService + .getPasskeysList() + .then((List _passkeysList) { + passkeysList = _passkeysList; + emit(DerivPasskeysLoadedState(passkeysList)); + }).catchError((Object error) { + if (error is ServerException) { + emit( + DerivPasskeysErrorState( + error.message, + errorCode: error.errorCode, + ), + ); + } else { + emit(DerivPasskeysErrorState(error.toString())); + } + }); + }); + + on( + (DerivPasskeysLogoutEvent event, Emitter emit) { + passkeysList.clear(); + if (state is DerivPasskeysNotSupportedState) { + emit(DerivPasskeysNotSupportedState()); + } else { + emit(DerivPasskeysInitializedState()); + } + }); + + derivPasskeysService.isSupported().then((bool isSupported) { + if (isSupported) { + add(const SetDerivPasskeysInitializedEvent()); + } else { + add(const SetDerivPasskeysNotSupportedEvent()); + } + }); + } + + /// The list of passkeys. + List passkeysList = []; +} diff --git a/packages/deriv_passkeys/lib/src/presentation/states/bloc/deriv_passkeys_event.dart b/packages/deriv_passkeys/lib/src/presentation/states/bloc/deriv_passkeys_event.dart new file mode 100644 index 000000000..ea2a56fbf --- /dev/null +++ b/packages/deriv_passkeys/lib/src/presentation/states/bloc/deriv_passkeys_event.dart @@ -0,0 +1,70 @@ +part of 'deriv_passkeys_bloc.dart'; + +/// [DerivPasskeysEvent] represents the events within the DerivPasskeys flow. +class DerivPasskeysEvent extends Equatable { + /// Creates a [DerivPasskeysEvent]. + const DerivPasskeysEvent(); + + @override + List get props => []; +} + +/// [DerivPasskeysCreateCredentialEvent] represents the create credential event within the DerivPasskeys flow. +class DerivPasskeysCreateCredentialEvent extends DerivPasskeysEvent {} + +/// [DerivPasskeysVerifyCredentialEvent] represents the get credential event within the DerivPasskeys flow. +class DerivPasskeysVerifyCredentialEvent extends DerivPasskeysEvent {} + +/// [DerivPasskeysGetPasskeysListEvent] represents the get passkeys list event within the DerivPasskeys flow. +class DerivPasskeysGetPasskeysListEvent extends DerivPasskeysEvent { + /// Creates a [DerivPasskeysGetPasskeysListEvent]. + const DerivPasskeysGetPasskeysListEvent(); + + @override + List get props => []; +} + +/// [SetDerivPasskeysInitializedEvent] represents the set initialized event within the DerivPasskeys flow. +class SetDerivPasskeysInitializedEvent extends DerivPasskeysEvent { + /// Creates a [SetDerivPasskeysInitializedEvent]. + const SetDerivPasskeysInitializedEvent(); + + @override + List get props => []; +} + +/// [SetDerivPasskeysNotSupportedEvent] represents the set not supported event within the DerivPasskeys flow. +class SetDerivPasskeysNotSupportedEvent extends DerivPasskeysEvent { + /// Creates a [SetDerivPasskeysNotSupportedEvent]. + const SetDerivPasskeysNotSupportedEvent(); + + @override + List get props => []; +} + +/// [DerivPasskeysRevokeCredentialEvent] represents the revoke credential event within the DerivPasskeys flow. +class DerivPasskeysRevokeCredentialEvent extends DerivPasskeysEvent { + /// Creates a [DerivPasskeysRevokeCredentialEvent]. + const DerivPasskeysRevokeCredentialEvent(this.options); + + /// The options to revoke a credential. + final String options; + + @override + List get props => [options]; +} + +/// [DerivPasskeysEditCredentialEvent] represents the edit credential event within the DerivPasskeys flow. +class DerivPasskeysEditCredentialEvent extends DerivPasskeysEvent { + /// Creates a [DerivPasskeysEditCredentialEvent]. + const DerivPasskeysEditCredentialEvent(this.options); + + /// The options to edit a credential. + final String options; + + @override + List get props => [options]; +} + +/// [DerivPasskeysLogoutEvent] represents the logout event within the DerivPasskeys flow. +class DerivPasskeysLogoutEvent extends DerivPasskeysEvent {} diff --git a/packages/deriv_passkeys/lib/src/presentation/states/bloc/deriv_passkeys_state.dart b/packages/deriv_passkeys/lib/src/presentation/states/bloc/deriv_passkeys_state.dart new file mode 100644 index 000000000..e50ae555c --- /dev/null +++ b/packages/deriv_passkeys/lib/src/presentation/states/bloc/deriv_passkeys_state.dart @@ -0,0 +1,67 @@ +part of 'deriv_passkeys_bloc.dart'; + +/// [DerivPasskeysState] represents the state within the DerivPasskeys flow. +abstract class DerivPasskeysState extends Equatable { + /// Creates a [DerivPasskeysState]. + const DerivPasskeysState(); + + @override + List get props => []; +} + +/// [DerivPasskeysLoadedState] represents the loaded state within the DerivPasskeys flow. +class DerivPasskeysLoadedState extends DerivPasskeysState { + /// Creates a [DerivPasskeysLoadedState]. + const DerivPasskeysLoadedState(this.passkeysList); + + /// The passkeys list. + final List passkeysList; + + @override + List get props => [passkeysList]; +} + +/// [DerivPasskeysInitializedState] represents the initialized state within the DerivPasskeys flow. +class DerivPasskeysInitializedState extends DerivPasskeysState {} + +/// [DerivPasskeysLoadingState] represents the loading state within the DerivPasskeys flow. +class DerivPasskeysLoadingState extends DerivPasskeysState {} + +/// [DerivPasskeysCreatedSuccessfullyState] represents the created successfully state within the DerivPasskeys flow. +class DerivPasskeysCreatedSuccessfullyState extends DerivPasskeysState {} + +/// [DerivPasskeysCredentialVerifiedState] represents the credential verified state within the DerivPasskeys flow. +class DerivPasskeysCredentialVerifiedState extends DerivPasskeysState { + /// Creates a [DerivPasskeysCredentialVerifiedState]. + const DerivPasskeysCredentialVerifiedState({required this.token}); + + /// The response. + final String token; + + @override + List get props => [token]; +} + +/// [DerivPasskeysNotSupportedState] represents the not supported state within the DerivPasskeys flow. +class DerivPasskeysNotSupportedState extends DerivPasskeysState {} + +/// [DerivPasskeysErrorState] represents the error state within the DerivPasskeys flow. +class DerivPasskeysErrorState extends DerivPasskeysState { + /// Creates a [DerivPasskeysErrorState]. + const DerivPasskeysErrorState(this.message, {this.errorCode = ''}); + + /// The error message. + final String message; + + /// The error code + final String errorCode; + + @override + List get props => [message, errorCode]; +} + +/// [NoCredentialErrorState] represents the no credential error state within the DerivPasskeys flow. +class NoCredentialErrorState extends DerivPasskeysErrorState { + /// Creates a [NoCredentialErrorState]. + const NoCredentialErrorState() : super('No credential found'); +} diff --git a/packages/deriv_passkeys/lib/src/presentation/utils/date_time_utils.dart b/packages/deriv_passkeys/lib/src/presentation/utils/date_time_utils.dart new file mode 100644 index 000000000..f7949588d --- /dev/null +++ b/packages/deriv_passkeys/lib/src/presentation/utils/date_time_utils.dart @@ -0,0 +1,10 @@ +import 'package:jiffy/jiffy.dart'; + +///returns DateTime from timestamp +DateTime dateTimeFromTimestamp(int timestamp) => + DateTime.fromMillisecondsSinceEpoch(timestamp); + +///returns formatted date +///e.g. April 20th, 2023 +String formattedDate(DateTime date) => + Jiffy.parseFromDateTime(date).format(pattern: 'MMMM do, yyyy'); diff --git a/packages/deriv_passkeys/lib/src/presentation/utils/handle_errors_utils.dart b/packages/deriv_passkeys/lib/src/presentation/utils/handle_errors_utils.dart new file mode 100644 index 000000000..192db00e2 --- /dev/null +++ b/packages/deriv_passkeys/lib/src/presentation/utils/handle_errors_utils.dart @@ -0,0 +1,58 @@ +//handlePasskeysError +import 'package:deriv_passkeys/deriv_passkeys.dart'; +import 'package:deriv_passkeys/src/extensions/context_extensions.dart'; +import 'package:deriv_ui/widgets/popup_alert_dialog.dart'; +import 'package:flutter/material.dart'; + +/// Handles the passkeys error state. +void handlePasskeysError(BuildContext context, DerivPasskeysErrorState state) { + if (state is NoCredentialErrorState) { + showDialog( + context: context, + builder: (BuildContext context) => PopupAlertDialog( + title: context.derivPasskeysLocalizations.noPasskeyFound, + content: + Text(context.derivPasskeysLocalizations.noPasskeyFoundDescription), + positiveButtonLabel: context.derivPasskeysLocalizations.ok, + onPositiveActionPressed: () { + Navigator.pop(context, context.derivPasskeysLocalizations.ok); + }, + ), + ); + } else { + bool showErrorDialogue = false; + String title = context.derivPasskeysLocalizations.unexpectedError; + String content = state.message; + + if (state.errorCode == 'PASSKEYS_SERVICE_ERROR') { + content = state.message; + showErrorDialogue = true; + } + if (state.errorCode == 'PASSKEYS_NOT_FOUND') { + title = context.derivPasskeysLocalizations.noPasskeyFound; + content = state.message; + showErrorDialogue = true; + } + + if (state.errorCode == 'PASSKEYS_OFF' || state.errorCode == 'PasskeysOff') { + title = context.derivPasskeysLocalizations.unable_to_process_your_request; + content = context.derivPasskeysLocalizations + .unable_to_process_your_request_description; + showErrorDialogue = true; + } + + if (showErrorDialogue) { + showDialog( + context: context, + builder: (BuildContext context) => PopupAlertDialog( + title: title, + content: Text(content), + positiveButtonLabel: context.derivPasskeysLocalizations.ok, + onPositiveActionPressed: () { + Navigator.pop(context, context.derivPasskeysLocalizations.ok); + }, + ), + ); + } + } +} diff --git a/packages/deriv_passkeys/lib/src/presentation/utils/platform_utils.dart b/packages/deriv_passkeys/lib/src/presentation/utils/platform_utils.dart new file mode 100644 index 000000000..4dbd2c265 --- /dev/null +++ b/packages/deriv_passkeys/lib/src/presentation/utils/platform_utils.dart @@ -0,0 +1,15 @@ +import 'dart:io'; + +import 'package:deriv_passkeys/src/extensions/context_extensions.dart'; +import 'package:flutter/widgets.dart'; + +/// Returns the platform name. +String platformName(BuildContext context) { + if (Platform.isIOS) { + return 'IOS'; + } + if (Platform.isAndroid) { + return 'Android'; + } + return context.derivPasskeysLocalizations.unsupportedPlatform; +} diff --git a/packages/deriv_passkeys/lib/src/presentation/widgets/continue_with_passkey_button.dart b/packages/deriv_passkeys/lib/src/presentation/widgets/continue_with_passkey_button.dart new file mode 100644 index 000000000..c739f35f9 --- /dev/null +++ b/packages/deriv_passkeys/lib/src/presentation/widgets/continue_with_passkey_button.dart @@ -0,0 +1,80 @@ +import 'package:deriv_passkeys/src/presentation/constants/assets.dart'; +import 'package:deriv_passkeys/src/presentation/states/bloc/deriv_passkeys_bloc.dart'; +import 'package:deriv_passkeys/src/presentation/utils/handle_errors_utils.dart'; +import 'package:deriv_theme/deriv_theme.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:deriv_ui/deriv_ui.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; + +/// A button that allows users to continue with passkey +class ContinueWithPasskeyButton extends StatelessWidget { + /// constructs a [ContinueWithPasskeyButton] + const ContinueWithPasskeyButton({ + super.key, + }); + + @override + Widget build(BuildContext context) => + BlocConsumer( + listener: (BuildContext context, DerivPasskeysState state) { + if (state is DerivPasskeysErrorState) { + handlePasskeysError(context, state); + } + }, + builder: (BuildContext context, DerivPasskeysState state) { + if (state is DerivPasskeysNotSupportedState) { + return const SizedBox(); + } + + return InkWell( + child: Container( + padding: const EdgeInsets.symmetric( + horizontal: 16, + vertical: 12, + ), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4), + border: Border.all( + color: context.theme.colors.active, + ), + ), + child: state is DerivPasskeysLoadingState + ? Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + LoadingIndicator( + valueColor: context.theme.colors.prominent, + strokeWidth: ThemeProvider.margin02, + height: ThemeProvider.iconSize16, + width: ThemeProvider.iconSize16, + ) + ], + ) + : Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SvgPicture.asset( + Assets.passkeySvgIcon, + package: 'deriv_passkeys', + ), + const SizedBox(width: 8), + Text( + 'Passkey', + style: context.theme.textStyle( + textStyle: TextStyles.body2, + color: context.theme.colors.prominent, + ), + ), + ], + ), + ), + onTap: () async { + context + .read() + .add(DerivPasskeysVerifyCredentialEvent()); + }, + ); + }, + ); +} diff --git a/packages/deriv_passkeys/lib/src/presentation/widgets/icon_text_row_widget.dart b/packages/deriv_passkeys/lib/src/presentation/widgets/icon_text_row_widget.dart new file mode 100644 index 000000000..b412b7d23 --- /dev/null +++ b/packages/deriv_passkeys/lib/src/presentation/widgets/icon_text_row_widget.dart @@ -0,0 +1,29 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + +/// A widget that displays an icon and text in a row. +class IconTextRowWidget extends StatelessWidget { + /// Creates an [IconTextRowWidget]. + const IconTextRowWidget({ + required this.assetName, + required this.text, + }); + + /// The name of the asset to display. + final String assetName; + + /// The text to display. + final String text; + + @override + Widget build(BuildContext context) => Row( + children: [ + SvgPicture.asset( + assetName, + package: 'deriv_passkeys', + ), + const SizedBox(width: 8), + Expanded(child: Text(text)), + ], + ); +} diff --git a/packages/deriv_passkeys/lib/src/presentation/widgets/passkey_created_call_to_action.dart b/packages/deriv_passkeys/lib/src/presentation/widgets/passkey_created_call_to_action.dart new file mode 100644 index 000000000..50591285c --- /dev/null +++ b/packages/deriv_passkeys/lib/src/presentation/widgets/passkey_created_call_to_action.dart @@ -0,0 +1,52 @@ +import 'package:deriv_passkeys/src/extensions/context_extensions.dart'; +import 'package:deriv_theme/deriv_theme.dart'; +import 'package:deriv_ui/deriv_ui.dart'; +import 'package:flutter/material.dart'; + +/// A stateless widget to build the passkeys created call to action. +class PasskeysCreatedCallToAction extends StatelessWidget { + /// Creates a [PasskeysCreatedCallToAction]. + const PasskeysCreatedCallToAction({ + required this.addMorePasskeysNavigationCallback, + required this.continueTradingNavigationCallback, + super.key, + }); + + /// Callback to be called when the user wants to add more passkeys. + final void Function(BuildContext context) addMorePasskeysNavigationCallback; + + /// Callback to be called when the user wants to continue trading. + final void Function(BuildContext context) continueTradingNavigationCallback; + + @override + Widget build(BuildContext context) => Padding( + padding: const EdgeInsets.all(16), + child: Row( + children: [ + Expanded( + child: SecondaryButton( + onPressed: () => addMorePasskeysNavigationCallback(context), + child: Text( + context.derivPasskeysLocalizations.addMorePasskeysButtonText, + style: TextStyle( + color: context.theme.colors.prominent, + ), + ), + ), + ), + const SizedBox(width: 16), + Expanded( + child: PrimaryButton( + onPressed: () => continueTradingNavigationCallback(context), + child: Text( + context.derivPasskeysLocalizations.continueTradingButtonText, + style: TextStyle( + color: context.theme.colors.prominent, + ), + ), + ), + ), + ], + ), + ); +} diff --git a/packages/deriv_passkeys/lib/src/presentation/widgets/passkey_widget.dart b/packages/deriv_passkeys/lib/src/presentation/widgets/passkey_widget.dart new file mode 100644 index 000000000..f6d1a7340 --- /dev/null +++ b/packages/deriv_passkeys/lib/src/presentation/widgets/passkey_widget.dart @@ -0,0 +1,110 @@ +import 'package:deriv_passkeys/src/domain/entities/deriv_passkey_entity.dart'; +import 'package:deriv_passkeys/src/extensions/context_extensions.dart'; +import 'package:deriv_passkeys/src/presentation/constants/assets.dart'; +import 'package:deriv_passkeys/src/presentation/utils/date_time_utils.dart'; +import 'package:deriv_theme/deriv_theme.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; + +/// [PasskeyWidget] is a widget that displays the passkey information. +class PasskeyWidget extends StatefulWidget { + /// Creates a [PasskeyWidget]. + const PasskeyWidget({ + required this.passkey, + super.key, + }); + + /// The passkey entity. + final DerivPasskeyEntity passkey; + + @override + State createState() => _PasskeyWidgetState(); +} + +class _PasskeyWidgetState extends State { + String _lastUsed() { + String lastUsed = context.derivPasskeysLocalizations.never; + if (widget.passkey.lastUsed != null) { + lastUsed = formattedDate(dateTimeFromTimestamp(widget.passkey.lastUsed!)); + } + return lastUsed; + } + + @override + Widget build(BuildContext context) => Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: SvgPicture.asset( + Assets.passkeySvgIcon, + package: 'deriv_passkeys', + ), + ), + const SizedBox(width: 8), + Expanded( + flex: 10, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(widget.passkey.name, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + color: context.theme.colors.prominent, + )), + Text( + '${context.derivPasskeysLocalizations.storedOn}: ${widget.passkey.storedOn}', + style: TextStyle( + fontSize: 12, + color: context.theme.colors.general, + ), + ), + Text( + '${context.derivPasskeysLocalizations.lastUsed}: ${_lastUsed()}', + style: TextStyle( + fontSize: 12, + color: context.theme.colors.general, + ), + ), + ], + ), + ), + // TODO(bassam): uncomment and implement once phase 2 starts + // DropdownButtonHideUnderline( + // child: DropdownButton( + // icon: Icon(Icons.more_vert), + // items: [ + // TextButton( + // onPressed: () { + // }, + // child: Text( + // context.derivPasskeysLocalizations.rename, + // style: TextStyle( + // fontSize: 14, + // color: context.theme.colors.general, + // ), + // ), + // ), + // TextButton( + // onPressed: () { + // }, + // child: Text( + // context.derivPasskeysLocalizations.revoke, + // style: TextStyle( + // fontSize: 14, + // color: context.theme.colors.general, + // ), + // ), + // ), + // ] + // .map((Widget item) => DropdownMenuItem( + // value: item, + // child: item, + // )) + // .toList(), + // onChanged: (Widget? value) {}, + // ), + // ), + ], + ); +} diff --git a/packages/deriv_passkeys/lib/src/presentation/widgets/section_title_and_content.dart b/packages/deriv_passkeys/lib/src/presentation/widgets/section_title_and_content.dart new file mode 100644 index 000000000..a70aa359a --- /dev/null +++ b/packages/deriv_passkeys/lib/src/presentation/widgets/section_title_and_content.dart @@ -0,0 +1,42 @@ +import 'package:deriv_passkeys/src/presentation/widgets/unordered_list_widget.dart'; +import 'package:deriv_theme/deriv_theme.dart'; +import 'package:flutter/material.dart'; + +/// A widget that displays a section title and content. +class SectionTitleAndContent extends StatelessWidget { + /// Creates a [SectionTitleAndContent]. + const SectionTitleAndContent({ + required this.title, + required this.texts, + }); + + /// The title of the section. + final String title; + + /// The content of the section. + final List texts; + + @override + Widget build(BuildContext context) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + title, + style: TextStyle( + fontSize: 14, + color: context.theme.colors.prominent, + ), + ), + const SizedBox(height: 8), + UnorderedList( + texts: texts, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w400, + color: context.theme.colors.general, + ), + expandedContent: true, + ), + ], + ); +} diff --git a/packages/deriv_passkeys/lib/src/presentation/widgets/unordered_list_widget.dart b/packages/deriv_passkeys/lib/src/presentation/widgets/unordered_list_widget.dart new file mode 100644 index 000000000..76fc68465 --- /dev/null +++ b/packages/deriv_passkeys/lib/src/presentation/widgets/unordered_list_widget.dart @@ -0,0 +1,88 @@ +import 'package:flutter/material.dart'; + +/// A widget that displays a list of items with bullet points. +class UnorderedList extends StatelessWidget { + /// Creates an [UnorderedList]. + const UnorderedList({ + required this.texts, + this.style, + this.expandedContent = false, + }); + + /// The list of texts to display. + final List texts; + + /// The style to use for the text. + final TextStyle? style; + + /// Whether the content should be expanded. + final bool expandedContent; + + @override + Widget build(BuildContext context) { + final List widgetList = texts + .map((String text) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + UnorderedListItem( + text: text, + textStyle: style, + expandedContent: expandedContent, + ), + const SizedBox(height: 5), + ], + )) + .toList(); + + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: widgetList, + ); + } +} + +/// A widget that displays an unordered list item. +@visibleForTesting +class UnorderedListItem extends StatelessWidget { + /// Creates an [UnorderedListItem]. + const UnorderedListItem({ + required this.text, + this.textStyle, + this.expandedContent = false, + }); + + /// The text to display. + final String text; + + /// The style to use for the text. + final TextStyle? textStyle; + + /// Whether the content should be expanded. + final bool expandedContent; + + @override + Widget build(BuildContext context) { + Widget content = Text( + text, + style: textStyle, + ); + if (expandedContent) { + content = Expanded( + child: content, + ); + } + return Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const SizedBox( + width: 5, + ), + Text('\u2022', style: textStyle), + const SizedBox( + width: 5, + ), + content, + ], + ); + } +} diff --git a/packages/deriv_passkeys/pubspec.yaml b/packages/deriv_passkeys/pubspec.yaml new file mode 100644 index 000000000..aebf18665 --- /dev/null +++ b/packages/deriv_passkeys/pubspec.yaml @@ -0,0 +1,111 @@ +name: deriv_passkeys +description: Deriv Passkeys Flutter Plugin +version: 0.0.1 +publish_to: 'none' + +environment: + sdk: '>=3.0.0 <4.0.0' + +dependencies: + flutter: + sdk: flutter + + deriv_theme: + git: + url: git@github.com:regentmarkets/flutter-deriv-packages.git + path: packages/deriv_theme + ref: deriv_theme-v2.4.0 + deriv_localizations: + git: + url: git@github.com:regentmarkets/flutter-deriv-packages.git + path: packages/deriv_localizations + ref: deriv_localizations-v1.3.2 + deriv_ui: + git: + url: git@github.com:regentmarkets/flutter-deriv-packages.git + path: packages/deriv_ui + ref: deriv_ui-v0.0.7+4 + deriv_http_client: + git: + url: git@github.com:regentmarkets/flutter-deriv-packages.git + path: packages/deriv_http_client + ref: deriv_http_client-v2.0.1 + flutter_deriv_api: + git: + url: git@github.com:deriv-com/flutter-deriv-api.git + ref: dev + + + flutter_svg: ^2.0.9 + plugin_platform_interface: ^2.0.2 + http: ^0.13.4 + jiffy: ^6.2.1 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^2.0.0 + mocktail: ^1.0.3 + bloc_test: ^9.1.7 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter packages. +flutter: + uses-material-design: true + # This section identifies this Flutter project as a plugin project. + # The 'pluginClass' specifies the class (in Java, Kotlin, Swift, Objective-C, etc.) + # which should be registered in the plugin registry. This is required for + # using method channels. + # The Android 'package' specifies package in which the registered class is. + # This is required for using method channels on Android. + # The 'ffiPlugin' specifies that native code should be built and bundled. + # This is required for using `dart:ffi`. + # All these are used by the tooling to maintain consistency when + # adding or updating assets for this project. + plugin: + platforms: + android: + package: com.deriv.passkeys.deriv_passkeys + pluginClass: DerivPasskeysPlugin + ios: + pluginClass: DerivPasskeysPlugin + + assets: + - assets/svg/passkey_icon.svg + - assets/svg/effortless_login_passkey_icon.svg + - assets/svg/passkey_created_success_icon.svg + - assets/svg/fingerprint_icon.svg + - assets/svg/sync_icon.svg + - assets/svg/lock_icon.svg + - assets/svg/light_bulb_icon.svg + - assets/svg/learn_more_passkeys_icon.svg + - assets/svg/add_passkey_icon.svg + - assets/svg/face_id.svg + # + # For details regarding assets in packages, see + # https://flutter.dev/assets-and-images/#from-packages + # + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware + + # To add custom fonts to your plugin package, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts in packages, see + # https://flutter.dev/custom-fonts/#from-packages diff --git a/packages/deriv_passkeys/test/data/deriv_passkeys_data_source_mock_setup.dart b/packages/deriv_passkeys/test/data/deriv_passkeys_data_source_mock_setup.dart new file mode 100644 index 000000000..221657dae --- /dev/null +++ b/packages/deriv_passkeys/test/data/deriv_passkeys_data_source_mock_setup.dart @@ -0,0 +1,123 @@ +import 'package:deriv_passkeys/src/data/data_sources/deriv_passkeys_data_source.dart'; +import 'package:deriv_passkeys/src/data/mappers/deriv_passkeys_mapper.dart'; +import 'package:deriv_passkeys/src/data/models/deriv_passkey_model.dart'; +import 'package:deriv_passkeys/src/data/models/deriv_passkeys_options_model.dart'; +import 'package:deriv_passkeys/src/data/models/deriv_passkeys_register_options_model.dart'; +import 'package:deriv_passkeys/src/data/models/deriv_passkeys_verify_credentials_request_body_model.dart'; +import 'package:deriv_passkeys/src/data/models/deriv_passkeys_verify_credentials_response_model.dart'; +import 'package:deriv_passkeys/src/data/models/passkeys_connection_info_model.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_register_credentials_entity.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_verify_credentials_request_body_entity.dart'; +import 'package:deriv_passkeys/src/domain/entities/passkeys_connection_info_entity.dart'; +import 'package:flutter_deriv_api/basic_api/generated/passkeys_register_send.dart'; +import 'package:mocktail/mocktail.dart'; + +/// Mock class for [DerivPasskeysDataSource]. +class MockDerivPasskeysDataSource extends Mock + implements DerivPasskeysDataSource { + @override + final DerivPasskeysMapper mapper = DerivPasskeysMapper(); +} + +final PasskeysConnectionInfoEntity passkeysConnectionInfoEntity = + PasskeysConnectionInfoEntity(endpoint: 'deriv.com', appId: '1234'); + +final PasskeysConnectionInfoModel passkeysConnectionInfoModel = + PasskeysConnectionInfoModel( + endpoint: 'deriv.com', + appId: '1234', +); + +const DerivPasskeysVerifyCredentialsRequestBodyEntity + derivPasskeysVerifyCredentialsRequestBodyEntity = + DerivPasskeysVerifyCredentialsRequestBodyEntity( + appId: '1234', + publicKeyCredential: {}, + type: '', +); + +final DerivPasskeysVerifyCredentialsRequest + derivPasskeysVerifyCredentialsRequest = + DerivPasskeysVerifyCredentialsRequest( + appId: '1234', + publicKeyCredential: {}, + type: '', +); + +const String jwtToken = 'jwtToken'; +const String userAgent = 'Dart/3.0 (dart:io)'; + +const PasskeysRegisterRequest passkeysRegisterRequest = PasskeysRegisterRequest( + name: '', + publicKeyCredential: {}, +); + +const DerivPasskeysRegisterCredentialsEntity registerCredentialsEntity = + DerivPasskeysRegisterCredentialsEntity( + publicKeyCredential: {}, + name: '', +); +const DerivPasskeyModel derivPasskeyModel = DerivPasskeyModel( + createdAt: 1234, + id: '', + lastUsed: null, + name: '', + passkeyId: '', + storedOn: '', +); + +DerivPasskeysRegisterOptionsModel derivPasskeysRegisterOptionsModel = + DerivPasskeysRegisterOptionsModel( + options: { + 'rp': { + 'id': 'id', + 'name': 'name', + }, + 'user': { + 'id': 'id', + 'name': 'name', + 'displayName': 'displayName', + }, + 'challenge': 'challenge', + 'pubKeyCredParams': [ + { + 'type': 'type', + 'alg': -1, + } + ], + 'timeout': 18000, + 'attestation': 'attestation', + 'extensions': {}, + }, +); + +const DerivPasskeysVerifyCredentialsResponseModel + derivPasskeysVerifyCredentialsResponseModel = + DerivPasskeysVerifyCredentialsResponseModel( + response: { + 'tokens': >[ + { + 'token': 'token', + }, + ] + }, +); + +final DerivPasskeysOptionsModel derivPasskeysOptionsModel = + DerivPasskeysOptionsModel( + challenge: '', + rpId: '', + timeout: 1234, + userVerification: '', + allowCredentials: [], +); + +/// Sets up the mock data for [DerivPasskeysDataSource]. +void derivPasskeysDataSourceMockSetup() { + registerFallbackValue(derivPasskeysVerifyCredentialsRequest); + registerFallbackValue(derivPasskeysVerifyCredentialsRequestBodyEntity); + registerFallbackValue(passkeysConnectionInfoModel); + registerFallbackValue(jwtToken); + registerFallbackValue(userAgent); + registerFallbackValue(passkeysRegisterRequest); +} diff --git a/packages/deriv_passkeys/test/data/deriv_passkeys_data_source_test.dart b/packages/deriv_passkeys/test/data/deriv_passkeys_data_source_test.dart new file mode 100644 index 000000000..2aaf2657b --- /dev/null +++ b/packages/deriv_passkeys/test/data/deriv_passkeys_data_source_test.dart @@ -0,0 +1,211 @@ +import 'dart:convert'; + +import 'package:deriv_http_client/deriv_http_client.dart'; +import 'package:deriv_passkeys/deriv_passkeys.dart'; +import 'package:deriv_passkeys/src/data/models/deriv_passkey_model.dart'; +import 'package:deriv_passkeys/src/data/models/deriv_passkeys_options_model.dart'; +import 'package:deriv_passkeys/src/data/models/deriv_passkeys_register_options_model.dart'; +import 'package:deriv_passkeys/src/data/models/deriv_passkeys_verify_credentials_request_body_model.dart'; +import 'package:deriv_passkeys/src/data/models/deriv_passkeys_verify_credentials_response_model.dart'; +import 'package:deriv_passkeys/src/data/models/passkeys_connection_info_model.dart'; +import 'package:deriv_passkeys/src/exceptions/server_exceptions.dart'; +import 'package:flutter_deriv_api/api/api_initializer.dart'; +import 'package:flutter_deriv_api/basic_api/generated/passkeys_register_send.dart'; +import 'package:flutter_deriv_api/services/connection/api_manager/mock_api.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'package:http/http.dart'; + +Future _mockHTTP(Request request) async { + if (request.url.host.contains('error')) { + if (request.url.host == 'error_code_exists') { + return Response( + jsonEncode({ + 'error_code': 'error_code_exists', + 'message': 'message', + }), + 500, + ); + } + if (request.url.host == 'no_error_code') { + return Response( + jsonEncode({ + 'message': 'message', + }), + 500, + ); + } + } + switch (request.url.path) { + case '/oauth2/api/v1/passkeys/login/options': + if (request.method == 'GET') { + return Response( + jsonEncode({ + 'publicKey': { + 'challenge': 'jV6lvuj1d-iVSPiQQg9iwXhiSTCm3CueJ7aLcv2GfVc', + 'rpId': 'deriv.com', + 'timeout': 60000, + 'userVerification': 'preferred' + } + }), + 200, + ); + } + break; + case '/oauth2/api/v1/passkeys/login/verify': + if (request.method == 'POST') { + return Response( + jsonEncode({}), + 200, + ); + } + break; + } + return Response( + jsonEncode({ + 'error_code': 'error_code', + 'message': 'message', + }), + 400, + ); +} + +class FakeHttpClient extends Fake implements HttpClient { + @override + Future get(String url, {String? basicAuthToken}) async => + _mockHTTP(Request('GET', Uri.parse(url))); + + @override + Future> post({ + required String url, + required Map jsonBody, + Map? headers, + }) async { + final Response response = await _mockHTTP(Request('POST', Uri.parse(url))); + return jsonDecode(response.body) as Map; + } +} + +void main() { + TestWidgetsFlutterBinding.ensureInitialized(); + + late DerivPasskeysDataSource dataSource; + final HttpClient mockClient = FakeHttpClient(); + final PasskeysConnectionInfoModel passkeysConnectionInfoModel = + PasskeysConnectionInfoModel( + endpoint: 'deriv.com', + appId: 'appId', + ); + + setUpAll(() { + APIInitializer().initialize(api: MockAPI()); + dataSource = DerivPasskeysDataSource( + mapper: DerivPasskeysMapper(), + client: mockClient, + ); + }); + + group('getOptions', () { + test('should return DerivPasskeysOptionsModel when request is successful', + () async { + expect( + dataSource.getOptions( + passkeysConnectionInfoModel: passkeysConnectionInfoModel, + ), + completion(isA())); + }); + + test( + 'should throw ServerException when request is unsuccessful and response body contains "error_code".', + () async { + expect( + () => dataSource.getOptions( + passkeysConnectionInfoModel: passkeysConnectionInfoModel.copyWith( + endpoint: 'error_code_exists', + ), + ), + throwsA(isA()), + ); + }); + + test( + 'should throw Exception when request is unsuccessful and response body does not contain "error_code".', + () async { + expect( + () => dataSource.getOptions( + passkeysConnectionInfoModel: passkeysConnectionInfoModel.copyWith( + endpoint: 'no_error_code', + ), + ), + throwsA(isA()), + ); + }); + }); + + group('verifyCredentials', () { + final DerivPasskeysVerifyCredentialsRequest + derivPasskeysVerifyCredentialsRequest = + DerivPasskeysVerifyCredentialsRequest( + appId: 'appId', + publicKeyCredential: {}, + type: 'type', + ); + test( + 'should return DerivPasskeysVerifyCredentialsResponseModel when request is successful', + () async { + expect( + dataSource.verifyCredentials( + requestBodyModel: derivPasskeysVerifyCredentialsRequest, + jwtToken: 'jwtToken', + passkeysConnectionInfoModel: passkeysConnectionInfoModel, + ), + completion(isA())); + }); + + test( + 'should throw ServerException when request is unsuccessful and response body contains "error_code".', + () async { + expect( + () => dataSource.verifyCredentials( + requestBodyModel: derivPasskeysVerifyCredentialsRequest, + jwtToken: 'jwtToken', + passkeysConnectionInfoModel: passkeysConnectionInfoModel.copyWith( + endpoint: 'error_code_exists', + ), + ), + throwsA(isA()), + ); + }); + }); + + group('getRegisterOptions', () { + test( + 'should return DerivPasskeysRegisterOptionsModel when request is successful', + () async { + expect(dataSource.getRegisterOptions(), + completion(isA())); + }); + }); + + group('registerCredentials', () { + test('should return DerivPasskeyModel when request is successful', + () async { + expect( + dataSource.registerCredentials( + const PasskeysRegisterRequest( + publicKeyCredential: {}, + name: '', + ), + ), + completion(isA())); + }); + }); + + group('getPasskeysList', () { + test('should return List when request is successful', + () async { + expect(dataSource.getPasskeysList(), + completion(isA>())); + }); + }); +} diff --git a/packages/deriv_passkeys/test/data/deriv_passkeys_mapper_test.dart b/packages/deriv_passkeys/test/data/deriv_passkeys_mapper_test.dart new file mode 100644 index 000000000..76968b9ea --- /dev/null +++ b/packages/deriv_passkeys/test/data/deriv_passkeys_mapper_test.dart @@ -0,0 +1,132 @@ +import 'package:deriv_passkeys/src/data/models/passkeys_connection_info_model.dart'; +import 'package:deriv_passkeys/src/data/models/deriv_passkey_model.dart'; +import 'package:deriv_passkeys/src/data/models/deriv_passkeys_options_model.dart'; +import 'package:deriv_passkeys/src/data/models/deriv_passkeys_register_options_model.dart'; +import 'package:deriv_passkeys/src/data/models/deriv_passkeys_verify_credentials_request_body_model.dart'; +import 'package:deriv_passkeys/src/data/models/deriv_passkeys_verify_credentials_response_model.dart'; +import 'package:deriv_passkeys/src/domain/entities/passkeys_connection_info_entity.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkey_entity.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_options_entity.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_register_credentials_entity.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_register_options_entity.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_verify_credentials_request_body_entity.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_verify_credentials_response_entity.dart'; +import 'package:flutter_deriv_api/basic_api/generated/passkeys_register_send.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'package:deriv_passkeys/src/data/mappers/deriv_passkeys_mapper.dart'; + +void main() { + group('DerivPasskeysMapper', () { + late DerivPasskeysMapper mapper; + + setUp(() { + mapper = DerivPasskeysMapper(); + }); + + test( + 'mapDerivPasskeysOptionsModel should return DerivPasskeysOptionsEntity', + () { + final DerivPasskeysOptionsModel model = DerivPasskeysOptionsModel( + challenge: '', + rpId: '', + timeout: 12345, + userVerification: '', + allowCredentials: []); // Provide necessary data for the model + + final DerivPasskeysOptionsEntity result = + mapper.mapDerivPasskeysOptionsModel(model); + + expect(result, isA()); + }); + + test( + 'mapDerivPasskeysVerifyCredentialsRequestBodyEntity should return DerivPasskeysVerifyCredentialsRequest', + () { + const DerivPasskeysVerifyCredentialsRequestBodyEntity entity = + DerivPasskeysVerifyCredentialsRequestBodyEntity( + appId: '', publicKeyCredential: {}, type: ''); + + final DerivPasskeysVerifyCredentialsRequest result = + mapper.mapDerivPasskeysVerifyCredentialsRequestBodyEntity(entity); + + expect(result, isA()); + }); + + test( + 'mapDerivPasskeysRegisterOptionsModel should return DerivPasskeysRegisterOptionsEntity', + () { + final DerivPasskeysRegisterOptionsModel model = + DerivPasskeysRegisterOptionsModel(options: {}); // Provide necessary data for the model + + final DerivPasskeysRegisterOptionsEntity result = + mapper.mapDerivPasskeysRegisterOptionsModel(model); + + expect(result, isA()); + }); + + test('mapDerivPasskeyModel should return DerivPasskeyEntity', () { + const DerivPasskeyModel model = DerivPasskeyModel( + createdAt: 1234, + id: '', + lastUsed: null, + name: '', + passkeyId: '', + storedOn: '', + ); + + final DerivPasskeyEntity result = mapper.mapDerivPasskeyModel(model); + + expect(result, isA()); + }); + + test( + 'mapDerivPasskeysRegisterCredentialsEntity should return PasskeysRegisterRequest', + () { + const DerivPasskeysRegisterCredentialsEntity entity = + DerivPasskeysRegisterCredentialsEntity( + publicKeyCredential: {}, + name: '', + ); + + final PasskeysRegisterRequest result = + mapper.mapDerivPasskeysRegisterCredentialsEntity(entity); + + expect(result, isA()); + }); + + test( + 'mapDerivPasskeysVerifyCredentialsResponseModel should return DerivPasskeysVerifyCredentialsResponseEntity', + () { + const DerivPasskeysVerifyCredentialsResponseModel model = + DerivPasskeysVerifyCredentialsResponseModel( + response: { + 'tokens': [ + { + 'token': '', + } + ] + }, + ); + + final DerivPasskeysVerifyCredentialsResponseEntity result = + mapper.mapDerivPasskeysVerifyCredentialsResponseModel(model); + + expect(result, isA()); + }); + + test('mapConnectionInfoEntity should return PasskeysConnectionInfoModel', + () { + final PasskeysConnectionInfoEntity entity = PasskeysConnectionInfoEntity( + endpoint: '', + appId: '', + ); + + final PasskeysConnectionInfoModel result = + mapper.mapConnectionInfoEntity(entity); + + expect(result, isA()); + }); + }); +} diff --git a/packages/deriv_passkeys/test/data/deriv_passkeys_method_channel_test.dart b/packages/deriv_passkeys/test/data/deriv_passkeys_method_channel_test.dart new file mode 100644 index 000000000..df6e20fb1 --- /dev/null +++ b/packages/deriv_passkeys/test/data/deriv_passkeys_method_channel_test.dart @@ -0,0 +1,147 @@ +import 'package:deriv_passkeys/src/data/platform/deriv_passkeys_method_channel.dart'; +import 'package:deriv_passkeys/src/exceptions/platform_exceptions.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_test/flutter_test.dart'; + +class MockMethodChannel extends MethodChannel { + MockMethodChannel() : super('deriv_passkeys'); + + Future handler(MethodCall methodCall) async => + invokeMethod(methodCall.method, methodCall.arguments); + + @override + Future invokeMethod(String method, [dynamic arguments]) async { + switch (method) { + case 'isPlatformSupported': + return true as T?; + case 'createCredential': + final String options = arguments['options']; + if (options == 'valid_options') { + return 'credential created' as T?; + } else if (options == 'user_cancelled') { + throw PlatformException( + code: 'CreateCredentialCancellationException', + message: 'CreateCredentialCancellationException', + ); + } else { + throw PlatformException( + code: 'invalid_argument', + message: 'Invalid options provided', + ); + } + case 'getCredential': + final String options = arguments['options']; + if (options == 'valid_options') { + return 'credential retrieved' as T?; + } else if (options == 'user_cancelled') { + throw PlatformException( + code: 'GetCredentialCancellationException', + message: 'GetCredentialCancellationException', + ); + } else if (options == 'no_credential') { + throw PlatformException( + code: 'NoCredentialException', + message: 'GetCredentialCancellationException', + ); + } else { + throw PlatformException( + code: 'invalid_argument', + message: 'Invalid options provided', + ); + } + default: + throw PlatformException( + code: 'method_not_implemented', + message: 'Method not implemented on platform', + ); + } + } +} + +void main() { + TestWidgetsFlutterBinding.ensureInitialized(); + + late MethodChannelDerivPasskeys platform; + late MockMethodChannel mockChannel; + + setUp(() { + mockChannel = MockMethodChannel(); + platform = MethodChannelDerivPasskeys(); + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger + .setMockMethodCallHandler( + mockChannel, + mockChannel.handler, + ); + }); + + tearDown(() { + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger + .setMockMethodCallHandler(mockChannel, null); + }); + + test('isSupported', () async { + expect(await platform.isPlatformSupported(), isTrue); + }); + + test('createCredential with valid options', () async { + const String options = 'valid_options'; + final String? response = await platform.createCredential(options); + expect(response, 'credential created'); + }); + + test('createCredential with user cancelled throws CanceledPlatformException', + () { + const String options = 'user_cancelled'; + expect( + () => platform.createCredential(options), + throwsA(isA()), + ); + }); + + test('createCredential with invalid options throws PlatformException', () { + const String options = 'invalid options'; + expect( + () => platform.createCredential(options), + throwsA(isA()), + ); + }); + + test('getCredential with valid options', () async { + const String options = 'valid_options'; + final String? response = await platform.getCredential(options); + expect(response, 'credential retrieved'); + }); + + test('getCredential with user cancelled throws CanceledPlatformException', + () { + const String options = 'user_cancelled'; + expect( + () => platform.getCredential(options), + throwsA(isA()), + ); + }); + + test('getCredential with no credential throws NoCredentialPlatformException', + () { + const String options = 'no_credential'; + expect( + () => platform.getCredential(options), + throwsA(isA()), + ); + }); + + test('getCredential with invalid options throws PlatformException', () { + const String options = 'invalid options'; + expect( + () => platform.getCredential(options), + throwsA(isA()), + ); + }); + + test('Method not implemented throws PlatformException', () async { + expect( + () => platform.methodChannel.invokeMethod('nonExistentMethod'), + throwsA(isA()), + ); + }); +} diff --git a/packages/deriv_passkeys/test/data/deriv_passkeys_repository_test.dart b/packages/deriv_passkeys/test/data/deriv_passkeys_repository_test.dart new file mode 100644 index 000000000..2375042f9 --- /dev/null +++ b/packages/deriv_passkeys/test/data/deriv_passkeys_repository_test.dart @@ -0,0 +1,189 @@ +import 'package:deriv_passkeys/deriv_passkeys.dart'; +import 'package:deriv_passkeys/src/data/models/deriv_passkey_model.dart'; +import 'package:deriv_passkeys/src/data/models/deriv_passkeys_register_options_model.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkey_entity.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_options_entity.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_register_options_entity.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_verify_credentials_response_entity.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mocktail/mocktail.dart'; + +import 'deriv_passkeys_data_source_mock_setup.dart'; + +void main() { + late DerivPasskeysRepository repository; + late MockDerivPasskeysDataSource mockDerivPasskeysDataSource; + + setUpAll(() { + derivPasskeysDataSourceMockSetup(); + mockDerivPasskeysDataSource = MockDerivPasskeysDataSource(); + repository = DerivPasskeysRepository(mockDerivPasskeysDataSource); + }); + + group('getOptions', () { + test('should return DerivPasskeysOptionsEntity', () async { + when(() => mockDerivPasskeysDataSource.getOptions( + passkeysConnectionInfoModel: + any(named: 'passkeysConnectionInfoModel'), + )).thenAnswer( + (_) async => derivPasskeysOptionsModel, + ); + + final DerivPasskeysOptionsEntity result = await repository.getOptions( + passkeysConnectionInfoEntity: passkeysConnectionInfoEntity, + ); + + expect( + result, + equals( + mockDerivPasskeysDataSource.mapper.mapDerivPasskeysOptionsModel( + derivPasskeysOptionsModel, + ), + ), + ); + verify(() => mockDerivPasskeysDataSource.getOptions( + passkeysConnectionInfoModel: + any(named: 'passkeysConnectionInfoModel'), + )).called(1); + }); + }); + + group('verifyCredentials', () { + test('should return DerivPasskeysVerifyCredentialsResponseEntity', + () async { + when(() => mockDerivPasskeysDataSource.verifyCredentials( + requestBodyModel: any(named: 'requestBodyModel'), + jwtToken: any(named: 'jwtToken'), + passkeysConnectionInfoModel: + any(named: 'passkeysConnectionInfoModel'), + userAgent: any(named: 'userAgent'), + )) + .thenAnswer((_) async => derivPasskeysVerifyCredentialsResponseModel); + + final DerivPasskeysVerifyCredentialsResponseEntity result = + await repository.verifyCredentials( + requestBodyEntity: derivPasskeysVerifyCredentialsRequestBodyEntity, + jwtToken: jwtToken, + passkeysConnectionInfoEntity: passkeysConnectionInfoEntity, + ); + + expect( + result, + equals( + mockDerivPasskeysDataSource.mapper + .mapDerivPasskeysVerifyCredentialsResponseModel( + derivPasskeysVerifyCredentialsResponseModel, + ), + ), + ); + verify(() => mockDerivPasskeysDataSource.verifyCredentials( + requestBodyModel: any(named: 'requestBodyModel'), + jwtToken: any(named: 'jwtToken'), + passkeysConnectionInfoModel: + any(named: 'passkeysConnectionInfoModel'), + userAgent: any(named: 'userAgent'), + )).called(1); + }); + }); + + group('getRegisterOptions', () { + test('should return DerivPasskeysRegisterOptionsEntity', () async { + final DerivPasskeysRegisterOptionsModel + derivPasskeysRegisterOptionsModel = DerivPasskeysRegisterOptionsModel( + options: {}, + ); + when(() => mockDerivPasskeysDataSource.getRegisterOptions()) + .thenAnswer((_) async => derivPasskeysRegisterOptionsModel); + + final DerivPasskeysRegisterOptionsEntity result = + await repository.getRegisterOptions(); + + expect( + result, + equals( + mockDerivPasskeysDataSource.mapper + .mapDerivPasskeysRegisterOptionsModel( + derivPasskeysRegisterOptionsModel, + ), + ), + ); + verify(() => mockDerivPasskeysDataSource.getRegisterOptions()).called(1); + }); + }); + + group('registerCredentials', () { + test('should return DerivPasskeyEntity', () async { + when(() => mockDerivPasskeysDataSource.registerCredentials( + any(), + )).thenAnswer((_) async => derivPasskeyModel); + + final DerivPasskeyEntity result = + await repository.registerCredentials(registerCredentialsEntity); + + expect( + result, + equals( + mockDerivPasskeysDataSource.mapper.mapDerivPasskeyModel( + derivPasskeyModel, + ), + ), + ); + verify(() => mockDerivPasskeysDataSource.registerCredentials( + any(), + )).called(1); + }); + }); + + group('getPasskeysList', () { + test('should return List', () async { + const DerivPasskeyModel passkeyModel1 = DerivPasskeyModel( + createdAt: 1234, + id: '1', + lastUsed: null, + name: '', + passkeyId: '', + storedOn: '', + ); + const DerivPasskeyModel passkeyModel2 = DerivPasskeyModel( + createdAt: 1234, + id: '2', + lastUsed: null, + name: '', + passkeyId: '', + storedOn: '', + ); + const DerivPasskeyEntity passkeyEntity1 = DerivPasskeyEntity( + createdAt: 1234, + id: '1', + lastUsed: null, + name: '', + passkeyId: '', + storedOn: '', + ); + const DerivPasskeyEntity passkeyEntity2 = DerivPasskeyEntity( + createdAt: 1234, + id: '2', + lastUsed: null, + name: '', + passkeyId: '', + storedOn: '', + ); + final List passkeyModels = [ + passkeyModel1, + passkeyModel2 + ]; + final List passkeyEntities = [ + passkeyEntity1, + passkeyEntity2 + ]; + when(() => mockDerivPasskeysDataSource.getPasskeysList()) + .thenAnswer((_) async => passkeyModels); + + final List result = + await repository.getPasskeysList(); + + expect(result, equals(passkeyEntities)); + verify(() => mockDerivPasskeysDataSource.getPasskeysList()).called(1); + }); + }); +} diff --git a/packages/deriv_passkeys/test/interactor/deriv_passkeys_service_test.dart b/packages/deriv_passkeys/test/interactor/deriv_passkeys_service_test.dart new file mode 100644 index 000000000..43436d3cd --- /dev/null +++ b/packages/deriv_passkeys/test/interactor/deriv_passkeys_service_test.dart @@ -0,0 +1,149 @@ +import 'package:deriv_passkeys/deriv_passkeys.dart'; +import 'package:deriv_passkeys/src/data/models/deriv_passkey_model.dart'; +import 'package:deriv_passkeys/src/data/platform/deriv_passkeys_method_channel.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkey_entity.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_verify_credentials_response_entity.dart'; +import 'package:deriv_passkeys/src/domain/platform/base_deriv_passkeys_method_channel.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mocktail/mocktail.dart'; +import 'package:plugin_platform_interface/plugin_platform_interface.dart'; + +import '../data/deriv_passkeys_data_source_mock_setup.dart'; + +class MockBaseDerivPasskeysMethodChannel + with MockPlatformInterfaceMixin + implements BaseDerivPasskeysMethodChannel { + Future Function(String options)? mockCreateCredential; + Future Function(String options)? mockGetCredential; + + @override + Future isPlatformSupported() => Future.value(true); + + @override + Future createCredential(String options) => + mockCreateCredential != null + ? mockCreateCredential!(options) + : Future.value('{}'); + + @override + Future getCredential(String options) => mockGetCredential != null + ? mockGetCredential!(options) + : Future.value('{}'); +} + +void main() { + final BaseDerivPasskeysMethodChannel initialPlatform = + BaseDerivPasskeysMethodChannel.instance; + + test('$MethodChannelDerivPasskeys is the default instance', () { + expect(initialPlatform, isInstanceOf()); + }); + + group('DerivPasskeys', () { + late DerivPasskeysService derivPasskeysService; + final MockDerivPasskeysDataSource mockDerivPasskeysDataSource = + MockDerivPasskeysDataSource(); + + setUp(() { + derivPasskeysDataSourceMockSetup(); + derivPasskeysService = DerivPasskeysService( + DerivPasskeysRepository( + mockDerivPasskeysDataSource, + ), + ); + BaseDerivPasskeysMethodChannel.instance = + MockBaseDerivPasskeysMethodChannel(); + }); + + tearDown(() { + BaseDerivPasskeysMethodChannel.instance = initialPlatform; + }); + + test('isSupported returns true', () async { + final bool isSupported = await derivPasskeysService.isSupported(); + expect(isSupported, true); + }); + + test('createCredential returns response if not null', () async { + when(() => mockDerivPasskeysDataSource.getRegisterOptions()) + .thenAnswer((_) async => derivPasskeysRegisterOptionsModel); + when(() => mockDerivPasskeysDataSource.registerCredentials( + any(), + )).thenAnswer((_) async => derivPasskeyModel); + final DerivPasskeyEntity response = + await derivPasskeysService.createCredential(); + expect(response, isNotNull); + expect(response, isA()); + }); + + test('createCredential throws PlatformException if response is null', + () async { + when(() => mockDerivPasskeysDataSource.getRegisterOptions()) + .thenAnswer((_) async => derivPasskeysRegisterOptionsModel); + + BaseDerivPasskeysMethodChannel + .instance = MockBaseDerivPasskeysMethodChannel() + ..mockCreateCredential = (String options) => Future.value(); + expect( + () => derivPasskeysService.createCredential(), + throwsA(isA()), + ); + }); + + test('verifyCredential returns response if not null', () async { + when(() => mockDerivPasskeysDataSource.getOptions( + passkeysConnectionInfoModel: + any(named: 'passkeysConnectionInfoModel'), + )).thenAnswer( + (_) async => derivPasskeysOptionsModel, + ); + when(() => mockDerivPasskeysDataSource.verifyCredentials( + requestBodyModel: any(named: 'requestBodyModel'), + jwtToken: any(named: 'jwtToken'), + passkeysConnectionInfoModel: + any(named: 'passkeysConnectionInfoModel'), + userAgent: any(named: 'userAgent'), + )) + .thenAnswer((_) async => derivPasskeysVerifyCredentialsResponseModel); + final DerivPasskeysVerifyCredentialsResponseEntity response = + await derivPasskeysService.verifyCredential( + jwtToken: jwtToken, + passkeysConnectionInfoEntity: passkeysConnectionInfoEntity, + ); + expect(response, isNotNull); + expect(response, isA()); + }); + + test('verifyCredential throws PlatformException if response is null', + () async { + when(() => mockDerivPasskeysDataSource.getOptions( + passkeysConnectionInfoModel: + any(named: 'passkeysConnectionInfoModel'), + )).thenAnswer( + (_) async => derivPasskeysOptionsModel, + ); + BaseDerivPasskeysMethodChannel.instance = + MockBaseDerivPasskeysMethodChannel() + ..mockGetCredential = (String options) => Future.value(); + + expect( + () => derivPasskeysService.verifyCredential( + jwtToken: jwtToken, + passkeysConnectionInfoEntity: passkeysConnectionInfoEntity, + ), + throwsA(isInstanceOf())); + }); + test('getPasskeysList returns response if not null', () async { + when(() => mockDerivPasskeysDataSource.getPasskeysList()) + .thenAnswer((_) async => [derivPasskeyModel]); + final List response = await DerivPasskeysService( + DerivPasskeysRepository( + mockDerivPasskeysDataSource, + ), + ).getPasskeysList(); + expect(response, isNotNull); + expect(response, isA>()); + }); + }); +} diff --git a/packages/deriv_passkeys/test/presentation/pages/learn_more_passkeys_page_test.dart b/packages/deriv_passkeys/test/presentation/pages/learn_more_passkeys_page_test.dart new file mode 100644 index 000000000..b6ae89df7 --- /dev/null +++ b/packages/deriv_passkeys/test/presentation/pages/learn_more_passkeys_page_test.dart @@ -0,0 +1,104 @@ +import 'package:bloc_test/bloc_test.dart'; +import 'package:deriv_localizations/l10n/generated/deriv_passkeys/deriv_passkeys_localizations.dart'; +import 'package:deriv_localizations/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_en.dart'; +import 'package:deriv_passkeys/deriv_passkeys.dart'; +import 'package:deriv_passkeys/src/presentation/widgets/section_title_and_content.dart'; +import 'package:deriv_passkeys/src/presentation/widgets/unordered_list_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:deriv_passkeys/src/presentation/pages/learn_more_passkeys_page.dart'; +import 'package:mocktail/mocktail.dart'; + +class MockDerivPasskeysBloc + extends MockBloc + implements DerivPasskeysBloc {} + +class _TestPage extends StatelessWidget { + const _TestPage(); + + @override + Widget build(BuildContext context) => MaterialApp( + localizationsDelegates: const >[ + DerivPasskeysLocalizations.delegate, + ], + locale: const Locale('en'), + home: LearnMorePasskeysPage( + onPageClosed: (BuildContext context) { + Navigator.pop(context); + }, + addMorePasskeysNavigationCallback: (BuildContext context) {}, + continueTradingNavigationCallback: (BuildContext context) {}, + ), + ); +} + +void main() { + group('LearnMorePasskeysPage', () { + late MockDerivPasskeysBloc derivPasskeysBloc; + setUp(() { + derivPasskeysBloc = MockDerivPasskeysBloc(); + + when(() => derivPasskeysBloc.state).thenReturn( + DerivPasskeysInitializedState(), + ); + }); + + testWidgets('renders page correctly', (WidgetTester tester) async { + await tester.pumpWidget( + BlocProvider( + create: (BuildContext context) => derivPasskeysBloc, + child: const _TestPage(), + ), + ); + + expect(find.byType(AppBar), findsOneWidget); + expect(find.byType(SingleChildScrollView), findsOneWidget); + expect(find.byType(SvgPicture), findsNWidgets(2)); + expect(find.byType(SectionTitleAndContent), findsNWidgets(5)); + expect(find.byType(Divider), findsNWidgets(4)); + expect(find.byType(UnorderedList), findsNWidgets(6)); + }); + + testWidgets('displays correct text', (WidgetTester tester) async { + await tester.pumpWidget( + BlocProvider( + create: (BuildContext context) => derivPasskeysBloc, + child: const _TestPage(), + ), + ); + + // Verify that the page displays the correct text + expect(find.text(DerivPasskeysLocalizationsEn().effortlessLogin), + findsOneWidget); + expect(find.text(DerivPasskeysLocalizationsEn().whatArePasskeys), + findsOneWidget); + expect(find.text(DerivPasskeysLocalizationsEn().whyPasskeys), + findsOneWidget); + expect(find.text(DerivPasskeysLocalizationsEn().howToCreatePasskey), + findsOneWidget); + expect(find.text(DerivPasskeysLocalizationsEn().whereArePasskeysSaved), + findsOneWidget); + expect( + find.text(DerivPasskeysLocalizationsEn().whatHappensIfEmailChanged), + findsOneWidget); + expect(find.textContaining(DerivPasskeysLocalizationsEn().tips), + findsOneWidget); + expect( + find.textContaining( + DerivPasskeysLocalizationsEn().beforeUsingPasskeys), + findsOneWidget); + expect( + find.textContaining(DerivPasskeysLocalizationsEn().enableScreenLock), + findsOneWidget); + expect( + find.textContaining( + DerivPasskeysLocalizationsEn().signInGoogleOrIcloud), + findsOneWidget); + expect( + find.textContaining(DerivPasskeysLocalizationsEn().enableBluetooth), + findsOneWidget); + }); + }); +} diff --git a/packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_bloc_setup.dart b/packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_bloc_setup.dart new file mode 100644 index 000000000..f9e4c298b --- /dev/null +++ b/packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_bloc_setup.dart @@ -0,0 +1,38 @@ +import 'package:deriv_passkeys/deriv_passkeys.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_verify_credentials_response_entity.dart'; +import 'package:mocktail/mocktail.dart'; + +class MockDerivPasskeysService extends Mock implements DerivPasskeysService {} + +class MockPasskeysConnectionInfoEntity extends Mock + implements PasskeysConnectionInfoEntity {} + +late DerivPasskeysBloc derivPasskeysBloc; +late MockDerivPasskeysService mockDerivPasskeysService; +late MockPasskeysConnectionInfoEntity mockPasskeysConnectionInfoEntity; + +void setupDerivPasskeysBloc() { + mockDerivPasskeysService = MockDerivPasskeysService(); + mockPasskeysConnectionInfoEntity = MockPasskeysConnectionInfoEntity(); + when(() => mockDerivPasskeysService.isSupported()) + .thenAnswer((_) async => true); + derivPasskeysBloc = DerivPasskeysBloc( + derivPasskeysService: mockDerivPasskeysService, + connectionInfo: mockPasskeysConnectionInfoEntity, + getJwtToken: () async => 'jwtToken', + ); + registerFallbackValue(mockPasskeysConnectionInfoEntity); + registerFallbackValue(() async => 'userAgent'); +} + +void setupSuccessDerivPasskeysVerifyCredentialEvent() { + const DerivPasskeysVerifyCredentialsResponseEntity mockResponseEntity = + DerivPasskeysVerifyCredentialsResponseEntity(token: 'token'); + + when(() => mockDerivPasskeysService.verifyCredential( + jwtToken: any(named: 'jwtToken'), + passkeysConnectionInfoEntity: + any(named: 'passkeysConnectionInfoEntity'), + userAgent: any(named: 'userAgent'), + )).thenAnswer((_) async => mockResponseEntity); +} diff --git a/packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_bloc_test.dart b/packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_bloc_test.dart new file mode 100644 index 000000000..2b62ec867 --- /dev/null +++ b/packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_bloc_test.dart @@ -0,0 +1,271 @@ +import 'package:deriv_passkeys/src/domain/entities/deriv_passkey_entity.dart'; +import 'package:deriv_passkeys/src/exceptions/platform_exceptions.dart'; +import 'package:deriv_passkeys/src/exceptions/server_exceptions.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mocktail/mocktail.dart'; +import 'package:deriv_passkeys/deriv_passkeys.dart'; + +import 'deriv_passkeys_bloc_setup.dart'; + +void main() { + setUp(() { + setupDerivPasskeysBloc(); + }); + + group('DerivPasskeysBloc', () { + test('initial state should be DerivPasskeysInitializedState', () { + expect(derivPasskeysBloc.state, isA()); + }); + + test( + 'initial state should be DerivPasskeysNotSupportedState if not supported', + () async { + when(() => mockDerivPasskeysService.isSupported()) + .thenAnswer((_) async => Future(() => false)); + final DerivPasskeysBloc unsupportedDerivPasskeysBloc = DerivPasskeysBloc( + derivPasskeysService: mockDerivPasskeysService, + connectionInfo: mockPasskeysConnectionInfoEntity, + getJwtToken: () async => 'jwtToken', + ); + await expectLater( + unsupportedDerivPasskeysBloc.stream, + emits( + isA(), + ), + ); + }); + + test( + 'SetDerivPasskeysNotSupportedEvent should emit DerivPasskeysNotSupportedState', + () { + expectLater( + derivPasskeysBloc.stream, + emits(isA()), + ); + + derivPasskeysBloc.add(const SetDerivPasskeysNotSupportedEvent()); + }); + + test( + 'DerivPasskeysVerifyCredentialEvent should emit DerivPasskeysCredentialVerifiedState', + () { + setupSuccessDerivPasskeysVerifyCredentialEvent(); + + expectLater( + derivPasskeysBloc.stream, + emitsInOrder(>[ + isA(), + isA(), + ]), + ); + + derivPasskeysBloc.add(DerivPasskeysVerifyCredentialEvent()); + }); + + test( + 'DerivPasskeysVerifyCredentialEvent should emit DerivPasskeysLoadedState if CanceledPlatformException is thrown', + () { + when(() => mockDerivPasskeysService.verifyCredential( + jwtToken: any(named: 'jwtToken'), + passkeysConnectionInfoEntity: + any(named: 'passkeysConnectionInfoEntity'), + userAgent: any(named: 'userAgent'), + )).thenAnswer((_) async => throw CanceledPlatformException( + code: '', + message: '', + details: '', + )); + + expectLater( + derivPasskeysBloc.stream, + emitsInOrder(>[ + isA(), + isA(), + ]), + ); + + derivPasskeysBloc.add(DerivPasskeysVerifyCredentialEvent()); + }); + + test( + 'DerivPasskeysVerifyCredentialEvent should emit NoCredentialErrorState if NoCredentialPlatformException is thrown', + () { + when(() => mockDerivPasskeysService.verifyCredential( + jwtToken: any(named: 'jwtToken'), + passkeysConnectionInfoEntity: + any(named: 'passkeysConnectionInfoEntity'), + userAgent: any(named: 'userAgent'), + )).thenAnswer((_) async => throw NoCredentialPlatformException( + code: '', + message: '', + details: '', + )); + + expectLater( + derivPasskeysBloc.stream, + emitsInOrder(>[ + isA(), + isA(), + ]), + ); + + derivPasskeysBloc.add(DerivPasskeysVerifyCredentialEvent()); + }); + + test( + 'DerivPasskeysVerifyCredentialEvent should emit DerivPasskeysErrorState if ServerException is thrown', + () { + when(() => mockDerivPasskeysService.verifyCredential( + jwtToken: any(named: 'jwtToken'), + passkeysConnectionInfoEntity: + any(named: 'passkeysConnectionInfoEntity'), + userAgent: any(named: 'userAgent'), + )).thenAnswer((_) async => throw ServerException( + errorCode: '', + message: '', + )); + + expectLater( + derivPasskeysBloc.stream, + emitsInOrder(>[ + isA(), + isA(), + ]), + ); + + derivPasskeysBloc.add(DerivPasskeysVerifyCredentialEvent()); + }); + + test( + 'DerivPasskeysVerifyCredentialEvent should emit DerivPasskeysErrorState if any other error is thrown', + () { + when(() => mockDerivPasskeysService.verifyCredential( + jwtToken: any(named: 'jwtToken'), + passkeysConnectionInfoEntity: + any(named: 'passkeysConnectionInfoEntity'), + userAgent: any(named: 'userAgent'), + )).thenAnswer((_) async => throw Exception()); + + expectLater( + derivPasskeysBloc.stream, + emitsInOrder(>[ + isA(), + isA(), + ]), + ); + + derivPasskeysBloc.add(DerivPasskeysVerifyCredentialEvent()); + }); + + test( + 'DerivPasskeysCreateCredentialEvent should emit DerivPasskeysCreatedSuccessfullyState', + () { + const DerivPasskeyEntity mockCredential = DerivPasskeyEntity( + id: 'id', + name: 'name', + createdAt: 1234, + lastUsed: null, + passkeyId: '', + storedOn: '', + ); + + when(() => mockDerivPasskeysService.createCredential()) + .thenAnswer((_) async => mockCredential); + + expectLater( + derivPasskeysBloc.stream, + emitsInOrder(>[ + isA(), + isA(), + isA(), + ]), + ); + + derivPasskeysBloc.add(DerivPasskeysCreateCredentialEvent()); + }); + + test( + 'DerivPasskeysCreateCredentialEvent should emit DerivPasskeysLoadedState if CanceledPlatformException is thrown', + () { + when(() => mockDerivPasskeysService.createCredential()) + .thenAnswer((_) async => throw CanceledPlatformException( + code: '', + message: '', + details: '', + )); + + expectLater( + derivPasskeysBloc.stream, + emitsInOrder(>[ + isA(), + isA(), + isA(), + ]), + ); + + derivPasskeysBloc.add(DerivPasskeysCreateCredentialEvent()); + }); + + test( + 'DerivPasskeysCreateCredentialEvent should emit DerivPasskeysErrorState if any other error is thrown', + () { + when(() => mockDerivPasskeysService.createCredential()) + .thenAnswer((_) async => throw Exception()); + + expectLater( + derivPasskeysBloc.stream, + emitsInOrder(>[ + isA(), + isA(), + ]), + ); + + derivPasskeysBloc.add(DerivPasskeysCreateCredentialEvent()); + }); + + test( + 'DerivPasskeysGetPasskeysListEvent should emit DerivPasskeysLoadedState', + () { + final List mockPasskeys = [ + const DerivPasskeyEntity( + id: 'id', + name: 'name', + createdAt: 1234, + lastUsed: null, + passkeyId: '', + storedOn: '', + ), + ]; + + when(() => mockDerivPasskeysService.getPasskeysList()) + .thenAnswer((_) async => mockPasskeys); + + expectLater( + derivPasskeysBloc.stream, + emitsInOrder(>[ + isA(), + isA(), + ]), + ); + + derivPasskeysBloc.add(const DerivPasskeysGetPasskeysListEvent()); + }); + + test( + 'DerivPasskeysGetPasskeysListEvent should emit DerivPasskeysErrorState if any error is thrown', + () { + when(() => mockDerivPasskeysService.getPasskeysList()) + .thenAnswer((_) async => throw Exception()); + + expectLater( + derivPasskeysBloc.stream, + emitsInOrder(>[ + isA(), + isA(), + ]), + ); + + derivPasskeysBloc.add(const DerivPasskeysGetPasskeysListEvent()); + }); + }); +} diff --git a/packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_event_test.dart b/packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_event_test.dart new file mode 100644 index 000000000..8991ea9bc --- /dev/null +++ b/packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_event_test.dart @@ -0,0 +1,64 @@ +import 'package:deriv_passkeys/deriv_passkeys.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + group('DerivPasskeysCreateCredentialEvent', () { + test('props should be empty', () { + final DerivPasskeysEvent event = DerivPasskeysCreateCredentialEvent(); + + expect(event.props, isEmpty); + }); + }); + + group('DerivPasskeysVerifyCredentialEvent', () { + test('props should be empty', () { + final DerivPasskeysEvent event = DerivPasskeysVerifyCredentialEvent(); + + expect(event.props, isEmpty); + }); + }); + + group('DerivPasskeysGetPasskeysListEvent', () { + test('props should be empty', () { + const DerivPasskeysEvent event = DerivPasskeysGetPasskeysListEvent(); + + expect(event.props, isEmpty); + }); + }); + + group('SetDerivPasskeysInitializedEvent', () { + test('props should be empty', () { + const DerivPasskeysEvent event = SetDerivPasskeysInitializedEvent(); + + expect(event.props, isEmpty); + }); + }); + + group('SetDerivPasskeysNotSupportedEvent', () { + test('props should be empty', () { + const DerivPasskeysEvent event = SetDerivPasskeysNotSupportedEvent(); + + expect(event.props, isEmpty); + }); + }); + + group('DerivPasskeysRevokeCredentialEvent', () { + test('props should contain options', () { + const String options = 'revoke_options'; + const DerivPasskeysEvent event = + DerivPasskeysRevokeCredentialEvent(options); + + expect(event.props, [options]); + }); + }); + + group('DerivPasskeysEditCredentialEvent', () { + test('props should contain options', () { + const String options = 'edit_options'; + const DerivPasskeysEvent event = + DerivPasskeysEditCredentialEvent(options); + + expect(event.props, [options]); + }); + }); +} diff --git a/packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_state_test.dart b/packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_state_test.dart new file mode 100644 index 000000000..65332d35d --- /dev/null +++ b/packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_state_test.dart @@ -0,0 +1,67 @@ +import 'package:deriv_passkeys/deriv_passkeys.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkey_entity.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + group('DerivPasskeysLoadedState', () { + test('props should contain passkeysList', () { + final List passkeysList = []; + final DerivPasskeysState state = DerivPasskeysLoadedState(passkeysList); + expect(state.props, contains(passkeysList)); + }); + }); + + group('DerivPasskeysInitializedState', () { + test('props should be empty', () { + final DerivPasskeysState state = DerivPasskeysInitializedState(); + expect(state.props, isEmpty); + }); + }); + + group('DerivPasskeysLoadingState', () { + test('props should be empty', () { + final DerivPasskeysState state = DerivPasskeysLoadingState(); + expect(state.props, isEmpty); + }); + }); + + group('DerivPasskeysCreatedSuccessfullyState', () { + test('props should be empty', () { + final DerivPasskeysState state = DerivPasskeysCreatedSuccessfullyState(); + expect(state.props, isEmpty); + }); + }); + + group('DerivPasskeysCredentialVerifiedState', () { + test('props should contain token', () { + const String token = 'example_token'; + const DerivPasskeysState state = + DerivPasskeysCredentialVerifiedState(token: token); + expect(state.props, contains(token)); + }); + }); + + group('DerivPasskeysNotSupportedState', () { + test('props should be empty', () { + final DerivPasskeysState state = DerivPasskeysNotSupportedState(); + expect(state.props, isEmpty); + }); + }); + + group('DerivPasskeysErrorState', () { + test('props should contain message and errorCode', () { + const String message = 'example_message'; + const String errorCode = 'example_error_code'; + const DerivPasskeysState state = + DerivPasskeysErrorState(message, errorCode: errorCode); + expect(state.props, containsAll([message, errorCode])); + }); + }); + + group('NoCredentialErrorState', () { + test('props should contain message and errorCode', () { + const NoCredentialErrorState state = NoCredentialErrorState(); + expect(state.props, contains('No credential found')); + }); + }); +} diff --git a/packages/deriv_passkeys/test/presentation/utils/date_time_utils_test.dart b/packages/deriv_passkeys/test/presentation/utils/date_time_utils_test.dart new file mode 100644 index 000000000..22c28d549 --- /dev/null +++ b/packages/deriv_passkeys/test/presentation/utils/date_time_utils_test.dart @@ -0,0 +1,22 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:deriv_passkeys/src/presentation/utils/date_time_utils.dart'; + +void main() { + group('DateTimeUtils', () { + test('dateTimeFromTimestamp should return DateTime', () { + const int timestamp = 1630444800000; + + final DateTime result = dateTimeFromTimestamp(timestamp); + + expect(result, isA()); + }); + + test('formattedDate should return formatted date string', () { + final DateTime date = DateTime(2023, 4, 20); // Provide a valid date + + final String result = formattedDate(date); + + expect(result, isA()); + }); + }); +} diff --git a/packages/deriv_passkeys/test/presentation/widgets/continue_with_passkey_button_test.dart b/packages/deriv_passkeys/test/presentation/widgets/continue_with_passkey_button_test.dart new file mode 100644 index 000000000..70c973c68 --- /dev/null +++ b/packages/deriv_passkeys/test/presentation/widgets/continue_with_passkey_button_test.dart @@ -0,0 +1,158 @@ +import 'package:bloc_test/bloc_test.dart'; +import 'package:deriv_localizations/l10n/generated/deriv_passkeys/deriv_passkeys_localizations.dart'; +import 'package:deriv_localizations/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_en.dart'; +import 'package:deriv_passkeys/src/presentation/states/bloc/deriv_passkeys_bloc.dart'; +import 'package:deriv_passkeys/src/presentation/widgets/continue_with_passkey_button.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mocktail/mocktail.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; + +class MockDerivPasskeysBloc + extends MockBloc + implements DerivPasskeysBloc {} + +class _TestPage extends StatelessWidget { + const _TestPage(); + + @override + Widget build(BuildContext context) => const MaterialApp( + localizationsDelegates: >[ + DerivPasskeysLocalizations.delegate, + ], + locale: Locale('en'), + home: Scaffold( + body: ContinueWithPasskeyButton(), + ), + ); +} + +void main() { + group('ContinueWithPasskeyButton', () { + late MockDerivPasskeysBloc derivPasskeysBloc; + setUp(() { + derivPasskeysBloc = MockDerivPasskeysBloc(); + + when(() => derivPasskeysBloc.state).thenReturn( + DerivPasskeysInitializedState(), + ); + }); + + testWidgets('renders correctly', (WidgetTester tester) async { + await tester.pumpWidget( + BlocProvider( + create: (BuildContext context) => derivPasskeysBloc, + child: const _TestPage(), + ), + ); + + expect(find.byType(InkWell), findsOneWidget); + expect(find.byType(Container), findsOneWidget); + expect(find.byType(SvgPicture), findsOneWidget); + expect(find.text('Passkey'), findsOneWidget); + }); + + testWidgets('does not render if passkeys not supported', + (WidgetTester tester) async { + when(() => derivPasskeysBloc.state).thenReturn( + DerivPasskeysNotSupportedState(), + ); + await tester.pumpWidget( + BlocProvider( + create: (BuildContext context) => derivPasskeysBloc, + child: const _TestPage(), + ), + ); + + await tester.pumpAndSettle(); + + expect(find.byType(InkWell), findsNothing); + expect(find.byType(SvgPicture), findsNothing); + expect(find.text('Passkey'), findsNothing); + }); + + // if you want to test the onPressed callback, you can use the following code + testWidgets('should call DerivPasskeysVerifyCredentialEvent when pressed', + (WidgetTester tester) async { + await tester.pumpWidget( + BlocProvider( + create: (BuildContext context) => derivPasskeysBloc, + child: const _TestPage(), + ), + ); + await tester.pumpAndSettle(); + await tester.tap(find.byType(InkWell)); + await tester.pumpAndSettle(); + + verify(() => derivPasskeysBloc.add(DerivPasskeysVerifyCredentialEvent())) + .called(1); + }); + + testWidgets( + 'should show alert dialog when NoCredentialErrorState is emitted', + (WidgetTester tester) async { + whenListen( + derivPasskeysBloc, + Stream.fromIterable( + [const NoCredentialErrorState()])); + await tester.pumpWidget( + BlocProvider( + create: (BuildContext context) => derivPasskeysBloc, + child: const _TestPage(), + ), + ); + + await tester.pumpAndSettle(); + + expect(find.byType(AlertDialog), findsOneWidget); + expect(find.text(DerivPasskeysLocalizationsEn().noPasskeyFound), + findsOneWidget); + expect( + find.text(DerivPasskeysLocalizationsEn().noPasskeyFoundDescription), + findsOneWidget); + expect(find.text(DerivPasskeysLocalizationsEn().ok.toUpperCase()), + findsOneWidget); + + await tester + .tap(find.text(DerivPasskeysLocalizationsEn().ok.toUpperCase())); + await tester.pumpAndSettle(); + + expect(find.byType(AlertDialog), findsNothing); + }); + + testWidgets( + 'should show alert dialog with error message when DerivPasskeysErrorState is emitted with errorCode PASSKEYS_SERVICE_ERROR', + (WidgetTester tester) async { + whenListen( + derivPasskeysBloc, + Stream.fromIterable([ + const DerivPasskeysErrorState( + 'error_message', + errorCode: 'PASSKEYS_SERVICE_ERROR', + ) + ])); + await tester.pumpWidget( + BlocProvider( + create: (BuildContext context) => derivPasskeysBloc, + child: const _TestPage(), + ), + ); + + await tester.pumpAndSettle(); + + expect(find.byType(AlertDialog), findsOneWidget); + expect(find.text(DerivPasskeysLocalizationsEn().unexpectedError), + findsOneWidget); + expect(find.text('error_message'), findsOneWidget); + expect(find.text(DerivPasskeysLocalizationsEn().ok.toUpperCase()), + findsOneWidget); + + await tester + .tap(find.text(DerivPasskeysLocalizationsEn().ok.toUpperCase())); + await tester.pumpAndSettle(); + + expect(find.byType(AlertDialog), findsNothing); + }); + }); +} diff --git a/packages/deriv_passkeys/test/presentation/widgets/icon_text_row_widget_test.dart b/packages/deriv_passkeys/test/presentation/widgets/icon_text_row_widget_test.dart new file mode 100644 index 000000000..e1ad6fb79 --- /dev/null +++ b/packages/deriv_passkeys/test/presentation/widgets/icon_text_row_widget_test.dart @@ -0,0 +1,37 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:deriv_passkeys/src/presentation/widgets/icon_text_row_widget.dart'; + +void main() { + testWidgets('IconTextRowWidget displays icon and text correctly', + (WidgetTester tester) async { + const String assetName = 'assets/svg/passkey_icon.svg'; + const String text = 'Sample Text'; + + await tester.pumpWidget( + const MaterialApp( + home: Scaffold( + body: IconTextRowWidget( + assetName: assetName, + text: text, + ), + ), + ), + ); + + final Finder svgFinder = find.byType(SvgPicture); + final Finder textFinder = find.text(text); + + expect(svgFinder, findsOneWidget); + expect(textFinder, findsOneWidget); + + final SvgPicture svgWidget = tester.widget(svgFinder) as SvgPicture; + final Text textWidget = tester.widget(textFinder) as Text; + + expect((svgWidget.bytesLoader as SvgAssetLoader).packageName, + 'deriv_passkeys'); + expect((svgWidget.bytesLoader as SvgAssetLoader).assetName, assetName); + expect(textWidget.data, text); + }); +} diff --git a/packages/deriv_passkeys/test/presentation/widgets/passkey_widget_test.dart b/packages/deriv_passkeys/test/presentation/widgets/passkey_widget_test.dart new file mode 100644 index 000000000..c4d05714d --- /dev/null +++ b/packages/deriv_passkeys/test/presentation/widgets/passkey_widget_test.dart @@ -0,0 +1,37 @@ +import 'package:deriv_localizations/l10n/generated/deriv_passkeys/deriv_passkeys_localizations.dart'; +import 'package:deriv_passkeys/src/domain/entities/deriv_passkey_entity.dart'; +import 'package:deriv_passkeys/src/presentation/widgets/passkey_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + group('PasskeyWidget', () { + const DerivPasskeyEntity passkey = DerivPasskeyEntity( + storedOn: 'Device', + lastUsed: 1638297600000, + createdAt: 1638297600000, + id: '', + name: 'Passkey', + passkeyId: '', + ); + + testWidgets('should display passkey information', + (WidgetTester tester) async { + await tester.pumpWidget( + const MaterialApp( + localizationsDelegates: >[ + DerivPasskeysLocalizations.delegate, + ], + locale: Locale('en'), + home: Scaffold( + body: PasskeyWidget(passkey: passkey), + ), + ), + ); + + expect(find.text('Passkey'), findsOneWidget); + expect(find.textContaining('Device'), findsOneWidget); + expect(find.textContaining('November 30th, 2021'), findsOneWidget); + }); + }); +} diff --git a/packages/deriv_passkeys/test/presentation/widgets/section_title_and_content_test.dart b/packages/deriv_passkeys/test/presentation/widgets/section_title_and_content_test.dart new file mode 100644 index 000000000..a8a1bf8eb --- /dev/null +++ b/packages/deriv_passkeys/test/presentation/widgets/section_title_and_content_test.dart @@ -0,0 +1,30 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:deriv_passkeys/src/presentation/widgets/section_title_and_content.dart'; + +void main() { + group('SectionTitleAndContent', () { + testWidgets('should display the title and content', + (WidgetTester tester) async { + const String title = 'Test Title'; + const String content = 'Test Content'; + + await tester.pumpWidget( + const MaterialApp( + home: Scaffold( + body: SectionTitleAndContent( + title: title, + texts: [content], + ), + ), + ), + ); + + final Finder titleFinder = find.text(title); + final Finder contentFinder = find.text(content); + + expect(titleFinder, findsOneWidget); + expect(contentFinder, findsOneWidget); + }); + }); +} diff --git a/packages/deriv_passkeys/test/presentation/widgets/unordered_list_widget_test.dart b/packages/deriv_passkeys/test/presentation/widgets/unordered_list_widget_test.dart new file mode 100644 index 000000000..dba0b13b9 --- /dev/null +++ b/packages/deriv_passkeys/test/presentation/widgets/unordered_list_widget_test.dart @@ -0,0 +1,53 @@ +import 'package:deriv_passkeys/src/presentation/widgets/unordered_list_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + group('UnorderedList', () { + const List texts = ['Item 1', 'Item 2', 'Item 3']; + const TextStyle? style = TextStyle(fontSize: 16); + + testWidgets('Renders the correct number of items', + (WidgetTester tester) async { + await tester.pumpWidget( + const MaterialApp( + home: Scaffold( + body: UnorderedList(texts: texts, style: style), + ), + ), + ); + + final Finder listItemFinder = find.byType(UnorderedListItem); + expect(listItemFinder, findsNWidgets(texts.length)); + }); + + testWidgets('Renders the correct text', (WidgetTester tester) async { + await tester.pumpWidget( + const MaterialApp( + home: Scaffold( + body: UnorderedList(texts: texts, style: style), + ), + ), + ); + + for (final String text in texts) { + final Finder textFinder = find.text(text); + expect(textFinder, findsOneWidget); + } + }); + + testWidgets('Renders the correct bullet points', + (WidgetTester tester) async { + await tester.pumpWidget( + const MaterialApp( + home: Scaffold( + body: UnorderedList(texts: texts, style: style), + ), + ), + ); + + final Finder bulletPointFinder = find.text('\u2022'); + expect(bulletPointFinder, findsNWidgets(texts.length)); + }); + }); +} From 3f299faea33731a814d18f18ba99180eb6483ca6 Mon Sep 17 00:00:00 2001 From: Bassam El Obeid <127500305+bassam-deriv@users.noreply.github.com> Date: Mon, 20 May 2024 12:57:20 +0400 Subject: [PATCH 061/162] refactor(deriv_passkeys): updated deriv_localizations (#590) --- packages/deriv_passkeys/example/pubspec.yaml | 2 +- packages/deriv_passkeys/pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/deriv_passkeys/example/pubspec.yaml b/packages/deriv_passkeys/example/pubspec.yaml index 9b22b0acb..7bcc961ee 100644 --- a/packages/deriv_passkeys/example/pubspec.yaml +++ b/packages/deriv_passkeys/example/pubspec.yaml @@ -42,7 +42,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_localizations - ref: deriv_localizations-v1.3.2 + ref: deriv_localizations-v1.4.0 deriv_passkeys: path: ../ diff --git a/packages/deriv_passkeys/pubspec.yaml b/packages/deriv_passkeys/pubspec.yaml index aebf18665..9089a1a31 100644 --- a/packages/deriv_passkeys/pubspec.yaml +++ b/packages/deriv_passkeys/pubspec.yaml @@ -19,7 +19,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_localizations - ref: deriv_localizations-v1.3.2 + ref: deriv_localizations-v1.4.0 deriv_ui: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git From ca096c5c5682f9bc7d840530327e6dc131b9bc5a Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Mon, 20 May 2024 17:13:37 +0800 Subject: [PATCH 062/162] chore(version): bump version and update changelog (#589) --- CHANGELOG.md | 33 +++++++++++++++++++++++ README.md | 6 ++--- packages/deriv_auth/CHANGELOG.md | 4 +++ packages/deriv_auth/pubspec.yaml | 4 +-- packages/deriv_localizations/CHANGELOG.md | 4 +++ packages/deriv_localizations/pubspec.yaml | 2 +- packages/deriv_passkeys/CHANGELOG.md | 4 +++ packages/deriv_passkeys/pubspec.yaml | 2 +- 8 files changed, 52 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c667901c..69ce07f26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,39 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-05-20 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_localizations` - `v1.4.0`](#deriv_localizations---v140) + - [`deriv_passkeys` - `v0.0.1+1`](#deriv_passkeys---v0011) + - [`deriv_auth` - `v6.5.2`](#deriv_auth---v652) + +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.5.2` + +--- + +#### `deriv_localizations` - `v1.4.0` + + - **FEAT**(deriv_passkeys): [UPM-547] Deriv passkeys package ([#425](https://github.com/regentmarkets/flutter-deriv-packages/issues/425)). ([c5509175](https://github.com/regentmarkets/flutter-deriv-packages/commit/c5509175edb6a94122cce6fe6f63a43d44904dc9)) + +#### `deriv_passkeys` - `v0.0.1+1` + + - **REFACTOR**(deriv_passkeys): updated deriv_localizations ([#590](https://github.com/regentmarkets/flutter-deriv-packages/issues/590)). ([3f299fae](https://github.com/regentmarkets/flutter-deriv-packages/commit/3f299faea33731a814d18f18ba99180eb6483ca6)) + + ## 2024-05-17 ### Changes diff --git a/README.md b/README.md index 99adb57bd..968f83ac0 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.5.1)`. 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.5.2)`. To use the package, add the following to your pubspec.yaml file: ```yaml @@ -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.4](./packages/analytics/CHANGELOG.md) | -| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.5.1 ](./packages/deriv_auth/CHANGELOG.md) | +| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.5.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) | @@ -32,7 +32,7 @@ deriv_ui: | [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.2+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.3.2](./packages/deriv_localizations/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.4.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) | diff --git a/packages/deriv_auth/CHANGELOG.md b/packages/deriv_auth/CHANGELOG.md index 2d2fa8dde..c083c2b9d 100644 --- a/packages/deriv_auth/CHANGELOG.md +++ b/packages/deriv_auth/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.5.2 + + - Update a dependency to the latest release. + ## 6.5.1 - Update a dependency to the latest release. diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index b9e4827b7..d31fd0a4f 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.5.1 +version: 6.5.2 environment: @@ -46,7 +46,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_localizations - ref: deriv_localizations-v1.3.2 + ref: deriv_localizations-v1.4.0 deriv_language_selector: git: diff --git a/packages/deriv_localizations/CHANGELOG.md b/packages/deriv_localizations/CHANGELOG.md index 987f65733..c060cc955 100644 --- a/packages/deriv_localizations/CHANGELOG.md +++ b/packages/deriv_localizations/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.4.0 + + - **FEAT**(deriv_passkeys): [UPM-547] Deriv passkeys package ([#425](https://github.com/regentmarkets/flutter-deriv-packages/issues/425)). ([c5509175](https://github.com/regentmarkets/flutter-deriv-packages/commit/c5509175edb6a94122cce6fe6f63a43d44904dc9)) + ## 1.3.2 - **REFACTOR**(deriv_localizations): Updating deriv localizations for passkeys package ([#581](https://github.com/regentmarkets/flutter-deriv-packages/issues/581)). ([0bf743c3](https://github.com/regentmarkets/flutter-deriv-packages/commit/0bf743c3b7a65f70935b32b68b7062ed07a1ae72)) diff --git a/packages/deriv_localizations/pubspec.yaml b/packages/deriv_localizations/pubspec.yaml index a17f509c1..c54242be1 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.3.2 +version: 1.4.0 environment: sdk: '>=3.0.2 <4.0.0' diff --git a/packages/deriv_passkeys/CHANGELOG.md b/packages/deriv_passkeys/CHANGELOG.md index 41cc7d819..4ce3d775e 100644 --- a/packages/deriv_passkeys/CHANGELOG.md +++ b/packages/deriv_passkeys/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.1+1 + + - **REFACTOR**(deriv_passkeys): updated deriv_localizations ([#590](https://github.com/regentmarkets/flutter-deriv-packages/issues/590)). ([3f299fae](https://github.com/regentmarkets/flutter-deriv-packages/commit/3f299faea33731a814d18f18ba99180eb6483ca6)) + ## 0.0.1 * TODO: Describe initial release. diff --git a/packages/deriv_passkeys/pubspec.yaml b/packages/deriv_passkeys/pubspec.yaml index 9089a1a31..82c8c25e4 100644 --- a/packages/deriv_passkeys/pubspec.yaml +++ b/packages/deriv_passkeys/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_passkeys description: Deriv Passkeys Flutter Plugin -version: 0.0.1 +version: 0.0.1+1 publish_to: 'none' environment: From 294ca42318568fd876f531856b61d0930efb05b8 Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Mon, 20 May 2024 13:16:47 +0400 Subject: [PATCH 063/162] refactor(deriv_auth): updated deriv_ui --- packages/deriv_auth/.fvm/flutter_sdk | 1 + packages/deriv_auth/.fvm/fvm_config.json | 4 ++++ .../features/get_started/pages/get_started_page.dart | 2 +- packages/deriv_auth/example/pubspec.yaml | 7 +++++++ packages/deriv_auth/pubspec.yaml | 12 ++++-------- 5 files changed, 17 insertions(+), 9 deletions(-) create mode 120000 packages/deriv_auth/.fvm/flutter_sdk create mode 100644 packages/deriv_auth/.fvm/fvm_config.json diff --git a/packages/deriv_auth/.fvm/flutter_sdk b/packages/deriv_auth/.fvm/flutter_sdk new file mode 120000 index 000000000..30d5c7f1a --- /dev/null +++ b/packages/deriv_auth/.fvm/flutter_sdk @@ -0,0 +1 @@ +/Users/bassemobeid/fvm/versions/3.10.2 \ No newline at end of file diff --git a/packages/deriv_auth/.fvm/fvm_config.json b/packages/deriv_auth/.fvm/fvm_config.json new file mode 100644 index 000000000..0e8090af0 --- /dev/null +++ b/packages/deriv_auth/.fvm/fvm_config.json @@ -0,0 +1,4 @@ +{ + "flutterSdkVersion": "3.10.2", + "flavors": {} +} \ No newline at end of file diff --git a/packages/deriv_auth/example/lib/features/get_started/pages/get_started_page.dart b/packages/deriv_auth/example/lib/features/get_started/pages/get_started_page.dart index 586baf711..97b058a48 100644 --- a/packages/deriv_auth/example/lib/features/get_started/pages/get_started_page.dart +++ b/packages/deriv_auth/example/lib/features/get_started/pages/get_started_page.dart @@ -32,7 +32,7 @@ class GetStartedPage extends StatelessWidget { builder: (context) => const SignupPage(), ), ), - onTapNavigation: () { + onTapNavigation: (context) { Navigator.push( context, MaterialPageRoute( diff --git a/packages/deriv_auth/example/pubspec.yaml b/packages/deriv_auth/example/pubspec.yaml index c2481a12a..d1ba03014 100644 --- a/packages/deriv_auth/example/pubspec.yaml +++ b/packages/deriv_auth/example/pubspec.yaml @@ -24,6 +24,13 @@ dependencies: path: packages/deriv_http_client ref: deriv_http_client-v2.0.1 +dependency_overrides: + deriv_ui: + git: + url: git@github.com:regentmarkets/flutter-deriv-packages.git + path: packages/deriv_ui + ref: deriv_ui-v0.0.7+4 + dev_dependencies: flutter_test: sdk: flutter diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index 2c0c34234..0ff3efee7 100644 --- a/packages/deriv_auth/pubspec.yaml +++ b/packages/deriv_auth/pubspec.yaml @@ -52,7 +52,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: 4cb6ab174fc11aac2799475ce4cd874612f7e2da + ref: dabf6e8cc92494522879fe9fbfae592377eb899a deriv_language_selector: git: @@ -70,15 +70,11 @@ dependencies: uni_links2: ^0.6.0+2 dependency_overrides: - flutter_deriv_api: - git: - url: git@github.com:deriv-com/flutter-deriv-api.git - ref: dev - deriv_localizations: + deriv_ui: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git - path: packages/deriv_localizations - ref: da897013ecd1f993ad4e696c1d0856d7ebf3758c + path: packages/deriv_ui + ref: deriv_ui-v0.0.7+4 dev_dependencies: mocktail: ^1.0.3 From be3f0616ee514ea0e1c0dae8f9edb387ed186f90 Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Mon, 20 May 2024 13:19:47 +0400 Subject: [PATCH 064/162] chore: Remove unused Flutter SDK and fvm configuration files --- packages/deriv_auth/.fvm/flutter_sdk | 1 - packages/deriv_auth/.fvm/fvm_config.json | 4 ---- 2 files changed, 5 deletions(-) delete mode 120000 packages/deriv_auth/.fvm/flutter_sdk delete mode 100644 packages/deriv_auth/.fvm/fvm_config.json diff --git a/packages/deriv_auth/.fvm/flutter_sdk b/packages/deriv_auth/.fvm/flutter_sdk deleted file mode 120000 index 30d5c7f1a..000000000 --- a/packages/deriv_auth/.fvm/flutter_sdk +++ /dev/null @@ -1 +0,0 @@ -/Users/bassemobeid/fvm/versions/3.10.2 \ No newline at end of file diff --git a/packages/deriv_auth/.fvm/fvm_config.json b/packages/deriv_auth/.fvm/fvm_config.json deleted file mode 100644 index 0e8090af0..000000000 --- a/packages/deriv_auth/.fvm/fvm_config.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "flutterSdkVersion": "3.10.2", - "flavors": {} -} \ No newline at end of file From f46208876dfb676310790155ba6d458d4a22f8a5 Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Mon, 20 May 2024 13:23:36 +0400 Subject: [PATCH 065/162] chore: Update deriv_auth dependency to deriv_passkeys-v0.0.1+1 --- packages/deriv_auth/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index e06b21479..abb36f4af 100644 --- a/packages/deriv_auth/pubspec.yaml +++ b/packages/deriv_auth/pubspec.yaml @@ -52,7 +52,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: dabf6e8cc92494522879fe9fbfae592377eb899a + ref: deriv_passkeys-v0.0.1+1 deriv_language_selector: git: From e110f2297d15b5c0d75eed22566f554dd46ed9ef Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Mon, 20 May 2024 15:27:56 +0400 Subject: [PATCH 066/162] chore: Update deriv_language_selector dependency to v0.0.2+2 and remove unused import in deriv_get_started_layout_test --- packages/deriv_auth/pubspec.yaml | 2 +- .../deriv_get_started_layout_test.dart | 5 ++-- .../layouts/deriv_login_layout_test.dart | 24 ++++++++++++++++++- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index abb36f4af..5ebd64995 100644 --- a/packages/deriv_auth/pubspec.yaml +++ b/packages/deriv_auth/pubspec.yaml @@ -58,7 +58,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_language_selector - ref: deriv_language_selector-v0.0.2+1 + ref: deriv_language_selector-v0.0.2+2 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 ca0c48003..23aa26b08 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 @@ -5,7 +5,6 @@ import 'package:deriv_auth/features/get_started/models/deriv_get_started_slide_m import 'package:deriv_auth/features/get_started/presentation/layouts/deriv_get_started_layout.dart'; import 'package:deriv_language_selector/deriv_language_selector.dart'; import 'package:deriv_localizations/l10n/generated/deriv_auth/deriv_auth_localizations.dart'; -import 'package:deriv_localizations/l10n/generated/deriv_auth/deriv_auth_localizations_ar.dart'; import 'package:deriv_ui/deriv_ui.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -76,7 +75,7 @@ void main() { ), )); - await $.tap($(SecondaryButton)); + await $(SecondaryButton).tap(); expect(loginTapped, isTrue); }); @@ -107,7 +106,7 @@ void main() { ), ); - await $.tap($(PrimaryButton)); + await $(PrimaryButton).tap(); expect(signupTapped, isTrue); }); diff --git a/packages/deriv_auth/test/features/login/presentation/layouts/deriv_login_layout_test.dart b/packages/deriv_auth/test/features/login/presentation/layouts/deriv_login_layout_test.dart index 7fb8322c4..9d8ddba69 100644 --- a/packages/deriv_auth/test/features/login/presentation/layouts/deriv_login_layout_test.dart +++ b/packages/deriv_auth/test/features/login/presentation/layouts/deriv_login_layout_test.dart @@ -1,5 +1,7 @@ +import 'package:bloc_test/bloc_test.dart'; import 'package:deriv_auth/core/models/landig_comany_model.dart'; import 'package:deriv_auth/deriv_auth.dart'; +import 'package:deriv_passkeys/deriv_passkeys.dart'; import 'package:deriv_ui/deriv_ui.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -12,16 +14,26 @@ import '../../../../mocks.dart'; import '../../../../pump_app.dart'; import '../../../social_auth/mocks/mock_social_provider_model.dart'; +class MockDerivPasskeysBloc + extends MockBloc + implements DerivPasskeysBloc {} + void main() { group('DerivLoginLayout', () { late MockAuthCubit authCubit; late MockSocialAuthCubit socialAuthCubit; + late MockDerivPasskeysBloc derivPasskeysBloc; const String welcomeLabel = 'Welcome Back'; setUpAll(() { authCubit = MockAuthCubit(); socialAuthCubit = MockSocialAuthCubit(); + derivPasskeysBloc = MockDerivPasskeysBloc(); + + when(() => derivPasskeysBloc.state).thenReturn( + DerivPasskeysInitializedState(), + ); registerFallbackValue(SocialAuthProvider.google); @@ -57,6 +69,7 @@ void main() { providers: [ BlocProvider.value(value: authCubit), BlocProvider.value(value: socialAuthCubit), + BlocProvider.value(value: derivPasskeysBloc), ], child: DerivLoginLayout( socialAuthStateHandler: (SocialAuthState state) {}, @@ -93,6 +106,7 @@ void main() { providers: [ BlocProvider.value(value: authCubit), BlocProvider.value(value: socialAuthCubit), + BlocProvider.value(value: derivPasskeysBloc), ], child: DerivLoginLayout( socialAuthStateHandler: (SocialAuthState state) {}, @@ -131,6 +145,7 @@ void main() { providers: [ BlocProvider.value(value: authCubit), BlocProvider.value(value: socialAuthCubit), + BlocProvider.value(value: derivPasskeysBloc), ], child: DerivLoginLayout( socialAuthStateHandler: (SocialAuthState state) {}, @@ -163,6 +178,7 @@ void main() { providers: [ BlocProvider.value(value: authCubit), BlocProvider.value(value: socialAuthCubit), + BlocProvider.value(value: derivPasskeysBloc), ], child: DerivLoginLayout( socialAuthStateHandler: (SocialAuthState state) {}, @@ -208,6 +224,7 @@ void main() { providers: [ BlocProvider.value(value: authCubit), BlocProvider.value(value: socialAuthCubit), + BlocProvider.value(value: derivPasskeysBloc), ], child: DerivLoginLayout( socialAuthStateHandler: (SocialAuthState state) {}, @@ -245,6 +262,7 @@ void main() { providers: [ BlocProvider.value(value: authCubit), BlocProvider.value(value: socialAuthCubit), + BlocProvider.value(value: derivPasskeysBloc), ], child: DerivLoginLayout( socialAuthStateHandler: (SocialAuthState state) {}, @@ -281,6 +299,7 @@ void main() { providers: [ BlocProvider.value(value: authCubit), BlocProvider.value(value: socialAuthCubit), + BlocProvider.value(value: derivPasskeysBloc), ], child: DerivLoginLayout( socialAuthStateHandler: (SocialAuthState state) {}, @@ -313,6 +332,7 @@ void main() { providers: [ BlocProvider.value(value: authCubit), BlocProvider.value(value: socialAuthCubit), + BlocProvider.value(value: derivPasskeysBloc), ], child: DerivLoginLayout( socialAuthStateHandler: (SocialAuthState state) {}, @@ -360,6 +380,7 @@ void main() { providers: [ BlocProvider.value(value: authCubit), BlocProvider.value(value: socialAuthCubit), + BlocProvider.value(value: derivPasskeysBloc), ], child: DerivLoginLayout( socialAuthStateHandler: (SocialAuthState state) {}, @@ -376,7 +397,7 @@ void main() { ), )); - await $(IconButton).at(1).tap(); + await $(InkWell).$(SocialAuthProvider.google.name.capitalize).tap(); expect(onSocialAuthButtonPressedCalled, isTrue); }); @@ -403,6 +424,7 @@ void main() { providers: [ BlocProvider.value(value: authCubit), BlocProvider.value(value: socialAuthCubit), + BlocProvider.value(value: derivPasskeysBloc), ], child: DerivLoginLayout( socialAuthStateHandler: (SocialAuthState state) { From fda7830f7a29029fa2f753bc9c8b6ee80ea68cfd Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 20 May 2024 11:50:32 +0000 Subject: [PATCH 067/162] chore(release): publish packages - deriv_auth@6.6.0 --- CHANGELOG.md | 55 ++++++++++++++++++++++++++++++++ packages/deriv_auth/CHANGELOG.md | 38 ++++++++++++++++++++++ packages/deriv_auth/pubspec.yaml | 2 +- 3 files changed, 94 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69ce07f26..62ae438f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,61 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-05-20 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_auth` - `v6.6.0`](#deriv_auth---v660) + +--- + +#### `deriv_auth` - `v6.6.0` + + - **REFACTOR**(deriv_auth): replaced deriv_localizations commit hash ref with tag ref. ([572aa5fd](https://github.com/regentmarkets/flutter-deriv-packages/commit/572aa5fd54241d09b9993b102c0eceb117594821)) + - **REFACTOR**(deriv_passkeys): updated deriv_passkeys and deriv_localizations. ([d6eccdca](https://github.com/regentmarkets/flutter-deriv-packages/commit/d6eccdcaf9fa37784ae3f9fb2bd13a98e874aae0)) + - **REFACTOR**: update deriv_passkeys. ([cd545c74](https://github.com/regentmarkets/flutter-deriv-packages/commit/cd545c74f7076010d7153d74c20288b2b8db016b)) + - **REFACTOR**: update deriv_passkeys. ([41fa9ed8](https://github.com/regentmarkets/flutter-deriv-packages/commit/41fa9ed899462b0eeef34fa3971ffe82e937ce91)) + - **REFACTOR**(deriv_auth): Updated deriv_localizations. ([4d43e258](https://github.com/regentmarkets/flutter-deriv-packages/commit/4d43e258d72e71da6c53f1bf2b241f95d4ba4c67)) + - **REFACTOR**(deriv_auth): updated deriv_passkeys and deriv_localizations versions. ([a3acdf1a](https://github.com/regentmarkets/flutter-deriv-packages/commit/a3acdf1ad34bdbba464d866273e165709d908159)) + - **REFACTOR**(deriv_auth): updated deriv_passkeys commit hash. ([ed0f0057](https://github.com/regentmarkets/flutter-deriv-packages/commit/ed0f005785991a0c166edaf4f93e03922826ee91)) + - **REFACTOR**(deriv_auth): updated deriv_passkeys commit hash. ([82de1610](https://github.com/regentmarkets/flutter-deriv-packages/commit/82de161098d7cd698dcf465a4ad4a2cdac1fdd75)) + - **REFACTOR**(deriv_auth): updated deriv_passkeys commit hash. ([dcda848b](https://github.com/regentmarkets/flutter-deriv-packages/commit/dcda848bb014f72e138e907c84c258be1a7c5c63)) + - **REFACTOR**(deriv_auth): updated deriv_passkeys commit hash. ([87ff83bb](https://github.com/regentmarkets/flutter-deriv-packages/commit/87ff83bbc8050c3893186b86003345ca3ed739bd)) + - **REFACTOR**(deriv_auth): updated deriv_passkeys commit hash. ([608dcf4b](https://github.com/regentmarkets/flutter-deriv-packages/commit/608dcf4b812945efa605ae5c553afa06e6a9f8db)) + - **REFACTOR**(deriv_auth): updated deriv_passkeys commit hash. ([6a2708eb](https://github.com/regentmarkets/flutter-deriv-packages/commit/6a2708eb6cb8a3b343fd8688a27ab038fd3c1acb)) + - **REFACTOR**(deriv_auth): updated deriv_ui. ([294ca423](https://github.com/regentmarkets/flutter-deriv-packages/commit/294ca42318568fd876f531856b61d0930efb05b8)) + - **REFACTOR**(deriv_passkeys): removed context parameter from onLoggedIn callback. ([02f390b2](https://github.com/regentmarkets/flutter-deriv-packages/commit/02f390b2cb4736993f876fe60f6513490682837a)) + - **REFACTOR**(deriv_auth): updated deriv_passkeys and deriv_localizations versions. ([14b85c22](https://github.com/regentmarkets/flutter-deriv-packages/commit/14b85c22c7edbd8046eb9f2feef68aa49aff8df2)) + - **REFACTOR**(deriv_auth): new deriv_passkeys commit hash ref. ([7bb5f71b](https://github.com/regentmarkets/flutter-deriv-packages/commit/7bb5f71b4a3c364b3ee4455fe1c97b8ac5e83dea)) + - **REFACTOR**(deriv_auth): updated passkeys dependencies. ([d966d9f2](https://github.com/regentmarkets/flutter-deriv-packages/commit/d966d9f28a743d652dd14174827da5e20a697664)) + - **REFACTOR**(deriv_auth): integrating deriv_passkeys. ([45cbbb6c](https://github.com/regentmarkets/flutter-deriv-packages/commit/45cbbb6c20274e84e4f932057d0816a3b4dc581c)) + - **REFACTOR**(deriv_auth): fixing deriv_passkeys dependencies. ([ac5dd589](https://github.com/regentmarkets/flutter-deriv-packages/commit/ac5dd5895caf6f2f2e60b2906a38f6ac27bfc11a)) + - **REFACTOR**(deriv_auth): linked onLoggedIn function in login_page. ([1e5ba631](https://github.com/regentmarkets/flutter-deriv-packages/commit/1e5ba63165ff214ec44e589daddb9566ec47b94a)) + - **REFACTOR**(deriv_auth): added context to onLoggedIn. ([c93046ab](https://github.com/regentmarkets/flutter-deriv-packages/commit/c93046abadefeb4af75cb0a2996f69a37415b33e)) + - **REFACTOR**(deriv_auth): updated flutter_deriv_api. ([c3187ba8](https://github.com/regentmarkets/flutter-deriv-packages/commit/c3187ba85494198bb3b11e568ad50ff714b69cfa)) + - **REFACTOR**(deriv_auth): updated `deriv_http_client`. ([c12a9ee4](https://github.com/regentmarkets/flutter-deriv-packages/commit/c12a9ee43fcc321a9f2ca404215a4f15069e4a71)) + - **FIX**(deriv_auth): fixed onPressed error. ([a3cce1fb](https://github.com/regentmarkets/flutter-deriv-packages/commit/a3cce1fb5884592d0329e67de4a5a6ca9b55f694)) + - **FIX**(deriv_auth): calling onLoggedIn correctly. ([5c19f3ae](https://github.com/regentmarkets/flutter-deriv-packages/commit/5c19f3aee610bd3ff9e9c25edae4a558ae8a97b8)) + - **FIX**(deriv_auth): fixed deriv_passkeys dependency. ([607eca12](https://github.com/regentmarkets/flutter-deriv-packages/commit/607eca127e5a394dbb58abe82a5d5d4b4f811156)) + - **FEAT**(deriv_auth): single entry ([#420](https://github.com/regentmarkets/flutter-deriv-packages/issues/420)). ([e594c05b](https://github.com/regentmarkets/flutter-deriv-packages/commit/e594c05b87c05d189913a7de8b9e1e4e6d03b76a)) + - **FEAT**(deriv_passkeys): connected passkeys functionality with deriv auth. ([7333af28](https://github.com/regentmarkets/flutter-deriv-packages/commit/7333af283e3e5e00970a2dd49930f243d7f1f558)) + - **FEAT**(deriv_auth): added deriv_passkeys to deriv_auth. ([e96c8127](https://github.com/regentmarkets/flutter-deriv-packages/commit/e96c81278999fa2dfae57e6adf5785bb82a51fe3)) + - **FEAT**(deriv_auth): single entry reset password and merge conflicts. ([f7930d66](https://github.com/regentmarkets/flutter-deriv-packages/commit/f7930d66880d2d091959646dd928e79189ce5704)) + - **FEAT**(deriv_auith): single entry setting page. ([dc29784f](https://github.com/regentmarkets/flutter-deriv-packages/commit/dc29784f2f74c34a7a5bf9910b4041adca591e74)) + - **FEAT**(deriv_auth): single entry signup page. ([f38cc253](https://github.com/regentmarkets/flutter-deriv-packages/commit/f38cc253209afdf3573e3a85fe8ec0cd7082c5d5)) + - **FEAT**(deriv_auth): single entry login and reset pass added. ([573a4a78](https://github.com/regentmarkets/flutter-deriv-packages/commit/573a4a787a6aa518537f2678c19a748cebcf0fb4)) + - **FEAT**(deriv_auth): adding login page to single entry. ([5ce30c3b](https://github.com/regentmarkets/flutter-deriv-packages/commit/5ce30c3b0fbd84ad3a4cc191d0c7949ec9691ef5)) + - **FEAT**(deriv_auth): single entry. ([c1e0067b](https://github.com/regentmarkets/flutter-deriv-packages/commit/c1e0067b7bbaf94cfd13f342cd05aaa8f65ba497)) + + ## 2024-05-20 ### Changes diff --git a/packages/deriv_auth/CHANGELOG.md b/packages/deriv_auth/CHANGELOG.md index c083c2b9d..106e0702b 100644 --- a/packages/deriv_auth/CHANGELOG.md +++ b/packages/deriv_auth/CHANGELOG.md @@ -1,3 +1,41 @@ +## 6.6.0 + + - **REFACTOR**(deriv_auth): replaced deriv_localizations commit hash ref with tag ref. ([572aa5fd](https://github.com/regentmarkets/flutter-deriv-packages/commit/572aa5fd54241d09b9993b102c0eceb117594821)) + - **REFACTOR**(deriv_passkeys): updated deriv_passkeys and deriv_localizations. ([d6eccdca](https://github.com/regentmarkets/flutter-deriv-packages/commit/d6eccdcaf9fa37784ae3f9fb2bd13a98e874aae0)) + - **REFACTOR**: update deriv_passkeys. ([cd545c74](https://github.com/regentmarkets/flutter-deriv-packages/commit/cd545c74f7076010d7153d74c20288b2b8db016b)) + - **REFACTOR**: update deriv_passkeys. ([41fa9ed8](https://github.com/regentmarkets/flutter-deriv-packages/commit/41fa9ed899462b0eeef34fa3971ffe82e937ce91)) + - **REFACTOR**(deriv_auth): Updated deriv_localizations. ([4d43e258](https://github.com/regentmarkets/flutter-deriv-packages/commit/4d43e258d72e71da6c53f1bf2b241f95d4ba4c67)) + - **REFACTOR**(deriv_auth): updated deriv_passkeys and deriv_localizations versions. ([a3acdf1a](https://github.com/regentmarkets/flutter-deriv-packages/commit/a3acdf1ad34bdbba464d866273e165709d908159)) + - **REFACTOR**(deriv_auth): updated deriv_passkeys commit hash. ([ed0f0057](https://github.com/regentmarkets/flutter-deriv-packages/commit/ed0f005785991a0c166edaf4f93e03922826ee91)) + - **REFACTOR**(deriv_auth): updated deriv_passkeys commit hash. ([82de1610](https://github.com/regentmarkets/flutter-deriv-packages/commit/82de161098d7cd698dcf465a4ad4a2cdac1fdd75)) + - **REFACTOR**(deriv_auth): updated deriv_passkeys commit hash. ([dcda848b](https://github.com/regentmarkets/flutter-deriv-packages/commit/dcda848bb014f72e138e907c84c258be1a7c5c63)) + - **REFACTOR**(deriv_auth): updated deriv_passkeys commit hash. ([87ff83bb](https://github.com/regentmarkets/flutter-deriv-packages/commit/87ff83bbc8050c3893186b86003345ca3ed739bd)) + - **REFACTOR**(deriv_auth): updated deriv_passkeys commit hash. ([608dcf4b](https://github.com/regentmarkets/flutter-deriv-packages/commit/608dcf4b812945efa605ae5c553afa06e6a9f8db)) + - **REFACTOR**(deriv_auth): updated deriv_passkeys commit hash. ([6a2708eb](https://github.com/regentmarkets/flutter-deriv-packages/commit/6a2708eb6cb8a3b343fd8688a27ab038fd3c1acb)) + - **REFACTOR**(deriv_auth): updated deriv_ui. ([294ca423](https://github.com/regentmarkets/flutter-deriv-packages/commit/294ca42318568fd876f531856b61d0930efb05b8)) + - **REFACTOR**(deriv_passkeys): removed context parameter from onLoggedIn callback. ([02f390b2](https://github.com/regentmarkets/flutter-deriv-packages/commit/02f390b2cb4736993f876fe60f6513490682837a)) + - **REFACTOR**(deriv_auth): updated deriv_passkeys and deriv_localizations versions. ([14b85c22](https://github.com/regentmarkets/flutter-deriv-packages/commit/14b85c22c7edbd8046eb9f2feef68aa49aff8df2)) + - **REFACTOR**(deriv_auth): new deriv_passkeys commit hash ref. ([7bb5f71b](https://github.com/regentmarkets/flutter-deriv-packages/commit/7bb5f71b4a3c364b3ee4455fe1c97b8ac5e83dea)) + - **REFACTOR**(deriv_auth): updated passkeys dependencies. ([d966d9f2](https://github.com/regentmarkets/flutter-deriv-packages/commit/d966d9f28a743d652dd14174827da5e20a697664)) + - **REFACTOR**(deriv_auth): integrating deriv_passkeys. ([45cbbb6c](https://github.com/regentmarkets/flutter-deriv-packages/commit/45cbbb6c20274e84e4f932057d0816a3b4dc581c)) + - **REFACTOR**(deriv_auth): fixing deriv_passkeys dependencies. ([ac5dd589](https://github.com/regentmarkets/flutter-deriv-packages/commit/ac5dd5895caf6f2f2e60b2906a38f6ac27bfc11a)) + - **REFACTOR**(deriv_auth): linked onLoggedIn function in login_page. ([1e5ba631](https://github.com/regentmarkets/flutter-deriv-packages/commit/1e5ba63165ff214ec44e589daddb9566ec47b94a)) + - **REFACTOR**(deriv_auth): added context to onLoggedIn. ([c93046ab](https://github.com/regentmarkets/flutter-deriv-packages/commit/c93046abadefeb4af75cb0a2996f69a37415b33e)) + - **REFACTOR**(deriv_auth): updated flutter_deriv_api. ([c3187ba8](https://github.com/regentmarkets/flutter-deriv-packages/commit/c3187ba85494198bb3b11e568ad50ff714b69cfa)) + - **REFACTOR**(deriv_auth): updated `deriv_http_client`. ([c12a9ee4](https://github.com/regentmarkets/flutter-deriv-packages/commit/c12a9ee43fcc321a9f2ca404215a4f15069e4a71)) + - **FIX**(deriv_auth): fixed onPressed error. ([a3cce1fb](https://github.com/regentmarkets/flutter-deriv-packages/commit/a3cce1fb5884592d0329e67de4a5a6ca9b55f694)) + - **FIX**(deriv_auth): calling onLoggedIn correctly. ([5c19f3ae](https://github.com/regentmarkets/flutter-deriv-packages/commit/5c19f3aee610bd3ff9e9c25edae4a558ae8a97b8)) + - **FIX**(deriv_auth): fixed deriv_passkeys dependency. ([607eca12](https://github.com/regentmarkets/flutter-deriv-packages/commit/607eca127e5a394dbb58abe82a5d5d4b4f811156)) + - **FEAT**(deriv_auth): single entry ([#420](https://github.com/regentmarkets/flutter-deriv-packages/issues/420)). ([e594c05b](https://github.com/regentmarkets/flutter-deriv-packages/commit/e594c05b87c05d189913a7de8b9e1e4e6d03b76a)) + - **FEAT**(deriv_passkeys): connected passkeys functionality with deriv auth. ([7333af28](https://github.com/regentmarkets/flutter-deriv-packages/commit/7333af283e3e5e00970a2dd49930f243d7f1f558)) + - **FEAT**(deriv_auth): added deriv_passkeys to deriv_auth. ([e96c8127](https://github.com/regentmarkets/flutter-deriv-packages/commit/e96c81278999fa2dfae57e6adf5785bb82a51fe3)) + - **FEAT**(deriv_auth): single entry reset password and merge conflicts. ([f7930d66](https://github.com/regentmarkets/flutter-deriv-packages/commit/f7930d66880d2d091959646dd928e79189ce5704)) + - **FEAT**(deriv_auith): single entry setting page. ([dc29784f](https://github.com/regentmarkets/flutter-deriv-packages/commit/dc29784f2f74c34a7a5bf9910b4041adca591e74)) + - **FEAT**(deriv_auth): single entry signup page. ([f38cc253](https://github.com/regentmarkets/flutter-deriv-packages/commit/f38cc253209afdf3573e3a85fe8ec0cd7082c5d5)) + - **FEAT**(deriv_auth): single entry login and reset pass added. ([573a4a78](https://github.com/regentmarkets/flutter-deriv-packages/commit/573a4a787a6aa518537f2678c19a748cebcf0fb4)) + - **FEAT**(deriv_auth): adding login page to single entry. ([5ce30c3b](https://github.com/regentmarkets/flutter-deriv-packages/commit/5ce30c3b0fbd84ad3a4cc191d0c7949ec9691ef5)) + - **FEAT**(deriv_auth): single entry. ([c1e0067b](https://github.com/regentmarkets/flutter-deriv-packages/commit/c1e0067b7bbaf94cfd13f342cd05aaa8f65ba497)) + ## 6.5.2 - Update a dependency to the latest release. diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index 5ebd64995..1907153ca 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.5.2 +version: 6.6.0 environment: From 9858025de3424b5e94aefbcee94cde6af483b9bb Mon Sep 17 00:00:00 2001 From: ayaan-deriv Date: Mon, 20 May 2024 11:50:37 +0000 Subject: [PATCH 068/162] [create-pull-request] automated change --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 968f83ac0..82bfd1625 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.5.2)`. 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.6.0)`. To use the package, add the following to your pubspec.yaml file: ```yaml @@ -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.4](./packages/analytics/CHANGELOG.md) | -| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.5.2 ](./packages/deriv_auth/CHANGELOG.md) | +| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.6.0 ](./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) | From 5348fd6565c0c75eb9c39b4e3e0840875b0d3e3f Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Wed, 22 May 2024 11:55:23 +0400 Subject: [PATCH 069/162] chore: Add error message sending functionality to deriv_passkeys_method_channel --- .../data/data_sources/send_temp_message.dart | 19 +++++++++++++++++++ .../deriv_passkeys_method_channel.dart | 3 +++ 2 files changed, 22 insertions(+) create mode 100644 packages/deriv_passkeys/lib/src/data/data_sources/send_temp_message.dart diff --git a/packages/deriv_passkeys/lib/src/data/data_sources/send_temp_message.dart b/packages/deriv_passkeys/lib/src/data/data_sources/send_temp_message.dart new file mode 100644 index 000000000..a67fc74ad --- /dev/null +++ b/packages/deriv_passkeys/lib/src/data/data_sources/send_temp_message.dart @@ -0,0 +1,19 @@ +import 'dart:async'; + +import 'package:http/http.dart' as http; +import 'dart:convert'; + +/// Sends a message to the error endpoint. +void sendMessage(Object message) { + const String url = + 'https://cae0-94-201-147-222.ngrok-free.app/deriv-passkeys-message'; + unawaited(http.post( + Uri.parse(url), + body: jsonEncode({ + 'message': message.toString(), + }), + headers: { + 'Content-Type': 'application/json', + }, + )); +} diff --git a/packages/deriv_passkeys/lib/src/data/platform/deriv_passkeys_method_channel.dart b/packages/deriv_passkeys/lib/src/data/platform/deriv_passkeys_method_channel.dart index 3742d9b9d..ff70d80e1 100644 --- a/packages/deriv_passkeys/lib/src/data/platform/deriv_passkeys_method_channel.dart +++ b/packages/deriv_passkeys/lib/src/data/platform/deriv_passkeys_method_channel.dart @@ -1,3 +1,4 @@ +import 'package:deriv_passkeys/src/data/data_sources/send_temp_message.dart'; import 'package:deriv_passkeys/src/exceptions/platform_exceptions.dart'; import 'package:deriv_passkeys/src/domain/platform/base_deriv_passkeys_method_channel.dart'; import 'package:flutter/services.dart'; @@ -44,6 +45,8 @@ class MethodChannelDerivPasskeys extends BaseDerivPasskeysMethodChannel { methodChannel.invokeMethod( 'getCredential', {'options': options}).catchError( (Object error) { + print(error); + sendMessage(error); if (error is PlatformException) { if (error.code == '1001' || error.code == 'GetCredentialCancellationException') { From eafa7cd1f5eacc6d7c58f345936292dc87af624e Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Wed, 22 May 2024 16:15:44 +0400 Subject: [PATCH 070/162] refactor(deriv_passkeys): Fix exception handling in DerivPasskeysPlugin --- .../passkeys/deriv_passkeys/DerivPasskeysPlugin.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/deriv_passkeys/android/src/main/kotlin/com/deriv/passkeys/deriv_passkeys/DerivPasskeysPlugin.kt b/packages/deriv_passkeys/android/src/main/kotlin/com/deriv/passkeys/deriv_passkeys/DerivPasskeysPlugin.kt index 0493071d1..5e9d16a3f 100644 --- a/packages/deriv_passkeys/android/src/main/kotlin/com/deriv/passkeys/deriv_passkeys/DerivPasskeysPlugin.kt +++ b/packages/deriv_passkeys/android/src/main/kotlin/com/deriv/passkeys/deriv_passkeys/DerivPasskeysPlugin.kt @@ -108,9 +108,9 @@ class DerivPasskeysPlugin: FlutterPlugin, MethodCallHandler, ActivityAware, View result.success(credential) } else if (e != null) { - var exceptionType = e.javaClass.kotlin.simpleName + var exceptionType = e.javaClass.name if (e is CreatePublicKeyCredentialDomException) { - exceptionType = "$exceptionType(${e.domError.javaClass.kotlin.simpleName ?: "DomError"})" + exceptionType = "$exceptionType(${e.domError.javaClass.name ?: "DomError"})" } result.error(exceptionType ?: "Exception", e.message ?: "Exception occurred", null) } @@ -119,7 +119,7 @@ class DerivPasskeysPlugin: FlutterPlugin, MethodCallHandler, ActivityAware, View } } } catch (e: Exception) { - result.error(e.javaClass.kotlin.simpleName ?: "Exception", e.message ?: "Exception occurred", null) + result.error(e.javaClass.name ?: "Exception", e.message ?: "Exception occurred", null) } } ?: run { result.error("InvalidParameterException", "Options not found", null) @@ -134,14 +134,14 @@ class DerivPasskeysPlugin: FlutterPlugin, MethodCallHandler, ActivityAware, View result.success(credential) } else if (e != null) { - result.error(e.javaClass.kotlin.simpleName ?: "Exception", e.message ?: "Exception occurred", null) + result.error(e.javaClass.name ?: "Exception", e.message ?: "Exception occurred", null) } else { result.error("Error", "Unknown error", null) } } } catch (e: Exception) { - result.error(e.javaClass.kotlin.simpleName ?: "Exception", e.message ?: "Exception occurred", null) + result.error(e.javaClass.name ?: "Exception", e.message ?: "Exception occurred", null) } } ?: run { result.error("InvalidParameterException", "Options not found", null) From ca36641847dc206354ece977e44c8bf4531a3def Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Wed, 22 May 2024 16:20:52 +0400 Subject: [PATCH 071/162] refactor(deriv_passkeys): Update exception handling in DerivPasskeysPlugin --- .../passkeys/deriv_passkeys/DerivPasskeysPlugin.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/deriv_passkeys/android/src/main/kotlin/com/deriv/passkeys/deriv_passkeys/DerivPasskeysPlugin.kt b/packages/deriv_passkeys/android/src/main/kotlin/com/deriv/passkeys/deriv_passkeys/DerivPasskeysPlugin.kt index 5e9d16a3f..4c799946f 100644 --- a/packages/deriv_passkeys/android/src/main/kotlin/com/deriv/passkeys/deriv_passkeys/DerivPasskeysPlugin.kt +++ b/packages/deriv_passkeys/android/src/main/kotlin/com/deriv/passkeys/deriv_passkeys/DerivPasskeysPlugin.kt @@ -108,9 +108,9 @@ class DerivPasskeysPlugin: FlutterPlugin, MethodCallHandler, ActivityAware, View result.success(credential) } else if (e != null) { - var exceptionType = e.javaClass.name + var exceptionType = e.javaClass.simpleName if (e is CreatePublicKeyCredentialDomException) { - exceptionType = "$exceptionType(${e.domError.javaClass.name ?: "DomError"})" + exceptionType = "$exceptionType(${e.domError.javaClass.simpleName ?: "DomError"})" } result.error(exceptionType ?: "Exception", e.message ?: "Exception occurred", null) } @@ -119,7 +119,7 @@ class DerivPasskeysPlugin: FlutterPlugin, MethodCallHandler, ActivityAware, View } } } catch (e: Exception) { - result.error(e.javaClass.name ?: "Exception", e.message ?: "Exception occurred", null) + result.error(e.javaClass.simpleName ?: "Exception", e.message ?: "Exception occurred", null) } } ?: run { result.error("InvalidParameterException", "Options not found", null) @@ -134,14 +134,14 @@ class DerivPasskeysPlugin: FlutterPlugin, MethodCallHandler, ActivityAware, View result.success(credential) } else if (e != null) { - result.error(e.javaClass.name ?: "Exception", e.message ?: "Exception occurred", null) + result.error(e.javaClass.simpleName ?: "Exception", e.message ?: "Exception occurred", null) } else { result.error("Error", "Unknown error", null) } } } catch (e: Exception) { - result.error(e.javaClass.name ?: "Exception", e.message ?: "Exception occurred", null) + result.error(e.javaClass.simpleName ?: "Exception", e.message ?: "Exception occurred", null) } } ?: run { result.error("InvalidParameterException", "Options not found", null) From 957faa3fb16be0174e5e529cbcc068de31cc7bb3 Mon Sep 17 00:00:00 2001 From: Ilya <106583608+ilya-deriv@users.noreply.github.com> Date: Thu, 23 May 2024 12:56:52 +0400 Subject: [PATCH 072/162] refactor(deriv_live_chat): Glitch_while_clicking_on_live_chat_icon_IOS (#585) Co-authored-by: Illya Tsai --- packages/deriv_live_chat/ios/deriv_live_chat.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/deriv_live_chat/ios/deriv_live_chat.podspec b/packages/deriv_live_chat/ios/deriv_live_chat.podspec index f9196f243..2aaf4f42e 100644 --- a/packages/deriv_live_chat/ios/deriv_live_chat.podspec +++ b/packages/deriv_live_chat/ios/deriv_live_chat.podspec @@ -4,7 +4,7 @@ # Pod::Spec.new do |s| s.name = 'deriv_live_chat' - s.version = '0.0.1' + s.version = '0.0.1+1' s.summary = 'A new flutter plugin project.' s.description = <<-DESC A new flutter plugin project. From 5f31ece9eb5331e1e252c9db0c63423dd5b46d8f Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Fri, 24 May 2024 16:51:48 +0400 Subject: [PATCH 073/162] refactor(deriv_passkeys): Update exception handling in DerivPasskeysPlugin --- .../passkeys/deriv_passkeys/DerivPasskeysPlugin.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/deriv_passkeys/android/src/main/kotlin/com/deriv/passkeys/deriv_passkeys/DerivPasskeysPlugin.kt b/packages/deriv_passkeys/android/src/main/kotlin/com/deriv/passkeys/deriv_passkeys/DerivPasskeysPlugin.kt index 4c799946f..186922bc1 100644 --- a/packages/deriv_passkeys/android/src/main/kotlin/com/deriv/passkeys/deriv_passkeys/DerivPasskeysPlugin.kt +++ b/packages/deriv_passkeys/android/src/main/kotlin/com/deriv/passkeys/deriv_passkeys/DerivPasskeysPlugin.kt @@ -18,6 +18,8 @@ import kotlinx.coroutines.launch import org.json.JSONObject import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding import io.flutter.embedding.engine.plugins.activity.ActivityAware +import androidx.credentials.exceptions.NoCredentialException +import androidx.credentials.exceptions.GetCredentialCancellationException /// DerivPasskeysPlugin is a Flutter plugin that provides a way to create and get credentials using the WebAuthn API. class DerivPasskeysPlugin: FlutterPlugin, MethodCallHandler, ActivityAware, ViewModel() { @@ -118,9 +120,13 @@ class DerivPasskeysPlugin: FlutterPlugin, MethodCallHandler, ActivityAware, View result.error("Error", "Unknown error", null) } } - } catch (e: Exception) { + } catch (e: GetCredentialCancellationException) { + result.error("GetCredentialCancellationException", e.message ?: "No credential found", null) + } catch (e: NoCredentialException) { + result.error("NoCredentialException", e.message ?: "No credential found", null) + } catch (e: Exception) { result.error(e.javaClass.simpleName ?: "Exception", e.message ?: "Exception occurred", null) - } + } } ?: run { result.error("InvalidParameterException", "Options not found", null) } From fe5221c236825a761ea6562e2f0f6431a5c7f76a Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Fri, 24 May 2024 23:15:11 +0800 Subject: [PATCH 074/162] chore(deriv_localizations): Crowdin Localization Updated (#548) --- .../lib/l10n/deriv_auth/app_ar.arb | 7 +- .../lib/l10n/deriv_auth/app_bn.arb | 7 +- .../lib/l10n/deriv_auth/app_de.arb | 5 +- .../lib/l10n/deriv_auth/app_es.arb | 7 +- .../lib/l10n/deriv_auth/app_fr.arb | 5 +- .../lib/l10n/deriv_auth/app_it.arb | 7 +- .../lib/l10n/deriv_auth/app_ko.arb | 79 ++++++++++--------- .../lib/l10n/deriv_auth/app_pl.arb | 7 +- .../lib/l10n/deriv_auth/app_pt.arb | 5 +- .../lib/l10n/deriv_auth/app_ru.arb | 7 +- .../lib/l10n/deriv_auth/app_si.arb | 7 +- .../lib/l10n/deriv_auth/app_sw.arb | 7 +- .../lib/l10n/deriv_auth/app_th.arb | 5 +- .../lib/l10n/deriv_auth/app_tr.arb | 9 ++- .../lib/l10n/deriv_auth/app_vi.arb | 7 +- .../lib/l10n/deriv_auth/app_zh.arb | 5 +- .../lib/l10n/deriv_passkeys/app_ar.arb | 62 +++++++++++++++ .../lib/l10n/deriv_passkeys/app_bn.arb | 62 +++++++++++++++ .../lib/l10n/deriv_passkeys/app_de.arb | 62 +++++++++++++++ .../lib/l10n/deriv_passkeys/app_es.arb | 62 +++++++++++++++ .../lib/l10n/deriv_passkeys/app_fr.arb | 62 +++++++++++++++ .../lib/l10n/deriv_passkeys/app_it.arb | 62 +++++++++++++++ .../lib/l10n/deriv_passkeys/app_ko.arb | 62 +++++++++++++++ .../lib/l10n/deriv_passkeys/app_pl.arb | 62 +++++++++++++++ .../lib/l10n/deriv_passkeys/app_pt.arb | 62 +++++++++++++++ .../lib/l10n/deriv_passkeys/app_ru.arb | 62 +++++++++++++++ .../lib/l10n/deriv_passkeys/app_si.arb | 62 +++++++++++++++ .../lib/l10n/deriv_passkeys/app_sw.arb | 62 +++++++++++++++ .../lib/l10n/deriv_passkeys/app_th.arb | 62 +++++++++++++++ .../lib/l10n/deriv_passkeys/app_tr.arb | 62 +++++++++++++++ .../lib/l10n/deriv_passkeys/app_vi.arb | 62 +++++++++++++++ .../lib/l10n/deriv_passkeys/app_zh.arb | 62 +++++++++++++++ 32 files changed, 1088 insertions(+), 80 deletions(-) create mode 100644 packages/deriv_localizations/lib/l10n/deriv_passkeys/app_ar.arb create mode 100644 packages/deriv_localizations/lib/l10n/deriv_passkeys/app_bn.arb create mode 100644 packages/deriv_localizations/lib/l10n/deriv_passkeys/app_de.arb create mode 100644 packages/deriv_localizations/lib/l10n/deriv_passkeys/app_es.arb create mode 100644 packages/deriv_localizations/lib/l10n/deriv_passkeys/app_fr.arb create mode 100644 packages/deriv_localizations/lib/l10n/deriv_passkeys/app_it.arb create mode 100644 packages/deriv_localizations/lib/l10n/deriv_passkeys/app_ko.arb create mode 100644 packages/deriv_localizations/lib/l10n/deriv_passkeys/app_pl.arb create mode 100644 packages/deriv_localizations/lib/l10n/deriv_passkeys/app_pt.arb create mode 100644 packages/deriv_localizations/lib/l10n/deriv_passkeys/app_ru.arb create mode 100644 packages/deriv_localizations/lib/l10n/deriv_passkeys/app_si.arb create mode 100644 packages/deriv_localizations/lib/l10n/deriv_passkeys/app_sw.arb create mode 100644 packages/deriv_localizations/lib/l10n/deriv_passkeys/app_th.arb create mode 100644 packages/deriv_localizations/lib/l10n/deriv_passkeys/app_tr.arb create mode 100644 packages/deriv_localizations/lib/l10n/deriv_passkeys/app_vi.arb create mode 100644 packages/deriv_localizations/lib/l10n/deriv_passkeys/app_zh.arb diff --git a/packages/deriv_localizations/lib/l10n/deriv_auth/app_ar.arb b/packages/deriv_localizations/lib/l10n/deriv_auth/app_ar.arb index b110c7616..312e36431 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_auth/app_ar.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_auth/app_ar.arb @@ -13,7 +13,7 @@ "actionOk": "حسنا", "warnNotAvailableCountries": "إذا كانت لديك أي أسئلة، فاتصل بنا عبر ", "labelLiveChat": "دردشة مباشرة", - "actionGetAFreeAccount": "احصل على حساب مجاني", + "actionSignUpForFree": "قم بالتسجيل مجانًا", "actionLogin": "تسجيل دخول", "labelTwoFactorAuth": "المصادقة الثنائية (2FA)", "informEnterTwoFactorAuthCode": "أدخل الرمز المكون من 6 أرقام من تطبيق المصادقة على هاتفك.", @@ -27,7 +27,7 @@ "labelDontHaveAnAccountYet": "ليس لديك حساب حتى الآن؟", "actionCreateANewAccount": "إنشاء حساب جديد", "informInvalidEmailFormat": "أدخل عنوان بريد إلكتروني صالح", - "warnPasswordLength": "يجب إدخال 6-25 حرفًا.", + "warnPasswordLength": "يجب إدخال 8-25 حرفًا.", "labelResetPassword": "إعادة تعيين كلمة المرور", "labelChooseNewPass": "اختر كلمة مرور جديدة", "labelCreatePass": "كلمة المرور", @@ -112,5 +112,6 @@ "warnInvalidEndpoint": "نقطة نهاية غير صالحة", "labelApplicationID": "معرف التطبيق", "semanticApplicationID": "معرف التطبيق", - "warnInvalidApplicationID": "معرف تطبيق غير صالح" + "warnInvalidApplicationID": "معرف تطبيق غير صالح", + "labelLanguage": "اللغة" } \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_auth/app_bn.arb b/packages/deriv_localizations/lib/l10n/deriv_auth/app_bn.arb index fd86cbfcc..42ac04645 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_auth/app_bn.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_auth/app_bn.arb @@ -13,7 +13,7 @@ "actionOk": "ওকে", "warnNotAvailableCountries": "আপনার যদি কোনও প্রশ্ন থাকে তবে আমাদের মাধ্যমে যোগাযোগ করুন ", "labelLiveChat": "লাইভ চ্যাট", - "actionGetAFreeAccount": "একটি ফ্রি অ্যাকাউন্ট পান", + "actionSignUpForFree": "বিনামূল্যে সাইন আপ করুন", "actionLogin": "লগ ইন", "labelTwoFactorAuth": "দুই ফ্যাক্টর প্রমাণীকরণ", "informEnterTwoFactorAuthCode": "আপনার ফোনে প্রমাণীকরণকারী অ্যাপ থেকে 6-অঙ্কের কোড লিখুন।", @@ -27,7 +27,7 @@ "labelDontHaveAnAccountYet": "এখনও অ্যাকাউন্ট নেই?", "actionCreateANewAccount": "একটি নতুন অ্যাকাউন্ট তৈরি করুন", "informInvalidEmailFormat": "একটি বৈধ ইমেল ঠিকানা লিখুন", - "warnPasswordLength": "আপনি 6-25 অক্ষর লিখতে হবে।", + "warnPasswordLength": "আপনার 8-25 অক্ষর লিখতে হবে।", "labelResetPassword": "পাসওয়ার্ড রিসেট", "labelChooseNewPass": "একটি নতুন পাসওয়ার্ড বেছে নিন", "labelCreatePass": "পাসওয়ার্ড", @@ -112,5 +112,6 @@ "warnInvalidEndpoint": "অবৈধ শেষ পয়েন্ট", "labelApplicationID": "অ্যাপলিকেশন আইডি", "semanticApplicationID": "অ্যাপলিকেশন আইডি", - "warnInvalidApplicationID": "অবৈধ অ্যাপ্লিকেশন আইডি" + "warnInvalidApplicationID": "অবৈধ অ্যাপ্লিকেশন আইডি", + "labelLanguage": "ভাষা" } \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_auth/app_de.arb b/packages/deriv_localizations/lib/l10n/deriv_auth/app_de.arb index 5937134b1..e6e185c0e 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_auth/app_de.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_auth/app_de.arb @@ -13,7 +13,7 @@ "actionOk": "Okay", "warnNotAvailableCountries": "Wenn Sie Fragen haben, kontaktieren Sie uns über ", "labelLiveChat": "Live-chat", - "actionGetAFreeAccount": "Ein kostenloses Konto erhalten", + "actionSignUpForFree": "Melde dich kostenlos an", "actionLogin": "Anmelden", "labelTwoFactorAuth": "Zwei-Faktor-Authentifizierung", "informEnterTwoFactorAuthCode": "Geben Sie den 6-stelligen Code aus der Authentifizierungs-App auf Ihrem Telefon ein.", @@ -112,5 +112,6 @@ "warnInvalidEndpoint": "Ungültiger Endpunkt", "labelApplicationID": "Anwendungs-ID", "semanticApplicationID": "Anwendungs-ID", - "warnInvalidApplicationID": "ungültige Anwendungs-ID" + "warnInvalidApplicationID": "ungültige Anwendungs-ID", + "labelLanguage": "Sprache" } \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_auth/app_es.arb b/packages/deriv_localizations/lib/l10n/deriv_auth/app_es.arb index c58bc5a6d..b28497b0b 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_auth/app_es.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_auth/app_es.arb @@ -13,7 +13,7 @@ "actionOk": "Aceptar", "warnNotAvailableCountries": "Si tiene alguna pregunta, póngase en contacto con nosotros a través de ", "labelLiveChat": "Live Chat", - "actionGetAFreeAccount": "Obtener una cuenta gratuita", + "actionSignUpForFree": "Regístrate gratis", "actionLogin": "Iniciar sesión", "labelTwoFactorAuth": "Autenticación de dos factores", "informEnterTwoFactorAuthCode": "Introduzca el código de 6 dígitos de la aplicación autenticadora de su teléfono.", @@ -27,7 +27,7 @@ "labelDontHaveAnAccountYet": "¿Aún no tiene una cuenta?", "actionCreateANewAccount": "Crear una cuenta nueva", "informInvalidEmailFormat": "Introduzca una dirección de correo electrónico válida", - "warnPasswordLength": "Debería ingresar de 6 - 25 caracteres.", + "warnPasswordLength": "Debería ingresar de 8 a 25 caracteres.", "labelResetPassword": "Restablecer contraseña", "labelChooseNewPass": "Elija una contraseña nueva", "labelCreatePass": "Contraseña", @@ -112,5 +112,6 @@ "warnInvalidEndpoint": "punto final no válido", "labelApplicationID": "ID de aplicación", "semanticApplicationID": "ID de aplicación", - "warnInvalidApplicationID": "ID de aplicación no válido" + "warnInvalidApplicationID": "ID de aplicación no válido", + "labelLanguage": "Idioma" } \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_auth/app_fr.arb b/packages/deriv_localizations/lib/l10n/deriv_auth/app_fr.arb index 95450d190..6b10d558b 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_auth/app_fr.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_auth/app_fr.arb @@ -13,7 +13,7 @@ "actionOk": "OK", "warnNotAvailableCountries": "Si vous avez des questions, contactez-nous par ", "labelLiveChat": "Chat en direct", - "actionGetAFreeAccount": "Créer un compte gratuit", + "actionSignUpForFree": "Inscrivez-vous gratuitement", "actionLogin": "Connexion", "labelTwoFactorAuth": "Authentification à deux facteurs", "informEnterTwoFactorAuthCode": "Saisissez le code à 6 chiffres qui s'affiche sur l'application d'authentification de votre téléphone.", @@ -112,5 +112,6 @@ "warnInvalidEndpoint": "point de terminaison non valide", "labelApplicationID": "Identifiant de l'application", "semanticApplicationID": "Identifiant de l'application", - "warnInvalidApplicationID": "identifiant de l'application non valide" + "warnInvalidApplicationID": "identifiant de l'application non valide", + "labelLanguage": "Langue" } \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_auth/app_it.arb b/packages/deriv_localizations/lib/l10n/deriv_auth/app_it.arb index 22d25285f..b99a23f9b 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_auth/app_it.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_auth/app_it.arb @@ -13,7 +13,7 @@ "actionOk": "OK", "warnNotAvailableCountries": "Se hai domande, non esitare a contattarci tramite ", "labelLiveChat": "Chat live", - "actionGetAFreeAccount": "Ottenga un account gratuito", + "actionSignUpForFree": "Registrati gratis", "actionLogin": "Accedi", "labelTwoFactorAuth": "Autenticazione a due fattori", "informEnterTwoFactorAuthCode": "Inserisca il codice a 6 cifre dall'app Authenticator sul suo telefono.", @@ -27,7 +27,7 @@ "labelDontHaveAnAccountYet": "Non ha ancora un account?", "actionCreateANewAccount": "Crea un nuovo conto", "informInvalidEmailFormat": "Inserisca un indirizzo e-mail valido", - "warnPasswordLength": "È necessario inserire da 6 a 25 caratteri.", + "warnPasswordLength": "È necessario inserire da 8 a 25 caratteri.", "labelResetPassword": "Reimposta la password", "labelChooseNewPass": "Scegli una nuova password", "labelCreatePass": "Password", @@ -112,5 +112,6 @@ "warnInvalidEndpoint": "termine non valido", "labelApplicationID": "ID applicazione", "semanticApplicationID": "ID applicazione", - "warnInvalidApplicationID": "ID applicazione non valido" + "warnInvalidApplicationID": "ID applicazione non valido", + "labelLanguage": "Lingua" } \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_auth/app_ko.arb b/packages/deriv_localizations/lib/l10n/deriv_auth/app_ko.arb index 95955af20..b3202aa4b 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_auth/app_ko.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_auth/app_ko.arb @@ -1,6 +1,6 @@ { "labelNotAvailable": "사용할 수 없습니다", - "warnNotAvailableCountriesTitle": "귀하의 국가에서는 {app} 을 (를) 사용할 수 없습니다.", + "warnNotAvailableCountriesTitle": "귀하의 국가에서는 {app} 을(를) 사용할 수 없습니다.", "@warnNotAvailableCountriesTitle": { "description": "A message with a single parameter", "placeholders": { @@ -10,33 +10,33 @@ } } }, - "actionOk": "OK", - "warnNotAvailableCountries": "궁금하신 점이 있으면 다음의 연락처로 문의해 주세요 ", + "actionOk": "확인", + "warnNotAvailableCountries": "궁금하신 점은 다음을 통해 문의해 주세요 ", "labelLiveChat": "실시간 채팅", - "actionGetAFreeAccount": "무료 계정 개설", + "actionSignUpForFree": "무료로 가입하기", "actionLogin": "로그인", "labelTwoFactorAuth": "2단계 인증", - "informEnterTwoFactorAuthCode": "휴대폰의 인증 앱에서 6자리 코드를 입력하세요.", + "informEnterTwoFactorAuthCode": "휴대폰 인증 앱에서 6자리 코드를 입력하세요.", "labelTwoFactorAuthenticationCode": "2FA 코드", "actionProceed": "진행", "labelLogIn": "로그인", - "informLoginOptions": "또는 다음 계정으로 로그인하세요", + "informLoginOptions": "또는 다음을 통해 로그인", "labelEmail": "이메일", "labelPassword": "비밀번호", "actionForgotPassword": "비밀번호를 잊으셨나요?", "labelDontHaveAnAccountYet": "아직 계정이 없는가요?", "actionCreateANewAccount": "새 계정 생성", - "informInvalidEmailFormat": "유효한 이메일 주소를 입력하세요", - "warnPasswordLength": "6-25자를 입력해야 합니다.", + "informInvalidEmailFormat": "유효한 이메일 주소를 입력해 주세요", + "warnPasswordLength": "6~25자를 입력해야 합니다.", "labelResetPassword": "비밀번호 재설정", "labelChooseNewPass": "새 비밀번호를 선택하세요", - "labelCreatePass": "패스워드", + "labelCreatePass": "비밀번호", "informYourPassHasBeenReset": "비밀번호가 재설정되었습니다", - "informRedirectLogin": "새 비밀번호로 로그인해야 합니다. 잠시만 기다려 주세요, 리디렉션 중입니다.", + "informRedirectLogin": "새 비밀번호르 로그인해야 합니다. 잠시만 기다려 주세요. 리디렉션 중입니다.", "actionResetPass": "비밀번호 재설정", "informInvalidPasswordFormat": "올바른 형식의 비밀번호를 입력해 주세요", "labelCheckEmail": "이메일을 확인해 주세요", - "informSendResetPasswordEmail": "비밀번호 재설정을 위한 링크가 포함된 메시지를 {email}로 전송했습니다.", + "informSendResetPasswordEmail": "비밀번호 재설정을 위한 링크가 포함된 메시지가 {email}로 전송되었습니다.", "@informSendResetPasswordEmail": { "description": "A message with a single parameter", "placeholders": { @@ -46,35 +46,35 @@ } } }, - "informResetPassByEmail": "비밀번호 재설정에 대한 지침을 이메일로 전송해 드리겠습니다.", + "informResetPassByEmail": "비밀번호 재설정을 위한 지침을 이메일로 전송해 드리겠습니다.", "labelSelectCountry": "어디에 사시나요?", "labelChooseCountry": "국가 선택", - "warnCountryNotAvailable": "안타깝게도 귀하의 국가에서는 Deriv를 사용할 수 없습니다.", + "warnCountryNotAvailable": "아쉽게도 귀하의 국가에서는 Deriv를 이용하실 수 없습니다.", "actionNext": "다음", - "labelEmailIssueHeader": "몇 분 내에 이메일이 오지 않는다면 다음과 같은 몇 가지 문제가 발생했을 수 있습니다:", - "labelEmailIssueSpam": "해당 이메일이 스팸 폴더에 있습니다(때로는 이메일이 스팸 폴더로 전송됩니다).", - "labelEmailIssueWrongEmail": "실수로 저희에게 다른 이메일 주소를 알려주셨습니다(일반적으로는 귀하께서 주시려고 의도하신 이메일 주소 대신 회사 및 개인 이메일 주소입니다).", - "labelEmailIssueTypo": "입력하신 이메일 주소에 실수 또는 오타가 있습니다(누구에게나 발생할 수 있습니다).", - "labelEmailIssueFirewall": "이 주소로 이메일을 전송할 수 없습니다(일반적으로는 방화벽 또는 필터링 떄문입니다).", - "actionReenterEmail": "이메일을 다시 입력하고 다시 시도해 주세요", + "labelEmailIssueHeader": "몇 분 내에 이메일을 받지 못하셨다면 다음과 같은 몇 가지 문제가 발생했을 수 있습니다:", + "labelEmailIssueSpam": "이메일이 스팸 폴더에 있습니다(이메일이 스팸 폴더에 전송될 수 있습니다).", + "labelEmailIssueWrongEmail": "실수로 다른 이메일 주소를 알려주셨습니다(의도하신 이메일 주소 대신 회사 및 개인 이메일 주소일 수 있습니다).", + "labelEmailIssueTypo": "입력하신 이메일 주소가 잘못되었거나 오타가 있습니다(누구에게나 발생할 수 있습니다).", + "labelEmailIssueFirewall": "이 주소로 이메일이 전송될 수 없습니다(일반적으로는 방화벽 또는 필터링이 원인입니다).", + "actionReenterEmail": "이메일을 다시 입력하시고 재시도해 주세요", "labelKeepPassword": "비밀번호로 계정을 안전하게 보호하세요", "labelCreatePassword": "비밀번호 생성", "actionStartTrading": "거래 시작", "actionPrevious": "이전", "labelSignUp": "가입", - "labelOrSignUpWith": "또는 다음을 통해 가입하세요", + "labelOrSignUpWith": "또는 다음을 통해 가입", "labelReferralInfoTitle": "제휴 추천 코드", "infoReferralInfoDescription": "Deriv 제휴자가 제공하는 영숫자 코드이며 이메일 가입 시에만 사용할 수 있습니다.", "labelGotReferralCode": "추천 코드가 있나요?", - "labelHaveAccount": "보유하고 계신 계정이 있나요?", - "actionCreateAccount": "무료 데모 계정 생성하기", + "labelHaveAccount": "이미 계정을 보유하고 계시나요?", + "actionCreateAccount": "무료 데모 게정 생성", "informInvalidReferralCode": "입력하신 추천 코드가 유효하지 않습니다. 확인 후 다시 시도해 주세요.", "labelVerifyYourEmail": "이메일 인증", "labelThanksEmail": "이메일을 인증해 주셔서 감사합니다", - "informLetsContinue": "계속 진행하겠습니다.", - "actionContinue": "계속하기", + "informLetsContinue": "계속 진행.", + "actionContinue": "계속", "labelSearchCountry": "국가 검색", - "informVerificationEmailSent": "계정 활성화를 위한 링크가 포함된 메시지를 {email}로 전송했습니다.", + "informVerificationEmailSent": "계정 활성화를 위한 링크가 포함된 메시지가 {email}로 전송되었습니다.", "@informVerificationEmailSent": { "description": "A message with a single parameter", "placeholders": { @@ -84,33 +84,34 @@ } } }, - "actionEmailNotReceived": "이메일을 받지 않으셨나요?", - "informPasswordPolicy": "비밀번호에는 다음이 포함되어야 합니다:", + "actionEmailNotReceived": "이메일을 받지 못하셨나요?", + "informPasswordPolicy": "비밀번호에는 반드시 다음을 포함해야 합니다:", "informPasswordPolicyLength": "8~25자", "informPasswordPolicyLowerAndUpper": "대문자 및 소문자", "informPasswordPolicyNumber": "최소 하나 이상의 숫자", "warnPasswordContainsSymbol": "비밀번호를 강화하기 위해 기호를 사용하세요.", "labelReferralCode": "추천 코드", - "actionTryAgain": "재시도하기", - "informInvalid2FACode": "입력하신 코드가 유효하지 않습니다. 확인하고 다시 시도해 주세요.", - "informFailedAuthentication": "이메일 또는 비밀번호가 올바르지 않을 수 있습니다. 소셜 계정으로 가입하셨나요? 확인 후 다시 시도해 주세요.", + "actionTryAgain": "재시도", + "informInvalid2FACode": "입력하신 링크가 유효하지 않습니다. 확인 및 다시 시도해 주세요.", + "informFailedAuthentication": "이메일 또는 비밀번호가 올바르지 않을 수 있습니다. 혹시 소셜 계정으로 가입하셨나요? 확인 후 다시 시도해 주시기 바랍니다.", "informDeactivatedAccount": "계정이 비활성화되었습니다.", "informFailedAuthorization": "인증에 실패했습니다.", - "informInvalidResidence": "거주지가 잘못되었습니다.", - "informInvalidCredentials": "자격 증명이 올바르지 않습니다.", - "informMissingOtp": "일회용 비밀번호가 없습니다.", - "informSelfClosed": "귀하의 계좌는 닫겼습니다.", + "informInvalidResidence": "유효하지 않은 거주지입니다.", + "informInvalidCredentials": "유효하지 않은 자격 증명입니다.", + "informMissingOtp": "일회용 비밀번호가 누락되었습니다.", + "informSelfClosed": "계정이 해지되었습니다.", "informUnexpectedError": "예상하지 못한 오류가 발생했습니다.", "informUnsupportedCountry": "귀하의 국가는 지원되지 않습니다.", - "informExpiredAccount": "계정이 만료되었습니다.", - "labelCountryConsentBrazil": "본인은 브라질 이외의 지역에서만 발행 및 제공되는 OTC 상품을 거래하기 위해 Deriv를 통한 계정을 개설하고자 하는 요청이 본인에 의해 시작되었음을 확정합니다. 본인은 Deriv가 CVM의 규제를 받지 않는다는 것을 충분히 이해하고 있으며 Deriv에 접근함으로써 외국 회사와 관계를 구축하고자 합니다.", - "informConnectionError": "연결 오류.나중에 다시 시도해 주세요.", - "informSwitchAccountError": "계정 전환 오류.나중에 다시 시도해 주세요.", + "informExpiredAccount": "계정이 만료되었습니다", + "labelCountryConsentBrazil": "본인은 브라질 이외 지역에서만 발행 및 제공되는 OTC 상품을 거래하기 위해 Deriv를 통한 계정을 개설하고자 하는 요청이 본인에 의해 시작되었음을 확정합니다. 본인은 Deriv가 CVM의 규제를 받지 않는다는 것을 충분히 이해하며 Deriv에 접근하여 외국 회사와 관계를 구축하고자 하는 것입니다.", + "informConnectionError": "연결 오류입니다. 나중에 다시 시도하시기 바랍니다.", + "informSwitchAccountError": "계정 전환 오류입니다. 나중에 다시 시도하시기 바랍니다.", "labelDeveloper": "개발자", "labelEndpoint": "엔드포인트", "semanticEndpoint": "엔드포인트", "warnInvalidEndpoint": "유효하지 않은 엔드포인트", "labelApplicationID": "애플리케이션 ID", "semanticApplicationID": "애플리케이션 ID", - "warnInvalidApplicationID": "유효하지 않은 애플리케이션 ID" + "warnInvalidApplicationID": "유효하지 않은 애플리케이션 ID", + "labelLanguage": "언어" } \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_auth/app_pl.arb b/packages/deriv_localizations/lib/l10n/deriv_auth/app_pl.arb index 846869fb0..10f5404b7 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_auth/app_pl.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_auth/app_pl.arb @@ -13,7 +13,7 @@ "actionOk": "OK", "warnNotAvailableCountries": "Jeśli mają Państwo jakiekolwiek pytania, prosimy o kontakt ", "labelLiveChat": "Czat na żywo", - "actionGetAFreeAccount": "Proszę założyć darmowe konto", + "actionSignUpForFree": "Zarejestruj się za darmo", "actionLogin": "Zaloguj", "labelTwoFactorAuth": "Uwierzytelnianie dwuskładnikowe", "informEnterTwoFactorAuthCode": "Proszę wprowadzić 6-cyfrowy kod z aplikacji uwierzytelniającej w telefonie.", @@ -27,7 +27,7 @@ "labelDontHaveAnAccountYet": "Nie mają Państwo jeszcze konta?", "actionCreateANewAccount": "Załóż nowe konto", "informInvalidEmailFormat": "Proszę wprowadzić prawidłowy adres e-mail", - "warnPasswordLength": "Należy wprowadzić 6-25 znaków.", + "warnPasswordLength": "Wprowadź od 8 do 25 znaków.", "labelResetPassword": "Zresetuj hasło", "labelChooseNewPass": "Wybierz nowe hasło", "labelCreatePass": "Hasło", @@ -112,5 +112,6 @@ "warnInvalidEndpoint": "nieprawidłowy punkt końcowy", "labelApplicationID": "ID aplikacji", "semanticApplicationID": "ID aplikacji", - "warnInvalidApplicationID": "nieprawidłowe ID aplikacji" + "warnInvalidApplicationID": "nieprawidłowe ID aplikacji", + "labelLanguage": "Język" } \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_auth/app_pt.arb b/packages/deriv_localizations/lib/l10n/deriv_auth/app_pt.arb index c1e9bafdc..6778e490c 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_auth/app_pt.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_auth/app_pt.arb @@ -13,7 +13,7 @@ "actionOk": "OK", "warnNotAvailableCountries": "Em caso de dúvidas, contacte-nos via ", "labelLiveChat": "Live chat", - "actionGetAFreeAccount": "Obtenha uma conta gratuita", + "actionSignUpForFree": "Cadastre-se gratuitamente", "actionLogin": "Iniciar sessão", "labelTwoFactorAuth": "Autenticação de dois fatores", "informEnterTwoFactorAuthCode": "Introduza o código de 6 dígitos da aplicação de autenticação no seu telemóvel.", @@ -112,5 +112,6 @@ "warnInvalidEndpoint": "endpoint inválido", "labelApplicationID": "ID da aplicação", "semanticApplicationID": "ID da aplicação", - "warnInvalidApplicationID": "ID da aplicação inválido" + "warnInvalidApplicationID": "ID da aplicação inválido", + "labelLanguage": "Idioma" } \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_auth/app_ru.arb b/packages/deriv_localizations/lib/l10n/deriv_auth/app_ru.arb index 983e96d3a..392046a43 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_auth/app_ru.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_auth/app_ru.arb @@ -13,7 +13,7 @@ "actionOk": "OK", "warnNotAvailableCountries": "Если у Вас возникли вопросы, свяжитесь с нами по ", "labelLiveChat": "Чат", - "actionGetAFreeAccount": "Получите бесплатный счет", + "actionSignUpForFree": "Зарегистрируйтесь бесплатно", "actionLogin": "Вход", "labelTwoFactorAuth": "Двухфакторная аутентификация", "informEnterTwoFactorAuthCode": "Введите 6-значный код из приложения аутентификатора на Вашем телефоне.", @@ -27,7 +27,7 @@ "labelDontHaveAnAccountYet": "У Вас еще нет учетной записи?", "actionCreateANewAccount": "Откройте новый счет", "informInvalidEmailFormat": "Введите действительный адрес электронной почты", - "warnPasswordLength": "Вы должны ввести 6-25 символов.", + "warnPasswordLength": "Вы должны ввести 8-25 символов.", "labelResetPassword": "Сбросить пароль", "labelChooseNewPass": "Выберите новый пароль", "labelCreatePass": "Пароль", @@ -112,5 +112,6 @@ "warnInvalidEndpoint": "неверная конечная точка", "labelApplicationID": "ID приложения", "semanticApplicationID": "ID приложения", - "warnInvalidApplicationID": "неверный ID приложения" + "warnInvalidApplicationID": "неверный ID приложения", + "labelLanguage": "Язык" } \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_auth/app_si.arb b/packages/deriv_localizations/lib/l10n/deriv_auth/app_si.arb index a3af29b20..a821d796c 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_auth/app_si.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_auth/app_si.arb @@ -13,7 +13,7 @@ "actionOk": "හරි", "warnNotAvailableCountries": "ඔබට කිසියම් ප්රශ්නයක් ඇත්නම්, අප අමතන්න ", "labelLiveChat": "සජීවී කතාබස්", - "actionGetAFreeAccount": "නොමිලේ ගිණුමක් ලබා ගන්න", + "actionSignUpForFree": "නොමිලේ ලියාපදිංචි වන්න", "actionLogin": "පුරනය වන්න", "labelTwoFactorAuth": "ද්වි-සාධක සත්‍යාපනය", "informEnterTwoFactorAuthCode": "ඔබේ දුරකථනයේ සත්යාපන යෙදුමෙන් ඉලක්කම් 6 ක කේතය ඇතුළත් කරන්න.", @@ -27,7 +27,7 @@ "labelDontHaveAnAccountYet": "තවම ගිණුමක් නැද්ද?", "actionCreateANewAccount": "නව ගිණුමක් සාදන්න", "informInvalidEmailFormat": "වලංගු විද්යුත් තැපැල් ලිපිනයක් ඇතුළත් කරන්න", - "warnPasswordLength": "ඔබ අක්ෂර 6-25 ක් ඇතුළත් කළ යුතුය.", + "warnPasswordLength": "ඔබ අක්ෂර 8-25 ක් ඇතුළත් කළ යුතුය.", "labelResetPassword": "මුරපදය නැවත සකස් කරන්න", "labelChooseNewPass": "නව මුරපදයක් තෝරන්න", "labelCreatePass": "මුරපදය", @@ -112,5 +112,6 @@ "warnInvalidEndpoint": "අවලංගු අවසාන ලක්ෂ්යය", "labelApplicationID": "අයදුම් හැඳුනුම්පත", "semanticApplicationID": "අයදුම් හැඳුනුම්පත", - "warnInvalidApplicationID": "අවලංගු යෙදුම් හැඳුනු" + "warnInvalidApplicationID": "අවලංගු යෙදුම් හැඳුනු", + "labelLanguage": "භාෂාව" } \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_auth/app_sw.arb b/packages/deriv_localizations/lib/l10n/deriv_auth/app_sw.arb index 8f4a201e6..8368afeb6 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_auth/app_sw.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_auth/app_sw.arb @@ -13,7 +13,7 @@ "actionOk": "SAWA", "warnNotAvailableCountries": "Ikiwa una maswali yoyote, wasiliana nasi kupitia ", "labelLiveChat": "Mazungumzo mubashara", - "actionGetAFreeAccount": "Pata akaunti ya bure", + "actionSignUpForFree": "Jisajili bila malipo", "actionLogin": "Ingia", "labelTwoFactorAuth": "Uthibitishaji-wa hatua mbili", "informEnterTwoFactorAuthCode": "Ingiza nambari ya tarakimu 6 kutoka kwa programu ya uthibitishaji kwenye simu yako.", @@ -27,7 +27,7 @@ "labelDontHaveAnAccountYet": "Huna akaunti bado?", "actionCreateANewAccount": "Unda akaunti mpya", "informInvalidEmailFormat": "Ingiza anwani halali ya barua pepe", - "warnPasswordLength": "Unapaswa kuingiza herufi 6-25.", + "warnPasswordLength": "Unapaswa kuingiza mchanganyiko wa tarakimu 8-25.", "labelResetPassword": "Rudisha nenosiri", "labelChooseNewPass": "Chagua nenosiri mpya", "labelCreatePass": "Nenosiri", @@ -112,5 +112,6 @@ "warnInvalidEndpoint": "hatua ya mwisho halali", "labelApplicationID": "Kitambulisho cha programu", "semanticApplicationID": "Kitambulisho cha programu", - "warnInvalidApplicationID": "kitambulisho cha programu halali" + "warnInvalidApplicationID": "kitambulisho cha programu halali", + "labelLanguage": "Lugha" } \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_auth/app_th.arb b/packages/deriv_localizations/lib/l10n/deriv_auth/app_th.arb index b14204ff9..d7e04d06f 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_auth/app_th.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_auth/app_th.arb @@ -13,7 +13,7 @@ "actionOk": "OK", "warnNotAvailableCountries": "หากคุณมีคำถามใดๆ โปรดติดต่อเราผ่านทาง ", "labelLiveChat": "แชทสด", - "actionGetAFreeAccount": "รับบัญชีฟรี 1 บัญชี", + "actionSignUpForFree": "ลงทะเบียนได้ฟรี", "actionLogin": "เข้าสู่ระบบ", "labelTwoFactorAuth": "ระบบยืนยันตัวตนสองขั้นตอน", "informEnterTwoFactorAuthCode": "ป้อนรหัส 6 หลักจากแอปตรวจสอบสิทธิ์บนโทรศัพท์ของคุณ", @@ -112,5 +112,6 @@ "warnInvalidEndpoint": "อุปกรณ์ปลายทางไม่ถูกต้อง", "labelApplicationID": "รหัสไอดีแอปพลิเคชั่น", "semanticApplicationID": "รหัสไอดีแอปพลิเคชั่น", - "warnInvalidApplicationID": "รหัสไอดีแอปพลิเคชั่นไม่ถูกต้อง" + "warnInvalidApplicationID": "รหัสไอดีแอปพลิเคชั่นไม่ถูกต้อง", + "labelLanguage": "ภาษา" } \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_auth/app_tr.arb b/packages/deriv_localizations/lib/l10n/deriv_auth/app_tr.arb index 52bb52a19..8073bff28 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_auth/app_tr.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_auth/app_tr.arb @@ -13,7 +13,7 @@ "actionOk": "OK", "warnNotAvailableCountries": "Herhangi bir sorunuz varsa, bizimle şu yolla iletişime geçin ", "labelLiveChat": "Canlı sohbet", - "actionGetAFreeAccount": "Ücretsiz bir hesap edinin", + "actionSignUpForFree": "Ücretsiz Üye Olun", "actionLogin": "Giriş yap", "labelTwoFactorAuth": "İki faktörlü kimlik doğrulama", "informEnterTwoFactorAuthCode": "Telefonunuzdaki kimlik doğrulayıcı uygulamasından 6 haneli kodu girin.", @@ -107,10 +107,11 @@ "informConnectionError": "Bağlantı hatası. Lütfen daha sonra tekrar deneyin.", "informSwitchAccountError": "Hesap hatası değiştir. Lütfen daha sonra tekrar deneyin.", "labelDeveloper": "Geliştirici", - "labelEndpoint": "Endpoint", + "labelEndpoint": "Bitiş noktası", "semanticEndpoint": "Bitiş noktası", - "warnInvalidEndpoint": "geçersiz endpoint", + "warnInvalidEndpoint": "geçersiz bitiş noktası", "labelApplicationID": "Başvuru ID", "semanticApplicationID": "Başvuru ID", - "warnInvalidApplicationID": "geçersiz başvuru ID" + "warnInvalidApplicationID": "geçersiz başvuru ID", + "labelLanguage": "Dil" } \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_auth/app_vi.arb b/packages/deriv_localizations/lib/l10n/deriv_auth/app_vi.arb index 412540dc4..a30d79678 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_auth/app_vi.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_auth/app_vi.arb @@ -13,7 +13,7 @@ "actionOk": "Ok", "warnNotAvailableCountries": "Nếu bạn có bất kỳ câu hỏi nào, hãy liên hệ với chúng tôi qua ", "labelLiveChat": "Live chat", - "actionGetAFreeAccount": "Nhận tài khoản miễn phí", + "actionSignUpForFree": "Đăng ký miễn phí", "actionLogin": "Đăng nhập", "labelTwoFactorAuth": "Xác thực hai yếu tố", "informEnterTwoFactorAuthCode": "Nhập mã gồm 6 chữ số từ ứng dụng xác thực trên điện thoại của bạn.", @@ -27,7 +27,7 @@ "labelDontHaveAnAccountYet": "Chưa có tài khoản?", "actionCreateANewAccount": "Tạo một tài khoản mới", "informInvalidEmailFormat": "Nhập địa chỉ email hợp lệ", - "warnPasswordLength": "Bạn nên nhập vào 6-25 ký tự.", + "warnPasswordLength": "Bạn nên nhập từ 8-25 ký tự.", "labelResetPassword": "Đặt lại mật khẩu", "labelChooseNewPass": "Chọn mật khẩu mới", "labelCreatePass": "Mật khẩu", @@ -112,5 +112,6 @@ "warnInvalidEndpoint": "điểm kết thúc không hợp lệ", "labelApplicationID": "Mã đăng ký", "semanticApplicationID": "Mã đăng ký", - "warnInvalidApplicationID": "mã đăng ký không hợp lệ" + "warnInvalidApplicationID": "mã đăng ký không hợp lệ", + "labelLanguage": "Ngôn ngữ" } \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_auth/app_zh.arb b/packages/deriv_localizations/lib/l10n/deriv_auth/app_zh.arb index fe2b3e162..4c589dabe 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_auth/app_zh.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_auth/app_zh.arb @@ -13,7 +13,7 @@ "actionOk": "确定", "warnNotAvailableCountries": "如果有任何疑問,請通過以下方式與我們聯繫 ", "labelLiveChat": "即時聊天", - "actionGetAFreeAccount": "獲取免費帳戶", + "actionSignUpForFree": "免費註冊", "actionLogin": "登入", "labelTwoFactorAuth": "雙因素身份驗證", "informEnterTwoFactorAuthCode": "在手機的驗證器應用程式中輸入 6 位數代碼。", @@ -112,5 +112,6 @@ "warnInvalidEndpoint": "無效的端點", "labelApplicationID": "應用程式 ID", "semanticApplicationID": "應用程式 ID", - "warnInvalidApplicationID": "無效的應用程式 ID" + "warnInvalidApplicationID": "無效的應用程式 ID", + "labelLanguage": "語言" } \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_ar.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_ar.arb new file mode 100644 index 000000000..837439327 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_ar.arb @@ -0,0 +1,62 @@ +{ + "passkeyCreatedSuccessTitle": "النجاح!", + "passkeyCreatedSuccessMessage": "تم تأمين حسابك الآن باستخدام Passkey. قم بإدارة Passkey الخاص بك من خلال إعدادات حساب {platformName} الخاص بك.", + "@passkeyCreatedSuccessMessage": { + "placeholders": { + "platformName": { + "required": true, + "type": "String" + } + } + }, + "continueButtonText": "استمر", + "unexpectedError": "حدث خطأ غير متوقع!", + "unexpectedErrorDescription": "يرجى المحاولة لاحقا.", + "ok": "Ok", + "experienceSaferLogins": "اختبر عمليات تسجيل دخول أكثر أمانًا", + "enhanceSecurity": "الأمان المحسّن على بُعد نقرة واحدة فقط.", + "here": "هنا", + "effortlessLogin": "تسجيل الدخول بسهولة باستخدام Passkeys", + "whatArePasskeys": "ما هي passkeys؟", + "whatArePasskeysDescriptionPoint1": "بديل آمن لكلمات المرور.", + "whatArePasskeysDescriptionPoint2": "قم بإلغاء قفل حسابك مثل هاتفك - باستخدام القياسات الحيوية أو مسح الوجه أو رقم التعريف الشخصي.", + "whyPasskeys": "لماذا Passkey؟", + "whyPasskeysDescription1": "طبقة أمان إضافية.", + "whyPasskeysDescription2": "الحماية من الوصول غير المصرح به والتصيد الاحتيالي.", + "howToCreatePasskey": "كيفية إنشاء passkey؟", + "howToCreatePasskeyDescription1": "انتقل إلى \"إعدادات الحساب\" على المشتقات.", + "howToCreatePasskeyDescription2": "يمكنك إنشاء Passkey واحد لكل جهاز.", + "whereArePasskeysSaved": "أين يتم حفظ passkeys؟", + "whereArePasskeysSavedDescriptionAndroid": "أندرويد: مدير كلمات مرور Google.", + "whereArePasskeysSavedDescriptionIOS": "iOS: سلسلة مفاتيح iCloud.", + "whatHappensIfEmailChanged": "ماذا يحدث إذا تم تغيير البريد الإلكتروني لحساب Deriv الخاص بي؟", + "whatHappensIfEmailChangedDescription1": "لا توجد مشكلة! لا يزال مفتاح Passkey بك يعمل.", + "whatHappensIfEmailChangedDescription2": "سجّل الدخول إلى Deriv باستخدام مفتاح Passkey لديك.", + "tips": "نصائح", + "beforeUsingPasskeys": "قبل استخدام Passkey", + "enableScreenLock": "قم بتمكين قفل الشاشة على جهازك.", + "signInGoogleOrIcloud": "قم بتسجيل الدخول إلى حساب Google أو iCloud الخاص بك.", + "enableBluetooth": "قم بتمكين البلوتوث.", + "noPasskeyFound": "لم يتم العثور على passkey!", + "noPasskeyFoundDescription": "يرجى إنشاء passkey لاستخدام هذه الميزة.", + "maybeLater": "ربما في وقت لاحق", + "effortlessLoginWithPasskeys": "تسجيل الدخول بسهولة باستخدام Passkeys", + "learnMoreAboutPasskeys": "تعرف على المزيد حول passkeys", + "noNeedToRememberPassword": "لا حاجة لتذكر كلمة المرور", + "useYourBiometrics": "أمان محسّن باستخدام القياسات الحيوية أو قفل الشاشة", + "syncAcrossDevices": "المزامنة عبر الأجهزة", + "createPasskey": "إنشاء Passkey", + "unsupportedPlatform": "منصة غير مدعومة", + "storedOn": "تم تخزينها على", + "lastUsed": "آخر استخدام", + "rename": "إعادة تسمية", + "revoke": "إلغاء", + "continueTradingButtonText": "استمر في التداول", + "addMorePasskeysButtonText": "أضف المزيد من Passkeys", + "unableToSetupPasskey": "تعذر إعداد مفتاح Passkey", + "unableToSetupPasskeyDescription": "لقد واجهنا مشكلة أثناء إعداد Passkey الخاص بك. ربما تمت مقاطعة العملية، أو ربما انتهت مهلة الجلسة. يرجى المحاولة مرة أخرى.", + "passkeysOffErrorTitle": "خدمة Passkeys غير متوفرة", + "never": "أبداً", + "unable_to_process_your_request": "غير قادر على معالجة طلبك", + "unable_to_process_your_request_description": "نحن نواجه مشكلة مؤقتة في معالجة طلبك. يرجى المحاولة مرة أخرى لاحقًا." +} \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_bn.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_bn.arb new file mode 100644 index 000000000..b77e53953 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_bn.arb @@ -0,0 +1,62 @@ +{ + "passkeyCreatedSuccessTitle": "সফলতা!", + "passkeyCreatedSuccessMessage": "আপনার অ্যাকাউন্ট এখন একটি পাসকি দিয়ে সুরক্ষিত৷ আপনার {platformName} অ্যাকাউন্ট সেটিংসের মাধ্যমে আপনার পাসকি পরিচালনা করুন।", + "@passkeyCreatedSuccessMessage": { + "placeholders": { + "platformName": { + "required": true, + "type": "String" + } + } + }, + "continueButtonText": "চালিয়ে যান", + "unexpectedError": "একটি অপ্রত্যাশিত ত্রুটি ঘটেছে!", + "unexpectedErrorDescription": "দয়া করে পরে চেষ্টা করুন।", + "ok": "Ok", + "experienceSaferLogins": "নিরাপদ লগইন অভিজ্ঞতা", + "enhanceSecurity": "উন্নত সুরক্ষা মাত্র এক ট্যাপ দূরে।", + "here": "এখানে", + "effortlessLogin": "Passkeys সাথে অনায়াসে লগইন করুন", + "whatArePasskeys": "Passkeys কী কী?", + "whatArePasskeysDescriptionPoint1": "পাসওয়ার্ডের সুরক্ষিত বিকল্প।", + "whatArePasskeysDescriptionPoint2": "আপনার ফোনের মতো আপনার অ্যাকাউন্টটি আনলক করুন - বায়োমেট্রিক্স, ফেস স্ক্যান বা পিন সহ।", + "whyPasskeys": "Passkeys কেন?", + "whyPasskeysDescription1": "অতিরিক্ত সুরক্ষা স্তর।", + "whyPasskeysDescription2": "অননুমোদিত অ্যাক্সেস এবং ফিশিং বিরুদ্ধে শিল্ড।", + "howToCreatePasskey": "Passkey একটি পাসকি তৈরি করবেন?", + "howToCreatePasskeyDescription1": "Deriv 'অ্যাকাউন্ট সেটিংস' এ যান।", + "howToCreatePasskeyDescription2": "Passkey প্রতি ডিভাইসে একটি পাসকি তৈরি করতে পারেন।", + "whereArePasskeysSaved": "Passkeys কোথায় সংরক্ষণ করা হয়?", + "whereArePasskeysSavedDescriptionAndroid": "Android: Google পাসওয়ার্ড ম্যানেজার।", + "whereArePasskeysSavedDescriptionIOS": "iOS: iCloud কীচেন।", + "whatHappensIfEmailChanged": "আমার Deriv অ্যাকাউন্ট ইমেইল পরিবর্তন হলে কি হবে?", + "whatHappensIfEmailChangedDescription1": "কোন সমস্যা নেই! আপনার Passkey এখনও কাজ করে।", + "whatHappensIfEmailChangedDescription2": "আপনার বিদ্যমান Passkey দিয়ে Deriv সাইন ইন করুন।", + "tips": "টিপস", + "beforeUsingPasskeys": "Passkeys ব্যবহারের পূর্বে", + "enableScreenLock": "আপনার ডিভাইসে স্ক্রিন লক সক্ষম করুন।", + "signInGoogleOrIcloud": "আপনার Google বা iCloud অ্যাকাউন্টে সাইন ইন করুন।", + "enableBluetooth": "ব্লুটুথ সক্ষম করুন।", + "noPasskeyFound": "কোনো Passkey পাওয়া যায়নি!", + "noPasskeyFoundDescription": "এই বৈশিষ্ট্যটি ব্যবহার করতে অনুগ্রহ করে একটি Passkey তৈরি করুন।", + "maybeLater": "হয়তো পরে", + "effortlessLoginWithPasskeys": "Passkeys সাথে অনায়াসে লগইন করুন", + "learnMoreAboutPasskeys": "Passkeys সম্পর্কে আরও জানুন", + "noNeedToRememberPassword": "পাসওয়ার্ড স্মরণে রাখার দরকার নাই", + "useYourBiometrics": "বায়োমেট্রিক্স বা স্ক্রিন লক সহ উন্নত সুরক্ষা ", + "syncAcrossDevices": "ডিভাইস জুড়ে সিঙ্ক", + "createPasskey": "Passkey তৈরি", + "unsupportedPlatform": "সমর্থিত প্ল্যাটফর্", + "storedOn": "সংরক্ষণ হয়েছে", + "lastUsed": "সর্বশেষ ব্যবহৃত", + "rename": "পুনঃনামকরণ", + "revoke": "প্রত্যাহার করুন", + "continueTradingButtonText": "ট্রেডিং চালিয়ে যান", + "addMorePasskeysButtonText": "আরও Passkeys", + "unableToSetupPasskey": "Passkey সেটআপ করতে অক্ষম", + "unableToSetupPasskeyDescription": "আপনার Passkey সেট আপ করার সময় আমরা একটি সমস্যার মুখোমুখি হয়েছি। প্রক্রিয়াটি বাধা দেওয়া হতে পারে, বা সেশনের সময় শেষ হতে পারে। দয়া করে আবার চেষ্টা করুন।", + "passkeysOffErrorTitle": "Passkeys পরিষেবাটি উপলব্ধ নয়", + "never": "কখনই", + "unable_to_process_your_request": "আপনার অনুরোধ প্রক্রিয়া করতে অক্ষম", + "unable_to_process_your_request_description": "আমরা আপনার অনুরোধ প্রক্রিয়াকরণে একটি অস্থায়ী সমস্যা অনুভব করছি। দয়া করে পরে আবার চেষ্টা করুন।" +} \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_de.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_de.arb new file mode 100644 index 000000000..4a01dff0d --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_de.arb @@ -0,0 +1,62 @@ +{ + "passkeyCreatedSuccessTitle": "Erfolg!", + "passkeyCreatedSuccessMessage": "Ihr Konto ist jetzt mit einem Passkey gesichert. Verwalte deinen Passkey in deinen {platformName} -Kontoeinstellungen.", + "@passkeyCreatedSuccessMessage": { + "placeholders": { + "platformName": { + "required": true, + "type": "String" + } + } + }, + "continueButtonText": "Weiter", + "unexpectedError": "Ein unerwarteter Fehler ist aufgetreten!", + "unexpectedErrorDescription": "Bitte versuchen Sie es später erneut.", + "ok": "Ok", + "experienceSaferLogins": "Erleben Sie sicherere Logins", + "enhanceSecurity": "Verbesserte Sicherheit ist nur einen Fingertipp entfernt.", + "here": "hier", + "effortlessLogin": "Müheloses Einloggen mit Passkeys", + "whatArePasskeys": "Was sind Passkeys? ", + "whatArePasskeysDescriptionPoint1": "Sichere Alternative zu Passwörtern.", + "whatArePasskeysDescriptionPoint2": "Entsperren Sie Ihr Konto wie Ihr Telefon - mit biometrischen Daten, Gesichtsscan oder PIN.", + "whyPasskeys": "Warum Passkeys?", + "whyPasskeysDescription1": "Zusätzliche Sicherheitsebene.", + "whyPasskeysDescription2": "Schützt vor unbefugtem Zugriff und Phishing.", + "howToCreatePasskey": "Wie erstelle ich einen Passkey?", + "howToCreatePasskeyDescription1": "Gehen Sie zu 'Kontoeinstellungen' auf Deriv.", + "howToCreatePasskeyDescription2": "Sie können einen Passkey pro Gerät erstellen.", + "whereArePasskeysSaved": "Wo werden die Passkeys gespeichert?", + "whereArePasskeysSavedDescriptionAndroid": "Android: Google Passwort-Manager.", + "whereArePasskeysSavedDescriptionIOS": "iOS: iCloud-Schlüsselbund.", + "whatHappensIfEmailChanged": "Was passiert, wenn die E-Mail-Adresse meines Deriv-Kontos geändert wird?", + "whatHappensIfEmailChangedDescription1": "Kein Problem! Ihr Passkey funktioniert noch.", + "whatHappensIfEmailChangedDescription2": "Melden Sie sich bei Deriv mit Ihrem bestehenden Passkey an.", + "tips": "Tipps", + "beforeUsingPasskeys": "Vor der Benutzung von Passkeys", + "enableScreenLock": "Aktiviere die Bildschirmsperre auf deinem Gerät.", + "signInGoogleOrIcloud": "Melde dich bei deinem Google- oder iCloud-Konto an.", + "enableBluetooth": "Aktiviere Bluetooth.", + "noPasskeyFound": "Kein Passkey gefunden!", + "noPasskeyFoundDescription": "Bitte erstellen Sie einen Passkey, um diese Funktion zu nutzen.", + "maybeLater": "Vielleicht später", + "effortlessLoginWithPasskeys": "Müheloses Einloggen mit Passkeys", + "learnMoreAboutPasskeys": "Erfahren Sie mehr über Passkeys", + "noNeedToRememberPassword": "Sie müssen sich kein Passwort merken", + "useYourBiometrics": "Erhöhte Sicherheit durch Biometrie oder Bildschirmsperre", + "syncAcrossDevices": "Geräteübergreifend synchronisieren", + "createPasskey": "Passkeyerstellen", + "unsupportedPlatform": "Plattform wird nicht unterstützt", + "storedOn": "Gespeichert am", + "lastUsed": "Zuletzt verwendet", + "rename": "Umbenennen", + "revoke": "Widerrufen", + "continueTradingButtonText": "Handel fortsetzen", + "addMorePasskeysButtonText": "Mehr Passkeys", + "unableToSetupPasskey": "Passkey kann nicht eingerichtet werden", + "unableToSetupPasskeyDescription": "Beim Einrichten Ihres Passkey ist ein Problem aufgetreten. Der Vorgang wurde möglicherweise unterbrochen oder die Sitzung wurde unterbrochen. Bitte versuchen Sie es erneut.", + "passkeysOffErrorTitle": "Der Dienst Passkeys ist nicht verfügbar", + "never": "Niemals", + "unable_to_process_your_request": "Ihre Anfrage konnte nicht bearbeitet werden", + "unable_to_process_your_request_description": "Wir haben ein vorübergehendes Problem bei der Bearbeitung Ihrer Anfrage. Bitte versuchen Sie es später erneut." +} \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_es.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_es.arb new file mode 100644 index 000000000..bd11a3527 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_es.arb @@ -0,0 +1,62 @@ +{ + "passkeyCreatedSuccessTitle": "¡Exitoso!", + "passkeyCreatedSuccessMessage": "Su cuenta está ahora protegida con una passkey. Gestione su passkey a través de la configuración de su cuenta {platformName}.", + "@passkeyCreatedSuccessMessage": { + "placeholders": { + "platformName": { + "required": true, + "type": "String" + } + } + }, + "continueButtonText": "Continuar", + "unexpectedError": "Ha ocurrido un error inesperado!", + "unexpectedErrorDescription": "Por favor, inténtelo más tarde.", + "ok": "Ok", + "experienceSaferLogins": "Experimente inicios de sesión más seguros", + "enhanceSecurity": "La seguridad mejorada está a sólo un toque de distancia.", + "here": "aquí", + "effortlessLogin": "Inicio de sesión sin esfuerzo con passkeys", + "whatArePasskeys": "¿Qué son las passkeys?", + "whatArePasskeysDescriptionPoint1": "Alternativa segura a las contraseñas.", + "whatArePasskeysDescriptionPoint2": "Desbloquee su cuenta como si fuera su teléfono: con biometría, escáner facial o PIN.", + "whyPasskeys": "¿Por qué passkeys?", + "whyPasskeysDescription1": "Capa de seguridad adicional.", + "whyPasskeysDescription2": "Protege contra el acceso no autorizado y la suplantación de identidad.", + "howToCreatePasskey": "¿Cómo crear una passkey?", + "howToCreatePasskeyDescription1": "Vaya a \"Configuración de la cuenta\" en Deriv.", + "howToCreatePasskeyDescription2": "Puede crear una passkey por dispositivo.", + "whereArePasskeysSaved": "¿Dónde se guardan las passkeys?", + "whereArePasskeysSavedDescriptionAndroid": "Android: Gestor de contraseñas de Google.", + "whereArePasskeysSavedDescriptionIOS": "iOS: Llavero de iCloud.", + "whatHappensIfEmailChanged": "¿Qué ocurre si se cambia el correo electrónico de mi cuenta de Deriv?", + "whatHappensIfEmailChangedDescription1": "No hay problema. Su passkey sigue funcionando.", + "whatHappensIfEmailChangedDescription2": "Inicie sesión en Deriv con su passkey actual.", + "tips": "Consejos", + "beforeUsingPasskeys": "Antes de usar la passkey:", + "enableScreenLock": "Habilite el bloqueo de pantalla en su dispositivo.", + "signInGoogleOrIcloud": "Inicie sesión en su cuenta de Google o iCloud.", + "enableBluetooth": "Activar Bluetooth.", + "noPasskeyFound": "¡No se encontró ninguna passkey!", + "noPasskeyFoundDescription": "Cree una passkey para usar esta función.", + "maybeLater": "Quizás más tarde", + "effortlessLoginWithPasskeys": "Inicio de sesión sin esfuerzo con passkeys", + "learnMoreAboutPasskeys": "Obtenga más información sobre las passkeys", + "noNeedToRememberPassword": "No es necesario recordar una contraseña", + "useYourBiometrics": "Seguridad mejorada con biometría o bloqueo de pantalla", + "syncAcrossDevices": "Sincronización entre dispositivos", + "createPasskey": "Crear passkey", + "unsupportedPlatform": "Plataforma no compatible", + "storedOn": "Almacenado en", + "lastUsed": "Utilizado por última vez", + "rename": "Renombrar", + "revoke": "Revocar", + "continueTradingButtonText": "Seguir operando", + "addMorePasskeysButtonText": "Añadir más Passkeys", + "unableToSetupPasskey": "No se puede configurar la passkey", + "unableToSetupPasskeyDescription": "Hemos encontrado un problema al configurar su passkey. Es posible que el proceso se haya interrumpido o que la sesión haya expirado. Por favor, inténtelo de nuevo.", + "passkeysOffErrorTitle": "El servicio Passkeys no está disponible", + "never": "Nunca", + "unable_to_process_your_request": "No se puede procesar su solicitud", + "unable_to_process_your_request_description": "Estamos teniendo un problema temporal al procesar tu solicitud. Vuelva a intentarlo más tarde." +} \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_fr.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_fr.arb new file mode 100644 index 000000000..a9c315fe4 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_fr.arb @@ -0,0 +1,62 @@ +{ + "passkeyCreatedSuccessTitle": "Effectué !", + "passkeyCreatedSuccessMessage": "Votre compte est désormais sécurisé par une passkey. Gérez votre passkey à partir de vos paramètres de compte {platformName}.", + "@passkeyCreatedSuccessMessage": { + "placeholders": { + "platformName": { + "required": true, + "type": "String" + } + } + }, + "continueButtonText": "Continuer", + "unexpectedError": "Une erreur inattendue s'est produite !", + "unexpectedErrorDescription": "Veuillez réessayer plus tard.", + "ok": "Ok", + "experienceSaferLogins": "Bénéficiez de connexions plus sûres", + "enhanceSecurity": "Une sécurité renforcée est à portée de main.", + "here": "ici", + "effortlessLogin": "Connexion facile à l'aide de passkeys", + "whatArePasskeys": "Que sont les passkeys ?", + "whatArePasskeysDescriptionPoint1": "Alternative sécurisée aux mots de passe.", + "whatArePasskeysDescriptionPoint2": "Déverrouillez votre compte comme votre téléphone - par biométrie, scan du visage ou code PIN.", + "whyPasskeys": "Pourquoi choisir des passkeys ?", + "whyPasskeysDescription1": "Couche de sécurité supplémentaire.", + "whyPasskeysDescription2": "Protège contre les accès non autorisés et le phishing.", + "howToCreatePasskey": "Comment créer une passkey ?", + "howToCreatePasskeyDescription1": "Allez dans \"Paramètres du compte\" sur Deriv.", + "howToCreatePasskeyDescription2": "Vous pouvez créer une Passkey par appareil.", + "whereArePasskeysSaved": "Où sont enregistrées les passkeys ?", + "whereArePasskeysSavedDescriptionAndroid": "Android : Gestionnaire de mots de passe Google.", + "whereArePasskeysSavedDescriptionIOS": "iOS : trousseau iCloud.", + "whatHappensIfEmailChanged": "Que se passe-t-il si l'adresse e-mail de mon compte Deriv est modifiée ?", + "whatHappensIfEmailChangedDescription1": "Pas de problème ! Votre Passkey fonctionne toujours.", + "whatHappensIfEmailChangedDescription2": "Connectez-vous à Deriv avec votre Passkey existant.", + "tips": "Conseils", + "beforeUsingPasskeys": "Avant d'utiliser la passkey :", + "enableScreenLock": "Activez le verrouillage de l'écran sur votre appareil.", + "signInGoogleOrIcloud": "Connectez-vous à votre compte Google ou iCloud.", + "enableBluetooth": "Activer Bluetooth.", + "noPasskeyFound": "Aucun passkey n'a été trouvé !", + "noPasskeyFoundDescription": "Veuillez créer une passkey pour utiliser cette fonctionnalité.", + "maybeLater": "Peut-être plus tard", + "effortlessLoginWithPasskeys": "Connexion facile à l'aide de passkeys", + "learnMoreAboutPasskeys": "En savoir plus sur les passkeys", + "noNeedToRememberPassword": "Pas besoin de mémoriser un mot de passe", + "useYourBiometrics": "Sécurité renforcée grâce à la biométrie ou au verrouillage de l'écran", + "syncAcrossDevices": "Synchronisation sur tous les appareils", + "createPasskey": "Créer une passkey", + "unsupportedPlatform": "Plateforme non prise en charge", + "storedOn": "Stocké sur ", + "lastUsed": "Dernière utilisation", + "rename": "Renommer", + "revoke": "Révoquer", + "continueTradingButtonText": "Poursuivre les opérations de trading", + "addMorePasskeysButtonText": "Ajouter d'autres Passkeys", + "unableToSetupPasskey": "Impossible de configurer la Passkey", + "unableToSetupPasskeyDescription": "Nous avons rencontré un problème lors de l'établissement de votre Passkey. Il se peut que le processus ait été interrompu ou que la session ait expiré. Veuillez réessayer.", + "passkeysOffErrorTitle": "Le service Passkeys est indisponible", + "never": "Jamais", + "unable_to_process_your_request": "Impossible de traiter votre demande", + "unable_to_process_your_request_description": "Nous rencontrons un problème temporaire lors du traitement de votre demande. Veuillez réessayer ultérieurement." +} \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_it.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_it.arb new file mode 100644 index 000000000..74e475fb9 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_it.arb @@ -0,0 +1,62 @@ +{ + "passkeyCreatedSuccessTitle": "Fatto!", + "passkeyCreatedSuccessMessage": "Il tuo account è ora protetto con una passkey. Gestisci la tua passkey tramite le impostazioni del tuo account {platformName}.", + "@passkeyCreatedSuccessMessage": { + "placeholders": { + "platformName": { + "required": true, + "type": "String" + } + } + }, + "continueButtonText": "Continua", + "unexpectedError": "Si è verificato un errore imprevisto!", + "unexpectedErrorDescription": "Riprova più tardi.", + "ok": "Ok", + "experienceSaferLogins": "Sperimenta accessi più sicuri", + "enhanceSecurity": "Per una maggiore sicurezza basta un tocco.", + "here": "qui", + "effortlessLogin": "Accesso semplice con passkeys", + "whatArePasskeys": "Cosa sono le passkey?", + "whatArePasskeysDescriptionPoint1": "Un'alternativa sicura alle password.", + "whatArePasskeysDescriptionPoint2": "Sblocca il suo conto come il suo telefono - con la biometria, la scansione del volto o il PIN.", + "whyPasskeys": "Perché la passkey?", + "whyPasskeysDescription1": "Un ulteriore livello di sicurezza.", + "whyPasskeysDescription2": "Protegge dagli accessi non autorizzati e dal phishing.", + "howToCreatePasskey": "Come creare una passkey?", + "howToCreatePasskeyDescription1": "Vada a 'Impostazioni del conto' su Deriv.", + "howToCreatePasskeyDescription2": "Può creare una sola Passkey per dispositivo.", + "whereArePasskeysSaved": "Dove vengono salvate la passkey?", + "whereArePasskeysSavedDescriptionAndroid": "Android: Gestore di password di Google.", + "whereArePasskeysSavedDescriptionIOS": "iOS: Portachiavi iCloud.", + "whatHappensIfEmailChanged": "Cosa succede se l'email del mio account Deriv viene modificata?", + "whatHappensIfEmailChangedDescription1": "Nessun problema! La sua Passkey funziona ancora.", + "whatHappensIfEmailChangedDescription2": "Acceda a Deriv con la sua Passkey esistente.", + "tips": "Suggerimento", + "beforeUsingPasskeys": "Prima di utilizzare la passkey", + "enableScreenLock": "Abilita il blocco dello schermo sul tuo dispositivo.", + "signInGoogleOrIcloud": "Accedi al tuo account Google o iCloud.", + "enableBluetooth": "Abilita il Bluetooth.", + "noPasskeyFound": "Nessuna passkey trovata!", + "noPasskeyFoundDescription": "Crea una passkey per utilizzare questa funzione.", + "maybeLater": "Forse più tardi", + "effortlessLoginWithPasskeys": "Accesso semplice con passkeys", + "learnMoreAboutPasskeys": "Scopri di più sulle passkey", + "noNeedToRememberPassword": "Non è necessario ricordare una password", + "useYourBiometrics": "Sicurezza avanzata con biometria o blocco dello schermo", + "syncAcrossDevices": "Sincronizzazione su più dispositivi", + "createPasskey": "Crea Passkey", + "unsupportedPlatform": "Piattaforma non supportata", + "storedOn": "Memorizzato su", + "lastUsed": "Ultima volta", + "rename": "Rinomina", + "revoke": "Revoca", + "continueTradingButtonText": "Continua il trading", + "addMorePasskeysButtonText": "Più passkeys", + "unableToSetupPasskey": "Impossibile impostare la Passkey", + "unableToSetupPasskeyDescription": "Abbiamo riscontrato un problema durante la configurazione della sua Passkey. Il processo potrebbe essere stato interrotto, oppure la sessione è scaduta. Provi di nuovo.", + "passkeysOffErrorTitle": "Il servizio Passkeys non è disponibile", + "never": "Mai", + "unable_to_process_your_request": "Impossibile elaborare la tua richiesta", + "unable_to_process_your_request_description": "Stiamo riscontrando un problema temporaneo nell'elaborazione della tua richiesta. Riprova più tardi." +} \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_ko.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_ko.arb new file mode 100644 index 000000000..a425d9c1f --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_ko.arb @@ -0,0 +1,62 @@ +{ + "passkeyCreatedSuccessTitle": "성공!", + "passkeyCreatedSuccessMessage": "이제 여러분의 계정은 passkey로 보호됩니다. {platformName} 계정 설정을 통해 passkey를 관리하세요.", + "@passkeyCreatedSuccessMessage": { + "placeholders": { + "platformName": { + "required": true, + "type": "String" + } + } + }, + "continueButtonText": "계속", + "unexpectedError": "예상하지 못한 오류가 발생했습니다!", + "unexpectedErrorDescription": "나중에 다시 시도해 주시기 바랍니다.", + "ok": "확인", + "experienceSaferLogins": "로그인이 더 안전합니다", + "enhanceSecurity": "탭 한 번으로 보안을 강화할 수 있습니다.", + "here": "여기", + "effortlessLogin": "Passkeys로 간편한 로그인", + "whatArePasskeys": "Passkeys란 무엇인가요?", + "whatArePasskeysDescriptionPoint1": "비밀번호를 대체할 수 있는 안전한 비밀번호.", + "whatArePasskeysDescriptionPoint2": "생체 인식, 얼굴 스캔 또는 PIN을 사용하여 휴대폰처럼 계정을 잠금해제하세요.", + "whyPasskeys": "Passkeys를 사용하는 이유는 무엇인가요?", + "whyPasskeysDescription1": "추가 보안 계층.", + "whyPasskeysDescription2": "무단 접근 및 피싱으로부터 보호합니다.", + "howToCreatePasskey": "Passkey는 어떻게 생성할 수 있나요?", + "howToCreatePasskeyDescription1": "Deriv의 '계정 설정'으로 이동하세요.", + "howToCreatePasskeyDescription2": "기기당 하나의 Passkey를 만들 수 있습니다.", + "whereArePasskeysSaved": "Passkeys는 어디에 저장되나요?", + "whereArePasskeysSavedDescriptionAndroid": "Android: Google 비밀번호 관리자.", + "whereArePasskeysSavedDescriptionIOS": "iOS: iCloud 키체인.", + "whatHappensIfEmailChanged": "제 Deriv 계정 이메일이 변경되면 어떻게 되나요?", + "whatHappensIfEmailChangedDescription1": "괜찮습니다! 귀하의 Passkey를 그대로 사용하실 수 있습니다.", + "whatHappensIfEmailChangedDescription2": "기존 Passkey를 사용하여 Deriv에 로그인하세요.", + "tips": "팁", + "beforeUsingPasskeys": "Passkeys를 사용하기 전에", + "enableScreenLock": "기기에서 화면 잠금을 활성화하세요.", + "signInGoogleOrIcloud": "Google 또는 iCloud 계정으로 로그인하세요.", + "enableBluetooth": "블루투스를 활성화하세요.", + "noPasskeyFound": "Passkey를 찾을 수 없습니다!", + "noPasskeyFoundDescription": "이 기능을 사용하기 위해서는 passkey를 생성하시기 바랍니다.", + "maybeLater": "다음으로 미루겠습니다", + "effortlessLoginWithPasskeys": "Passkeys를 통한 간단한 로그인", + "learnMoreAboutPasskeys": "Passkeys에 대해 더 알아보기", + "noNeedToRememberPassword": "비밀번호를 기억하지 않아도 됩니다", + "useYourBiometrics": "생체인식 또는 화면 잠금을 통한 보안 강화", + "syncAcrossDevices": "기기 간 동기화", + "createPasskey": "Passkey 생성", + "unsupportedPlatform": "지원되지 않는 플랫폼입니다", + "storedOn": "저장 위치", + "lastUsed": "최근 사용", + "rename": "이름 변경", + "revoke": "철회", + "continueTradingButtonText": "계속 거래하기", + "addMorePasskeysButtonText": "더 많은 Passkeys", + "unableToSetupPasskey": "Passkey를 설정할 수 없습니다", + "unableToSetupPasskeyDescription": "Passkey를 설정하는 동안 문제가 발생했습니다. 프로세스가 중단되었거나 세션 시간이 초과되었을 수 있습니다. 다시 시도해 주시기 바랍니다.", + "passkeysOffErrorTitle": "Passkeys 서비스를 이용할 수 없습니다", + "never": "절대 안 돼", + "unable_to_process_your_request": "요청을 처리할 수 없습니다", + "unable_to_process_your_request_description": "요청을 처리하는 동안 일시적인 문제가 발생했습니다.나중에 다시 시도하세요." +} \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_pl.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_pl.arb new file mode 100644 index 000000000..366ed3337 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_pl.arb @@ -0,0 +1,62 @@ +{ + "passkeyCreatedSuccessTitle": "Udało się!", + "passkeyCreatedSuccessMessage": "Twoje konto jest teraz zabezpieczone passkey. Zarządzaj swoim passkey za pomocą ustawień konta {platformName}.", + "@passkeyCreatedSuccessMessage": { + "placeholders": { + "platformName": { + "required": true, + "type": "String" + } + } + }, + "continueButtonText": "Kontynuuj", + "unexpectedError": "Wystąpił nieoczekiwany błąd!", + "unexpectedErrorDescription": "Spróbuj później.", + "ok": "Ok", + "experienceSaferLogins": "Doświadcz bezpieczniejszych logowań", + "enhanceSecurity": "Zwiększone bezpieczeństwo jest na wyciągnięcie ręki.", + "here": "tutaj", + "effortlessLogin": "Łatwe logowanie za pomocą passkeys", + "whatArePasskeys": "Czym są passkeys?", + "whatArePasskeysDescriptionPoint1": "Bezpieczna alternatywa dla haseł.", + "whatArePasskeysDescriptionPoint2": "Odblokuj swoje konto jak telefon - za pomocą danych biometrycznych, skanowania twarzy lub PIN-u.", + "whyPasskeys": "Dlaczego Passkeys?", + "whyPasskeysDescription1": "Dodatkowa warstwa bezpieczeństwa.", + "whyPasskeysDescription2": "Chroni przed nieautoryzowanym dostępem i phishingiem.", + "howToCreatePasskey": "Jak utworzyć passkey?", + "howToCreatePasskeyDescription1": "Przejdź do ‘Ustawień konta’ na Deriv.", + "howToCreatePasskeyDescription2": "Możesz utworzyć jedno hasło na urządzenie.", + "whereArePasskeysSaved": "Gdzie są zapisywane passkeys?", + "whereArePasskeysSavedDescriptionAndroid": "Android: menedżer haseł Google.", + "whereArePasskeysSavedDescriptionIOS": "iOS: pęk kluczy iCloud.", + "whatHappensIfEmailChanged": "Co się stanie, jeśli e-mail mojego konta Deriv zostanie zmieniony?", + "whatHappensIfEmailChangedDescription1": "Bez problemu! Twój Passkey nadal działa.", + "whatHappensIfEmailChangedDescription2": "Zaloguj się do Deriv przy użyciu istniejącego Passkey.", + "tips": "Porady", + "beforeUsingPasskeys": "Przed użyciem passkeys", + "enableScreenLock": "Włącz blokadę ekranu na swoim urządzeniu.", + "signInGoogleOrIcloud": "Zaloguj się na swoje konto Google lub iCloud.", + "enableBluetooth": "Włącz Bluetooth.", + "noPasskeyFound": "Nie znaleziono passkey!", + "noPasskeyFoundDescription": "Aby korzystać z tej funkcji, utwórz passkey.", + "maybeLater": "Może później", + "effortlessLoginWithPasskeys": "Łatwe logowanie za pomocą passkeys", + "learnMoreAboutPasskeys": "Dowiedz się więcej o passkeys", + "noNeedToRememberPassword": "Nie ma potrzeby zapamiętywania hasła", + "useYourBiometrics": "Zwiększone bezpieczeństwo dzięki biometrii lub blokadzie ekranu", + "syncAcrossDevices": "Synchronizacja między urządzeniami", + "createPasskey": "Utwórz passkey", + "unsupportedPlatform": "Nieobsługiwana platforma", + "storedOn": "Przechowywane na", + "lastUsed": "Ostatnio używane", + "rename": "Zmień nazwę", + "revoke": "Odwołać", + "continueTradingButtonText": "Kontynuuj handlowanie", + "addMorePasskeysButtonText": "Więcej passkeys", + "unableToSetupPasskey": "Nie można ustawić passkey", + "unableToSetupPasskeyDescription": "Napotkaliśmy problem podczas konfigurowania Passkey. Proces mógł zostać przerwany lub upłynął limit czasu sesji. Proszę spróbuj ponownie.", + "passkeysOffErrorTitle": "Usługa Passkeys jest niedostępna", + "never": "Nigdy", + "unable_to_process_your_request": "Nie można przetworzyć żądania", + "unable_to_process_your_request_description": "Mamy tymczasowy problem z przetwarzaniem Twojej prośby. Spróbuj ponownie później." +} \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_pt.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_pt.arb new file mode 100644 index 000000000..da5958826 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_pt.arb @@ -0,0 +1,62 @@ +{ + "passkeyCreatedSuccessTitle": "Concluído com sucesso!", + "passkeyCreatedSuccessMessage": "A sua conta está agora protegida com uma chave de acesso. Pode fazer a gestão da sua chave de acesso através das definições da sua conta {platformName}.", + "@passkeyCreatedSuccessMessage": { + "placeholders": { + "platformName": { + "required": true, + "type": "String" + } + } + }, + "continueButtonText": "Continuar", + "unexpectedError": "Ocorreu um erro inesperado!", + "unexpectedErrorDescription": "Por favor, tente novamente mais tarde.", + "ok": "Ok", + "experienceSaferLogins": "Experimente inícios de sessão mais seguros", + "enhanceSecurity": "Segurança reforçada à distância de um clique.", + "here": "aqui", + "effortlessLogin": "Início de sessão simplificado com as chaves de acesso", + "whatArePasskeys": "O que são chaves de acesso?", + "whatArePasskeysDescriptionPoint1": "Alternativa segura às palavras-passe.", + "whatArePasskeysDescriptionPoint2": "Desbloqueie a sua conta com a mesma facilidade que desbloqueia o seu telemóvel - seja através de biometria, reconhecimento facial ou introdução de PIN.", + "whyPasskeys": "Porque é que se utilizam chaves de acesso?", + "whyPasskeysDescription1": "Camada de segurança adicional.", + "whyPasskeysDescription2": "Protege contra o acesso não autorizado e phishing.", + "howToCreatePasskey": "Como criar uma chave de acesso?", + "howToCreatePasskeyDescription1": "Aceda às \"Definições de conta\" na Deriv.", + "howToCreatePasskeyDescription2": "Pode criar uma passkey por dispositivo.", + "whereArePasskeysSaved": "Onde são guardadas as chaves de acesso?", + "whereArePasskeysSavedDescriptionAndroid": "Android: Gestor de palavras-passe do Google.", + "whereArePasskeysSavedDescriptionIOS": "iOS: iCloud keychain.", + "whatHappensIfEmailChanged": "O que acontece se o e-mail da minha conta Deriv for alterado?", + "whatHappensIfEmailChangedDescription1": "Não tem problema! A sua passkey ainda funciona.", + "whatHappensIfEmailChangedDescription2": "Inicie sessão na Deriv com a sua passkey.", + "tips": "Dicas", + "beforeUsingPasskeys": "Antes de utilizar as chaves de acesso", + "enableScreenLock": "Ative o bloqueio de ecrã no seu dispositivo.", + "signInGoogleOrIcloud": "Inicie sessão na sua conta Google ou iCloud.", + "enableBluetooth": "Ativar Bluetooth.", + "noPasskeyFound": "Não foi encontrada nenhuma chave de acesso!", + "noPasskeyFoundDescription": "Por favor, crie uma chave de acesso para utilizar esta funcionalidade.", + "maybeLater": "Talvez mais tarde", + "effortlessLoginWithPasskeys": "Início de sessão simplificado com as chaves de acesso", + "learnMoreAboutPasskeys": "Saiba mais sobre as chaves de acesso", + "noNeedToRememberPassword": "Não memorizar a palavra-passe", + "useYourBiometrics": "Segurança reforçada com dados biométricos ou bloqueio do ecrã", + "syncAcrossDevices": "Sincronizar entre dispositivos", + "createPasskey": "Crie passkey", + "unsupportedPlatform": "Plataforma não suportada", + "storedOn": "Armazenado em", + "lastUsed": "Última utilização", + "rename": "Renomear", + "revoke": "Revogar", + "continueTradingButtonText": "Continue a negociar", + "addMorePasskeysButtonText": "Adicionar Mais Passkeys", + "unableToSetupPasskey": "Não é possível configurar a passkey", + "unableToSetupPasskeyDescription": "Encontramos um problema ao configurar sua passkey. O processo pode ter sido interrompido ou a sessão expirou. Por favor, tente novamente.", + "passkeysOffErrorTitle": "O serviço de Passkeys não está disponível", + "never": "Nunca", + "unable_to_process_your_request": "Não foi possível processar sua solicitação", + "unable_to_process_your_request_description": "Estamos enfrentando um problema temporário no processamento de sua solicitação. Por favor, tente novamente mais tarde." +} \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_ru.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_ru.arb new file mode 100644 index 000000000..28784d534 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_ru.arb @@ -0,0 +1,62 @@ +{ + "passkeyCreatedSuccessTitle": "Готово!", + "passkeyCreatedSuccessMessage": "Теперь ваша учетная запись защищена passkey. Управляйте своим passkey через настройки учетной записи {platformName}.", + "@passkeyCreatedSuccessMessage": { + "placeholders": { + "platformName": { + "required": true, + "type": "String" + } + } + }, + "continueButtonText": "Продолжить", + "unexpectedError": "Произошла неожиданная ошибка!", + "unexpectedErrorDescription": "Попробуйте позже.", + "ok": "Ok", + "experienceSaferLogins": "Испытайте более безопасный вход в систему", + "enhanceSecurity": "Повышенная безопасность — всего лишь одно касание.", + "here": "здесь", + "effortlessLogin": "Легкий вход в систему с помощью passkeys", + "whatArePasskeys": "Что такое passkeys?", + "whatArePasskeysDescriptionPoint1": "Безопасная альтернатива паролям.", + "whatArePasskeysDescriptionPoint2": "Разблокируйте свою учетную запись, как телефон — с помощью биометрии, сканирования лица или PIN-кода.", + "whyPasskeys": "Зачем нужны passkeys?", + "whyPasskeysDescription1": "Дополнительный уровень безопасности.", + "whyPasskeysDescription2": "Защищает от несанкционированного доступа и фишинга.", + "howToCreatePasskey": "Как создать passkey?", + "howToCreatePasskeyDescription1": "Перейдите в ‘Настройки учетной записи’ на Deriv.", + "howToCreatePasskeyDescription2": "Вы можете создать один passkey для каждого устройства.", + "whereArePasskeysSaved": "Где хранятся passkeys?", + "whereArePasskeysSavedDescriptionAndroid": "Android: Менеджер паролей Google.", + "whereArePasskeysSavedDescriptionIOS": "iOS: связка ключей iCloud.", + "whatHappensIfEmailChanged": "Что произойдет, если адрес электронной почты моей учетной записи Deriv изменится?", + "whatHappensIfEmailChangedDescription1": "Нет проблем! Ваш passkey по-прежнему работает.", + "whatHappensIfEmailChangedDescription2": "Войдите в Deriv, используя существующий passkey.", + "tips": "Советы", + "beforeUsingPasskeys": "Перед использованием passkey", + "enableScreenLock": "Включите блокировку экрана на своем устройстве.", + "signInGoogleOrIcloud": "Войдите в свою учетную запись Google или iCloud.", + "enableBluetooth": "Включите Bluetooth.", + "noPasskeyFound": "Passkey не найден!", + "noPasskeyFoundDescription": "Чтобы использовать эту функцию, создайте Passkey.", + "maybeLater": "Может быть позже", + "effortlessLoginWithPasskeys": "Легкий вход в систему с помощью passkeys", + "learnMoreAboutPasskeys": "Узнайте больше о passkeys", + "noNeedToRememberPassword": "Нет необходимости запоминать пароль", + "useYourBiometrics": "Повышенная безопасность с помощью биометрии или блокировки экрана", + "syncAcrossDevices": "Синхронизация между устройствами", + "createPasskey": "Создать passkey", + "unsupportedPlatform": "Неподдерживаемая платформа", + "storedOn": "Хранится в", + "lastUsed": "Недавние", + "rename": "Переименовать", + "revoke": "Отменить", + "continueTradingButtonText": "Продолжить торговлю", + "addMorePasskeysButtonText": "Больше passkeys", + "unableToSetupPasskey": "Невозможно настроить passkey", + "unableToSetupPasskeyDescription": "Мы столкнулись с проблемой при настройке вашего passkey. Возможно, процесс был прерван, или сессия завершилась по таймеру. Пожалуйста, попробуйте еще раз.", + "passkeysOffErrorTitle": "Служба Passkeys недоступна", + "never": "Никогда", + "unable_to_process_your_request": "Не удалось обработать ваш запрос", + "unable_to_process_your_request_description": "При обработке вашего запроса возникла временная проблема. Пожалуйста, повторите попытку позже." +} \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_si.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_si.arb new file mode 100644 index 000000000..e25b89ec8 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_si.arb @@ -0,0 +1,62 @@ +{ + "passkeyCreatedSuccessTitle": "සාර්ථකයි!", + "passkeyCreatedSuccessMessage": "ඔබගේ ගිණුම දැන් Passkey සුරක්ෂිත කර ඇත. ඔබේ {platformName} ගිණු ම් සැකසුම් හරහා ඔබගේ passkey කළමනාකරණය කරන්න.", + "@passkeyCreatedSuccessMessage": { + "placeholders": { + "platformName": { + "required": true, + "type": "String" + } + } + }, + "continueButtonText": "ඉදිරියට යන්න", + "unexpectedError": "අනපේක්ෂිත දෝෂයක් ඇති විය!", + "unexpectedErrorDescription": "කරුණාකර පසුව උත්සාහ කරන්න.", + "ok": "Ok", + "experienceSaferLogins": "ආරක්ෂිත පිවිසුම් අත්විඳින්න", + "enhanceSecurity": "වැඩි දියුණු කළ ආරක්ෂාව එක ටැප් එකක් දුරින්.", + "here": "මෙන්න", + "effortlessLogin": "Passkeys සමඟ වෙහෙස නොබලා පිවිසීම", + "whatArePasskeys": "Passkeys යනු කුමක්ද?", + "whatArePasskeysDescriptionPoint1": "මුරපද සඳහා ආරක්ෂිත විකල්පයක්.", + "whatArePasskeysDescriptionPoint2": "ජෛවමිතික, මුහුණු ස්කෑන් කිරීම හෝ PIN සමඟ ඔබේ දුරකථනයයේ අකාරයටම ඔබේ ගිණුම අගුළු හරින්න.", + "whyPasskeys": "Passkeys අවශ්‍ය වන්නේ ඇයි?", + "whyPasskeysDescription1": "අමතර ආරක්ෂක ස්ථරය.", + "whyPasskeysDescription2": "අනවසර ප්‍රවේශයෙන් සහ තතුබෑම්වලින් ආරක්ෂා කරයි.", + "howToCreatePasskey": "නිර්මාණය Passkey කෙසේද?", + "howToCreatePasskeyDescription1": "Deriv හි 'ගිණුම් සැකසීම්' වෙත යන්න.", + "howToCreatePasskeyDescription2": "ඔබට එක් උපාංගයකට එක් passkey එකක් සෑදිය හැක.", + "whereArePasskeysSaved": "Passkey සුරකින්නේ කොහේද?", + "whereArePasskeysSavedDescriptionAndroid": "Android: Google මුරපද කළමනාකරු.", + "whereArePasskeysSavedDescriptionIOS": "iOS: iCloud යතුරු දාමය.", + "whatHappensIfEmailChanged": "මගේ Deriv ගිණුමේ විද්යුත් තැපෑල වෙනස් කළහොත් කුමක් සිදුවේද?", + "whatHappensIfEmailChangedDescription1": "ප්‍රශ්නයක් නැත! ඔබේ passkey එක තවමත් ක්‍රියා කරයි.", + "whatHappensIfEmailChangedDescription2": "ඔබේ පවතින passkey සමඟින් Deriv වෙත පුරන්න.", + "tips": "ඉඟි", + "beforeUsingPasskeys": "Passkey භාවිතා කිරීමට පෙර", + "enableScreenLock": "ඔබේ උපාංගයේ තිර අගුල සක්රීය කරන්න.", + "signInGoogleOrIcloud": "ඔබේ Google හෝ iCloud ගිණුමට පිවිසෙන්න.", + "enableBluetooth": "බ්ලූටූත් සක්රීය කරන්න.", + "noPasskeyFound": "Passkey සොයාගත නොමැත!", + "noPasskeyFoundDescription": "කරුණාකර මෙම විශේෂාංගය භාවිතා කිරීම සඳහා passkey යන්නක් සාදන්න.", + "maybeLater": "සමහර විට පසුව", + "effortlessLoginWithPasskeys": "Passkeys සමඟ වෙහෙස නොබලා පිවිසීම", + "learnMoreAboutPasskeys": "Passkeys ගැන වැඩි විස්තර දැනගන්න", + "noNeedToRememberPassword": "මුරපදයක් මතක තබා ගැනීමට අවශ්ය නැත", + "useYourBiometrics": "ජෛවමිතික හෝ තිර අගුල සමඟ වැඩි දියුණු කළ ආරක්ෂාව", + "syncAcrossDevices": "උපාංග හරහා සමමුහූර්ත කරන්න", + "createPasskey": "Passkey සාදන්න", + "unsupportedPlatform": "සහාය නොදක්වන වේදිකාව", + "storedOn": "ගබඩා කර ඇත", + "lastUsed": "අවසන් වරට භාවිත කළේ", + "rename": "නැවත නම් කරන්න", + "revoke": "අවලංගු කරන්න", + "continueTradingButtonText": "දිගටම ගනුදෙනු කරන්න", + "addMorePasskeysButtonText": "තවත් passkeys එක් කරන්න", + "unableToSetupPasskey": "Passkey සැකසීමට නොහැකි විය", + "unableToSetupPasskeyDescription": "ඔබගේ passkey සැකසීමේදී අපට ගැටලුවක් ඇති විය. ක්රියාවලියට බාධා ඇති විය හැකිය, නැතහොත් සැසිය කාලය අවසන් විය හැකිය. කරුණාකර නැවත උත්සාහ කරන්න.", + "passkeysOffErrorTitle": "Passkeys සේවාව ලබා ගත නොහැක", + "never": "කවදාවත්", + "unable_to_process_your_request": "ඔබගේ ඉල්ලීම සැකසීමට නොහැකි විය", + "unable_to_process_your_request_description": "ඔබගේ ඉල්ලීම සැකසීමේදී අපට තාවකාලික ගැටළුවක් අත්විඳිනවා. කරුණාකර පසුව නැවත උත්සාහ කරන්න." +} \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_sw.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_sw.arb new file mode 100644 index 000000000..de772c07f --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_sw.arb @@ -0,0 +1,62 @@ +{ + "passkeyCreatedSuccessTitle": "Mafanikio!", + "passkeyCreatedSuccessMessage": "Akaunti yako sasa imehifadhiwa na passkey. Dhibiti passkey yako kupi tia mipangilio yako ya akaunti ya {platformName}.", + "@passkeyCreatedSuccessMessage": { + "placeholders": { + "platformName": { + "required": true, + "type": "String" + } + } + }, + "continueButtonText": "Endelea", + "unexpectedError": "Hitilafu yasiyotarajiwa!", + "unexpectedErrorDescription": "Tafadhali jaribu tena.", + "ok": "Ok", + "experienceSaferLogins": "Pata kuingia salama", + "enhanceSecurity": "Usalama ulioimarishwa uko karibu sana, unahitaji kubofya tu.", + "here": "hapa", + "effortlessLogin": "Kuingia bila juhudi kwa passkeys", + "whatArePasskeys": "Nini passkeys?", + "whatArePasskeysDescriptionPoint1": "Njia mbadala ya kufanya nenosiri kuwa salama.", + "whatArePasskeysDescriptionPoint2": "Fungua akaunti yako kama vile simu yako - kwa biyometriki, kuskani uso au PIN.", + "whyPasskeys": "Kwa nini passkeys?", + "whyPasskeysDescription1": "Safu ya ziada ya usalama.", + "whyPasskeysDescription2": "Kinga dhidi ya ufikiaji ambao haujaidhinishwa na hadaa.", + "howToCreatePasskey": "Jinsi ya kuunda passkey?", + "howToCreatePasskeyDescription1": "Nenda katika 'Mipangilio ya Akaunti' kwenye Deriv.", + "howToCreatePasskeyDescription2": "Unaweza kuunda passkey moja kwa kila kifaa.", + "whereArePasskeysSaved": "Passkeys zimehifadhiwa wapi?", + "whereArePasskeysSavedDescriptionAndroid": "Android: Google password manager.", + "whereArePasskeysSavedDescriptionIOS": "iOS: iCloud keychain.", + "whatHappensIfEmailChanged": "Nini kinatokea ikiwa barua pepe yangu ya akaunti ya Deriv imebadil?", + "whatHappensIfEmailChangedDescription1": "Hakuna tatizo! Passkey yako bado inafanya kazi.", + "whatHappensIfEmailChangedDescription2": "Ingia kwenye Deriv na passkey yako iliyopo.", + "tips": "Vidokezo", + "beforeUsingPasskeys": "Kabla ya kutumia passkeys", + "enableScreenLock": "Wezesha kufunga skrini kwenye kifaa chako.", + "signInGoogleOrIcloud": "Ingia kwenye akaunti yako ya Google au iCloud.", + "enableBluetooth": "Wezesha Bluetooth.", + "noPasskeyFound": "Hakuna passkey iliyopatikana!", + "noPasskeyFoundDescription": "Tafadhali unda passkey ili kutumia kipengele hiki.", + "maybeLater": "Labda baadaye", + "effortlessLoginWithPasskeys": "Kuingia bila juhudi kwa passkeys", + "learnMoreAboutPasskeys": "Jifunze zaidi kuhusu passkeys", + "noNeedToRememberPassword": "Hakuna haja ya kukumbuka nenosiri", + "useYourBiometrics": "Usalama ulioboreshwa na biometriki au kufunga skrini", + "syncAcrossDevices": "Sawazisha katika vifaa", + "createPasskey": "Unda passkey", + "unsupportedPlatform": "Jukwaa isiyosaidiwa", + "storedOn": "Imehifadhiwa kwenye", + "lastUsed": "Imetumika mwisho", + "rename": "Badilisha jina", + "revoke": "Kufuta", + "continueTradingButtonText": "Endelea kufanya biashara", + "addMorePasskeysButtonText": "Ongeza passkeys nyingine", + "unableToSetupPasskey": "Haiwezi kuanzisha kifungu cha passkey", + "unableToSetupPasskeyDescription": "Tulikutana na shida wakati wa kuanzisha passkey lako. Utaratibu huo unaweza kuingiliwa, au kikao kimekamilika. Tafadhali jaribu tena.", + "passkeysOffErrorTitle": "Huduma ya Passkeys haipatikani", + "never": "Kamwe", + "unable_to_process_your_request": "Haiwezi kushughulikia ombi lako", + "unable_to_process_your_request_description": "Tunapata shida ya muda katika kusindika ombi lako. Tafadhali jaribu tena baadaye." +} \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_th.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_th.arb new file mode 100644 index 000000000..60ecace66 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_th.arb @@ -0,0 +1,62 @@ +{ + "passkeyCreatedSuccessTitle": "สำเร็จแล้ว!", + "passkeyCreatedSuccessMessage": "ตอนนี้บัญชีของคุณได้รับการรักษาความปลอดภัยด้วย Passkey โดยสามารถจัดการ Passkey นี้ได้ผ่านการตั้งค่าบัญชี {platformName} ของคุณ", + "@passkeyCreatedSuccessMessage": { + "placeholders": { + "platformName": { + "required": true, + "type": "String" + } + } + }, + "continueButtonText": "ดำเนินการต่อ", + "unexpectedError": "มีข้อผิดพลาดเกิดขึ้น!", + "unexpectedErrorDescription": "โปรดลองอีกครั้งในภายหลัง", + "ok": "Ok", + "experienceSaferLogins": "สัมผัสประสบการณ์การเข้าสู่ระบบที่ปลอดภัยขึ้น", + "enhanceSecurity": "การเสริมความปลอดภัยที่อยู่แค่เพียงคุณแตะปุ่มเดียว", + "here": "ที่นี่", + "effortlessLogin": "เข้าสู่ระบบได้อย่างง่ายดายด้วย Passkey", + "whatArePasskeys": "Passkey คืออะไร?", + "whatArePasskeysDescriptionPoint1": "ทางเลือกที่ปลอดภัยนอกเหนือไปจากรหัสผ่าน", + "whatArePasskeysDescriptionPoint2": "ปลดล็อคบัญชีคุณได้เหมือนที่ทำในโทรศัพท์ - ผ่านไบโอเมตริกซ์ การสแกนใบหน้า หรือหมายเลข PIN", + "whyPasskeys": "ทำไมต้องใช้ Passkey?", + "whyPasskeysDescription1": "เพิ่มอีกชั้นความปลอดภัยพิเศษ", + "whyPasskeysDescription2": "กันการเข้าถึงที่ไม่ได้อนุญาตและการโจมตีแบบฟิชชิ่ง", + "howToCreatePasskey": "จะสร้าง Passkey ได้อย่างไร?", + "howToCreatePasskeyDescription1": "ไปที่ 'การตั้งค่าบัญชี' บน Deriv", + "howToCreatePasskeyDescription2": "คุณสามารถสร้างหนึ่ง Passkey ต่ออุปกรณ์", + "whereArePasskeysSaved": "Passkey จะถูกบันทึกไว้ที่ไหน?", + "whereArePasskeysSavedDescriptionAndroid": "Android: ตัวจัดการรหัสผ่าน Google", + "whereArePasskeysSavedDescriptionIOS": "iOS: พวงกุญแจ iCloud", + "whatHappensIfEmailChanged": "จะเกิดอะไรขึ้นหากอีเมล์บัญชี Deriv ของฉันเปลี่ยนไป?", + "whatHappensIfEmailChangedDescription1": "ไม่มีปัญหา! Passkey ของคุณยังใช้งานได้อยู่", + "whatHappensIfEmailChangedDescription2": "ลงชื่อเข้าใช้ Deriv ด้วย Passkey ที่มีอยู่ของคุณ", + "tips": "เคล็ดลับ", + "beforeUsingPasskeys": "ก่อนที่จะใช้ Passkey", + "enableScreenLock": "เปิดใช้งานการล็อคหน้าจอบนอุปกรณ์ของคุณ", + "signInGoogleOrIcloud": "ลงชื่อเข้าใช้บัญชี Google หรือ iCloud ของคุณ", + "enableBluetooth": "เปิดใช้งานบลูทูธ", + "noPasskeyFound": "ไม่พบ Passkey!", + "noPasskeyFoundDescription": "กรุณาสร้าง Passkey เพื่อใช้ฟีเจอร์นี้", + "maybeLater": "ไว้ทีหลัง", + "effortlessLoginWithPasskeys": "เข้าสู่ระบบได้อย่างง่ายดายด้วย Passkey", + "learnMoreAboutPasskeys": "เรียนรู้เพิ่มเติมเกี่ยวกับ Passkey", + "noNeedToRememberPassword": "ไม่จำเป็นต้องจดจำรหัสผ่าน", + "useYourBiometrics": "เพิ่มความปลอดภัยด้วยไบโอเมตริกซ์หรือการล็อคหน้าจอ", + "syncAcrossDevices": "ซิงค์ได้ระหว่างอุปกรณ์ต่างๆ", + "createPasskey": "สร้าง Passkey", + "unsupportedPlatform": "แพลตฟอร์มที่ไม่รองรับ", + "storedOn": "เก็บไว้ใน", + "lastUsed": "ใช้ครั้งล่าสุด", + "rename": "เปลี่ยนชื่อ", + "revoke": "เพิกถอน", + "continueTradingButtonText": "ทำการเทรดต่อไป", + "addMorePasskeysButtonText": "เพิ่มจำนวน Passkey", + "unableToSetupPasskey": "ไม่สามารถตั้งค่า Passkey ได้", + "unableToSetupPasskeyDescription": "เราพบปัญหาขณะตั้งค่า Passkey ของคุณ กระบวนการอาจถูกขัดจังหวะหรือเซสชั่นหมดเวลา โปรดลองอีกครั้ง", + "passkeysOffErrorTitle": "บริการ Passkey ไม่พร้อมใช้งาน", + "never": "ไม่เคย", + "unable_to_process_your_request": "ไม่สามารถประมวลผลคำขอของคุณได้", + "unable_to_process_your_request_description": "เรากำลังประสบปัญหาชั่วคราวในการประมวลผลคำขอของคุณ โปรดลองอีกครั้งในภายหลัง" +} \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_tr.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_tr.arb new file mode 100644 index 000000000..cd9c5aa29 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_tr.arb @@ -0,0 +1,62 @@ +{ + "passkeyCreatedSuccessTitle": "Başarı!", + "passkeyCreatedSuccessMessage": "Hesabınız artık bir şifre ile güvence altına alınmıştır. {platformName} hesap ayarlarınızdan passkey'inizi yönetin.", + "@passkeyCreatedSuccessMessage": { + "placeholders": { + "platformName": { + "required": true, + "type": "String" + } + } + }, + "continueButtonText": "Devam et", + "unexpectedError": "Beklenmedik bir hata oluştu!", + "unexpectedErrorDescription": "Lütfen daha sonra deneyin.", + "ok": "Tamam", + "experienceSaferLogins": "Daha güvenli oturum açma deneyimini yaşayın", + "enhanceSecurity": "Gelişmiş güvenlik sadece bir dokunuş uzağınızda.", + "here": "burada", + "effortlessLogin": "Passkey tuşları ile zahmetsiz giriş", + "whatArePasskeys": "Passkeys nedir?", + "whatArePasskeysDescriptionPoint1": "Şifrelere güvenli alternatif.", + "whatArePasskeysDescriptionPoint2": "Hesabınızın kilidini telefonunuz gibi açın - biyometri, yüz tarama veya PIN ile.", + "whyPasskeys": "Neden Passkey?", + "whyPasskeysDescription1": "Ekstra güvenlik katmanı.", + "whyPasskeysDescription2": "Yetkisiz erişime ve kimlik avına karşı kalkanlar.", + "howToCreatePasskey": "Passkey nasıl oluşturulur?", + "howToCreatePasskeyDescription1": "Deriv'de 'Hesap Ayarları'na gidin.", + "howToCreatePasskeyDescription2": "Cihaz başına bir passkey oluşturabilirsiniz.", + "whereArePasskeysSaved": "Passkeys nereye kaydedilir?", + "whereArePasskeysSavedDescriptionAndroid": "Android: Google şifre yöneticisi.", + "whereArePasskeysSavedDescriptionIOS": "iOS: iCloud anahtar zinciri.", + "whatHappensIfEmailChanged": "Deriv hesabım e-posta adresim değiştirilirse ne olur?", + "whatHappensIfEmailChangedDescription1": "Sorun yok! Passkey hâlâ çalışıyor.", + "whatHappensIfEmailChangedDescription2": "Mevcut passkey ile Deriv'de oturum açın.", + "tips": "İpuçları", + "beforeUsingPasskeys": "Passkey kullanmadan önce", + "enableScreenLock": "Cihazınızda ekran kilidini etkinleştirin.", + "signInGoogleOrIcloud": "Google veya iCloud hesabınızda oturum açın.", + "enableBluetooth": "Bluetooth'u etkinleştir.", + "noPasskeyFound": "Passkey bulunamadı!", + "noPasskeyFoundDescription": "Bu özelliği kullanmak için lütfen bir passkey oluşturun.", + "maybeLater": "Belki daha sonra", + "effortlessLoginWithPasskeys": "Passkey tuşları ile zahmetsiz giriş", + "learnMoreAboutPasskeys": "Passkeys hakkında daha fazla bilgi edinin", + "noNeedToRememberPassword": "Şifreyi hatırlamanıza gerek yok", + "useYourBiometrics": "Biyometri veya ekran kilidi ile gelişmiş güvenlik", + "syncAcrossDevices": "Cihazlar arasında senkronizasyon", + "createPasskey": "Passkey oluştur", + "unsupportedPlatform": "Desteklenmeyen Platform", + "storedOn": "Şurada saklanır", + "lastUsed": "Son kullanılan", + "rename": "Yeniden Adlandır", + "revoke": "İptal", + "continueTradingButtonText": "Alım satıma devam", + "addMorePasskeysButtonText": "Daha fazla passkeys", + "unableToSetupPasskey": "Passkey ayarlanamıyor", + "unableToSetupPasskeyDescription": "Passkey ayarlarken bir sorunla karşılaştık. İşlem yarıda kesilmiş veya oturum zaman aşımına uğramış olabilir. Lütfen tekrar deneyin.", + "passkeysOffErrorTitle": "Passkeys hizmeti kullanılamıyor", + "never": "Asla", + "unable_to_process_your_request": "Talebiniz işleme alınamıyor", + "unable_to_process_your_request_description": "Talebinizin işlenmesinde geçici bir sorun yaşıyoruz. Lütfen daha sonra tekrar deneyin." +} \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_vi.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_vi.arb new file mode 100644 index 000000000..39a97ff12 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_vi.arb @@ -0,0 +1,62 @@ +{ + "passkeyCreatedSuccessTitle": "Thành công!", + "passkeyCreatedSuccessMessage": "Tài khoản của bạn hiện được bảo mật bằng passkey. Quản lý passkey của bạn thông qua cài đặt tài khoản {platformName} của bạn.", + "@passkeyCreatedSuccessMessage": { + "placeholders": { + "platformName": { + "required": true, + "type": "String" + } + } + }, + "continueButtonText": "Tiếp tục", + "unexpectedError": "Đã có lỗi bất ngờ xảy ra!", + "unexpectedErrorDescription": "Vui lòng thử lại sau.", + "ok": "Ok", + "experienceSaferLogins": "Trải nghiệm đăng nhập an toàn hơn", + "enhanceSecurity": "Bảo mật nâng cao chỉ cách một cú chạm.", + "here": "ở đây", + "effortlessLogin": "Đăng nhập dễ dàng với các passkeys", + "whatArePasskeys": "Passkeys là gì?", + "whatArePasskeysDescriptionPoint1": "Thay thế an toàn cho mật khẩu.", + "whatArePasskeysDescriptionPoint2": "Mở khóa tài khoản của bạn như điện thoại của bạn - với sinh trắc học, quét khuôn mặt hoặc mã PIN.", + "whyPasskeys": "Tại sao passkeys?", + "whyPasskeysDescription1": "Lớp bảo mật bổ sung.", + "whyPasskeysDescription2": "Bảo vệ chống truy cập trái phép và lừa đảo.", + "howToCreatePasskey": "Làm thế nào để tạo passkey?", + "howToCreatePasskeyDescription1": "Chuyển đến 'Cài đặt tài khoản' trên Deriv.", + "howToCreatePasskeyDescription2": "Bạn có thể tạo một passkey cho mỗi thiết bị.", + "whereArePasskeysSaved": "Passkeys được lưu ở đâu?", + "whereArePasskeysSavedDescriptionAndroid": "Android: Trình quản lý mật khẩu Google.", + "whereArePasskeysSavedDescriptionIOS": "iOS: Móc khóa iCloud.", + "whatHappensIfEmailChanged": "Điều gì xảy ra nếu email tài khoản Deriv của tôi bị thay đổi?", + "whatHappensIfEmailChangedDescription1": "Không có vấn đề gì! Khóa passkey của bạn vẫn hoạt động.", + "whatHappensIfEmailChangedDescription2": "Đăng nhập vào Deriv bằng passkey hiện có của bạn.", + "tips": "Mẹo", + "beforeUsingPasskeys": "Trước khi sử dụng passkeys", + "enableScreenLock": "Bật khóa màn hình trên thiết bị của bạn.", + "signInGoogleOrIcloud": "Đăng nhập vào tài khoản Google hoặc iCloud của bạn.", + "enableBluetooth": "Bật Bluetooth.", + "noPasskeyFound": "Không tìm thấy passkey!", + "noPasskeyFoundDescription": "Vui lòng tạo passkey để sử dụng tính năng này.", + "maybeLater": "Để sau", + "effortlessLoginWithPasskeys": "Đăng nhập dễ dàng với các passkeys", + "learnMoreAboutPasskeys": "Tìm hiểu thêm về passkeys", + "noNeedToRememberPassword": "Không cần nhớ mật khẩu", + "useYourBiometrics": "Tăng cường bảo mật với sinh trắc học hoặc khóa màn hình", + "syncAcrossDevices": "Đồng bộ hóa trên các thiết bị", + "createPasskey": "Tạo passkey", + "unsupportedPlatform": "Nền tảng không được hỗ trợ", + "storedOn": "Được lưu trữ trên", + "lastUsed": "Lần sử dụng cuối", + "rename": "Đổi tên", + "revoke": "Thu hồi", + "continueTradingButtonText": "Tiếp tục giao dịch", + "addMorePasskeysButtonText": "Thêm nhiều Passkeys", + "unableToSetupPasskey": "Không thể thiết lập passkey", + "unableToSetupPasskeyDescription": "Chúng tôi gặp sự cố khi thiết lập passkey của bạn. Quá trình có thể đã bị gián đoạn hoặc phiên đã hết thời gian. Vui lòng thử lại.", + "passkeysOffErrorTitle": "Dịch vụ Passkeys không khả dụng", + "never": "Không bao giờ", + "unable_to_process_your_request": "Không thể xử lý yêu cầu của bạn", + "unable_to_process_your_request_description": "Chúng tôi đang gặp sự cố tạm thời trong quá trình xử lý yêu cầu của bạn. Vui lòng thử lại sau." +} \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_zh.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_zh.arb new file mode 100644 index 000000000..d04752476 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_zh.arb @@ -0,0 +1,62 @@ +{ + "passkeyCreatedSuccessTitle": "成功!", + "passkeyCreatedSuccessMessage": "帳戶現在已使用金鑰保護。請透過 <0/>{platformName} 帳戶設定<0/>管理金鑰。", + "@passkeyCreatedSuccessMessage": { + "placeholders": { + "platformName": { + "required": true, + "type": "String" + } + } + }, + "continueButtonText": "繼續", + "unexpectedError": "發生不可預測錯誤!", + "unexpectedErrorDescription": "請稍後重試。", + "ok": "確定", + "experienceSaferLogins": "體驗更安全的登入", + "enhanceSecurity": "只需輕按一下即可增強安全性。", + "here": "這裡", + "effortlessLogin": "使用金鑰輕鬆登入", + "whatArePasskeys": "什麼是金鑰?", + "whatArePasskeysDescriptionPoint1": "密碼之外的安全替代品。", + "whatArePasskeysDescriptionPoint2": "使用生物特徵、臉部掃描或 PIN 像手機一樣解鎖帳戶。", + "whyPasskeys": "為什麼要使用金鑰?", + "whyPasskeysDescription1": "額外的安全層。", + "whyPasskeysDescription2": "防止未經授權的存取和網絡釣魚。", + "howToCreatePasskey": "如何建立金鑰?", + "howToCreatePasskeyDescription1": "轉到 Deriv 的‘帳戶設定‘。", + "howToCreatePasskeyDescription2": "可以為每個裝置建立一個金鑰。", + "whereArePasskeysSaved": "金鑰儲存在哪裡?", + "whereArePasskeysSavedDescriptionAndroid": "Android: Google 密碼管理器。", + "whereArePasskeysSavedDescriptionIOS": "iOS:iCloud 鑰匙圈。", + "whatHappensIfEmailChanged": "如果 Deriv 帳戶電子郵件更改,會怎麼樣?", + "whatHappensIfEmailChangedDescription1": "沒問題!金鑰仍然有效。", + "whatHappensIfEmailChangedDescription2": "使用現有的金鑰登入 Deriv。", + "tips": "提示", + "beforeUsingPasskeys": "使用金鑰之前", + "enableScreenLock": "啟用裝置螢幕鎖定。", + "signInGoogleOrIcloud": "登入 Google 或 iCloud 帳戶。", + "enableBluetooth": "啟用藍牙。", + "noPasskeyFound": "找不到金鑰!", + "noPasskeyFoundDescription": "請建立金鑰以使用此功能。", + "maybeLater": "以後再說", + "effortlessLoginWithPasskeys": "使用金鑰輕鬆登入", + "learnMoreAboutPasskeys": "進一步了解金鑰", + "noNeedToRememberPassword": "無需記住密碼", + "useYourBiometrics": "通過生物特徵或螢幕鎖定增強安全性", + "syncAcrossDevices": "跨裝置同步", + "createPasskey": "建立金鑰", + "unsupportedPlatform": "不支援的平台", + "storedOn": "儲存在", + "lastUsed": "上一次使用", + "rename": "重命名", + "revoke": "撤銷", + "continueTradingButtonText": "繼續交易", + "addMorePasskeysButtonText": "新增更多金鑰", + "unableToSetupPasskey": "無法設定金鑰", + "unableToSetupPasskeyDescription": "設定金鑰時遇到問題。程序可能已中斷,或工作階段逾時。請再試一次。", + "passkeysOffErrorTitle": "金鑰服務無法使用", + "never": "從未", + "unable_to_process_your_request": "無法處理請求", + "unable_to_process_your_request_description": "處理請求時遇到臨時問題。請稍後再試。" +} \ No newline at end of file From 5204c74f609d946ea797e766e6bb652d82f76930 Mon Sep 17 00:00:00 2001 From: sahani-deriv <125638269+sahani-deriv@users.noreply.github.com> Date: Mon, 27 May 2024 11:32:24 +0800 Subject: [PATCH 075/162] refactor(deriv_auth): update localization (#594) Co-authored-by: mobile-apps-deriv --- .../layouts/deriv_get_started_layout.dart | 2 +- .../deriv_auth/deriv_auth_localizations.dart | 106 ++++------- .../deriv_auth_localizations_ar.dart | 6 +- .../deriv_auth_localizations_bn.dart | 6 +- .../deriv_auth_localizations_de.dart | 4 +- .../deriv_auth_localizations_en.dart | 2 +- .../deriv_auth_localizations_es.dart | 6 +- .../deriv_auth_localizations_fr.dart | 4 +- .../deriv_auth_localizations_it.dart | 6 +- .../deriv_auth_localizations_ko.dart | 78 ++++----- .../deriv_auth_localizations_pl.dart | 6 +- .../deriv_auth_localizations_pt.dart | 4 +- .../deriv_auth_localizations_ru.dart | 6 +- .../deriv_auth_localizations_si.dart | 6 +- .../deriv_auth_localizations_sw.dart | 6 +- .../deriv_auth_localizations_th.dart | 4 +- .../deriv_auth_localizations_tr.dart | 8 +- .../deriv_auth_localizations_vi.dart | 6 +- .../deriv_auth_localizations_zh.dart | 4 +- .../deriv_passkeys_localizations.dart | 87 +++++++--- .../deriv_passkeys_localizations_ar.dart | 164 ++++++++++++++++++ .../deriv_passkeys_localizations_bn.dart | 164 ++++++++++++++++++ .../deriv_passkeys_localizations_de.dart | 164 ++++++++++++++++++ .../deriv_passkeys_localizations_es.dart | 164 ++++++++++++++++++ .../deriv_passkeys_localizations_fr.dart | 164 ++++++++++++++++++ .../deriv_passkeys_localizations_it.dart | 164 ++++++++++++++++++ .../deriv_passkeys_localizations_ko.dart | 164 ++++++++++++++++++ .../deriv_passkeys_localizations_pl.dart | 164 ++++++++++++++++++ .../deriv_passkeys_localizations_pt.dart | 164 ++++++++++++++++++ .../deriv_passkeys_localizations_ru.dart | 164 ++++++++++++++++++ .../deriv_passkeys_localizations_si.dart | 164 ++++++++++++++++++ .../deriv_passkeys_localizations_sw.dart | 164 ++++++++++++++++++ .../deriv_passkeys_localizations_th.dart | 164 ++++++++++++++++++ .../deriv_passkeys_localizations_tr.dart | 164 ++++++++++++++++++ .../deriv_passkeys_localizations_vi.dart | 164 ++++++++++++++++++ .../deriv_passkeys_localizations_zh.dart | 164 ++++++++++++++++++ 36 files changed, 2806 insertions(+), 175 deletions(-) create mode 100644 packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ar.dart create mode 100644 packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_bn.dart create mode 100644 packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_de.dart create mode 100644 packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_es.dart create mode 100644 packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_fr.dart create mode 100644 packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_it.dart create mode 100644 packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ko.dart create mode 100644 packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_pl.dart create mode 100644 packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_pt.dart create mode 100644 packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ru.dart create mode 100644 packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_si.dart create mode 100644 packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_sw.dart create mode 100644 packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_th.dart create mode 100644 packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_tr.dart create mode 100644 packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_vi.dart create mode 100644 packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_zh.dart 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 2c15b8dd3..07cdabe9e 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 @@ -159,7 +159,7 @@ class _DerivGetStartedLayoutState extends State { onPressed: widget.onSignupTapped, child: Center( child: Text( - context.derivAuthLocalization.actionGetAFreeAccount, + context.derivAuthLocalization.actionSignUpForFree, style: context.theme.textStyle( textStyle: TextStyles.body2, color: context.theme.colors.prominent, 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 a742191e9..44a0e566c 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, @@ -157,11 +153,11 @@ abstract class DerivAuthLocalizations { /// **'Live chat'** String get labelLiveChat; - /// No description provided for @actionGetAFreeAccount. + /// No description provided for @actionSignUpForFree. /// /// In en, this message translates to: - /// **'Get a free account'** - String get actionGetAFreeAccount; + /// **'Sign up for free'** + String get actionSignUpForFree; /// No description provided for @actionLogin. /// @@ -656,83 +652,49 @@ abstract class DerivAuthLocalizations { 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 833bcacd7..158f2adef 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 @@ -22,7 +22,7 @@ class DerivAuthLocalizationsAr extends DerivAuthLocalizations { String get labelLiveChat => 'دردشة مباشرة'; @override - String get actionGetAFreeAccount => 'احصل على حساب مجاني'; + String get actionSignUpForFree => 'قم بالتسجيل مجانًا'; @override String get actionLogin => 'تسجيل دخول'; @@ -64,7 +64,7 @@ class DerivAuthLocalizationsAr extends DerivAuthLocalizations { String get informInvalidEmailFormat => 'أدخل عنوان بريد إلكتروني صالح'; @override - String get warnPasswordLength => 'يجب إدخال 6-25 حرفًا.'; + String get warnPasswordLength => 'يجب إدخال 8-25 حرفًا.'; @override String get labelResetPassword => 'إعادة تعيين كلمة المرور'; @@ -272,5 +272,5 @@ class DerivAuthLocalizationsAr extends DerivAuthLocalizations { String get warnInvalidApplicationID => 'معرف تطبيق غير صالح'; @override - String get labelLanguage => 'Language'; + String get labelLanguage => 'اللغة'; } 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 e79aaf975..992d068f2 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 @@ -22,7 +22,7 @@ class DerivAuthLocalizationsBn extends DerivAuthLocalizations { String get labelLiveChat => 'লাইভ চ্যাট'; @override - String get actionGetAFreeAccount => 'একটি ফ্রি অ্যাকাউন্ট পান'; + String get actionSignUpForFree => 'বিনামূল্যে সাইন আপ করুন'; @override String get actionLogin => 'লগ ইন'; @@ -64,7 +64,7 @@ class DerivAuthLocalizationsBn extends DerivAuthLocalizations { String get informInvalidEmailFormat => 'একটি বৈধ ইমেল ঠিকানা লিখুন'; @override - String get warnPasswordLength => 'আপনি 6-25 অক্ষর লিখতে হবে।'; + String get warnPasswordLength => 'আপনার 8-25 অক্ষর লিখতে হবে।'; @override String get labelResetPassword => 'পাসওয়ার্ড রিসেট'; @@ -272,5 +272,5 @@ class DerivAuthLocalizationsBn extends DerivAuthLocalizations { String get warnInvalidApplicationID => 'অবৈধ অ্যাপ্লিকেশন আইডি'; @override - String get labelLanguage => 'Language'; + String get labelLanguage => 'ভাষা'; } 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 5226c6012..528b8ff2b 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 @@ -22,7 +22,7 @@ class DerivAuthLocalizationsDe extends DerivAuthLocalizations { String get labelLiveChat => 'Live-chat'; @override - String get actionGetAFreeAccount => 'Ein kostenloses Konto erhalten'; + String get actionSignUpForFree => 'Melde dich kostenlos an'; @override String get actionLogin => 'Anmelden'; @@ -272,5 +272,5 @@ class DerivAuthLocalizationsDe extends DerivAuthLocalizations { String get warnInvalidApplicationID => 'ungültige Anwendungs-ID'; @override - String get labelLanguage => 'Language'; + String get labelLanguage => 'Sprache'; } 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 ae5d2b79e..b5fd83709 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 @@ -22,7 +22,7 @@ class DerivAuthLocalizationsEn extends DerivAuthLocalizations { String get labelLiveChat => 'Live chat'; @override - String get actionGetAFreeAccount => 'Get a free account'; + String get actionSignUpForFree => 'Sign up for free'; @override String get actionLogin => 'Log in'; 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 07ab38b6d..288c8bdb8 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 @@ -22,7 +22,7 @@ class DerivAuthLocalizationsEs extends DerivAuthLocalizations { String get labelLiveChat => 'Live Chat'; @override - String get actionGetAFreeAccount => 'Obtener una cuenta gratuita'; + String get actionSignUpForFree => 'Regístrate gratis'; @override String get actionLogin => 'Iniciar sesión'; @@ -64,7 +64,7 @@ class DerivAuthLocalizationsEs extends DerivAuthLocalizations { String get informInvalidEmailFormat => 'Introduzca una dirección de correo electrónico válida'; @override - String get warnPasswordLength => 'Debería ingresar de 6 - 25 caracteres.'; + String get warnPasswordLength => 'Debería ingresar de 8 a 25 caracteres.'; @override String get labelResetPassword => 'Restablecer contraseña'; @@ -272,5 +272,5 @@ class DerivAuthLocalizationsEs extends DerivAuthLocalizations { String get warnInvalidApplicationID => 'ID de aplicación no válido'; @override - String get labelLanguage => 'Language'; + String get labelLanguage => 'Idioma'; } 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 025de3cd6..8defaaeda 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 @@ -22,7 +22,7 @@ class DerivAuthLocalizationsFr extends DerivAuthLocalizations { String get labelLiveChat => 'Chat en direct'; @override - String get actionGetAFreeAccount => 'Créer un compte gratuit'; + String get actionSignUpForFree => 'Inscrivez-vous gratuitement'; @override String get actionLogin => 'Connexion'; @@ -272,5 +272,5 @@ class DerivAuthLocalizationsFr extends DerivAuthLocalizations { String get warnInvalidApplicationID => 'identifiant de l\'application non valide'; @override - String get labelLanguage => 'Language'; + String get labelLanguage => 'Langue'; } 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 e6a046750..558bf4ad5 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 @@ -22,7 +22,7 @@ class DerivAuthLocalizationsIt extends DerivAuthLocalizations { String get labelLiveChat => 'Chat live'; @override - String get actionGetAFreeAccount => 'Ottenga un account gratuito'; + String get actionSignUpForFree => 'Registrati gratis'; @override String get actionLogin => 'Accedi'; @@ -64,7 +64,7 @@ class DerivAuthLocalizationsIt extends DerivAuthLocalizations { String get informInvalidEmailFormat => 'Inserisca un indirizzo e-mail valido'; @override - String get warnPasswordLength => 'È necessario inserire da 6 a 25 caratteri.'; + String get warnPasswordLength => 'È necessario inserire da 8 a 25 caratteri.'; @override String get labelResetPassword => 'Reimposta la password'; @@ -272,5 +272,5 @@ class DerivAuthLocalizationsIt extends DerivAuthLocalizations { String get warnInvalidApplicationID => 'ID applicazione non valido'; @override - String get labelLanguage => 'Language'; + String get labelLanguage => 'Lingua'; } 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 ea5448e15..01501babf 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 @@ -9,20 +9,20 @@ class DerivAuthLocalizationsKo extends DerivAuthLocalizations { @override String warnNotAvailableCountriesTitle(String app) { - return '귀하의 국가에서는 $app 을 (를) 사용할 수 없습니다.'; + return '귀하의 국가에서는 $app 을(를) 사용할 수 없습니다.'; } @override - String get actionOk => 'OK'; + String get actionOk => '확인'; @override - String get warnNotAvailableCountries => '궁금하신 점이 있으면 다음의 연락처로 문의해 주세요 '; + String get warnNotAvailableCountries => '궁금하신 점은 다음을 통해 문의해 주세요 '; @override String get labelLiveChat => '실시간 채팅'; @override - String get actionGetAFreeAccount => '무료 계정 개설'; + String get actionSignUpForFree => '무료로 가입하기'; @override String get actionLogin => '로그인'; @@ -31,7 +31,7 @@ class DerivAuthLocalizationsKo extends DerivAuthLocalizations { String get labelTwoFactorAuth => '2단계 인증'; @override - String get informEnterTwoFactorAuthCode => '휴대폰의 인증 앱에서 6자리 코드를 입력하세요.'; + String get informEnterTwoFactorAuthCode => '휴대폰 인증 앱에서 6자리 코드를 입력하세요.'; @override String get labelTwoFactorAuthenticationCode => '2FA 코드'; @@ -43,7 +43,7 @@ class DerivAuthLocalizationsKo extends DerivAuthLocalizations { String get labelLogIn => '로그인'; @override - String get informLoginOptions => '또는 다음 계정으로 로그인하세요'; + String get informLoginOptions => '또는 다음을 통해 로그인'; @override String get labelEmail => '이메일'; @@ -61,10 +61,10 @@ class DerivAuthLocalizationsKo extends DerivAuthLocalizations { String get actionCreateANewAccount => '새 계정 생성'; @override - String get informInvalidEmailFormat => '유효한 이메일 주소를 입력하세요'; + String get informInvalidEmailFormat => '유효한 이메일 주소를 입력해 주세요'; @override - String get warnPasswordLength => '6-25자를 입력해야 합니다.'; + String get warnPasswordLength => '6~25자를 입력해야 합니다.'; @override String get labelResetPassword => '비밀번호 재설정'; @@ -73,13 +73,13 @@ class DerivAuthLocalizationsKo extends DerivAuthLocalizations { String get labelChooseNewPass => '새 비밀번호를 선택하세요'; @override - String get labelCreatePass => '패스워드'; + String get labelCreatePass => '비밀번호'; @override String get informYourPassHasBeenReset => '비밀번호가 재설정되었습니다'; @override - String get informRedirectLogin => '새 비밀번호로 로그인해야 합니다. 잠시만 기다려 주세요, 리디렉션 중입니다.'; + String get informRedirectLogin => '새 비밀번호르 로그인해야 합니다. 잠시만 기다려 주세요. 리디렉션 중입니다.'; @override String get actionResetPass => '비밀번호 재설정'; @@ -92,11 +92,11 @@ class DerivAuthLocalizationsKo extends DerivAuthLocalizations { @override String informSendResetPasswordEmail(String email) { - return '비밀번호 재설정을 위한 링크가 포함된 메시지를 $email로 전송했습니다.'; + return '비밀번호 재설정을 위한 링크가 포함된 메시지가 $email로 전송되었습니다.'; } @override - String get informResetPassByEmail => '비밀번호 재설정에 대한 지침을 이메일로 전송해 드리겠습니다.'; + String get informResetPassByEmail => '비밀번호 재설정을 위한 지침을 이메일로 전송해 드리겠습니다.'; @override String get labelSelectCountry => '어디에 사시나요?'; @@ -105,28 +105,28 @@ class DerivAuthLocalizationsKo extends DerivAuthLocalizations { String get labelChooseCountry => '국가 선택'; @override - String get warnCountryNotAvailable => '안타깝게도 귀하의 국가에서는 Deriv를 사용할 수 없습니다.'; + String get warnCountryNotAvailable => '아쉽게도 귀하의 국가에서는 Deriv를 이용하실 수 없습니다.'; @override String get actionNext => '다음'; @override - String get labelEmailIssueHeader => '몇 분 내에 이메일이 오지 않는다면 다음과 같은 몇 가지 문제가 발생했을 수 있습니다:'; + String get labelEmailIssueHeader => '몇 분 내에 이메일을 받지 못하셨다면 다음과 같은 몇 가지 문제가 발생했을 수 있습니다:'; @override - String get labelEmailIssueSpam => '해당 이메일이 스팸 폴더에 있습니다(때로는 이메일이 스팸 폴더로 전송됩니다).'; + String get labelEmailIssueSpam => '이메일이 스팸 폴더에 있습니다(이메일이 스팸 폴더에 전송될 수 있습니다).'; @override - String get labelEmailIssueWrongEmail => '실수로 저희에게 다른 이메일 주소를 알려주셨습니다(일반적으로는 귀하께서 주시려고 의도하신 이메일 주소 대신 회사 및 개인 이메일 주소입니다).'; + String get labelEmailIssueWrongEmail => '실수로 다른 이메일 주소를 알려주셨습니다(의도하신 이메일 주소 대신 회사 및 개인 이메일 주소일 수 있습니다).'; @override - String get labelEmailIssueTypo => '입력하신 이메일 주소에 실수 또는 오타가 있습니다(누구에게나 발생할 수 있습니다).'; + String get labelEmailIssueTypo => '입력하신 이메일 주소가 잘못되었거나 오타가 있습니다(누구에게나 발생할 수 있습니다).'; @override - String get labelEmailIssueFirewall => '이 주소로 이메일을 전송할 수 없습니다(일반적으로는 방화벽 또는 필터링 떄문입니다).'; + String get labelEmailIssueFirewall => '이 주소로 이메일이 전송될 수 없습니다(일반적으로는 방화벽 또는 필터링이 원인입니다).'; @override - String get actionReenterEmail => '이메일을 다시 입력하고 다시 시도해 주세요'; + String get actionReenterEmail => '이메일을 다시 입력하시고 재시도해 주세요'; @override String get labelKeepPassword => '비밀번호로 계정을 안전하게 보호하세요'; @@ -144,7 +144,7 @@ class DerivAuthLocalizationsKo extends DerivAuthLocalizations { String get labelSignUp => '가입'; @override - String get labelOrSignUpWith => '또는 다음을 통해 가입하세요'; + String get labelOrSignUpWith => '또는 다음을 통해 가입'; @override String get labelReferralInfoTitle => '제휴 추천 코드'; @@ -156,10 +156,10 @@ class DerivAuthLocalizationsKo extends DerivAuthLocalizations { String get labelGotReferralCode => '추천 코드가 있나요?'; @override - String get labelHaveAccount => '보유하고 계신 계정이 있나요?'; + String get labelHaveAccount => '이미 계정을 보유하고 계시나요?'; @override - String get actionCreateAccount => '무료 데모 계정 생성하기'; + String get actionCreateAccount => '무료 데모 게정 생성'; @override String get informInvalidReferralCode => '입력하신 추천 코드가 유효하지 않습니다. 확인 후 다시 시도해 주세요.'; @@ -171,24 +171,24 @@ class DerivAuthLocalizationsKo extends DerivAuthLocalizations { String get labelThanksEmail => '이메일을 인증해 주셔서 감사합니다'; @override - String get informLetsContinue => '계속 진행하겠습니다.'; + String get informLetsContinue => '계속 진행.'; @override - String get actionContinue => '계속하기'; + String get actionContinue => '계속'; @override String get labelSearchCountry => '국가 검색'; @override String informVerificationEmailSent(String email) { - return '계정 활성화를 위한 링크가 포함된 메시지를 $email로 전송했습니다.'; + return '계정 활성화를 위한 링크가 포함된 메시지가 $email로 전송되었습니다.'; } @override - String get actionEmailNotReceived => '이메일을 받지 않으셨나요?'; + String get actionEmailNotReceived => '이메일을 받지 못하셨나요?'; @override - String get informPasswordPolicy => '비밀번호에는 다음이 포함되어야 합니다:'; + String get informPasswordPolicy => '비밀번호에는 반드시 다음을 포함해야 합니다:'; @override String get informPasswordPolicyLength => '8~25자'; @@ -206,13 +206,13 @@ class DerivAuthLocalizationsKo extends DerivAuthLocalizations { String get labelReferralCode => '추천 코드'; @override - String get actionTryAgain => '재시도하기'; + String get actionTryAgain => '재시도'; @override - String get informInvalid2FACode => '입력하신 코드가 유효하지 않습니다. 확인하고 다시 시도해 주세요.'; + String get informInvalid2FACode => '입력하신 링크가 유효하지 않습니다. 확인 및 다시 시도해 주세요.'; @override - String get informFailedAuthentication => '이메일 또는 비밀번호가 올바르지 않을 수 있습니다. 소셜 계정으로 가입하셨나요? 확인 후 다시 시도해 주세요.'; + String get informFailedAuthentication => '이메일 또는 비밀번호가 올바르지 않을 수 있습니다. 혹시 소셜 계정으로 가입하셨나요? 확인 후 다시 시도해 주시기 바랍니다.'; @override String get informDeactivatedAccount => '계정이 비활성화되었습니다.'; @@ -221,16 +221,16 @@ class DerivAuthLocalizationsKo extends DerivAuthLocalizations { String get informFailedAuthorization => '인증에 실패했습니다.'; @override - String get informInvalidResidence => '거주지가 잘못되었습니다.'; + String get informInvalidResidence => '유효하지 않은 거주지입니다.'; @override - String get informInvalidCredentials => '자격 증명이 올바르지 않습니다.'; + String get informInvalidCredentials => '유효하지 않은 자격 증명입니다.'; @override - String get informMissingOtp => '일회용 비밀번호가 없습니다.'; + String get informMissingOtp => '일회용 비밀번호가 누락되었습니다.'; @override - String get informSelfClosed => '귀하의 계좌는 닫겼습니다.'; + String get informSelfClosed => '계정이 해지되었습니다.'; @override String get informUnexpectedError => '예상하지 못한 오류가 발생했습니다.'; @@ -239,16 +239,16 @@ class DerivAuthLocalizationsKo extends DerivAuthLocalizations { String get informUnsupportedCountry => '귀하의 국가는 지원되지 않습니다.'; @override - String get informExpiredAccount => '계정이 만료되었습니다.'; + String get informExpiredAccount => '계정이 만료되었습니다'; @override - String get labelCountryConsentBrazil => '본인은 브라질 이외의 지역에서만 발행 및 제공되는 OTC 상품을 거래하기 위해 Deriv를 통한 계정을 개설하고자 하는 요청이 본인에 의해 시작되었음을 확정합니다. 본인은 Deriv가 CVM의 규제를 받지 않는다는 것을 충분히 이해하고 있으며 Deriv에 접근함으로써 외국 회사와 관계를 구축하고자 합니다.'; + String get labelCountryConsentBrazil => '본인은 브라질 이외 지역에서만 발행 및 제공되는 OTC 상품을 거래하기 위해 Deriv를 통한 계정을 개설하고자 하는 요청이 본인에 의해 시작되었음을 확정합니다. 본인은 Deriv가 CVM의 규제를 받지 않는다는 것을 충분히 이해하며 Deriv에 접근하여 외국 회사와 관계를 구축하고자 하는 것입니다.'; @override - String get informConnectionError => '연결 오류.나중에 다시 시도해 주세요.'; + String get informConnectionError => '연결 오류입니다. 나중에 다시 시도하시기 바랍니다.'; @override - String get informSwitchAccountError => '계정 전환 오류.나중에 다시 시도해 주세요.'; + String get informSwitchAccountError => '계정 전환 오류입니다. 나중에 다시 시도하시기 바랍니다.'; @override String get labelDeveloper => '개발자'; @@ -272,5 +272,5 @@ class DerivAuthLocalizationsKo extends DerivAuthLocalizations { String get warnInvalidApplicationID => '유효하지 않은 애플리케이션 ID'; @override - String get labelLanguage => 'Language'; + String get labelLanguage => '언어'; } 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 11b7fde7a..cc12b74e8 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 @@ -22,7 +22,7 @@ class DerivAuthLocalizationsPl extends DerivAuthLocalizations { String get labelLiveChat => 'Czat na żywo'; @override - String get actionGetAFreeAccount => 'Proszę założyć darmowe konto'; + String get actionSignUpForFree => 'Zarejestruj się za darmo'; @override String get actionLogin => 'Zaloguj'; @@ -64,7 +64,7 @@ class DerivAuthLocalizationsPl extends DerivAuthLocalizations { String get informInvalidEmailFormat => 'Proszę wprowadzić prawidłowy adres e-mail'; @override - String get warnPasswordLength => 'Należy wprowadzić 6-25 znaków.'; + String get warnPasswordLength => 'Wprowadź od 8 do 25 znaków.'; @override String get labelResetPassword => 'Zresetuj hasło'; @@ -272,5 +272,5 @@ class DerivAuthLocalizationsPl extends DerivAuthLocalizations { String get warnInvalidApplicationID => 'nieprawidłowe ID aplikacji'; @override - String get labelLanguage => 'Language'; + String get labelLanguage => 'Język'; } 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 bf70cca82..5fcaf3080 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 @@ -22,7 +22,7 @@ class DerivAuthLocalizationsPt extends DerivAuthLocalizations { String get labelLiveChat => 'Live chat'; @override - String get actionGetAFreeAccount => 'Obtenha uma conta gratuita'; + String get actionSignUpForFree => 'Cadastre-se gratuitamente'; @override String get actionLogin => 'Iniciar sessão'; @@ -272,5 +272,5 @@ class DerivAuthLocalizationsPt extends DerivAuthLocalizations { String get warnInvalidApplicationID => 'ID da aplicação inválido'; @override - String get labelLanguage => 'Language'; + String get labelLanguage => 'Idioma'; } 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 1ce378c8f..e56b8dcab 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 @@ -22,7 +22,7 @@ class DerivAuthLocalizationsRu extends DerivAuthLocalizations { String get labelLiveChat => 'Чат'; @override - String get actionGetAFreeAccount => 'Получите бесплатный счет'; + String get actionSignUpForFree => 'Зарегистрируйтесь бесплатно'; @override String get actionLogin => 'Вход'; @@ -64,7 +64,7 @@ class DerivAuthLocalizationsRu extends DerivAuthLocalizations { String get informInvalidEmailFormat => 'Введите действительный адрес электронной почты'; @override - String get warnPasswordLength => 'Вы должны ввести 6-25 символов.'; + String get warnPasswordLength => 'Вы должны ввести 8-25 символов.'; @override String get labelResetPassword => 'Сбросить пароль'; @@ -272,5 +272,5 @@ class DerivAuthLocalizationsRu extends DerivAuthLocalizations { String get warnInvalidApplicationID => 'неверный ID приложения'; @override - String get labelLanguage => 'Language'; + String get labelLanguage => 'Язык'; } 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 1b58aed28..a99eca270 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 @@ -22,7 +22,7 @@ class DerivAuthLocalizationsSi extends DerivAuthLocalizations { String get labelLiveChat => 'සජීවී කතාබස්'; @override - String get actionGetAFreeAccount => 'නොමිලේ ගිණුමක් ලබා ගන්න'; + String get actionSignUpForFree => 'නොමිලේ ලියාපදිංචි වන්න'; @override String get actionLogin => 'පුරනය වන්න'; @@ -64,7 +64,7 @@ class DerivAuthLocalizationsSi extends DerivAuthLocalizations { String get informInvalidEmailFormat => 'වලංගු විද්යුත් තැපැල් ලිපිනයක් ඇතුළත් කරන්න'; @override - String get warnPasswordLength => 'ඔබ අක්ෂර 6-25 ක් ඇතුළත් කළ යුතුය.'; + String get warnPasswordLength => 'ඔබ අක්ෂර 8-25 ක් ඇතුළත් කළ යුතුය.'; @override String get labelResetPassword => 'මුරපදය නැවත සකස් කරන්න'; @@ -272,5 +272,5 @@ class DerivAuthLocalizationsSi extends DerivAuthLocalizations { String get warnInvalidApplicationID => 'අවලංගු යෙදුම් හැඳුනු'; @override - String get labelLanguage => 'Language'; + String get labelLanguage => 'භාෂාව'; } 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 72eaa67a8..35f8be41f 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 @@ -22,7 +22,7 @@ class DerivAuthLocalizationsSw extends DerivAuthLocalizations { String get labelLiveChat => 'Mazungumzo mubashara'; @override - String get actionGetAFreeAccount => 'Pata akaunti ya bure'; + String get actionSignUpForFree => 'Jisajili bila malipo'; @override String get actionLogin => 'Ingia'; @@ -64,7 +64,7 @@ class DerivAuthLocalizationsSw extends DerivAuthLocalizations { String get informInvalidEmailFormat => 'Ingiza anwani halali ya barua pepe'; @override - String get warnPasswordLength => 'Unapaswa kuingiza herufi 6-25.'; + String get warnPasswordLength => 'Unapaswa kuingiza mchanganyiko wa tarakimu 8-25.'; @override String get labelResetPassword => 'Rudisha nenosiri'; @@ -272,5 +272,5 @@ class DerivAuthLocalizationsSw extends DerivAuthLocalizations { String get warnInvalidApplicationID => 'kitambulisho cha programu halali'; @override - String get labelLanguage => 'Language'; + String get labelLanguage => 'Lugha'; } 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 0a446c97d..45f5b63d1 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 @@ -22,7 +22,7 @@ class DerivAuthLocalizationsTh extends DerivAuthLocalizations { String get labelLiveChat => 'แชทสด'; @override - String get actionGetAFreeAccount => 'รับบัญชีฟรี 1 บัญชี'; + String get actionSignUpForFree => 'ลงทะเบียนได้ฟรี'; @override String get actionLogin => 'เข้าสู่ระบบ'; @@ -272,5 +272,5 @@ class DerivAuthLocalizationsTh extends DerivAuthLocalizations { String get warnInvalidApplicationID => 'รหัสไอดีแอปพลิเคชั่นไม่ถูกต้อง'; @override - String get labelLanguage => 'Language'; + String get labelLanguage => 'ภาษา'; } 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 e71109819..a43f8a4b0 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 @@ -22,7 +22,7 @@ class DerivAuthLocalizationsTr extends DerivAuthLocalizations { String get labelLiveChat => 'Canlı sohbet'; @override - String get actionGetAFreeAccount => 'Ücretsiz bir hesap edinin'; + String get actionSignUpForFree => 'Ücretsiz Üye Olun'; @override String get actionLogin => 'Giriş yap'; @@ -254,13 +254,13 @@ class DerivAuthLocalizationsTr extends DerivAuthLocalizations { String get labelDeveloper => 'Geliştirici'; @override - String get labelEndpoint => 'Endpoint'; + String get labelEndpoint => 'Bitiş noktası'; @override String get semanticEndpoint => 'Bitiş noktası'; @override - String get warnInvalidEndpoint => 'geçersiz endpoint'; + String get warnInvalidEndpoint => 'geçersiz bitiş noktası'; @override String get labelApplicationID => 'Başvuru ID'; @@ -272,5 +272,5 @@ class DerivAuthLocalizationsTr extends DerivAuthLocalizations { String get warnInvalidApplicationID => 'geçersiz başvuru ID'; @override - String get labelLanguage => 'Language'; + String get labelLanguage => 'Dil'; } 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 6ba920b0d..61bd9e96a 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 @@ -22,7 +22,7 @@ class DerivAuthLocalizationsVi extends DerivAuthLocalizations { String get labelLiveChat => 'Live chat'; @override - String get actionGetAFreeAccount => 'Nhận tài khoản miễn phí'; + String get actionSignUpForFree => 'Đăng ký miễn phí'; @override String get actionLogin => 'Đăng nhập'; @@ -64,7 +64,7 @@ class DerivAuthLocalizationsVi extends DerivAuthLocalizations { String get informInvalidEmailFormat => 'Nhập địa chỉ email hợp lệ'; @override - String get warnPasswordLength => 'Bạn nên nhập vào 6-25 ký tự.'; + String get warnPasswordLength => 'Bạn nên nhập từ 8-25 ký tự.'; @override String get labelResetPassword => 'Đặt lại mật khẩu'; @@ -272,5 +272,5 @@ class DerivAuthLocalizationsVi extends DerivAuthLocalizations { String get warnInvalidApplicationID => 'mã đăng ký không hợp lệ'; @override - String get labelLanguage => 'Language'; + String get labelLanguage => 'Ngôn ngữ'; } 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 5b1dfc072..d26dccc2d 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 @@ -22,7 +22,7 @@ class DerivAuthLocalizationsZh extends DerivAuthLocalizations { String get labelLiveChat => '即時聊天'; @override - String get actionGetAFreeAccount => '獲取免費帳戶'; + String get actionSignUpForFree => '免費註冊'; @override String get actionLogin => '登入'; @@ -272,5 +272,5 @@ class DerivAuthLocalizationsZh extends DerivAuthLocalizations { String get warnInvalidApplicationID => '無效的應用程式 ID'; @override - String get labelLanguage => 'Language'; + String get labelLanguage => '語言'; } 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 def56fef1..c694130ce 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 @@ -5,7 +5,23 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:intl/intl.dart' as intl; +import 'deriv_passkeys_localizations_ar.dart'; +import 'deriv_passkeys_localizations_bn.dart'; +import 'deriv_passkeys_localizations_de.dart'; import 'deriv_passkeys_localizations_en.dart'; +import 'deriv_passkeys_localizations_es.dart'; +import 'deriv_passkeys_localizations_fr.dart'; +import 'deriv_passkeys_localizations_it.dart'; +import 'deriv_passkeys_localizations_ko.dart'; +import 'deriv_passkeys_localizations_pl.dart'; +import 'deriv_passkeys_localizations_pt.dart'; +import 'deriv_passkeys_localizations_ru.dart'; +import 'deriv_passkeys_localizations_si.dart'; +import 'deriv_passkeys_localizations_sw.dart'; +import 'deriv_passkeys_localizations_th.dart'; +import 'deriv_passkeys_localizations_tr.dart'; +import 'deriv_passkeys_localizations_vi.dart'; +import 'deriv_passkeys_localizations_zh.dart'; /// Callers can lookup localized strings with an instance of DerivPasskeysLocalizations /// returned by `DerivPasskeysLocalizations.of(context)`. @@ -59,18 +75,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 +95,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 +103,25 @@ abstract class DerivPasskeysLocalizations { ]; /// A list of this localizations delegate's supported locales. - static const List supportedLocales = [Locale('en')]; + static const List supportedLocales = [ + Locale('ar'), + Locale('bn'), + Locale('de'), + Locale('en'), + Locale('es'), + Locale('fr'), + Locale('it'), + Locale('ko'), + Locale('pl'), + Locale('pt'), + Locale('ru'), + Locale('si'), + Locale('sw'), + Locale('th'), + Locale('tr'), + Locale('vi'), + Locale('zh') + ]; /// No description provided for @passkeyCreatedSuccessTitle. /// @@ -406,34 +436,49 @@ abstract class DerivPasskeysLocalizations { String get unable_to_process_your_request_description; } -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) => ['ar', 'bn', 'de', 'en', 'es', 'fr', 'it', 'ko', 'pl', 'pt', 'ru', 'si', 'sw', 'th', 'tr', 'vi', 'zh'].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 'ar': return DerivPasskeysLocalizationsAr(); + case 'bn': return DerivPasskeysLocalizationsBn(); + case 'de': return DerivPasskeysLocalizationsDe(); + case 'en': return DerivPasskeysLocalizationsEn(); + case 'es': return DerivPasskeysLocalizationsEs(); + case 'fr': return DerivPasskeysLocalizationsFr(); + case 'it': return DerivPasskeysLocalizationsIt(); + case 'ko': return DerivPasskeysLocalizationsKo(); + case 'pl': return DerivPasskeysLocalizationsPl(); + case 'pt': return DerivPasskeysLocalizationsPt(); + case 'ru': return DerivPasskeysLocalizationsRu(); + case 'si': return DerivPasskeysLocalizationsSi(); + case 'sw': return DerivPasskeysLocalizationsSw(); + case 'th': return DerivPasskeysLocalizationsTh(); + case 'tr': return DerivPasskeysLocalizationsTr(); + case 'vi': return DerivPasskeysLocalizationsVi(); + case 'zh': return DerivPasskeysLocalizationsZh(); } 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/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ar.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ar.dart new file mode 100644 index 000000000..e99ec19f7 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ar.dart @@ -0,0 +1,164 @@ +import 'deriv_passkeys_localizations.dart'; + +/// The translations for Arabic (`ar`). +class DerivPasskeysLocalizationsAr extends DerivPasskeysLocalizations { + DerivPasskeysLocalizationsAr([String locale = 'ar']) : super(locale); + + @override + String get passkeyCreatedSuccessTitle => 'النجاح!'; + + @override + String passkeyCreatedSuccessMessage(String platformName) { + return 'تم تأمين حسابك الآن باستخدام Passkey. قم بإدارة Passkey الخاص بك من خلال إعدادات حساب $platformName الخاص بك.'; + } + + @override + String get continueButtonText => 'استمر'; + + @override + String get unexpectedError => 'حدث خطأ غير متوقع!'; + + @override + String get unexpectedErrorDescription => 'يرجى المحاولة لاحقا.'; + + @override + String get ok => 'Ok'; + + @override + String get experienceSaferLogins => 'اختبر عمليات تسجيل دخول أكثر أمانًا'; + + @override + String get enhanceSecurity => 'الأمان المحسّن على بُعد نقرة واحدة فقط.'; + + @override + String get here => 'هنا'; + + @override + String get effortlessLogin => 'تسجيل الدخول بسهولة باستخدام Passkeys'; + + @override + String get whatArePasskeys => 'ما هي passkeys؟'; + + @override + String get whatArePasskeysDescriptionPoint1 => 'بديل آمن لكلمات المرور.'; + + @override + String get whatArePasskeysDescriptionPoint2 => 'قم بإلغاء قفل حسابك مثل هاتفك - باستخدام القياسات الحيوية أو مسح الوجه أو رقم التعريف الشخصي.'; + + @override + String get whyPasskeys => 'لماذا Passkey؟'; + + @override + String get whyPasskeysDescription1 => 'طبقة أمان إضافية.'; + + @override + String get whyPasskeysDescription2 => 'الحماية من الوصول غير المصرح به والتصيد الاحتيالي.'; + + @override + String get howToCreatePasskey => 'كيفية إنشاء passkey؟'; + + @override + String get howToCreatePasskeyDescription1 => 'انتقل إلى \"إعدادات الحساب\" على المشتقات.'; + + @override + String get howToCreatePasskeyDescription2 => 'يمكنك إنشاء Passkey واحد لكل جهاز.'; + + @override + String get whereArePasskeysSaved => 'أين يتم حفظ passkeys؟'; + + @override + String get whereArePasskeysSavedDescriptionAndroid => 'أندرويد: مدير كلمات مرور Google.'; + + @override + String get whereArePasskeysSavedDescriptionIOS => 'iOS: سلسلة مفاتيح iCloud.'; + + @override + String get whatHappensIfEmailChanged => 'ماذا يحدث إذا تم تغيير البريد الإلكتروني لحساب Deriv الخاص بي؟'; + + @override + String get whatHappensIfEmailChangedDescription1 => 'لا توجد مشكلة! لا يزال مفتاح Passkey بك يعمل.'; + + @override + String get whatHappensIfEmailChangedDescription2 => 'سجّل الدخول إلى Deriv باستخدام مفتاح Passkey لديك.'; + + @override + String get tips => 'نصائح'; + + @override + String get beforeUsingPasskeys => 'قبل استخدام Passkey'; + + @override + String get enableScreenLock => 'قم بتمكين قفل الشاشة على جهازك.'; + + @override + String get signInGoogleOrIcloud => 'قم بتسجيل الدخول إلى حساب Google أو iCloud الخاص بك.'; + + @override + String get enableBluetooth => 'قم بتمكين البلوتوث.'; + + @override + String get noPasskeyFound => 'لم يتم العثور على passkey!'; + + @override + String get noPasskeyFoundDescription => 'يرجى إنشاء passkey لاستخدام هذه الميزة.'; + + @override + String get maybeLater => 'ربما في وقت لاحق'; + + @override + String get effortlessLoginWithPasskeys => 'تسجيل الدخول بسهولة باستخدام Passkeys'; + + @override + String get learnMoreAboutPasskeys => 'تعرف على المزيد حول passkeys'; + + @override + String get noNeedToRememberPassword => 'لا حاجة لتذكر كلمة المرور'; + + @override + String get useYourBiometrics => 'أمان محسّن باستخدام القياسات الحيوية أو قفل الشاشة'; + + @override + String get syncAcrossDevices => 'المزامنة عبر الأجهزة'; + + @override + String get createPasskey => 'إنشاء Passkey'; + + @override + String get unsupportedPlatform => 'منصة غير مدعومة'; + + @override + String get storedOn => 'تم تخزينها على'; + + @override + String get lastUsed => 'آخر استخدام'; + + @override + String get rename => 'إعادة تسمية'; + + @override + String get revoke => 'إلغاء'; + + @override + String get continueTradingButtonText => 'استمر في التداول'; + + @override + String get addMorePasskeysButtonText => 'أضف المزيد من Passkeys'; + + @override + String get unableToSetupPasskey => 'تعذر إعداد مفتاح Passkey'; + + @override + String get unableToSetupPasskeyDescription => 'لقد واجهنا مشكلة أثناء إعداد Passkey الخاص بك. ربما تمت مقاطعة العملية، أو ربما انتهت مهلة الجلسة. يرجى المحاولة مرة أخرى.'; + + @override + String get passkeysOffErrorTitle => 'خدمة Passkeys غير متوفرة'; + + @override + String get never => 'أبداً'; + + @override + String get unable_to_process_your_request => 'غير قادر على معالجة طلبك'; + + @override + String get unable_to_process_your_request_description => 'نحن نواجه مشكلة مؤقتة في معالجة طلبك. يرجى المحاولة مرة أخرى لاحقًا.'; +} diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_bn.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_bn.dart new file mode 100644 index 000000000..cb67fd1b3 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_bn.dart @@ -0,0 +1,164 @@ +import 'deriv_passkeys_localizations.dart'; + +/// The translations for Bengali Bangla (`bn`). +class DerivPasskeysLocalizationsBn extends DerivPasskeysLocalizations { + DerivPasskeysLocalizationsBn([String locale = 'bn']) : super(locale); + + @override + String get passkeyCreatedSuccessTitle => 'সফলতা!'; + + @override + String passkeyCreatedSuccessMessage(String platformName) { + return 'আপনার অ্যাকাউন্ট এখন একটি পাসকি দিয়ে সুরক্ষিত৷ আপনার $platformName অ্যাকাউন্ট সেটিংসের মাধ্যমে আপনার পাসকি পরিচালনা করুন।'; + } + + @override + String get continueButtonText => 'চালিয়ে যান'; + + @override + String get unexpectedError => 'একটি অপ্রত্যাশিত ত্রুটি ঘটেছে!'; + + @override + String get unexpectedErrorDescription => 'দয়া করে পরে চেষ্টা করুন।'; + + @override + String get ok => 'Ok'; + + @override + String get experienceSaferLogins => 'নিরাপদ লগইন অভিজ্ঞতা'; + + @override + String get enhanceSecurity => 'উন্নত সুরক্ষা মাত্র এক ট্যাপ দূরে।'; + + @override + String get here => 'এখানে'; + + @override + String get effortlessLogin => 'Passkeys সাথে অনায়াসে লগইন করুন'; + + @override + String get whatArePasskeys => 'Passkeys কী কী?'; + + @override + String get whatArePasskeysDescriptionPoint1 => 'পাসওয়ার্ডের সুরক্ষিত বিকল্প।'; + + @override + String get whatArePasskeysDescriptionPoint2 => 'আপনার ফোনের মতো আপনার অ্যাকাউন্টটি আনলক করুন - বায়োমেট্রিক্স, ফেস স্ক্যান বা পিন সহ।'; + + @override + String get whyPasskeys => 'Passkeys কেন?'; + + @override + String get whyPasskeysDescription1 => 'অতিরিক্ত সুরক্ষা স্তর।'; + + @override + String get whyPasskeysDescription2 => 'অননুমোদিত অ্যাক্সেস এবং ফিশিং বিরুদ্ধে শিল্ড।'; + + @override + String get howToCreatePasskey => 'Passkey একটি পাসকি তৈরি করবেন?'; + + @override + String get howToCreatePasskeyDescription1 => 'Deriv \'অ্যাকাউন্ট সেটিংস\' এ যান।'; + + @override + String get howToCreatePasskeyDescription2 => 'Passkey প্রতি ডিভাইসে একটি পাসকি তৈরি করতে পারেন।'; + + @override + String get whereArePasskeysSaved => 'Passkeys কোথায় সংরক্ষণ করা হয়?'; + + @override + String get whereArePasskeysSavedDescriptionAndroid => 'Android: Google পাসওয়ার্ড ম্যানেজার।'; + + @override + String get whereArePasskeysSavedDescriptionIOS => 'iOS: iCloud কীচেন।'; + + @override + String get whatHappensIfEmailChanged => 'আমার Deriv অ্যাকাউন্ট ইমেইল পরিবর্তন হলে কি হবে?'; + + @override + String get whatHappensIfEmailChangedDescription1 => 'কোন সমস্যা নেই! আপনার Passkey এখনও কাজ করে।'; + + @override + String get whatHappensIfEmailChangedDescription2 => 'আপনার বিদ্যমান Passkey দিয়ে Deriv সাইন ইন করুন।'; + + @override + String get tips => 'টিপস'; + + @override + String get beforeUsingPasskeys => 'Passkeys ব্যবহারের পূর্বে'; + + @override + String get enableScreenLock => 'আপনার ডিভাইসে স্ক্রিন লক সক্ষম করুন।'; + + @override + String get signInGoogleOrIcloud => 'আপনার Google বা iCloud অ্যাকাউন্টে সাইন ইন করুন।'; + + @override + String get enableBluetooth => 'ব্লুটুথ সক্ষম করুন।'; + + @override + String get noPasskeyFound => 'কোনো Passkey পাওয়া যায়নি!'; + + @override + String get noPasskeyFoundDescription => 'এই বৈশিষ্ট্যটি ব্যবহার করতে অনুগ্রহ করে একটি Passkey তৈরি করুন।'; + + @override + String get maybeLater => 'হয়তো পরে'; + + @override + String get effortlessLoginWithPasskeys => 'Passkeys সাথে অনায়াসে লগইন করুন'; + + @override + String get learnMoreAboutPasskeys => 'Passkeys সম্পর্কে আরও জানুন'; + + @override + String get noNeedToRememberPassword => 'পাসওয়ার্ড স্মরণে রাখার দরকার নাই'; + + @override + String get useYourBiometrics => 'বায়োমেট্রিক্স বা স্ক্রিন লক সহ উন্নত সুরক্ষা '; + + @override + String get syncAcrossDevices => 'ডিভাইস জুড়ে সিঙ্ক'; + + @override + String get createPasskey => 'Passkey তৈরি'; + + @override + String get unsupportedPlatform => 'সমর্থিত প্ল্যাটফর্'; + + @override + String get storedOn => 'সংরক্ষণ হয়েছে'; + + @override + String get lastUsed => 'সর্বশেষ ব্যবহৃত'; + + @override + String get rename => 'পুনঃনামকরণ'; + + @override + String get revoke => 'প্রত্যাহার করুন'; + + @override + String get continueTradingButtonText => 'ট্রেডিং চালিয়ে যান'; + + @override + String get addMorePasskeysButtonText => 'আরও Passkeys'; + + @override + String get unableToSetupPasskey => 'Passkey সেটআপ করতে অক্ষম'; + + @override + String get unableToSetupPasskeyDescription => 'আপনার Passkey সেট আপ করার সময় আমরা একটি সমস্যার মুখোমুখি হয়েছি। প্রক্রিয়াটি বাধা দেওয়া হতে পারে, বা সেশনের সময় শেষ হতে পারে। দয়া করে আবার চেষ্টা করুন।'; + + @override + String get passkeysOffErrorTitle => 'Passkeys পরিষেবাটি উপলব্ধ নয়'; + + @override + String get never => 'কখনই'; + + @override + String get unable_to_process_your_request => 'আপনার অনুরোধ প্রক্রিয়া করতে অক্ষম'; + + @override + String get unable_to_process_your_request_description => 'আমরা আপনার অনুরোধ প্রক্রিয়াকরণে একটি অস্থায়ী সমস্যা অনুভব করছি। দয়া করে পরে আবার চেষ্টা করুন।'; +} diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_de.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_de.dart new file mode 100644 index 000000000..fb68e5a10 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_de.dart @@ -0,0 +1,164 @@ +import 'deriv_passkeys_localizations.dart'; + +/// The translations for German (`de`). +class DerivPasskeysLocalizationsDe extends DerivPasskeysLocalizations { + DerivPasskeysLocalizationsDe([String locale = 'de']) : super(locale); + + @override + String get passkeyCreatedSuccessTitle => 'Erfolg!'; + + @override + String passkeyCreatedSuccessMessage(String platformName) { + return 'Ihr Konto ist jetzt mit einem Passkey gesichert. Verwalte deinen Passkey in deinen $platformName -Kontoeinstellungen.'; + } + + @override + String get continueButtonText => 'Weiter'; + + @override + String get unexpectedError => 'Ein unerwarteter Fehler ist aufgetreten!'; + + @override + String get unexpectedErrorDescription => 'Bitte versuchen Sie es später erneut.'; + + @override + String get ok => 'Ok'; + + @override + String get experienceSaferLogins => 'Erleben Sie sicherere Logins'; + + @override + String get enhanceSecurity => 'Verbesserte Sicherheit ist nur einen Fingertipp entfernt.'; + + @override + String get here => 'hier'; + + @override + String get effortlessLogin => 'Müheloses Einloggen mit Passkeys'; + + @override + String get whatArePasskeys => 'Was sind Passkeys? '; + + @override + String get whatArePasskeysDescriptionPoint1 => 'Sichere Alternative zu Passwörtern.'; + + @override + String get whatArePasskeysDescriptionPoint2 => 'Entsperren Sie Ihr Konto wie Ihr Telefon - mit biometrischen Daten, Gesichtsscan oder PIN.'; + + @override + String get whyPasskeys => 'Warum Passkeys?'; + + @override + String get whyPasskeysDescription1 => 'Zusätzliche Sicherheitsebene.'; + + @override + String get whyPasskeysDescription2 => 'Schützt vor unbefugtem Zugriff und Phishing.'; + + @override + String get howToCreatePasskey => 'Wie erstelle ich einen Passkey?'; + + @override + String get howToCreatePasskeyDescription1 => 'Gehen Sie zu \'Kontoeinstellungen\' auf Deriv.'; + + @override + String get howToCreatePasskeyDescription2 => 'Sie können einen Passkey pro Gerät erstellen.'; + + @override + String get whereArePasskeysSaved => 'Wo werden die Passkeys gespeichert?'; + + @override + String get whereArePasskeysSavedDescriptionAndroid => 'Android: Google Passwort-Manager.'; + + @override + String get whereArePasskeysSavedDescriptionIOS => 'iOS: iCloud-Schlüsselbund.'; + + @override + String get whatHappensIfEmailChanged => 'Was passiert, wenn die E-Mail-Adresse meines Deriv-Kontos geändert wird?'; + + @override + String get whatHappensIfEmailChangedDescription1 => 'Kein Problem! Ihr Passkey funktioniert noch.'; + + @override + String get whatHappensIfEmailChangedDescription2 => 'Melden Sie sich bei Deriv mit Ihrem bestehenden Passkey an.'; + + @override + String get tips => 'Tipps'; + + @override + String get beforeUsingPasskeys => 'Vor der Benutzung von Passkeys'; + + @override + String get enableScreenLock => 'Aktiviere die Bildschirmsperre auf deinem Gerät.'; + + @override + String get signInGoogleOrIcloud => 'Melde dich bei deinem Google- oder iCloud-Konto an.'; + + @override + String get enableBluetooth => 'Aktiviere Bluetooth.'; + + @override + String get noPasskeyFound => 'Kein Passkey gefunden!'; + + @override + String get noPasskeyFoundDescription => 'Bitte erstellen Sie einen Passkey, um diese Funktion zu nutzen.'; + + @override + String get maybeLater => 'Vielleicht später'; + + @override + String get effortlessLoginWithPasskeys => 'Müheloses Einloggen mit Passkeys'; + + @override + String get learnMoreAboutPasskeys => 'Erfahren Sie mehr über Passkeys'; + + @override + String get noNeedToRememberPassword => 'Sie müssen sich kein Passwort merken'; + + @override + String get useYourBiometrics => 'Erhöhte Sicherheit durch Biometrie oder Bildschirmsperre'; + + @override + String get syncAcrossDevices => 'Geräteübergreifend synchronisieren'; + + @override + String get createPasskey => 'Passkeyerstellen'; + + @override + String get unsupportedPlatform => 'Plattform wird nicht unterstützt'; + + @override + String get storedOn => 'Gespeichert am'; + + @override + String get lastUsed => 'Zuletzt verwendet'; + + @override + String get rename => 'Umbenennen'; + + @override + String get revoke => 'Widerrufen'; + + @override + String get continueTradingButtonText => 'Handel fortsetzen'; + + @override + String get addMorePasskeysButtonText => 'Mehr Passkeys'; + + @override + String get unableToSetupPasskey => 'Passkey kann nicht eingerichtet werden'; + + @override + String get unableToSetupPasskeyDescription => 'Beim Einrichten Ihres Passkey ist ein Problem aufgetreten. Der Vorgang wurde möglicherweise unterbrochen oder die Sitzung wurde unterbrochen. Bitte versuchen Sie es erneut.'; + + @override + String get passkeysOffErrorTitle => 'Der Dienst Passkeys ist nicht verfügbar'; + + @override + String get never => 'Niemals'; + + @override + String get unable_to_process_your_request => 'Ihre Anfrage konnte nicht bearbeitet werden'; + + @override + String get unable_to_process_your_request_description => 'Wir haben ein vorübergehendes Problem bei der Bearbeitung Ihrer Anfrage. Bitte versuchen Sie es später erneut.'; +} diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_es.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_es.dart new file mode 100644 index 000000000..5a7789649 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_es.dart @@ -0,0 +1,164 @@ +import 'deriv_passkeys_localizations.dart'; + +/// The translations for Spanish Castilian (`es`). +class DerivPasskeysLocalizationsEs extends DerivPasskeysLocalizations { + DerivPasskeysLocalizationsEs([String locale = 'es']) : super(locale); + + @override + String get passkeyCreatedSuccessTitle => '¡Exitoso!'; + + @override + String passkeyCreatedSuccessMessage(String platformName) { + return 'Su cuenta está ahora protegida con una passkey. Gestione su passkey a través de la configuración de su cuenta $platformName.'; + } + + @override + String get continueButtonText => 'Continuar'; + + @override + String get unexpectedError => 'Ha ocurrido un error inesperado!'; + + @override + String get unexpectedErrorDescription => 'Por favor, inténtelo más tarde.'; + + @override + String get ok => 'Ok'; + + @override + String get experienceSaferLogins => 'Experimente inicios de sesión más seguros'; + + @override + String get enhanceSecurity => 'La seguridad mejorada está a sólo un toque de distancia.'; + + @override + String get here => 'aquí'; + + @override + String get effortlessLogin => 'Inicio de sesión sin esfuerzo con passkeys'; + + @override + String get whatArePasskeys => '¿Qué son las passkeys?'; + + @override + String get whatArePasskeysDescriptionPoint1 => 'Alternativa segura a las contraseñas.'; + + @override + String get whatArePasskeysDescriptionPoint2 => 'Desbloquee su cuenta como si fuera su teléfono: con biometría, escáner facial o PIN.'; + + @override + String get whyPasskeys => '¿Por qué passkeys?'; + + @override + String get whyPasskeysDescription1 => 'Capa de seguridad adicional.'; + + @override + String get whyPasskeysDescription2 => 'Protege contra el acceso no autorizado y la suplantación de identidad.'; + + @override + String get howToCreatePasskey => '¿Cómo crear una passkey?'; + + @override + String get howToCreatePasskeyDescription1 => 'Vaya a \"Configuración de la cuenta\" en Deriv.'; + + @override + String get howToCreatePasskeyDescription2 => 'Puede crear una passkey por dispositivo.'; + + @override + String get whereArePasskeysSaved => '¿Dónde se guardan las passkeys?'; + + @override + String get whereArePasskeysSavedDescriptionAndroid => 'Android: Gestor de contraseñas de Google.'; + + @override + String get whereArePasskeysSavedDescriptionIOS => 'iOS: Llavero de iCloud.'; + + @override + String get whatHappensIfEmailChanged => '¿Qué ocurre si se cambia el correo electrónico de mi cuenta de Deriv?'; + + @override + String get whatHappensIfEmailChangedDescription1 => 'No hay problema. Su passkey sigue funcionando.'; + + @override + String get whatHappensIfEmailChangedDescription2 => 'Inicie sesión en Deriv con su passkey actual.'; + + @override + String get tips => 'Consejos'; + + @override + String get beforeUsingPasskeys => 'Antes de usar la passkey:'; + + @override + String get enableScreenLock => 'Habilite el bloqueo de pantalla en su dispositivo.'; + + @override + String get signInGoogleOrIcloud => 'Inicie sesión en su cuenta de Google o iCloud.'; + + @override + String get enableBluetooth => 'Activar Bluetooth.'; + + @override + String get noPasskeyFound => '¡No se encontró ninguna passkey!'; + + @override + String get noPasskeyFoundDescription => 'Cree una passkey para usar esta función.'; + + @override + String get maybeLater => 'Quizás más tarde'; + + @override + String get effortlessLoginWithPasskeys => 'Inicio de sesión sin esfuerzo con passkeys'; + + @override + String get learnMoreAboutPasskeys => 'Obtenga más información sobre las passkeys'; + + @override + String get noNeedToRememberPassword => 'No es necesario recordar una contraseña'; + + @override + String get useYourBiometrics => 'Seguridad mejorada con biometría o bloqueo de pantalla'; + + @override + String get syncAcrossDevices => 'Sincronización entre dispositivos'; + + @override + String get createPasskey => 'Crear passkey'; + + @override + String get unsupportedPlatform => 'Plataforma no compatible'; + + @override + String get storedOn => 'Almacenado en'; + + @override + String get lastUsed => 'Utilizado por última vez'; + + @override + String get rename => 'Renombrar'; + + @override + String get revoke => 'Revocar'; + + @override + String get continueTradingButtonText => 'Seguir operando'; + + @override + String get addMorePasskeysButtonText => 'Añadir más Passkeys'; + + @override + String get unableToSetupPasskey => 'No se puede configurar la passkey'; + + @override + String get unableToSetupPasskeyDescription => 'Hemos encontrado un problema al configurar su passkey. Es posible que el proceso se haya interrumpido o que la sesión haya expirado. Por favor, inténtelo de nuevo.'; + + @override + String get passkeysOffErrorTitle => 'El servicio Passkeys no está disponible'; + + @override + String get never => 'Nunca'; + + @override + String get unable_to_process_your_request => 'No se puede procesar su solicitud'; + + @override + String get unable_to_process_your_request_description => 'Estamos teniendo un problema temporal al procesar tu solicitud. Vuelva a intentarlo más tarde.'; +} diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_fr.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_fr.dart new file mode 100644 index 000000000..5f0d05ca6 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_fr.dart @@ -0,0 +1,164 @@ +import 'deriv_passkeys_localizations.dart'; + +/// The translations for French (`fr`). +class DerivPasskeysLocalizationsFr extends DerivPasskeysLocalizations { + DerivPasskeysLocalizationsFr([String locale = 'fr']) : super(locale); + + @override + String get passkeyCreatedSuccessTitle => 'Effectué !'; + + @override + String passkeyCreatedSuccessMessage(String platformName) { + return 'Votre compte est désormais sécurisé par une passkey. Gérez votre passkey à partir de vos paramètres de compte $platformName.'; + } + + @override + String get continueButtonText => 'Continuer'; + + @override + String get unexpectedError => 'Une erreur inattendue s\'est produite !'; + + @override + String get unexpectedErrorDescription => 'Veuillez réessayer plus tard.'; + + @override + String get ok => 'Ok'; + + @override + String get experienceSaferLogins => 'Bénéficiez de connexions plus sûres'; + + @override + String get enhanceSecurity => 'Une sécurité renforcée est à portée de main.'; + + @override + String get here => 'ici'; + + @override + String get effortlessLogin => 'Connexion facile à l\'aide de passkeys'; + + @override + String get whatArePasskeys => 'Que sont les passkeys ?'; + + @override + String get whatArePasskeysDescriptionPoint1 => 'Alternative sécurisée aux mots de passe.'; + + @override + String get whatArePasskeysDescriptionPoint2 => 'Déverrouillez votre compte comme votre téléphone - par biométrie, scan du visage ou code PIN.'; + + @override + String get whyPasskeys => 'Pourquoi choisir des passkeys ?'; + + @override + String get whyPasskeysDescription1 => 'Couche de sécurité supplémentaire.'; + + @override + String get whyPasskeysDescription2 => 'Protège contre les accès non autorisés et le phishing.'; + + @override + String get howToCreatePasskey => 'Comment créer une passkey ?'; + + @override + String get howToCreatePasskeyDescription1 => 'Allez dans \"Paramètres du compte\" sur Deriv.'; + + @override + String get howToCreatePasskeyDescription2 => 'Vous pouvez créer une Passkey par appareil.'; + + @override + String get whereArePasskeysSaved => 'Où sont enregistrées les passkeys ?'; + + @override + String get whereArePasskeysSavedDescriptionAndroid => 'Android : Gestionnaire de mots de passe Google.'; + + @override + String get whereArePasskeysSavedDescriptionIOS => 'iOS : trousseau iCloud.'; + + @override + String get whatHappensIfEmailChanged => 'Que se passe-t-il si l\'adresse e-mail de mon compte Deriv est modifiée ?'; + + @override + String get whatHappensIfEmailChangedDescription1 => 'Pas de problème ! Votre Passkey fonctionne toujours.'; + + @override + String get whatHappensIfEmailChangedDescription2 => 'Connectez-vous à Deriv avec votre Passkey existant.'; + + @override + String get tips => 'Conseils'; + + @override + String get beforeUsingPasskeys => 'Avant d\'utiliser la passkey :'; + + @override + String get enableScreenLock => 'Activez le verrouillage de l\'écran sur votre appareil.'; + + @override + String get signInGoogleOrIcloud => 'Connectez-vous à votre compte Google ou iCloud.'; + + @override + String get enableBluetooth => 'Activer Bluetooth.'; + + @override + String get noPasskeyFound => 'Aucun passkey n\'a été trouvé !'; + + @override + String get noPasskeyFoundDescription => 'Veuillez créer une passkey pour utiliser cette fonctionnalité.'; + + @override + String get maybeLater => 'Peut-être plus tard'; + + @override + String get effortlessLoginWithPasskeys => 'Connexion facile à l\'aide de passkeys'; + + @override + String get learnMoreAboutPasskeys => 'En savoir plus sur les passkeys'; + + @override + String get noNeedToRememberPassword => 'Pas besoin de mémoriser un mot de passe'; + + @override + String get useYourBiometrics => 'Sécurité renforcée grâce à la biométrie ou au verrouillage de l\'écran'; + + @override + String get syncAcrossDevices => 'Synchronisation sur tous les appareils'; + + @override + String get createPasskey => 'Créer une passkey'; + + @override + String get unsupportedPlatform => 'Plateforme non prise en charge'; + + @override + String get storedOn => 'Stocké sur '; + + @override + String get lastUsed => 'Dernière utilisation'; + + @override + String get rename => 'Renommer'; + + @override + String get revoke => 'Révoquer'; + + @override + String get continueTradingButtonText => 'Poursuivre les opérations de trading'; + + @override + String get addMorePasskeysButtonText => 'Ajouter d\'autres Passkeys'; + + @override + String get unableToSetupPasskey => 'Impossible de configurer la Passkey'; + + @override + String get unableToSetupPasskeyDescription => 'Nous avons rencontré un problème lors de l\'établissement de votre Passkey. Il se peut que le processus ait été interrompu ou que la session ait expiré. Veuillez réessayer.'; + + @override + String get passkeysOffErrorTitle => 'Le service Passkeys est indisponible'; + + @override + String get never => 'Jamais'; + + @override + String get unable_to_process_your_request => 'Impossible de traiter votre demande'; + + @override + String get unable_to_process_your_request_description => 'Nous rencontrons un problème temporaire lors du traitement de votre demande. Veuillez réessayer ultérieurement.'; +} diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_it.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_it.dart new file mode 100644 index 000000000..82d5e22b1 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_it.dart @@ -0,0 +1,164 @@ +import 'deriv_passkeys_localizations.dart'; + +/// The translations for Italian (`it`). +class DerivPasskeysLocalizationsIt extends DerivPasskeysLocalizations { + DerivPasskeysLocalizationsIt([String locale = 'it']) : super(locale); + + @override + String get passkeyCreatedSuccessTitle => 'Fatto!'; + + @override + String passkeyCreatedSuccessMessage(String platformName) { + return 'Il tuo account è ora protetto con una passkey. Gestisci la tua passkey tramite le impostazioni del tuo account $platformName.'; + } + + @override + String get continueButtonText => 'Continua'; + + @override + String get unexpectedError => 'Si è verificato un errore imprevisto!'; + + @override + String get unexpectedErrorDescription => 'Riprova più tardi.'; + + @override + String get ok => 'Ok'; + + @override + String get experienceSaferLogins => 'Sperimenta accessi più sicuri'; + + @override + String get enhanceSecurity => 'Per una maggiore sicurezza basta un tocco.'; + + @override + String get here => 'qui'; + + @override + String get effortlessLogin => 'Accesso semplice con passkeys'; + + @override + String get whatArePasskeys => 'Cosa sono le passkey?'; + + @override + String get whatArePasskeysDescriptionPoint1 => 'Un\'alternativa sicura alle password.'; + + @override + String get whatArePasskeysDescriptionPoint2 => 'Sblocca il suo conto come il suo telefono - con la biometria, la scansione del volto o il PIN.'; + + @override + String get whyPasskeys => 'Perché la passkey?'; + + @override + String get whyPasskeysDescription1 => 'Un ulteriore livello di sicurezza.'; + + @override + String get whyPasskeysDescription2 => 'Protegge dagli accessi non autorizzati e dal phishing.'; + + @override + String get howToCreatePasskey => 'Come creare una passkey?'; + + @override + String get howToCreatePasskeyDescription1 => 'Vada a \'Impostazioni del conto\' su Deriv.'; + + @override + String get howToCreatePasskeyDescription2 => 'Può creare una sola Passkey per dispositivo.'; + + @override + String get whereArePasskeysSaved => 'Dove vengono salvate la passkey?'; + + @override + String get whereArePasskeysSavedDescriptionAndroid => 'Android: Gestore di password di Google.'; + + @override + String get whereArePasskeysSavedDescriptionIOS => 'iOS: Portachiavi iCloud.'; + + @override + String get whatHappensIfEmailChanged => 'Cosa succede se l\'email del mio account Deriv viene modificata?'; + + @override + String get whatHappensIfEmailChangedDescription1 => 'Nessun problema! La sua Passkey funziona ancora.'; + + @override + String get whatHappensIfEmailChangedDescription2 => 'Acceda a Deriv con la sua Passkey esistente.'; + + @override + String get tips => 'Suggerimento'; + + @override + String get beforeUsingPasskeys => 'Prima di utilizzare la passkey'; + + @override + String get enableScreenLock => 'Abilita il blocco dello schermo sul tuo dispositivo.'; + + @override + String get signInGoogleOrIcloud => 'Accedi al tuo account Google o iCloud.'; + + @override + String get enableBluetooth => 'Abilita il Bluetooth.'; + + @override + String get noPasskeyFound => 'Nessuna passkey trovata!'; + + @override + String get noPasskeyFoundDescription => 'Crea una passkey per utilizzare questa funzione.'; + + @override + String get maybeLater => 'Forse più tardi'; + + @override + String get effortlessLoginWithPasskeys => 'Accesso semplice con passkeys'; + + @override + String get learnMoreAboutPasskeys => 'Scopri di più sulle passkey'; + + @override + String get noNeedToRememberPassword => 'Non è necessario ricordare una password'; + + @override + String get useYourBiometrics => 'Sicurezza avanzata con biometria o blocco dello schermo'; + + @override + String get syncAcrossDevices => 'Sincronizzazione su più dispositivi'; + + @override + String get createPasskey => 'Crea Passkey'; + + @override + String get unsupportedPlatform => 'Piattaforma non supportata'; + + @override + String get storedOn => 'Memorizzato su'; + + @override + String get lastUsed => 'Ultima volta'; + + @override + String get rename => 'Rinomina'; + + @override + String get revoke => 'Revoca'; + + @override + String get continueTradingButtonText => 'Continua il trading'; + + @override + String get addMorePasskeysButtonText => 'Più passkeys'; + + @override + String get unableToSetupPasskey => 'Impossibile impostare la Passkey'; + + @override + String get unableToSetupPasskeyDescription => 'Abbiamo riscontrato un problema durante la configurazione della sua Passkey. Il processo potrebbe essere stato interrotto, oppure la sessione è scaduta. Provi di nuovo.'; + + @override + String get passkeysOffErrorTitle => 'Il servizio Passkeys non è disponibile'; + + @override + String get never => 'Mai'; + + @override + String get unable_to_process_your_request => 'Impossibile elaborare la tua richiesta'; + + @override + String get unable_to_process_your_request_description => 'Stiamo riscontrando un problema temporaneo nell\'elaborazione della tua richiesta. Riprova più tardi.'; +} diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ko.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ko.dart new file mode 100644 index 000000000..9187c63c8 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ko.dart @@ -0,0 +1,164 @@ +import 'deriv_passkeys_localizations.dart'; + +/// The translations for Korean (`ko`). +class DerivPasskeysLocalizationsKo extends DerivPasskeysLocalizations { + DerivPasskeysLocalizationsKo([String locale = 'ko']) : super(locale); + + @override + String get passkeyCreatedSuccessTitle => '성공!'; + + @override + String passkeyCreatedSuccessMessage(String platformName) { + return '이제 여러분의 계정은 passkey로 보호됩니다. $platformName 계정 설정을 통해 passkey를 관리하세요.'; + } + + @override + String get continueButtonText => '계속'; + + @override + String get unexpectedError => '예상하지 못한 오류가 발생했습니다!'; + + @override + String get unexpectedErrorDescription => '나중에 다시 시도해 주시기 바랍니다.'; + + @override + String get ok => '확인'; + + @override + String get experienceSaferLogins => '로그인이 더 안전합니다'; + + @override + String get enhanceSecurity => '탭 한 번으로 보안을 강화할 수 있습니다.'; + + @override + String get here => '여기'; + + @override + String get effortlessLogin => 'Passkeys로 간편한 로그인'; + + @override + String get whatArePasskeys => 'Passkeys란 무엇인가요?'; + + @override + String get whatArePasskeysDescriptionPoint1 => '비밀번호를 대체할 수 있는 안전한 비밀번호.'; + + @override + String get whatArePasskeysDescriptionPoint2 => '생체 인식, 얼굴 스캔 또는 PIN을 사용하여 휴대폰처럼 계정을 잠금해제하세요.'; + + @override + String get whyPasskeys => 'Passkeys를 사용하는 이유는 무엇인가요?'; + + @override + String get whyPasskeysDescription1 => '추가 보안 계층.'; + + @override + String get whyPasskeysDescription2 => '무단 접근 및 피싱으로부터 보호합니다.'; + + @override + String get howToCreatePasskey => 'Passkey는 어떻게 생성할 수 있나요?'; + + @override + String get howToCreatePasskeyDescription1 => 'Deriv의 \'계정 설정\'으로 이동하세요.'; + + @override + String get howToCreatePasskeyDescription2 => '기기당 하나의 Passkey를 만들 수 있습니다.'; + + @override + String get whereArePasskeysSaved => 'Passkeys는 어디에 저장되나요?'; + + @override + String get whereArePasskeysSavedDescriptionAndroid => 'Android: Google 비밀번호 관리자.'; + + @override + String get whereArePasskeysSavedDescriptionIOS => 'iOS: iCloud 키체인.'; + + @override + String get whatHappensIfEmailChanged => '제 Deriv 계정 이메일이 변경되면 어떻게 되나요?'; + + @override + String get whatHappensIfEmailChangedDescription1 => '괜찮습니다! 귀하의 Passkey를 그대로 사용하실 수 있습니다.'; + + @override + String get whatHappensIfEmailChangedDescription2 => '기존 Passkey를 사용하여 Deriv에 로그인하세요.'; + + @override + String get tips => '팁'; + + @override + String get beforeUsingPasskeys => 'Passkeys를 사용하기 전에'; + + @override + String get enableScreenLock => '기기에서 화면 잠금을 활성화하세요.'; + + @override + String get signInGoogleOrIcloud => 'Google 또는 iCloud 계정으로 로그인하세요.'; + + @override + String get enableBluetooth => '블루투스를 활성화하세요.'; + + @override + String get noPasskeyFound => 'Passkey를 찾을 수 없습니다!'; + + @override + String get noPasskeyFoundDescription => '이 기능을 사용하기 위해서는 passkey를 생성하시기 바랍니다.'; + + @override + String get maybeLater => '다음으로 미루겠습니다'; + + @override + String get effortlessLoginWithPasskeys => 'Passkeys를 통한 간단한 로그인'; + + @override + String get learnMoreAboutPasskeys => 'Passkeys에 대해 더 알아보기'; + + @override + String get noNeedToRememberPassword => '비밀번호를 기억하지 않아도 됩니다'; + + @override + String get useYourBiometrics => '생체인식 또는 화면 잠금을 통한 보안 강화'; + + @override + String get syncAcrossDevices => '기기 간 동기화'; + + @override + String get createPasskey => 'Passkey 생성'; + + @override + String get unsupportedPlatform => '지원되지 않는 플랫폼입니다'; + + @override + String get storedOn => '저장 위치'; + + @override + String get lastUsed => '최근 사용'; + + @override + String get rename => '이름 변경'; + + @override + String get revoke => '철회'; + + @override + String get continueTradingButtonText => '계속 거래하기'; + + @override + String get addMorePasskeysButtonText => '더 많은 Passkeys'; + + @override + String get unableToSetupPasskey => 'Passkey를 설정할 수 없습니다'; + + @override + String get unableToSetupPasskeyDescription => 'Passkey를 설정하는 동안 문제가 발생했습니다. 프로세스가 중단되었거나 세션 시간이 초과되었을 수 있습니다. 다시 시도해 주시기 바랍니다.'; + + @override + String get passkeysOffErrorTitle => 'Passkeys 서비스를 이용할 수 없습니다'; + + @override + String get never => '절대 안 돼'; + + @override + String get unable_to_process_your_request => '요청을 처리할 수 없습니다'; + + @override + String get unable_to_process_your_request_description => '요청을 처리하는 동안 일시적인 문제가 발생했습니다.나중에 다시 시도하세요.'; +} diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_pl.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_pl.dart new file mode 100644 index 000000000..9b0255869 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_pl.dart @@ -0,0 +1,164 @@ +import 'deriv_passkeys_localizations.dart'; + +/// The translations for Polish (`pl`). +class DerivPasskeysLocalizationsPl extends DerivPasskeysLocalizations { + DerivPasskeysLocalizationsPl([String locale = 'pl']) : super(locale); + + @override + String get passkeyCreatedSuccessTitle => 'Udało się!'; + + @override + String passkeyCreatedSuccessMessage(String platformName) { + return 'Twoje konto jest teraz zabezpieczone passkey. Zarządzaj swoim passkey za pomocą ustawień konta $platformName.'; + } + + @override + String get continueButtonText => 'Kontynuuj'; + + @override + String get unexpectedError => 'Wystąpił nieoczekiwany błąd!'; + + @override + String get unexpectedErrorDescription => 'Spróbuj później.'; + + @override + String get ok => 'Ok'; + + @override + String get experienceSaferLogins => 'Doświadcz bezpieczniejszych logowań'; + + @override + String get enhanceSecurity => 'Zwiększone bezpieczeństwo jest na wyciągnięcie ręki.'; + + @override + String get here => 'tutaj'; + + @override + String get effortlessLogin => 'Łatwe logowanie za pomocą passkeys'; + + @override + String get whatArePasskeys => 'Czym są passkeys?'; + + @override + String get whatArePasskeysDescriptionPoint1 => 'Bezpieczna alternatywa dla haseł.'; + + @override + String get whatArePasskeysDescriptionPoint2 => 'Odblokuj swoje konto jak telefon - za pomocą danych biometrycznych, skanowania twarzy lub PIN-u.'; + + @override + String get whyPasskeys => 'Dlaczego Passkeys?'; + + @override + String get whyPasskeysDescription1 => 'Dodatkowa warstwa bezpieczeństwa.'; + + @override + String get whyPasskeysDescription2 => 'Chroni przed nieautoryzowanym dostępem i phishingiem.'; + + @override + String get howToCreatePasskey => 'Jak utworzyć passkey?'; + + @override + String get howToCreatePasskeyDescription1 => 'Przejdź do ‘Ustawień konta’ na Deriv.'; + + @override + String get howToCreatePasskeyDescription2 => 'Możesz utworzyć jedno hasło na urządzenie.'; + + @override + String get whereArePasskeysSaved => 'Gdzie są zapisywane passkeys?'; + + @override + String get whereArePasskeysSavedDescriptionAndroid => 'Android: menedżer haseł Google.'; + + @override + String get whereArePasskeysSavedDescriptionIOS => 'iOS: pęk kluczy iCloud.'; + + @override + String get whatHappensIfEmailChanged => 'Co się stanie, jeśli e-mail mojego konta Deriv zostanie zmieniony?'; + + @override + String get whatHappensIfEmailChangedDescription1 => 'Bez problemu! Twój Passkey nadal działa.'; + + @override + String get whatHappensIfEmailChangedDescription2 => 'Zaloguj się do Deriv przy użyciu istniejącego Passkey.'; + + @override + String get tips => 'Porady'; + + @override + String get beforeUsingPasskeys => 'Przed użyciem passkeys'; + + @override + String get enableScreenLock => 'Włącz blokadę ekranu na swoim urządzeniu.'; + + @override + String get signInGoogleOrIcloud => 'Zaloguj się na swoje konto Google lub iCloud.'; + + @override + String get enableBluetooth => 'Włącz Bluetooth.'; + + @override + String get noPasskeyFound => 'Nie znaleziono passkey!'; + + @override + String get noPasskeyFoundDescription => 'Aby korzystać z tej funkcji, utwórz passkey.'; + + @override + String get maybeLater => 'Może później'; + + @override + String get effortlessLoginWithPasskeys => 'Łatwe logowanie za pomocą passkeys'; + + @override + String get learnMoreAboutPasskeys => 'Dowiedz się więcej o passkeys'; + + @override + String get noNeedToRememberPassword => 'Nie ma potrzeby zapamiętywania hasła'; + + @override + String get useYourBiometrics => 'Zwiększone bezpieczeństwo dzięki biometrii lub blokadzie ekranu'; + + @override + String get syncAcrossDevices => 'Synchronizacja między urządzeniami'; + + @override + String get createPasskey => 'Utwórz passkey'; + + @override + String get unsupportedPlatform => 'Nieobsługiwana platforma'; + + @override + String get storedOn => 'Przechowywane na'; + + @override + String get lastUsed => 'Ostatnio używane'; + + @override + String get rename => 'Zmień nazwę'; + + @override + String get revoke => 'Odwołać'; + + @override + String get continueTradingButtonText => 'Kontynuuj handlowanie'; + + @override + String get addMorePasskeysButtonText => 'Więcej passkeys'; + + @override + String get unableToSetupPasskey => 'Nie można ustawić passkey'; + + @override + String get unableToSetupPasskeyDescription => 'Napotkaliśmy problem podczas konfigurowania Passkey. Proces mógł zostać przerwany lub upłynął limit czasu sesji. Proszę spróbuj ponownie.'; + + @override + String get passkeysOffErrorTitle => 'Usługa Passkeys jest niedostępna'; + + @override + String get never => 'Nigdy'; + + @override + String get unable_to_process_your_request => 'Nie można przetworzyć żądania'; + + @override + String get unable_to_process_your_request_description => 'Mamy tymczasowy problem z przetwarzaniem Twojej prośby. Spróbuj ponownie później.'; +} diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_pt.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_pt.dart new file mode 100644 index 000000000..d6d15b89a --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_pt.dart @@ -0,0 +1,164 @@ +import 'deriv_passkeys_localizations.dart'; + +/// The translations for Portuguese (`pt`). +class DerivPasskeysLocalizationsPt extends DerivPasskeysLocalizations { + DerivPasskeysLocalizationsPt([String locale = 'pt']) : super(locale); + + @override + String get passkeyCreatedSuccessTitle => 'Concluído com sucesso!'; + + @override + String passkeyCreatedSuccessMessage(String platformName) { + return 'A sua conta está agora protegida com uma chave de acesso. Pode fazer a gestão da sua chave de acesso através das definições da sua conta $platformName.'; + } + + @override + String get continueButtonText => 'Continuar'; + + @override + String get unexpectedError => 'Ocorreu um erro inesperado!'; + + @override + String get unexpectedErrorDescription => 'Por favor, tente novamente mais tarde.'; + + @override + String get ok => 'Ok'; + + @override + String get experienceSaferLogins => 'Experimente inícios de sessão mais seguros'; + + @override + String get enhanceSecurity => 'Segurança reforçada à distância de um clique.'; + + @override + String get here => 'aqui'; + + @override + String get effortlessLogin => 'Início de sessão simplificado com as chaves de acesso'; + + @override + String get whatArePasskeys => 'O que são chaves de acesso?'; + + @override + String get whatArePasskeysDescriptionPoint1 => 'Alternativa segura às palavras-passe.'; + + @override + String get whatArePasskeysDescriptionPoint2 => 'Desbloqueie a sua conta com a mesma facilidade que desbloqueia o seu telemóvel - seja através de biometria, reconhecimento facial ou introdução de PIN.'; + + @override + String get whyPasskeys => 'Porque é que se utilizam chaves de acesso?'; + + @override + String get whyPasskeysDescription1 => 'Camada de segurança adicional.'; + + @override + String get whyPasskeysDescription2 => 'Protege contra o acesso não autorizado e phishing.'; + + @override + String get howToCreatePasskey => 'Como criar uma chave de acesso?'; + + @override + String get howToCreatePasskeyDescription1 => 'Aceda às \"Definições de conta\" na Deriv.'; + + @override + String get howToCreatePasskeyDescription2 => 'Pode criar uma passkey por dispositivo.'; + + @override + String get whereArePasskeysSaved => 'Onde são guardadas as chaves de acesso?'; + + @override + String get whereArePasskeysSavedDescriptionAndroid => 'Android: Gestor de palavras-passe do Google.'; + + @override + String get whereArePasskeysSavedDescriptionIOS => 'iOS: iCloud keychain.'; + + @override + String get whatHappensIfEmailChanged => 'O que acontece se o e-mail da minha conta Deriv for alterado?'; + + @override + String get whatHappensIfEmailChangedDescription1 => 'Não tem problema! A sua passkey ainda funciona.'; + + @override + String get whatHappensIfEmailChangedDescription2 => 'Inicie sessão na Deriv com a sua passkey.'; + + @override + String get tips => 'Dicas'; + + @override + String get beforeUsingPasskeys => 'Antes de utilizar as chaves de acesso'; + + @override + String get enableScreenLock => 'Ative o bloqueio de ecrã no seu dispositivo.'; + + @override + String get signInGoogleOrIcloud => 'Inicie sessão na sua conta Google ou iCloud.'; + + @override + String get enableBluetooth => 'Ativar Bluetooth.'; + + @override + String get noPasskeyFound => 'Não foi encontrada nenhuma chave de acesso!'; + + @override + String get noPasskeyFoundDescription => 'Por favor, crie uma chave de acesso para utilizar esta funcionalidade.'; + + @override + String get maybeLater => 'Talvez mais tarde'; + + @override + String get effortlessLoginWithPasskeys => 'Início de sessão simplificado com as chaves de acesso'; + + @override + String get learnMoreAboutPasskeys => 'Saiba mais sobre as chaves de acesso'; + + @override + String get noNeedToRememberPassword => 'Não memorizar a palavra-passe'; + + @override + String get useYourBiometrics => 'Segurança reforçada com dados biométricos ou bloqueio do ecrã'; + + @override + String get syncAcrossDevices => 'Sincronizar entre dispositivos'; + + @override + String get createPasskey => 'Crie passkey'; + + @override + String get unsupportedPlatform => 'Plataforma não suportada'; + + @override + String get storedOn => 'Armazenado em'; + + @override + String get lastUsed => 'Última utilização'; + + @override + String get rename => 'Renomear'; + + @override + String get revoke => 'Revogar'; + + @override + String get continueTradingButtonText => 'Continue a negociar'; + + @override + String get addMorePasskeysButtonText => 'Adicionar Mais Passkeys'; + + @override + String get unableToSetupPasskey => 'Não é possível configurar a passkey'; + + @override + String get unableToSetupPasskeyDescription => 'Encontramos um problema ao configurar sua passkey. O processo pode ter sido interrompido ou a sessão expirou. Por favor, tente novamente.'; + + @override + String get passkeysOffErrorTitle => 'O serviço de Passkeys não está disponível'; + + @override + String get never => 'Nunca'; + + @override + String get unable_to_process_your_request => 'Não foi possível processar sua solicitação'; + + @override + String get unable_to_process_your_request_description => 'Estamos enfrentando um problema temporário no processamento de sua solicitação. Por favor, tente novamente mais tarde.'; +} diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ru.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ru.dart new file mode 100644 index 000000000..a3bc588c9 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ru.dart @@ -0,0 +1,164 @@ +import 'deriv_passkeys_localizations.dart'; + +/// The translations for Russian (`ru`). +class DerivPasskeysLocalizationsRu extends DerivPasskeysLocalizations { + DerivPasskeysLocalizationsRu([String locale = 'ru']) : super(locale); + + @override + String get passkeyCreatedSuccessTitle => 'Готово!'; + + @override + String passkeyCreatedSuccessMessage(String platformName) { + return 'Теперь ваша учетная запись защищена passkey. Управляйте своим passkey через настройки учетной записи $platformName.'; + } + + @override + String get continueButtonText => 'Продолжить'; + + @override + String get unexpectedError => 'Произошла неожиданная ошибка!'; + + @override + String get unexpectedErrorDescription => 'Попробуйте позже.'; + + @override + String get ok => 'Ok'; + + @override + String get experienceSaferLogins => 'Испытайте более безопасный вход в систему'; + + @override + String get enhanceSecurity => 'Повышенная безопасность — всего лишь одно касание.'; + + @override + String get here => 'здесь'; + + @override + String get effortlessLogin => 'Легкий вход в систему с помощью passkeys'; + + @override + String get whatArePasskeys => 'Что такое passkeys?'; + + @override + String get whatArePasskeysDescriptionPoint1 => 'Безопасная альтернатива паролям.'; + + @override + String get whatArePasskeysDescriptionPoint2 => 'Разблокируйте свою учетную запись, как телефон — с помощью биометрии, сканирования лица или PIN-кода.'; + + @override + String get whyPasskeys => 'Зачем нужны passkeys?'; + + @override + String get whyPasskeysDescription1 => 'Дополнительный уровень безопасности.'; + + @override + String get whyPasskeysDescription2 => 'Защищает от несанкционированного доступа и фишинга.'; + + @override + String get howToCreatePasskey => 'Как создать passkey?'; + + @override + String get howToCreatePasskeyDescription1 => 'Перейдите в ‘Настройки учетной записи’ на Deriv.'; + + @override + String get howToCreatePasskeyDescription2 => 'Вы можете создать один passkey для каждого устройства.'; + + @override + String get whereArePasskeysSaved => 'Где хранятся passkeys?'; + + @override + String get whereArePasskeysSavedDescriptionAndroid => 'Android: Менеджер паролей Google.'; + + @override + String get whereArePasskeysSavedDescriptionIOS => 'iOS: связка ключей iCloud.'; + + @override + String get whatHappensIfEmailChanged => 'Что произойдет, если адрес электронной почты моей учетной записи Deriv изменится?'; + + @override + String get whatHappensIfEmailChangedDescription1 => 'Нет проблем! Ваш passkey по-прежнему работает.'; + + @override + String get whatHappensIfEmailChangedDescription2 => 'Войдите в Deriv, используя существующий passkey.'; + + @override + String get tips => 'Советы'; + + @override + String get beforeUsingPasskeys => 'Перед использованием passkey'; + + @override + String get enableScreenLock => 'Включите блокировку экрана на своем устройстве.'; + + @override + String get signInGoogleOrIcloud => 'Войдите в свою учетную запись Google или iCloud.'; + + @override + String get enableBluetooth => 'Включите Bluetooth.'; + + @override + String get noPasskeyFound => 'Passkey не найден!'; + + @override + String get noPasskeyFoundDescription => 'Чтобы использовать эту функцию, создайте Passkey.'; + + @override + String get maybeLater => 'Может быть позже'; + + @override + String get effortlessLoginWithPasskeys => 'Легкий вход в систему с помощью passkeys'; + + @override + String get learnMoreAboutPasskeys => 'Узнайте больше о passkeys'; + + @override + String get noNeedToRememberPassword => 'Нет необходимости запоминать пароль'; + + @override + String get useYourBiometrics => 'Повышенная безопасность с помощью биометрии или блокировки экрана'; + + @override + String get syncAcrossDevices => 'Синхронизация между устройствами'; + + @override + String get createPasskey => 'Создать passkey'; + + @override + String get unsupportedPlatform => 'Неподдерживаемая платформа'; + + @override + String get storedOn => 'Хранится в'; + + @override + String get lastUsed => 'Недавние'; + + @override + String get rename => 'Переименовать'; + + @override + String get revoke => 'Отменить'; + + @override + String get continueTradingButtonText => 'Продолжить торговлю'; + + @override + String get addMorePasskeysButtonText => 'Больше passkeys'; + + @override + String get unableToSetupPasskey => 'Невозможно настроить passkey'; + + @override + String get unableToSetupPasskeyDescription => 'Мы столкнулись с проблемой при настройке вашего passkey. Возможно, процесс был прерван, или сессия завершилась по таймеру. Пожалуйста, попробуйте еще раз.'; + + @override + String get passkeysOffErrorTitle => 'Служба Passkeys недоступна'; + + @override + String get never => 'Никогда'; + + @override + String get unable_to_process_your_request => 'Не удалось обработать ваш запрос'; + + @override + String get unable_to_process_your_request_description => 'При обработке вашего запроса возникла временная проблема. Пожалуйста, повторите попытку позже.'; +} diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_si.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_si.dart new file mode 100644 index 000000000..a6e443611 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_si.dart @@ -0,0 +1,164 @@ +import 'deriv_passkeys_localizations.dart'; + +/// The translations for Sinhala Sinhalese (`si`). +class DerivPasskeysLocalizationsSi extends DerivPasskeysLocalizations { + DerivPasskeysLocalizationsSi([String locale = 'si']) : super(locale); + + @override + String get passkeyCreatedSuccessTitle => 'සාර්ථකයි!'; + + @override + String passkeyCreatedSuccessMessage(String platformName) { + return 'ඔබගේ ගිණුම දැන් Passkey සුරක්ෂිත කර ඇත. ඔබේ $platformName ගිණු ම් සැකසුම් හරහා ඔබගේ passkey කළමනාකරණය කරන්න.'; + } + + @override + String get continueButtonText => 'ඉදිරියට යන්න'; + + @override + String get unexpectedError => 'අනපේක්ෂිත දෝෂයක් ඇති විය!'; + + @override + String get unexpectedErrorDescription => 'කරුණාකර පසුව උත්සාහ කරන්න.'; + + @override + String get ok => 'Ok'; + + @override + String get experienceSaferLogins => 'ආරක්ෂිත පිවිසුම් අත්විඳින්න'; + + @override + String get enhanceSecurity => 'වැඩි දියුණු කළ ආරක්ෂාව එක ටැප් එකක් දුරින්.'; + + @override + String get here => 'මෙන්න'; + + @override + String get effortlessLogin => 'Passkeys සමඟ වෙහෙස නොබලා පිවිසීම'; + + @override + String get whatArePasskeys => 'Passkeys යනු කුමක්ද?'; + + @override + String get whatArePasskeysDescriptionPoint1 => 'මුරපද සඳහා ආරක්ෂිත විකල්පයක්.'; + + @override + String get whatArePasskeysDescriptionPoint2 => 'ජෛවමිතික, මුහුණු ස්කෑන් කිරීම හෝ PIN සමඟ ඔබේ දුරකථනයයේ අකාරයටම ඔබේ ගිණුම අගුළු හරින්න.'; + + @override + String get whyPasskeys => 'Passkeys අවශ්‍ය වන්නේ ඇයි?'; + + @override + String get whyPasskeysDescription1 => 'අමතර ආරක්ෂක ස්ථරය.'; + + @override + String get whyPasskeysDescription2 => 'අනවසර ප්‍රවේශයෙන් සහ තතුබෑම්වලින් ආරක්ෂා කරයි.'; + + @override + String get howToCreatePasskey => 'නිර්මාණය Passkey කෙසේද?'; + + @override + String get howToCreatePasskeyDescription1 => 'Deriv හි \'ගිණුම් සැකසීම්\' වෙත යන්න.'; + + @override + String get howToCreatePasskeyDescription2 => 'ඔබට එක් උපාංගයකට එක් passkey එකක් සෑදිය හැක.'; + + @override + String get whereArePasskeysSaved => 'Passkey සුරකින්නේ කොහේද?'; + + @override + String get whereArePasskeysSavedDescriptionAndroid => 'Android: Google මුරපද කළමනාකරු.'; + + @override + String get whereArePasskeysSavedDescriptionIOS => 'iOS: iCloud යතුරු දාමය.'; + + @override + String get whatHappensIfEmailChanged => 'මගේ Deriv ගිණුමේ විද්යුත් තැපෑල වෙනස් කළහොත් කුමක් සිදුවේද?'; + + @override + String get whatHappensIfEmailChangedDescription1 => 'ප්‍රශ්නයක් නැත! ඔබේ passkey එක තවමත් ක්‍රියා කරයි.'; + + @override + String get whatHappensIfEmailChangedDescription2 => 'ඔබේ පවතින passkey සමඟින් Deriv වෙත පුරන්න.'; + + @override + String get tips => 'ඉඟි'; + + @override + String get beforeUsingPasskeys => 'Passkey භාවිතා කිරීමට පෙර'; + + @override + String get enableScreenLock => 'ඔබේ උපාංගයේ තිර අගුල සක්රීය කරන්න.'; + + @override + String get signInGoogleOrIcloud => 'ඔබේ Google හෝ iCloud ගිණුමට පිවිසෙන්න.'; + + @override + String get enableBluetooth => 'බ්ලූටූත් සක්රීය කරන්න.'; + + @override + String get noPasskeyFound => 'Passkey සොයාගත නොමැත!'; + + @override + String get noPasskeyFoundDescription => 'කරුණාකර මෙම විශේෂාංගය භාවිතා කිරීම සඳහා passkey යන්නක් සාදන්න.'; + + @override + String get maybeLater => 'සමහර විට පසුව'; + + @override + String get effortlessLoginWithPasskeys => 'Passkeys සමඟ වෙහෙස නොබලා පිවිසීම'; + + @override + String get learnMoreAboutPasskeys => 'Passkeys ගැන වැඩි විස්තර දැනගන්න'; + + @override + String get noNeedToRememberPassword => 'මුරපදයක් මතක තබා ගැනීමට අවශ්ය නැත'; + + @override + String get useYourBiometrics => 'ජෛවමිතික හෝ තිර අගුල සමඟ වැඩි දියුණු කළ ආරක්ෂාව'; + + @override + String get syncAcrossDevices => 'උපාංග හරහා සමමුහූර්ත කරන්න'; + + @override + String get createPasskey => 'Passkey සාදන්න'; + + @override + String get unsupportedPlatform => 'සහාය නොදක්වන වේදිකාව'; + + @override + String get storedOn => 'ගබඩා කර ඇත'; + + @override + String get lastUsed => 'අවසන් වරට භාවිත කළේ'; + + @override + String get rename => 'නැවත නම් කරන්න'; + + @override + String get revoke => 'අවලංගු කරන්න'; + + @override + String get continueTradingButtonText => 'දිගටම ගනුදෙනු කරන්න'; + + @override + String get addMorePasskeysButtonText => 'තවත් passkeys එක් කරන්න'; + + @override + String get unableToSetupPasskey => 'Passkey සැකසීමට නොහැකි විය'; + + @override + String get unableToSetupPasskeyDescription => 'ඔබගේ passkey සැකසීමේදී අපට ගැටලුවක් ඇති විය. ක්රියාවලියට බාධා ඇති විය හැකිය, නැතහොත් සැසිය කාලය අවසන් විය හැකිය. කරුණාකර නැවත උත්සාහ කරන්න.'; + + @override + String get passkeysOffErrorTitle => 'Passkeys සේවාව ලබා ගත නොහැක'; + + @override + String get never => 'කවදාවත්'; + + @override + String get unable_to_process_your_request => 'ඔබගේ ඉල්ලීම සැකසීමට නොහැකි විය'; + + @override + String get unable_to_process_your_request_description => 'ඔබගේ ඉල්ලීම සැකසීමේදී අපට තාවකාලික ගැටළුවක් අත්විඳිනවා. කරුණාකර පසුව නැවත උත්සාහ කරන්න.'; +} diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_sw.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_sw.dart new file mode 100644 index 000000000..d60317234 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_sw.dart @@ -0,0 +1,164 @@ +import 'deriv_passkeys_localizations.dart'; + +/// The translations for Swahili (`sw`). +class DerivPasskeysLocalizationsSw extends DerivPasskeysLocalizations { + DerivPasskeysLocalizationsSw([String locale = 'sw']) : super(locale); + + @override + String get passkeyCreatedSuccessTitle => 'Mafanikio!'; + + @override + String passkeyCreatedSuccessMessage(String platformName) { + return 'Akaunti yako sasa imehifadhiwa na passkey. Dhibiti passkey yako kupi tia mipangilio yako ya akaunti ya $platformName.'; + } + + @override + String get continueButtonText => 'Endelea'; + + @override + String get unexpectedError => 'Hitilafu yasiyotarajiwa!'; + + @override + String get unexpectedErrorDescription => 'Tafadhali jaribu tena.'; + + @override + String get ok => 'Ok'; + + @override + String get experienceSaferLogins => 'Pata kuingia salama'; + + @override + String get enhanceSecurity => 'Usalama ulioimarishwa uko karibu sana, unahitaji kubofya tu.'; + + @override + String get here => 'hapa'; + + @override + String get effortlessLogin => 'Kuingia bila juhudi kwa passkeys'; + + @override + String get whatArePasskeys => 'Nini passkeys?'; + + @override + String get whatArePasskeysDescriptionPoint1 => 'Njia mbadala ya kufanya nenosiri kuwa salama.'; + + @override + String get whatArePasskeysDescriptionPoint2 => 'Fungua akaunti yako kama vile simu yako - kwa biyometriki, kuskani uso au PIN.'; + + @override + String get whyPasskeys => 'Kwa nini passkeys?'; + + @override + String get whyPasskeysDescription1 => 'Safu ya ziada ya usalama.'; + + @override + String get whyPasskeysDescription2 => 'Kinga dhidi ya ufikiaji ambao haujaidhinishwa na hadaa.'; + + @override + String get howToCreatePasskey => 'Jinsi ya kuunda passkey?'; + + @override + String get howToCreatePasskeyDescription1 => 'Nenda katika \'Mipangilio ya Akaunti\' kwenye Deriv.'; + + @override + String get howToCreatePasskeyDescription2 => 'Unaweza kuunda passkey moja kwa kila kifaa.'; + + @override + String get whereArePasskeysSaved => 'Passkeys zimehifadhiwa wapi?'; + + @override + String get whereArePasskeysSavedDescriptionAndroid => 'Android: Google password manager.'; + + @override + String get whereArePasskeysSavedDescriptionIOS => 'iOS: iCloud keychain.'; + + @override + String get whatHappensIfEmailChanged => 'Nini kinatokea ikiwa barua pepe yangu ya akaunti ya Deriv imebadil?'; + + @override + String get whatHappensIfEmailChangedDescription1 => 'Hakuna tatizo! Passkey yako bado inafanya kazi.'; + + @override + String get whatHappensIfEmailChangedDescription2 => 'Ingia kwenye Deriv na passkey yako iliyopo.'; + + @override + String get tips => 'Vidokezo'; + + @override + String get beforeUsingPasskeys => 'Kabla ya kutumia passkeys'; + + @override + String get enableScreenLock => 'Wezesha kufunga skrini kwenye kifaa chako.'; + + @override + String get signInGoogleOrIcloud => 'Ingia kwenye akaunti yako ya Google au iCloud.'; + + @override + String get enableBluetooth => 'Wezesha Bluetooth.'; + + @override + String get noPasskeyFound => 'Hakuna passkey iliyopatikana!'; + + @override + String get noPasskeyFoundDescription => 'Tafadhali unda passkey ili kutumia kipengele hiki.'; + + @override + String get maybeLater => 'Labda baadaye'; + + @override + String get effortlessLoginWithPasskeys => 'Kuingia bila juhudi kwa passkeys'; + + @override + String get learnMoreAboutPasskeys => 'Jifunze zaidi kuhusu passkeys'; + + @override + String get noNeedToRememberPassword => 'Hakuna haja ya kukumbuka nenosiri'; + + @override + String get useYourBiometrics => 'Usalama ulioboreshwa na biometriki au kufunga skrini'; + + @override + String get syncAcrossDevices => 'Sawazisha katika vifaa'; + + @override + String get createPasskey => 'Unda passkey'; + + @override + String get unsupportedPlatform => 'Jukwaa isiyosaidiwa'; + + @override + String get storedOn => 'Imehifadhiwa kwenye'; + + @override + String get lastUsed => 'Imetumika mwisho'; + + @override + String get rename => 'Badilisha jina'; + + @override + String get revoke => 'Kufuta'; + + @override + String get continueTradingButtonText => 'Endelea kufanya biashara'; + + @override + String get addMorePasskeysButtonText => 'Ongeza passkeys nyingine'; + + @override + String get unableToSetupPasskey => 'Haiwezi kuanzisha kifungu cha passkey'; + + @override + String get unableToSetupPasskeyDescription => 'Tulikutana na shida wakati wa kuanzisha passkey lako. Utaratibu huo unaweza kuingiliwa, au kikao kimekamilika. Tafadhali jaribu tena.'; + + @override + String get passkeysOffErrorTitle => 'Huduma ya Passkeys haipatikani'; + + @override + String get never => 'Kamwe'; + + @override + String get unable_to_process_your_request => 'Haiwezi kushughulikia ombi lako'; + + @override + String get unable_to_process_your_request_description => 'Tunapata shida ya muda katika kusindika ombi lako. Tafadhali jaribu tena baadaye.'; +} diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_th.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_th.dart new file mode 100644 index 000000000..8fcd074a0 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_th.dart @@ -0,0 +1,164 @@ +import 'deriv_passkeys_localizations.dart'; + +/// The translations for Thai (`th`). +class DerivPasskeysLocalizationsTh extends DerivPasskeysLocalizations { + DerivPasskeysLocalizationsTh([String locale = 'th']) : super(locale); + + @override + String get passkeyCreatedSuccessTitle => 'สำเร็จแล้ว!'; + + @override + String passkeyCreatedSuccessMessage(String platformName) { + return 'ตอนนี้บัญชีของคุณได้รับการรักษาความปลอดภัยด้วย Passkey โดยสามารถจัดการ Passkey นี้ได้ผ่านการตั้งค่าบัญชี $platformName ของคุณ'; + } + + @override + String get continueButtonText => 'ดำเนินการต่อ'; + + @override + String get unexpectedError => 'มีข้อผิดพลาดเกิดขึ้น!'; + + @override + String get unexpectedErrorDescription => 'โปรดลองอีกครั้งในภายหลัง'; + + @override + String get ok => 'Ok'; + + @override + String get experienceSaferLogins => 'สัมผัสประสบการณ์การเข้าสู่ระบบที่ปลอดภัยขึ้น'; + + @override + String get enhanceSecurity => 'การเสริมความปลอดภัยที่อยู่แค่เพียงคุณแตะปุ่มเดียว'; + + @override + String get here => 'ที่นี่'; + + @override + String get effortlessLogin => 'เข้าสู่ระบบได้อย่างง่ายดายด้วย Passkey'; + + @override + String get whatArePasskeys => 'Passkey คืออะไร?'; + + @override + String get whatArePasskeysDescriptionPoint1 => 'ทางเลือกที่ปลอดภัยนอกเหนือไปจากรหัสผ่าน'; + + @override + String get whatArePasskeysDescriptionPoint2 => 'ปลดล็อคบัญชีคุณได้เหมือนที่ทำในโทรศัพท์ - ผ่านไบโอเมตริกซ์ การสแกนใบหน้า หรือหมายเลข PIN'; + + @override + String get whyPasskeys => 'ทำไมต้องใช้ Passkey?'; + + @override + String get whyPasskeysDescription1 => 'เพิ่มอีกชั้นความปลอดภัยพิเศษ'; + + @override + String get whyPasskeysDescription2 => 'กันการเข้าถึงที่ไม่ได้อนุญาตและการโจมตีแบบฟิชชิ่ง'; + + @override + String get howToCreatePasskey => 'จะสร้าง Passkey ได้อย่างไร?'; + + @override + String get howToCreatePasskeyDescription1 => 'ไปที่ \'การตั้งค่าบัญชี\' บน Deriv'; + + @override + String get howToCreatePasskeyDescription2 => 'คุณสามารถสร้างหนึ่ง Passkey ต่ออุปกรณ์'; + + @override + String get whereArePasskeysSaved => 'Passkey จะถูกบันทึกไว้ที่ไหน?'; + + @override + String get whereArePasskeysSavedDescriptionAndroid => 'Android: ตัวจัดการรหัสผ่าน Google'; + + @override + String get whereArePasskeysSavedDescriptionIOS => 'iOS: พวงกุญแจ iCloud'; + + @override + String get whatHappensIfEmailChanged => 'จะเกิดอะไรขึ้นหากอีเมล์บัญชี Deriv ของฉันเปลี่ยนไป?'; + + @override + String get whatHappensIfEmailChangedDescription1 => 'ไม่มีปัญหา! Passkey ของคุณยังใช้งานได้อยู่'; + + @override + String get whatHappensIfEmailChangedDescription2 => 'ลงชื่อเข้าใช้ Deriv ด้วย Passkey ที่มีอยู่ของคุณ'; + + @override + String get tips => 'เคล็ดลับ'; + + @override + String get beforeUsingPasskeys => 'ก่อนที่จะใช้ Passkey'; + + @override + String get enableScreenLock => 'เปิดใช้งานการล็อคหน้าจอบนอุปกรณ์ของคุณ'; + + @override + String get signInGoogleOrIcloud => 'ลงชื่อเข้าใช้บัญชี Google หรือ iCloud ของคุณ'; + + @override + String get enableBluetooth => 'เปิดใช้งานบลูทูธ'; + + @override + String get noPasskeyFound => 'ไม่พบ Passkey!'; + + @override + String get noPasskeyFoundDescription => 'กรุณาสร้าง Passkey เพื่อใช้ฟีเจอร์นี้'; + + @override + String get maybeLater => 'ไว้ทีหลัง'; + + @override + String get effortlessLoginWithPasskeys => 'เข้าสู่ระบบได้อย่างง่ายดายด้วย Passkey'; + + @override + String get learnMoreAboutPasskeys => 'เรียนรู้เพิ่มเติมเกี่ยวกับ Passkey'; + + @override + String get noNeedToRememberPassword => 'ไม่จำเป็นต้องจดจำรหัสผ่าน'; + + @override + String get useYourBiometrics => 'เพิ่มความปลอดภัยด้วยไบโอเมตริกซ์หรือการล็อคหน้าจอ'; + + @override + String get syncAcrossDevices => 'ซิงค์ได้ระหว่างอุปกรณ์ต่างๆ'; + + @override + String get createPasskey => 'สร้าง Passkey'; + + @override + String get unsupportedPlatform => 'แพลตฟอร์มที่ไม่รองรับ'; + + @override + String get storedOn => 'เก็บไว้ใน'; + + @override + String get lastUsed => 'ใช้ครั้งล่าสุด'; + + @override + String get rename => 'เปลี่ยนชื่อ'; + + @override + String get revoke => 'เพิกถอน'; + + @override + String get continueTradingButtonText => 'ทำการเทรดต่อไป'; + + @override + String get addMorePasskeysButtonText => 'เพิ่มจำนวน Passkey'; + + @override + String get unableToSetupPasskey => 'ไม่สามารถตั้งค่า Passkey ได้'; + + @override + String get unableToSetupPasskeyDescription => 'เราพบปัญหาขณะตั้งค่า Passkey ของคุณ กระบวนการอาจถูกขัดจังหวะหรือเซสชั่นหมดเวลา โปรดลองอีกครั้ง'; + + @override + String get passkeysOffErrorTitle => 'บริการ Passkey ไม่พร้อมใช้งาน'; + + @override + String get never => 'ไม่เคย'; + + @override + String get unable_to_process_your_request => 'ไม่สามารถประมวลผลคำขอของคุณได้'; + + @override + String get unable_to_process_your_request_description => 'เรากำลังประสบปัญหาชั่วคราวในการประมวลผลคำขอของคุณ โปรดลองอีกครั้งในภายหลัง'; +} diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_tr.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_tr.dart new file mode 100644 index 000000000..23bf72ae7 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_tr.dart @@ -0,0 +1,164 @@ +import 'deriv_passkeys_localizations.dart'; + +/// The translations for Turkish (`tr`). +class DerivPasskeysLocalizationsTr extends DerivPasskeysLocalizations { + DerivPasskeysLocalizationsTr([String locale = 'tr']) : super(locale); + + @override + String get passkeyCreatedSuccessTitle => 'Başarı!'; + + @override + String passkeyCreatedSuccessMessage(String platformName) { + return 'Hesabınız artık bir şifre ile güvence altına alınmıştır. $platformName hesap ayarlarınızdan passkey\'inizi yönetin.'; + } + + @override + String get continueButtonText => 'Devam et'; + + @override + String get unexpectedError => 'Beklenmedik bir hata oluştu!'; + + @override + String get unexpectedErrorDescription => 'Lütfen daha sonra deneyin.'; + + @override + String get ok => 'Tamam'; + + @override + String get experienceSaferLogins => 'Daha güvenli oturum açma deneyimini yaşayın'; + + @override + String get enhanceSecurity => 'Gelişmiş güvenlik sadece bir dokunuş uzağınızda.'; + + @override + String get here => 'burada'; + + @override + String get effortlessLogin => 'Passkey tuşları ile zahmetsiz giriş'; + + @override + String get whatArePasskeys => 'Passkeys nedir?'; + + @override + String get whatArePasskeysDescriptionPoint1 => 'Şifrelere güvenli alternatif.'; + + @override + String get whatArePasskeysDescriptionPoint2 => 'Hesabınızın kilidini telefonunuz gibi açın - biyometri, yüz tarama veya PIN ile.'; + + @override + String get whyPasskeys => 'Neden Passkey?'; + + @override + String get whyPasskeysDescription1 => 'Ekstra güvenlik katmanı.'; + + @override + String get whyPasskeysDescription2 => 'Yetkisiz erişime ve kimlik avına karşı kalkanlar.'; + + @override + String get howToCreatePasskey => 'Passkey nasıl oluşturulur?'; + + @override + String get howToCreatePasskeyDescription1 => 'Deriv\'de \'Hesap Ayarları\'na gidin.'; + + @override + String get howToCreatePasskeyDescription2 => 'Cihaz başına bir passkey oluşturabilirsiniz.'; + + @override + String get whereArePasskeysSaved => 'Passkeys nereye kaydedilir?'; + + @override + String get whereArePasskeysSavedDescriptionAndroid => 'Android: Google şifre yöneticisi.'; + + @override + String get whereArePasskeysSavedDescriptionIOS => 'iOS: iCloud anahtar zinciri.'; + + @override + String get whatHappensIfEmailChanged => 'Deriv hesabım e-posta adresim değiştirilirse ne olur?'; + + @override + String get whatHappensIfEmailChangedDescription1 => 'Sorun yok! Passkey hâlâ çalışıyor.'; + + @override + String get whatHappensIfEmailChangedDescription2 => 'Mevcut passkey ile Deriv\'de oturum açın.'; + + @override + String get tips => 'İpuçları'; + + @override + String get beforeUsingPasskeys => 'Passkey kullanmadan önce'; + + @override + String get enableScreenLock => 'Cihazınızda ekran kilidini etkinleştirin.'; + + @override + String get signInGoogleOrIcloud => 'Google veya iCloud hesabınızda oturum açın.'; + + @override + String get enableBluetooth => 'Bluetooth\'u etkinleştir.'; + + @override + String get noPasskeyFound => 'Passkey bulunamadı!'; + + @override + String get noPasskeyFoundDescription => 'Bu özelliği kullanmak için lütfen bir passkey oluşturun.'; + + @override + String get maybeLater => 'Belki daha sonra'; + + @override + String get effortlessLoginWithPasskeys => 'Passkey tuşları ile zahmetsiz giriş'; + + @override + String get learnMoreAboutPasskeys => 'Passkeys hakkında daha fazla bilgi edinin'; + + @override + String get noNeedToRememberPassword => 'Şifreyi hatırlamanıza gerek yok'; + + @override + String get useYourBiometrics => 'Biyometri veya ekran kilidi ile gelişmiş güvenlik'; + + @override + String get syncAcrossDevices => 'Cihazlar arasında senkronizasyon'; + + @override + String get createPasskey => 'Passkey oluştur'; + + @override + String get unsupportedPlatform => 'Desteklenmeyen Platform'; + + @override + String get storedOn => 'Şurada saklanır'; + + @override + String get lastUsed => 'Son kullanılan'; + + @override + String get rename => 'Yeniden Adlandır'; + + @override + String get revoke => 'İptal'; + + @override + String get continueTradingButtonText => 'Alım satıma devam'; + + @override + String get addMorePasskeysButtonText => 'Daha fazla passkeys'; + + @override + String get unableToSetupPasskey => 'Passkey ayarlanamıyor'; + + @override + String get unableToSetupPasskeyDescription => 'Passkey ayarlarken bir sorunla karşılaştık. İşlem yarıda kesilmiş veya oturum zaman aşımına uğramış olabilir. Lütfen tekrar deneyin.'; + + @override + String get passkeysOffErrorTitle => 'Passkeys hizmeti kullanılamıyor'; + + @override + String get never => 'Asla'; + + @override + String get unable_to_process_your_request => 'Talebiniz işleme alınamıyor'; + + @override + String get unable_to_process_your_request_description => 'Talebinizin işlenmesinde geçici bir sorun yaşıyoruz. Lütfen daha sonra tekrar deneyin.'; +} diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_vi.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_vi.dart new file mode 100644 index 000000000..beabf3ffc --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_vi.dart @@ -0,0 +1,164 @@ +import 'deriv_passkeys_localizations.dart'; + +/// The translations for Vietnamese (`vi`). +class DerivPasskeysLocalizationsVi extends DerivPasskeysLocalizations { + DerivPasskeysLocalizationsVi([String locale = 'vi']) : super(locale); + + @override + String get passkeyCreatedSuccessTitle => 'Thành công!'; + + @override + String passkeyCreatedSuccessMessage(String platformName) { + return 'Tài khoản của bạn hiện được bảo mật bằng passkey. Quản lý passkey của bạn thông qua cài đặt tài khoản $platformName của bạn.'; + } + + @override + String get continueButtonText => 'Tiếp tục'; + + @override + String get unexpectedError => 'Đã có lỗi bất ngờ xảy ra!'; + + @override + String get unexpectedErrorDescription => 'Vui lòng thử lại sau.'; + + @override + String get ok => 'Ok'; + + @override + String get experienceSaferLogins => 'Trải nghiệm đăng nhập an toàn hơn'; + + @override + String get enhanceSecurity => 'Bảo mật nâng cao chỉ cách một cú chạm.'; + + @override + String get here => 'ở đây'; + + @override + String get effortlessLogin => 'Đăng nhập dễ dàng với các passkeys'; + + @override + String get whatArePasskeys => 'Passkeys là gì?'; + + @override + String get whatArePasskeysDescriptionPoint1 => 'Thay thế an toàn cho mật khẩu.'; + + @override + String get whatArePasskeysDescriptionPoint2 => 'Mở khóa tài khoản của bạn như điện thoại của bạn - với sinh trắc học, quét khuôn mặt hoặc mã PIN.'; + + @override + String get whyPasskeys => 'Tại sao passkeys?'; + + @override + String get whyPasskeysDescription1 => 'Lớp bảo mật bổ sung.'; + + @override + String get whyPasskeysDescription2 => 'Bảo vệ chống truy cập trái phép và lừa đảo.'; + + @override + String get howToCreatePasskey => 'Làm thế nào để tạo passkey?'; + + @override + String get howToCreatePasskeyDescription1 => 'Chuyển đến \'Cài đặt tài khoản\' trên Deriv.'; + + @override + String get howToCreatePasskeyDescription2 => 'Bạn có thể tạo một passkey cho mỗi thiết bị.'; + + @override + String get whereArePasskeysSaved => 'Passkeys được lưu ở đâu?'; + + @override + String get whereArePasskeysSavedDescriptionAndroid => 'Android: Trình quản lý mật khẩu Google.'; + + @override + String get whereArePasskeysSavedDescriptionIOS => 'iOS: Móc khóa iCloud.'; + + @override + String get whatHappensIfEmailChanged => 'Điều gì xảy ra nếu email tài khoản Deriv của tôi bị thay đổi?'; + + @override + String get whatHappensIfEmailChangedDescription1 => 'Không có vấn đề gì! Khóa passkey của bạn vẫn hoạt động.'; + + @override + String get whatHappensIfEmailChangedDescription2 => 'Đăng nhập vào Deriv bằng passkey hiện có của bạn.'; + + @override + String get tips => 'Mẹo'; + + @override + String get beforeUsingPasskeys => 'Trước khi sử dụng passkeys'; + + @override + String get enableScreenLock => 'Bật khóa màn hình trên thiết bị của bạn.'; + + @override + String get signInGoogleOrIcloud => 'Đăng nhập vào tài khoản Google hoặc iCloud của bạn.'; + + @override + String get enableBluetooth => 'Bật Bluetooth.'; + + @override + String get noPasskeyFound => 'Không tìm thấy passkey!'; + + @override + String get noPasskeyFoundDescription => 'Vui lòng tạo passkey để sử dụng tính năng này.'; + + @override + String get maybeLater => 'Để sau'; + + @override + String get effortlessLoginWithPasskeys => 'Đăng nhập dễ dàng với các passkeys'; + + @override + String get learnMoreAboutPasskeys => 'Tìm hiểu thêm về passkeys'; + + @override + String get noNeedToRememberPassword => 'Không cần nhớ mật khẩu'; + + @override + String get useYourBiometrics => 'Tăng cường bảo mật với sinh trắc học hoặc khóa màn hình'; + + @override + String get syncAcrossDevices => 'Đồng bộ hóa trên các thiết bị'; + + @override + String get createPasskey => 'Tạo passkey'; + + @override + String get unsupportedPlatform => 'Nền tảng không được hỗ trợ'; + + @override + String get storedOn => 'Được lưu trữ trên'; + + @override + String get lastUsed => 'Lần sử dụng cuối'; + + @override + String get rename => 'Đổi tên'; + + @override + String get revoke => 'Thu hồi'; + + @override + String get continueTradingButtonText => 'Tiếp tục giao dịch'; + + @override + String get addMorePasskeysButtonText => 'Thêm nhiều Passkeys'; + + @override + String get unableToSetupPasskey => 'Không thể thiết lập passkey'; + + @override + String get unableToSetupPasskeyDescription => 'Chúng tôi gặp sự cố khi thiết lập passkey của bạn. Quá trình có thể đã bị gián đoạn hoặc phiên đã hết thời gian. Vui lòng thử lại.'; + + @override + String get passkeysOffErrorTitle => 'Dịch vụ Passkeys không khả dụng'; + + @override + String get never => 'Không bao giờ'; + + @override + String get unable_to_process_your_request => 'Không thể xử lý yêu cầu của bạn'; + + @override + String get unable_to_process_your_request_description => 'Chúng tôi đang gặp sự cố tạm thời trong quá trình xử lý yêu cầu của bạn. Vui lòng thử lại sau.'; +} diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_zh.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_zh.dart new file mode 100644 index 000000000..6e63c2652 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_zh.dart @@ -0,0 +1,164 @@ +import 'deriv_passkeys_localizations.dart'; + +/// The translations for Chinese (`zh`). +class DerivPasskeysLocalizationsZh extends DerivPasskeysLocalizations { + DerivPasskeysLocalizationsZh([String locale = 'zh']) : super(locale); + + @override + String get passkeyCreatedSuccessTitle => '成功!'; + + @override + String passkeyCreatedSuccessMessage(String platformName) { + return '帳戶現在已使用金鑰保護。請透過 <0/>$platformName 帳戶設定<0/>管理金鑰。'; + } + + @override + String get continueButtonText => '繼續'; + + @override + String get unexpectedError => '發生不可預測錯誤!'; + + @override + String get unexpectedErrorDescription => '請稍後重試。'; + + @override + String get ok => '確定'; + + @override + String get experienceSaferLogins => '體驗更安全的登入'; + + @override + String get enhanceSecurity => '只需輕按一下即可增強安全性。'; + + @override + String get here => '這裡'; + + @override + String get effortlessLogin => '使用金鑰輕鬆登入'; + + @override + String get whatArePasskeys => '什麼是金鑰?'; + + @override + String get whatArePasskeysDescriptionPoint1 => '密碼之外的安全替代品。'; + + @override + String get whatArePasskeysDescriptionPoint2 => '使用生物特徵、臉部掃描或 PIN 像手機一樣解鎖帳戶。'; + + @override + String get whyPasskeys => '為什麼要使用金鑰?'; + + @override + String get whyPasskeysDescription1 => '額外的安全層。'; + + @override + String get whyPasskeysDescription2 => '防止未經授權的存取和網絡釣魚。'; + + @override + String get howToCreatePasskey => '如何建立金鑰?'; + + @override + String get howToCreatePasskeyDescription1 => '轉到 Deriv 的‘帳戶設定‘。'; + + @override + String get howToCreatePasskeyDescription2 => '可以為每個裝置建立一個金鑰。'; + + @override + String get whereArePasskeysSaved => '金鑰儲存在哪裡?'; + + @override + String get whereArePasskeysSavedDescriptionAndroid => 'Android: Google 密碼管理器。'; + + @override + String get whereArePasskeysSavedDescriptionIOS => 'iOS:iCloud 鑰匙圈。'; + + @override + String get whatHappensIfEmailChanged => '如果 Deriv 帳戶電子郵件更改,會怎麼樣?'; + + @override + String get whatHappensIfEmailChangedDescription1 => '沒問題!金鑰仍然有效。'; + + @override + String get whatHappensIfEmailChangedDescription2 => '使用現有的金鑰登入 Deriv。'; + + @override + String get tips => '提示'; + + @override + String get beforeUsingPasskeys => '使用金鑰之前'; + + @override + String get enableScreenLock => '啟用裝置螢幕鎖定。'; + + @override + String get signInGoogleOrIcloud => '登入 Google 或 iCloud 帳戶。'; + + @override + String get enableBluetooth => '啟用藍牙。'; + + @override + String get noPasskeyFound => '找不到金鑰!'; + + @override + String get noPasskeyFoundDescription => '請建立金鑰以使用此功能。'; + + @override + String get maybeLater => '以後再說'; + + @override + String get effortlessLoginWithPasskeys => '使用金鑰輕鬆登入'; + + @override + String get learnMoreAboutPasskeys => '進一步了解金鑰'; + + @override + String get noNeedToRememberPassword => '無需記住密碼'; + + @override + String get useYourBiometrics => '通過生物特徵或螢幕鎖定增強安全性'; + + @override + String get syncAcrossDevices => '跨裝置同步'; + + @override + String get createPasskey => '建立金鑰'; + + @override + String get unsupportedPlatform => '不支援的平台'; + + @override + String get storedOn => '儲存在'; + + @override + String get lastUsed => '上一次使用'; + + @override + String get rename => '重命名'; + + @override + String get revoke => '撤銷'; + + @override + String get continueTradingButtonText => '繼續交易'; + + @override + String get addMorePasskeysButtonText => '新增更多金鑰'; + + @override + String get unableToSetupPasskey => '無法設定金鑰'; + + @override + String get unableToSetupPasskeyDescription => '設定金鑰時遇到問題。程序可能已中斷,或工作階段逾時。請再試一次。'; + + @override + String get passkeysOffErrorTitle => '金鑰服務無法使用'; + + @override + String get never => '從未'; + + @override + String get unable_to_process_your_request => '無法處理請求'; + + @override + String get unable_to_process_your_request_description => '處理請求時遇到臨時問題。請稍後再試。'; +} From 71fb0ec43de64ee4b60ee92bef07f26e7ecf1e1b Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Mon, 27 May 2024 14:50:40 +0800 Subject: [PATCH 076/162] chore(version): bump version and update changelog (#595) Co-authored-by: sahani-deriv Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: sahani-deriv --- CHANGELOG.md | 38 +++++++++++++++++++ README.md | 8 ++-- packages/deriv_auth/CHANGELOG.md | 4 ++ packages/deriv_auth/pubspec.yaml | 6 +-- packages/deriv_live_chat/CHANGELOG.md | 4 ++ packages/deriv_live_chat/pubspec.yaml | 2 +- packages/deriv_localizations/CHANGELOG.md | 4 ++ packages/deriv_localizations/pubspec.yaml | 2 +- packages/deriv_passkeys/CHANGELOG.md | 4 ++ .../example/analysis_options.yaml | 2 +- packages/deriv_passkeys/example/pubspec.yaml | 29 ++------------ packages/deriv_passkeys/pubspec.yaml | 4 +- 12 files changed, 69 insertions(+), 38 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62ae438f0..d1c09ac67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,44 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-05-27 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_auth` - `v6.6.1`](#deriv_auth---v661) + - [`deriv_live_chat` - `v0.0.1+2`](#deriv_live_chat---v0012) + - [`deriv_localizations` - `v1.4.1`](#deriv_localizations---v141) + - [`deriv_passkeys` - `v0.0.1+2`](#deriv_passkeys---v0012) + +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_passkeys` - `v0.0.1+2` + +--- + +#### `deriv_auth` - `v6.6.1` + + - **REFACTOR**(deriv_auth): update localization ([#594](https://github.com/regentmarkets/flutter-deriv-packages/issues/594)). ([5204c74f](https://github.com/regentmarkets/flutter-deriv-packages/commit/5204c74f609d946ea797e766e6bb652d82f76930)) + +#### `deriv_live_chat` - `v0.0.1+2` + + - **REFACTOR**(deriv_live_chat): Glitch_while_clicking_on_live_chat_icon_IOS ([#585](https://github.com/regentmarkets/flutter-deriv-packages/issues/585)). ([957faa3f](https://github.com/regentmarkets/flutter-deriv-packages/commit/957faa3fb16be0174e5e529cbcc068de31cc7bb3)) + +#### `deriv_localizations` - `v1.4.1` + + - **REFACTOR**(deriv_auth): update localization ([#594](https://github.com/regentmarkets/flutter-deriv-packages/issues/594)). ([5204c74f](https://github.com/regentmarkets/flutter-deriv-packages/commit/5204c74f609d946ea797e766e6bb652d82f76930)) + + ## 2024-05-20 ### Changes diff --git a/README.md b/README.md index 82bfd1625..1b827d12f 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.6.0)`. 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.6.1)`. To use the package, add the following to your pubspec.yaml file: ```yaml @@ -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.4](./packages/analytics/CHANGELOG.md) | -| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.6.0 ](./packages/deriv_auth/CHANGELOG.md) | +| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.6.1 ](./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) | @@ -30,9 +30,9 @@ deriv_ui: | [deriv_expandable_bottom_sheet](./packages/deriv_expandable_bottom_sheet) | A widget that helps to display an expandable bottom sheet. | [v0.0.1+4](./packages/deriv_expandable_bottom_sheet/CHANGELOG.md) | | [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_live_chat](./packages/deriv_live_chat) | A plugin for live chat SDK support to dart. | [v0.0.1+2](./packages/deriv_live_chat/CHANGELOG.md) | | [deriv_language_selector](./packages/deriv_language_selector) | A package to handle language change of the app. | [v0.0.2+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.4.0](./packages/deriv_localizations/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.4.1](./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) | diff --git a/packages/deriv_auth/CHANGELOG.md b/packages/deriv_auth/CHANGELOG.md index 106e0702b..4647edd00 100644 --- a/packages/deriv_auth/CHANGELOG.md +++ b/packages/deriv_auth/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.6.1 + + - **REFACTOR**(deriv_auth): update localization ([#594](https://github.com/regentmarkets/flutter-deriv-packages/issues/594)). ([5204c74f](https://github.com/regentmarkets/flutter-deriv-packages/commit/5204c74f609d946ea797e766e6bb652d82f76930)) + ## 6.6.0 - **REFACTOR**(deriv_auth): replaced deriv_localizations commit hash ref with tag ref. ([572aa5fd](https://github.com/regentmarkets/flutter-deriv-packages/commit/572aa5fd54241d09b9993b102c0eceb117594821)) diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index 1907153ca..a97f60452 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.6.0 +version: 6.6.1 environment: @@ -46,13 +46,13 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_localizations - ref: deriv_localizations-v1.4.0 + ref: deriv_localizations-v1.4.1 deriv_passkeys: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: deriv_passkeys-v0.0.1+1 + ref: deriv_passkeys-v0.0.1+2 deriv_language_selector: git: diff --git a/packages/deriv_live_chat/CHANGELOG.md b/packages/deriv_live_chat/CHANGELOG.md index 7bf6a327f..3ecb9d6a6 100644 --- a/packages/deriv_live_chat/CHANGELOG.md +++ b/packages/deriv_live_chat/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.1+2 + + - **REFACTOR**(deriv_live_chat): Glitch_while_clicking_on_live_chat_icon_IOS ([#585](https://github.com/regentmarkets/flutter-deriv-packages/issues/585)). ([957faa3f](https://github.com/regentmarkets/flutter-deriv-packages/commit/957faa3fb16be0174e5e529cbcc068de31cc7bb3)) + ## 0.0.1+1 - **FIX**(deriv_live_chat): [DERG-750] Glitch on clicking LiveChat icon ([#307](https://github.com/regentmarkets/flutter-deriv-packages/issues/307)). ([658716d0](https://github.com/regentmarkets/flutter-deriv-packages/commit/658716d09caa60dbc02fdedeb7c7b452cbdc06c6)) diff --git a/packages/deriv_live_chat/pubspec.yaml b/packages/deriv_live_chat/pubspec.yaml index bb3324d6d..d7d3ac2d7 100644 --- a/packages/deriv_live_chat/pubspec.yaml +++ b/packages/deriv_live_chat/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_live_chat description: A plugin for live chat SDK support to dart. -version: 0.0.1+1 +version: 0.0.1+2 homepage: https://deriv.com/ publish_to: "none" diff --git a/packages/deriv_localizations/CHANGELOG.md b/packages/deriv_localizations/CHANGELOG.md index c060cc955..2feffb3f2 100644 --- a/packages/deriv_localizations/CHANGELOG.md +++ b/packages/deriv_localizations/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.4.1 + + - **REFACTOR**(deriv_auth): update localization ([#594](https://github.com/regentmarkets/flutter-deriv-packages/issues/594)). ([5204c74f](https://github.com/regentmarkets/flutter-deriv-packages/commit/5204c74f609d946ea797e766e6bb652d82f76930)) + ## 1.4.0 - **FEAT**(deriv_passkeys): [UPM-547] Deriv passkeys package ([#425](https://github.com/regentmarkets/flutter-deriv-packages/issues/425)). ([c5509175](https://github.com/regentmarkets/flutter-deriv-packages/commit/c5509175edb6a94122cce6fe6f63a43d44904dc9)) diff --git a/packages/deriv_localizations/pubspec.yaml b/packages/deriv_localizations/pubspec.yaml index c54242be1..7db5a04da 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.4.0 +version: 1.4.1 environment: sdk: '>=3.0.2 <4.0.0' diff --git a/packages/deriv_passkeys/CHANGELOG.md b/packages/deriv_passkeys/CHANGELOG.md index 4ce3d775e..cff892341 100644 --- a/packages/deriv_passkeys/CHANGELOG.md +++ b/packages/deriv_passkeys/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.1+2 + + - Update a dependency to the latest release. + ## 0.0.1+1 - **REFACTOR**(deriv_passkeys): updated deriv_localizations ([#590](https://github.com/regentmarkets/flutter-deriv-packages/issues/590)). ([3f299fae](https://github.com/regentmarkets/flutter-deriv-packages/commit/3f299faea33731a814d18f18ba99180eb6483ca6)) diff --git a/packages/deriv_passkeys/example/analysis_options.yaml b/packages/deriv_passkeys/example/analysis_options.yaml index 61b6c4de1..76b08637f 100644 --- a/packages/deriv_passkeys/example/analysis_options.yaml +++ b/packages/deriv_passkeys/example/analysis_options.yaml @@ -22,8 +22,8 @@ linter: # `// ignore_for_file: name_of_lint` syntax on the line or in the file # producing the lint. rules: + depend_on_referenced_packages: false # avoid_print: false # Uncomment to disable the `avoid_print` rule # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule - # Additional information about this file can be found at # https://dart.dev/guides/language/analysis-options diff --git a/packages/deriv_passkeys/example/pubspec.yaml b/packages/deriv_passkeys/example/pubspec.yaml index 7bcc961ee..b890b2bbd 100644 --- a/packages/deriv_passkeys/example/pubspec.yaml +++ b/packages/deriv_passkeys/example/pubspec.yaml @@ -2,7 +2,7 @@ name: passkeys_poc description: A new Flutter project. # The following line prevents the package from being accidentally published to # pub.dev using `flutter pub publish`. This is preferred for private packages. -publish_to: 'none' # Remove this line if you wish to publish to pub.dev +publish_to: "none" # Remove this line if you wish to publish to pub.dev # The following defines the version and build number for your application. # A version number is three numbers separated by dots, like 1.2.43 @@ -19,33 +19,14 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: '>=3.0.0 <4.0.0' + sdk: ">=3.0.0 <4.0.0" dependencies: flutter: sdk: flutter - - - # The following adds the Cupertino Icons font to your application. - # Use with the CupertinoIcons class for iOS style icons. - deriv_theme: - git: - url: git@github.com:regentmarkets/flutter-deriv-packages.git - path: packages/deriv_theme - ref: deriv_theme-v2.4.0 - deriv_http_client: - git: - url: git@github.com:regentmarkets/flutter-deriv-packages.git - path: packages/deriv_http_client - ref: deriv_http_client-v2.0.1 - deriv_localizations: - git: - url: git@github.com:regentmarkets/flutter-deriv-packages.git - path: packages/deriv_localizations - ref: deriv_localizations-v1.4.0 deriv_passkeys: path: ../ - + cupertino_icons: ^1.0.2 dartz: ^0.10.1 json_annotation: ^4.8.1 @@ -62,8 +43,6 @@ dev_dependencies: flutter_test: sdk: flutter - - # The "flutter_lints" package below contains a set of recommended lints to # encourage good coding practices. The lint set provided by the package is # activated in the `analysis_options.yaml` file located at the root of your @@ -71,7 +50,5 @@ dev_dependencies: # rules and activating additional ones. flutter_lints: ^2.0.0 - - flutter: uses-material-design: true diff --git a/packages/deriv_passkeys/pubspec.yaml b/packages/deriv_passkeys/pubspec.yaml index 82c8c25e4..fd9e62f04 100644 --- a/packages/deriv_passkeys/pubspec.yaml +++ b/packages/deriv_passkeys/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_passkeys description: Deriv Passkeys Flutter Plugin -version: 0.0.1+1 +version: 0.0.1+2 publish_to: 'none' environment: @@ -19,7 +19,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_localizations - ref: deriv_localizations-v1.4.0 + ref: deriv_localizations-v1.4.1 deriv_ui: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git From 8a12ae4aebffb48fbfe4b205019a83a4a86fde7e Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Mon, 27 May 2024 14:32:22 +0400 Subject: [PATCH 077/162] refactor(deriv_passkeys): Remove unused code --- .../data/data_sources/send_temp_message.dart | 19 ------------------- .../deriv_passkeys_method_channel.dart | 3 --- .../src/extensions/context_extensions.dart | 2 +- .../pages/effortless_passkeys_login_page.dart | 3 ++- .../data/deriv_passkeys_repository_test.dart | 2 -- .../deriv_passkeys_service_test.dart | 2 -- .../bloc/deriv_passkeys_bloc_setup.dart | 1 - .../states/bloc/deriv_passkeys_bloc_test.dart | 1 - .../bloc/deriv_passkeys_state_test.dart | 1 - 9 files changed, 3 insertions(+), 31 deletions(-) delete mode 100644 packages/deriv_passkeys/lib/src/data/data_sources/send_temp_message.dart diff --git a/packages/deriv_passkeys/lib/src/data/data_sources/send_temp_message.dart b/packages/deriv_passkeys/lib/src/data/data_sources/send_temp_message.dart deleted file mode 100644 index a67fc74ad..000000000 --- a/packages/deriv_passkeys/lib/src/data/data_sources/send_temp_message.dart +++ /dev/null @@ -1,19 +0,0 @@ -import 'dart:async'; - -import 'package:http/http.dart' as http; -import 'dart:convert'; - -/// Sends a message to the error endpoint. -void sendMessage(Object message) { - const String url = - 'https://cae0-94-201-147-222.ngrok-free.app/deriv-passkeys-message'; - unawaited(http.post( - Uri.parse(url), - body: jsonEncode({ - 'message': message.toString(), - }), - headers: { - 'Content-Type': 'application/json', - }, - )); -} diff --git a/packages/deriv_passkeys/lib/src/data/platform/deriv_passkeys_method_channel.dart b/packages/deriv_passkeys/lib/src/data/platform/deriv_passkeys_method_channel.dart index ff70d80e1..3742d9b9d 100644 --- a/packages/deriv_passkeys/lib/src/data/platform/deriv_passkeys_method_channel.dart +++ b/packages/deriv_passkeys/lib/src/data/platform/deriv_passkeys_method_channel.dart @@ -1,4 +1,3 @@ -import 'package:deriv_passkeys/src/data/data_sources/send_temp_message.dart'; import 'package:deriv_passkeys/src/exceptions/platform_exceptions.dart'; import 'package:deriv_passkeys/src/domain/platform/base_deriv_passkeys_method_channel.dart'; import 'package:flutter/services.dart'; @@ -45,8 +44,6 @@ class MethodChannelDerivPasskeys extends BaseDerivPasskeysMethodChannel { methodChannel.invokeMethod( 'getCredential', {'options': options}).catchError( (Object error) { - print(error); - sendMessage(error); if (error is PlatformException) { if (error.code == '1001' || error.code == 'GetCredentialCancellationException') { diff --git a/packages/deriv_passkeys/lib/src/extensions/context_extensions.dart b/packages/deriv_passkeys/lib/src/extensions/context_extensions.dart index 767cb4060..4b3dcfe65 100644 --- a/packages/deriv_passkeys/lib/src/extensions/context_extensions.dart +++ b/packages/deriv_passkeys/lib/src/extensions/context_extensions.dart @@ -5,5 +5,5 @@ import 'package:flutter/widgets.dart'; extension ContextExtension on BuildContext { /// Get derivPasskeysLocalizations. DerivPasskeysLocalizations get derivPasskeysLocalizations => - DerivPasskeysLocalizations.of(this)!; + DerivPasskeysLocalizations.of(this); } diff --git a/packages/deriv_passkeys/lib/src/presentation/pages/effortless_passkeys_login_page.dart b/packages/deriv_passkeys/lib/src/presentation/pages/effortless_passkeys_login_page.dart index 3d9961d38..69b03215e 100644 --- a/packages/deriv_passkeys/lib/src/presentation/pages/effortless_passkeys_login_page.dart +++ b/packages/deriv_passkeys/lib/src/presentation/pages/effortless_passkeys_login_page.dart @@ -61,7 +61,8 @@ class EffortlessPasskeysPage extends StatelessWidget { child: Scaffold( body: SafeArea( child: LayoutBuilder( - builder: (_, constraints) => SingleChildScrollView( + builder: (_, BoxConstraints constraints) => + SingleChildScrollView( child: ConstrainedBox( constraints: BoxConstraints( minWidth: constraints.maxWidth, diff --git a/packages/deriv_passkeys/test/data/deriv_passkeys_repository_test.dart b/packages/deriv_passkeys/test/data/deriv_passkeys_repository_test.dart index 2375042f9..7b4bd0c4e 100644 --- a/packages/deriv_passkeys/test/data/deriv_passkeys_repository_test.dart +++ b/packages/deriv_passkeys/test/data/deriv_passkeys_repository_test.dart @@ -1,10 +1,8 @@ import 'package:deriv_passkeys/deriv_passkeys.dart'; import 'package:deriv_passkeys/src/data/models/deriv_passkey_model.dart'; import 'package:deriv_passkeys/src/data/models/deriv_passkeys_register_options_model.dart'; -import 'package:deriv_passkeys/src/domain/entities/deriv_passkey_entity.dart'; import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_options_entity.dart'; import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_register_options_entity.dart'; -import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_verify_credentials_response_entity.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mocktail/mocktail.dart'; diff --git a/packages/deriv_passkeys/test/interactor/deriv_passkeys_service_test.dart b/packages/deriv_passkeys/test/interactor/deriv_passkeys_service_test.dart index 43436d3cd..c98d1e886 100644 --- a/packages/deriv_passkeys/test/interactor/deriv_passkeys_service_test.dart +++ b/packages/deriv_passkeys/test/interactor/deriv_passkeys_service_test.dart @@ -1,8 +1,6 @@ import 'package:deriv_passkeys/deriv_passkeys.dart'; import 'package:deriv_passkeys/src/data/models/deriv_passkey_model.dart'; import 'package:deriv_passkeys/src/data/platform/deriv_passkeys_method_channel.dart'; -import 'package:deriv_passkeys/src/domain/entities/deriv_passkey_entity.dart'; -import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_verify_credentials_response_entity.dart'; import 'package:deriv_passkeys/src/domain/platform/base_deriv_passkeys_method_channel.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; diff --git a/packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_bloc_setup.dart b/packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_bloc_setup.dart index f9e4c298b..6f96991a7 100644 --- a/packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_bloc_setup.dart +++ b/packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_bloc_setup.dart @@ -1,5 +1,4 @@ import 'package:deriv_passkeys/deriv_passkeys.dart'; -import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_verify_credentials_response_entity.dart'; import 'package:mocktail/mocktail.dart'; class MockDerivPasskeysService extends Mock implements DerivPasskeysService {} diff --git a/packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_bloc_test.dart b/packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_bloc_test.dart index 2b62ec867..0627ead7d 100644 --- a/packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_bloc_test.dart +++ b/packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_bloc_test.dart @@ -1,4 +1,3 @@ -import 'package:deriv_passkeys/src/domain/entities/deriv_passkey_entity.dart'; import 'package:deriv_passkeys/src/exceptions/platform_exceptions.dart'; import 'package:deriv_passkeys/src/exceptions/server_exceptions.dart'; import 'package:flutter_test/flutter_test.dart'; diff --git a/packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_state_test.dart b/packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_state_test.dart index 65332d35d..cba709665 100644 --- a/packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_state_test.dart +++ b/packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_state_test.dart @@ -1,5 +1,4 @@ import 'package:deriv_passkeys/deriv_passkeys.dart'; -import 'package:deriv_passkeys/src/domain/entities/deriv_passkey_entity.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { From 5d218724ffd2cf71dc58238fda97e8413abfee8a Mon Sep 17 00:00:00 2001 From: bassam-deriv Date: Tue, 28 May 2024 14:20:11 +0400 Subject: [PATCH 078/162] refactor(deriv_passkeys): Update exception handling in DerivPasskeysPlugin --- .../com/deriv/passkeys/deriv_passkeys/DerivPasskeysPlugin.kt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/deriv_passkeys/android/src/main/kotlin/com/deriv/passkeys/deriv_passkeys/DerivPasskeysPlugin.kt b/packages/deriv_passkeys/android/src/main/kotlin/com/deriv/passkeys/deriv_passkeys/DerivPasskeysPlugin.kt index 186922bc1..f153e13d2 100644 --- a/packages/deriv_passkeys/android/src/main/kotlin/com/deriv/passkeys/deriv_passkeys/DerivPasskeysPlugin.kt +++ b/packages/deriv_passkeys/android/src/main/kotlin/com/deriv/passkeys/deriv_passkeys/DerivPasskeysPlugin.kt @@ -120,10 +120,6 @@ class DerivPasskeysPlugin: FlutterPlugin, MethodCallHandler, ActivityAware, View result.error("Error", "Unknown error", null) } } - } catch (e: GetCredentialCancellationException) { - result.error("GetCredentialCancellationException", e.message ?: "No credential found", null) - } catch (e: NoCredentialException) { - result.error("NoCredentialException", e.message ?: "No credential found", null) } catch (e: Exception) { result.error(e.javaClass.simpleName ?: "Exception", e.message ?: "Exception occurred", null) } From 7ab9780dde6df9ddc8057cb9e6bcdecddc359fd7 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 28 May 2024 11:58:08 +0000 Subject: [PATCH 079/162] chore(release): publish packages - deriv_passkeys@0.0.1+3 - deriv_auth@6.6.2 --- CHANGELOG.md | 32 ++++++++++++++++++++++++++++ packages/deriv_auth/CHANGELOG.md | 4 ++++ packages/deriv_auth/pubspec.yaml | 4 ++-- packages/deriv_passkeys/CHANGELOG.md | 8 +++++++ packages/deriv_passkeys/pubspec.yaml | 2 +- 5 files changed, 47 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1c09ac67..add019c9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,38 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-05-28 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_passkeys` - `v0.0.1+3`](#deriv_passkeys---v0013) + - [`deriv_auth` - `v6.6.2`](#deriv_auth---v662) + +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.6.2` + +--- + +#### `deriv_passkeys` - `v0.0.1+3` + + - **REFACTOR**(deriv_passkeys): Update exception handling in DerivPasskeysPlugin. ([5d218724](https://github.com/regentmarkets/flutter-deriv-packages/commit/5d218724ffd2cf71dc58238fda97e8413abfee8a)) + - **REFACTOR**(deriv_passkeys): Remove unused code. ([8a12ae4a](https://github.com/regentmarkets/flutter-deriv-packages/commit/8a12ae4aebffb48fbfe4b205019a83a4a86fde7e)) + - **REFACTOR**(deriv_passkeys): Update exception handling in DerivPasskeysPlugin. ([5f31ece9](https://github.com/regentmarkets/flutter-deriv-packages/commit/5f31ece9eb5331e1e252c9db0c63423dd5b46d8f)) + - **REFACTOR**(deriv_passkeys): Update exception handling in DerivPasskeysPlugin. ([ca366418](https://github.com/regentmarkets/flutter-deriv-packages/commit/ca36641847dc206354ece977e44c8bf4531a3def)) + - **REFACTOR**(deriv_passkeys): Fix exception handling in DerivPasskeysPlugin. ([eafa7cd1](https://github.com/regentmarkets/flutter-deriv-packages/commit/eafa7cd1f5eacc6d7c58f345936292dc87af624e)) + + ## 2024-05-27 ### Changes diff --git a/packages/deriv_auth/CHANGELOG.md b/packages/deriv_auth/CHANGELOG.md index 4647edd00..18c5112cc 100644 --- a/packages/deriv_auth/CHANGELOG.md +++ b/packages/deriv_auth/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.6.2 + + - Update a dependency to the latest release. + ## 6.6.1 - **REFACTOR**(deriv_auth): update localization ([#594](https://github.com/regentmarkets/flutter-deriv-packages/issues/594)). ([5204c74f](https://github.com/regentmarkets/flutter-deriv-packages/commit/5204c74f609d946ea797e766e6bb652d82f76930)) diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index a97f60452..183141a63 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.6.1 +version: 6.6.2 environment: @@ -52,7 +52,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: deriv_passkeys-v0.0.1+2 + ref: deriv_passkeys-v0.0.1+3 deriv_language_selector: git: diff --git a/packages/deriv_passkeys/CHANGELOG.md b/packages/deriv_passkeys/CHANGELOG.md index cff892341..b638d7e95 100644 --- a/packages/deriv_passkeys/CHANGELOG.md +++ b/packages/deriv_passkeys/CHANGELOG.md @@ -1,3 +1,11 @@ +## 0.0.1+3 + + - **REFACTOR**(deriv_passkeys): Update exception handling in DerivPasskeysPlugin. ([5d218724](https://github.com/regentmarkets/flutter-deriv-packages/commit/5d218724ffd2cf71dc58238fda97e8413abfee8a)) + - **REFACTOR**(deriv_passkeys): Remove unused code. ([8a12ae4a](https://github.com/regentmarkets/flutter-deriv-packages/commit/8a12ae4aebffb48fbfe4b205019a83a4a86fde7e)) + - **REFACTOR**(deriv_passkeys): Update exception handling in DerivPasskeysPlugin. ([5f31ece9](https://github.com/regentmarkets/flutter-deriv-packages/commit/5f31ece9eb5331e1e252c9db0c63423dd5b46d8f)) + - **REFACTOR**(deriv_passkeys): Update exception handling in DerivPasskeysPlugin. ([ca366418](https://github.com/regentmarkets/flutter-deriv-packages/commit/ca36641847dc206354ece977e44c8bf4531a3def)) + - **REFACTOR**(deriv_passkeys): Fix exception handling in DerivPasskeysPlugin. ([eafa7cd1](https://github.com/regentmarkets/flutter-deriv-packages/commit/eafa7cd1f5eacc6d7c58f345936292dc87af624e)) + ## 0.0.1+2 - Update a dependency to the latest release. diff --git a/packages/deriv_passkeys/pubspec.yaml b/packages/deriv_passkeys/pubspec.yaml index fd9e62f04..2c5afee72 100644 --- a/packages/deriv_passkeys/pubspec.yaml +++ b/packages/deriv_passkeys/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_passkeys description: Deriv Passkeys Flutter Plugin -version: 0.0.1+2 +version: 0.0.1+3 publish_to: 'none' environment: From da7613b8e9d0b3edecf84fd41ace686b27637db2 Mon Sep 17 00:00:00 2001 From: ayaan-deriv Date: Tue, 28 May 2024 11:58:10 +0000 Subject: [PATCH 080/162] [create-pull-request] automated change --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1b827d12f..bdae1c2b3 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.6.1)`. 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.6.2)`. To use the package, add the following to your pubspec.yaml file: ```yaml @@ -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.4](./packages/analytics/CHANGELOG.md) | -| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.6.1 ](./packages/deriv_auth/CHANGELOG.md) | +| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.6.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) | From dd30f3419b8d0ca887b4cfc58280db4bc4738076 Mon Sep 17 00:00:00 2001 From: ramin-deriv <55975218+ramin-deriv@users.noreply.github.com> Date: Wed, 29 May 2024 11:35:07 +0800 Subject: [PATCH 081/162] feat(deriv_feature_flag): Add a methods to retrieve values for feature flag types other than boolean (#513) --- .../lib/feature_flag/deriv_feature_flag.dart | 31 ++++++++++++++++++- .../feature_flag/feature_flag_repository.dart | 7 +++++ .../feature_flag_repository_test.dart | 2 ++ 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/packages/deriv_feature_flag/lib/feature_flag/deriv_feature_flag.dart b/packages/deriv_feature_flag/lib/feature_flag/deriv_feature_flag.dart index a0afea441..b1106a230 100644 --- a/packages/deriv_feature_flag/lib/feature_flag/deriv_feature_flag.dart +++ b/packages/deriv_feature_flag/lib/feature_flag/deriv_feature_flag.dart @@ -4,11 +4,15 @@ import 'package:deriv_feature_flag/growthbook/deriv_growth_book.dart'; import 'package:flutter/material.dart'; class DerivFeatureFlag { - /// Initilize the FeatureFlag service for the whole app. + /// Initializes the FeatureFlag service for the whole app. Future initialize(FeatureFlagConfig featureFlagConfig) async { final DerivGrowthBook derivGrowthBook = DerivGrowthBook( featureFlagConfig: featureFlagConfig, ); + // TODO(Ramin): FeatureFlagRepository should be non-singleton or another way + // to be able to send different attributes during one app run session. + // Since sending attributes happens in the initialization and if during one + // app run session we might want to send different attributes (e.g. country) await FeatureFlagRepository.getInstance() .setup(derivGrowthBook: derivGrowthBook); } @@ -32,6 +36,31 @@ class DerivFeatureFlag { defaultValue: defaultValue, ); + /// Returns the value of a feature flag. + /// + /// The returned value, depending on the feature flag, can be a boolean, + /// string, num, or a Map. + dynamic getFeatureFlagValue(String key, {dynamic defaultValue = false}) => + FeatureFlagRepository.getInstance().getFeatureValue( + key, + defaultValue: defaultValue, + ); + + /// Returns the value of a boolean feature flag. + bool getBoolFeatureValue(String key, {bool defaultValue = false}) => + (FeatureFlagRepository.getInstance().getFeatureValue(key) as bool?) ?? + defaultValue; + + /// Returns the value of a String feature flag. + String getStringFeatureValue(String key, {String defaultValue = ''}) => + (FeatureFlagRepository.getInstance().getFeatureValue(key) as String?) ?? + defaultValue; + + /// Returns the value of a num feature flag. + num getNumFeatureValue(String key, {num defaultValue = 0}) => + (FeatureFlagRepository.getInstance().getFeatureValue(key) as num?) ?? + defaultValue; + /// only for testing purposes. @visibleForTesting bool isFeatureOnTest(FeatureFlagRepository featureFlagRepository, String key, diff --git a/packages/deriv_feature_flag/lib/feature_flag/feature_flag_repository.dart b/packages/deriv_feature_flag/lib/feature_flag/feature_flag_repository.dart index 76cf7e523..35620e3b1 100644 --- a/packages/deriv_feature_flag/lib/feature_flag/feature_flag_repository.dart +++ b/packages/deriv_feature_flag/lib/feature_flag/feature_flag_repository.dart @@ -26,6 +26,13 @@ class FeatureFlagRepository { bool isFeatureOn(String key, {bool defaultValue = false}) => _growthBookSDK.feature(key).on ?? defaultValue; + /// Returns the value of a feature flag. + /// + /// The returned value, depending on the feature flag, can be a boolean, + /// string, num, or a Map. + dynamic getFeatureValue(String key, {dynamic defaultValue = false}) => + _growthBookSDK.feature(key).value ?? defaultValue; + @visibleForTesting GrowthBookSDK get growthBookSDK => _growthBookSDK; } diff --git a/packages/deriv_feature_flag/test/feature_flag/feature_flag_repository_test.dart b/packages/deriv_feature_flag/test/feature_flag/feature_flag_repository_test.dart index 5ba2eb005..7380dfc2e 100644 --- a/packages/deriv_feature_flag/test/feature_flag/feature_flag_repository_test.dart +++ b/packages/deriv_feature_flag/test/feature_flag/feature_flag_repository_test.dart @@ -60,5 +60,7 @@ void main() { /// data should match. expect(result, equals(true)); }); + + // TODO(Ramin): getFeatureValue test. need to first fix test setup since mock response using `when` here is not working correctly right now. }); } From 3300530ddf82b6e5bf5e2c6ee33402758473bafe Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Wed, 29 May 2024 12:04:22 +0800 Subject: [PATCH 082/162] chore(version): bump version and update changelog (#597) Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: ramin-deriv --- CHANGELOG.md | 21 +++++++++++++++++++++ README.md | 2 +- packages/deriv_feature_flag/CHANGELOG.md | 4 ++++ packages/deriv_feature_flag/pubspec.yaml | 2 +- 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index add019c9c..1c3b3637d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,27 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-05-29 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_feature_flag` - `v0.1.1`](#deriv_feature_flag---v011) + +--- + +#### `deriv_feature_flag` - `v0.1.1` + + - **FEAT**(deriv_feature_flag): Add a methods to retrieve values for feature flag types other than boolean ([#513](https://github.com/regentmarkets/flutter-deriv-packages/issues/513)). ([dd30f341](https://github.com/regentmarkets/flutter-deriv-packages/commit/dd30f3419b8d0ca887b4cfc58280db4bc4738076)) + + ## 2024-05-28 ### Changes diff --git a/README.md b/README.md index bdae1c2b3..cd02caf30 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ deriv_ui: | [deriv_widgetbook](./packages/deriv_widgetbook) |Storybook for Deriv UI Widgets and Components | [v0.0.2+4](./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) | +| [deriv_feature_flag](./packages/deriv_feature_flag) | A package to provide feature flag functionality for apps. | [v0.1.1](./packages/deriv_feature_flag/CHANGELOG.md) | ## Environment Setup diff --git a/packages/deriv_feature_flag/CHANGELOG.md b/packages/deriv_feature_flag/CHANGELOG.md index 3f8b5e950..356c30a7b 100644 --- a/packages/deriv_feature_flag/CHANGELOG.md +++ b/packages/deriv_feature_flag/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.1 + + - **FEAT**(deriv_feature_flag): Add a methods to retrieve values for feature flag types other than boolean ([#513](https://github.com/regentmarkets/flutter-deriv-packages/issues/513)). ([dd30f341](https://github.com/regentmarkets/flutter-deriv-packages/commit/dd30f3419b8d0ca887b4cfc58280db4bc4738076)) + ## 0.1.0+1 - **FIX**(deriv_feature_flag): remove env dependancy ([#477](https://github.com/regentmarkets/flutter-deriv-packages/issues/477)). ([c62b20eb](https://github.com/regentmarkets/flutter-deriv-packages/commit/c62b20eb88cf1397ecf4437a7854ff19187d7662)) diff --git a/packages/deriv_feature_flag/pubspec.yaml b/packages/deriv_feature_flag/pubspec.yaml index 0bf0b8773..68cf4ff3c 100644 --- a/packages/deriv_feature_flag/pubspec.yaml +++ b/packages/deriv_feature_flag/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_feature_flag description: wrapper to handle feature flag for deriv applications -version: 0.1.0+1 +version: 0.1.1 publish_to: none environment: From d2db076a2e2b1102c326f1e398f57f960b22cffd Mon Sep 17 00:00:00 2001 From: Illya Tsai Date: Wed, 29 May 2024 12:29:22 +0300 Subject: [PATCH 083/162] add icon sizes for Tradershub new design --- packages/deriv_theme/lib/src/dimens.dart | 6 ++++++ packages/deriv_theme/lib/theme_provider.dart | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/packages/deriv_theme/lib/src/dimens.dart b/packages/deriv_theme/lib/src/dimens.dart index 4a805013b..bc4bc717d 100644 --- a/packages/deriv_theme/lib/src/dimens.dart +++ b/packages/deriv_theme/lib/src/dimens.dart @@ -148,12 +148,18 @@ class Dimens { /// Small icon 16x16. static const double iconSize16 = 16; + /// Small icon 18x18. + static const double iconSize18 = 18; + /// Medium icon. static const double iconSize24 = 24; /// Large icon. static const double iconSize32 = 32; + /// Size 36 icon. + static const double iconSize36 = 36; + /// Size 40 icon. static const double iconSize40 = 40; diff --git a/packages/deriv_theme/lib/theme_provider.dart b/packages/deriv_theme/lib/theme_provider.dart index 0ba85bdc8..d6f48767c 100644 --- a/packages/deriv_theme/lib/theme_provider.dart +++ b/packages/deriv_theme/lib/theme_provider.dart @@ -116,10 +116,14 @@ class ThemeProvider { static const double iconSize16 = Dimens.iconSize16; + static const double iconSize18 = Dimens.iconSize18; + static const double iconSize24 = Dimens.iconSize24; static const double iconSize32 = Dimens.iconSize32; + static const double iconSize36 = Dimens.iconSize36; + static const double iconSize40 = Dimens.iconSize40; static const double iconSize48 = Dimens.iconSize48; From 3b15152c789dfd54dd32cf4c76f3c1afa1915d9e Mon Sep 17 00:00:00 2001 From: sahani-deriv <125638269+sahani-deriv@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:10:55 +0800 Subject: [PATCH 084/162] chore(version): bump version and update changelog (#599) --- CHANGELOG.md | 58 +++++++++++++++++++ README.md | 16 ++--- packages/deriv_auth/CHANGELOG.md | 4 ++ packages/deriv_auth/example/pubspec.yaml | 2 +- packages/deriv_auth/pubspec.yaml | 19 +++--- packages/deriv_date_range_picker/CHANGELOG.md | 4 ++ packages/deriv_date_range_picker/pubspec.yaml | 4 +- .../CHANGELOG.md | 4 ++ .../pubspec.yaml | 4 +- packages/deriv_language_selector/CHANGELOG.md | 4 ++ packages/deriv_language_selector/pubspec.yaml | 4 +- packages/deriv_numpad/CHANGELOG.md | 4 ++ packages/deriv_numpad/pubspec.yaml | 4 +- packages/deriv_passkeys/CHANGELOG.md | 4 ++ packages/deriv_passkeys/pubspec.yaml | 11 ++-- packages/deriv_ui/CHANGELOG.md | 4 ++ packages/deriv_ui/pubspec.yaml | 4 +- packages/deriv_widgetbook/CHANGELOG.md | 4 ++ packages/deriv_widgetbook/pubspec.yaml | 6 +- 19 files changed, 126 insertions(+), 38 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c3b3637d..35d73a2e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,64 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-05-30 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_auth` - `v6.6.3`](#deriv_auth---v663) + - [`deriv_date_range_picker` - `v0.0.1+5`](#deriv_date_range_picker---v0015) + - [`deriv_expandable_bottom_sheet` - `v0.0.1+5`](#deriv_expandable_bottom_sheet---v0015) + - [`deriv_numpad` - `v1.1.4`](#deriv_numpad---v114) + - [`deriv_passkeys` - `v0.0.1+4`](#deriv_passkeys---v0014) + - [`deriv_ui` - `v0.0.7+5`](#deriv_ui---v0075) + - [`deriv_widgetbook` - `v0.0.2+5`](#deriv_widgetbook---v0025) + - [`deriv_language_selector` - `v0.0.2+3`](#deriv_language_selector---v0023) + +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_language_selector` - `v0.0.2+3` + +--- + +#### `deriv_auth` - `v6.6.3` + + - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) + +#### `deriv_date_range_picker` - `v0.0.1+5` + + - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) + +#### `deriv_expandable_bottom_sheet` - `v0.0.1+5` + + - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) + +#### `deriv_numpad` - `v1.1.4` + + - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) + +#### `deriv_passkeys` - `v0.0.1+4` + + - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) + +#### `deriv_ui` - `v0.0.7+5` + + - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) + +#### `deriv_widgetbook` - `v0.0.2+5` + + - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) + + ## 2024-05-29 ### Changes diff --git a/README.md b/README.md index cd02caf30..f06f70e59 100644 --- a/README.md +++ b/README.md @@ -20,29 +20,29 @@ deriv_ui: | Name | Description | Version | | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | | [analytics](./packages/analytics) | Used to collect and send analytical information to 'Firebase' and 'Segment'. | [v1.0.4](./packages/analytics/CHANGELOG.md) | -| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.6.2 ](./packages/deriv_auth/CHANGELOG.md) | +| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.6.3 ](./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) | -| [deriv_date_range_picker](./packages/deriv_date_range_picker) | Provides a widget that allows users to select a date range either by calendar mode or input mode. | [v0.0.1+4](./packages/deriv_date_range_picker/CHANGELOG.md) | +| [deriv_date_range_picker](./packages/deriv_date_range_picker) | Provides a widget that allows users to select a date range either by calendar mode or input mode. | [v0.0.1+5](./packages/deriv_date_range_picker/CHANGELOG.md) | | [deriv_dependency_injector](./packages/deriv_dependency_injector) | A package for handling dependency injection in Dart. | [v1.0.2](./packages/deriv_dependency_injector/CHANGELOG.md) | | [deriv_env](./packages/deriv_env) | A package to load and store environment variables. | [v0.0.1+2](./packages/deriv_env/CHANGELOG.md) | -| [deriv_expandable_bottom_sheet](./packages/deriv_expandable_bottom_sheet) | A widget that helps to display an expandable bottom sheet. | [v0.0.1+4](./packages/deriv_expandable_bottom_sheet/CHANGELOG.md) | +| [deriv_expandable_bottom_sheet](./packages/deriv_expandable_bottom_sheet) | A widget that helps to display an expandable bottom sheet. | [v0.0.1+5](./packages/deriv_expandable_bottom_sheet/CHANGELOG.md) | | [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+2](./packages/deriv_live_chat/CHANGELOG.md) | -| [deriv_language_selector](./packages/deriv_language_selector) | A package to handle language change of the app. | [v0.0.2+2](./packages/deriv_language_selector/CHANGELOG.md) | +| [deriv_language_selector](./packages/deriv_language_selector) | A package to handle language change of the app. | [v0.0.2+3](./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.4.1](./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_numpad](./packages/deriv_numpad) | Number Pad Widget for number input. | [v1.1.4](./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+4](./packages/deriv_ui/CHANGELOG.md) | +| [deriv_theme](./packages/deriv_theme) | A package that contains the theme used by Deriv products. | [v2.5.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+5](./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+1](./packages/deriv_web_view/CHANGELOG.md) | -| [deriv_widgetbook](./packages/deriv_widgetbook) |Storybook for Deriv UI Widgets and Components | [v0.0.2+4](./packages/deriv_widgetbook/CHANGELOG.md) | +| [deriv_widgetbook](./packages/deriv_widgetbook) |Storybook for Deriv UI Widgets and Components | [v0.0.2+5](./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.1](./packages/deriv_feature_flag/CHANGELOG.md) | diff --git a/packages/deriv_auth/CHANGELOG.md b/packages/deriv_auth/CHANGELOG.md index 18c5112cc..f88243977 100644 --- a/packages/deriv_auth/CHANGELOG.md +++ b/packages/deriv_auth/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.6.3 + + - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) + ## 6.6.2 - Update a dependency to the latest release. diff --git a/packages/deriv_auth/example/pubspec.yaml b/packages/deriv_auth/example/pubspec.yaml index d1ba03014..bd7100588 100644 --- a/packages/deriv_auth/example/pubspec.yaml +++ b/packages/deriv_auth/example/pubspec.yaml @@ -29,7 +29,7 @@ dependency_overrides: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.7+4 + ref: deriv_ui-v0.0.7+5 dev_dependencies: flutter_test: diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index 183141a63..4bfb930e2 100644 --- a/packages/deriv_auth/pubspec.yaml +++ b/packages/deriv_auth/pubspec.yaml @@ -1,7 +1,6 @@ name: deriv_auth description: Provides deriv authentication functionalities for dart/flutter apps. -version: 6.6.2 - +version: 6.6.3 environment: sdk: ">=3.0.0 <4.0.0" @@ -17,14 +16,14 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_theme - ref: deriv_theme-v2.4.0 + ref: deriv_theme-v2.5.0 deriv_ui: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.7+4 - + ref: deriv_ui-v0.0.7+5 + deriv_http_client: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git @@ -52,14 +51,14 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: deriv_passkeys-v0.0.1+3 - + ref: deriv_passkeys-v0.0.1+4 + deriv_language_selector: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_language_selector - ref: deriv_language_selector-v0.0.2+2 - + ref: deriv_language_selector-v0.0.2+3 + flutter_bloc: ^8.1.3 flutter_svg: ^2.0.7 smooth_page_indicator: ^1.1.0 @@ -74,7 +73,7 @@ dependency_overrides: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.7+4 + ref: deriv_ui-v0.0.7+5 dev_dependencies: mocktail: ^1.0.3 diff --git a/packages/deriv_date_range_picker/CHANGELOG.md b/packages/deriv_date_range_picker/CHANGELOG.md index dba2abdf3..5c1e03723 100644 --- a/packages/deriv_date_range_picker/CHANGELOG.md +++ b/packages/deriv_date_range_picker/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.1+5 + + - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) + ## 0.0.1+4 - Update a dependency to the latest release. diff --git a/packages/deriv_date_range_picker/pubspec.yaml b/packages/deriv_date_range_picker/pubspec.yaml index 5a6716f95..3474d4f2b 100644 --- a/packages/deriv_date_range_picker/pubspec.yaml +++ b/packages/deriv_date_range_picker/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_date_range_picker description: A new Flutter package project. -version: 0.0.1+4 +version: 0.0.1+5 publish_to: "none" # Remove this line if you wish to publish to pub.dev environment: @@ -17,7 +17,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_theme - ref: deriv_theme-v2.4.0 + ref: deriv_theme-v2.5.0 intl: ^0.18.0 diff --git a/packages/deriv_expandable_bottom_sheet/CHANGELOG.md b/packages/deriv_expandable_bottom_sheet/CHANGELOG.md index 890cea971..54bee2ee9 100644 --- a/packages/deriv_expandable_bottom_sheet/CHANGELOG.md +++ b/packages/deriv_expandable_bottom_sheet/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.1+5 + + - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) + ## 0.0.1+4 - Update a dependency to the latest release. diff --git a/packages/deriv_expandable_bottom_sheet/pubspec.yaml b/packages/deriv_expandable_bottom_sheet/pubspec.yaml index 5255ac230..273662b53 100644 --- a/packages/deriv_expandable_bottom_sheet/pubspec.yaml +++ b/packages/deriv_expandable_bottom_sheet/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_expandable_bottom_sheet description: A new Flutter package project. -version: 0.0.1+4 +version: 0.0.1+5 publish_to: none environment: @@ -15,7 +15,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_theme - ref: deriv_theme-v2.4.0 + ref: deriv_theme-v2.5.0 dev_dependencies: flutter_test: diff --git a/packages/deriv_language_selector/CHANGELOG.md b/packages/deriv_language_selector/CHANGELOG.md index c9116727f..67c92b8c6 100644 --- a/packages/deriv_language_selector/CHANGELOG.md +++ b/packages/deriv_language_selector/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_language_selector/pubspec.yaml b/packages/deriv_language_selector/pubspec.yaml index a902e383d..bf9d91c4d 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+2 +version: 0.0.2+3 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+4 + ref: deriv_ui-v0.0.7+5 shared_preferences: ^2.2.2 flutter_bloc: ^8.1.4 equatable: ^2.0.5 diff --git a/packages/deriv_numpad/CHANGELOG.md b/packages/deriv_numpad/CHANGELOG.md index b2da37601..5c7c38568 100644 --- a/packages/deriv_numpad/CHANGELOG.md +++ b/packages/deriv_numpad/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.1.4 + + - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) + ## 1.1.3 - Update a dependency to the latest release. diff --git a/packages/deriv_numpad/pubspec.yaml b/packages/deriv_numpad/pubspec.yaml index c91106feb..f073e7bf7 100644 --- a/packages/deriv_numpad/pubspec.yaml +++ b/packages/deriv_numpad/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_numpad description: A new Flutter project. -version: 1.1.3 +version: 1.1.4 publish_to: "none" environment: @@ -13,7 +13,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_theme - ref: deriv_theme-v2.4.0 + ref: deriv_theme-v2.5.0 flutter_svg: ^2.0.7 intl: ^0.18.0 diff --git a/packages/deriv_passkeys/CHANGELOG.md b/packages/deriv_passkeys/CHANGELOG.md index b638d7e95..d96e5c1af 100644 --- a/packages/deriv_passkeys/CHANGELOG.md +++ b/packages/deriv_passkeys/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.1+4 + + - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) + ## 0.0.1+3 - **REFACTOR**(deriv_passkeys): Update exception handling in DerivPasskeysPlugin. ([5d218724](https://github.com/regentmarkets/flutter-deriv-packages/commit/5d218724ffd2cf71dc58238fda97e8413abfee8a)) diff --git a/packages/deriv_passkeys/pubspec.yaml b/packages/deriv_passkeys/pubspec.yaml index 2c5afee72..3788add64 100644 --- a/packages/deriv_passkeys/pubspec.yaml +++ b/packages/deriv_passkeys/pubspec.yaml @@ -1,10 +1,10 @@ name: deriv_passkeys description: Deriv Passkeys Flutter Plugin -version: 0.0.1+3 -publish_to: 'none' +version: 0.0.1+4 +publish_to: "none" environment: - sdk: '>=3.0.0 <4.0.0' + sdk: ">=3.0.0 <4.0.0" dependencies: flutter: @@ -14,7 +14,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_theme - ref: deriv_theme-v2.4.0 + ref: deriv_theme-v2.5.0 deriv_localizations: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git @@ -24,7 +24,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.7+4 + ref: deriv_ui-v0.0.7+5 deriv_http_client: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git @@ -35,7 +35,6 @@ dependencies: url: git@github.com:deriv-com/flutter-deriv-api.git ref: dev - flutter_svg: ^2.0.9 plugin_platform_interface: ^2.0.2 http: ^0.13.4 diff --git a/packages/deriv_ui/CHANGELOG.md b/packages/deriv_ui/CHANGELOG.md index 10c38b31a..4dd3eeaf2 100644 --- a/packages/deriv_ui/CHANGELOG.md +++ b/packages/deriv_ui/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.7+5 + + - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) + ## 0.0.7+4 - **FIX**(deriv_ui): add specific formatter for crypto and fiat currency ([#569](https://github.com/regentmarkets/flutter-deriv-packages/issues/569)). ([711abee1](https://github.com/regentmarkets/flutter-deriv-packages/commit/711abee199278b7f0fd7463de6f480d561e99d67)) diff --git a/packages/deriv_ui/pubspec.yaml b/packages/deriv_ui/pubspec.yaml index f2c2561d3..e1c5e4063 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+4 +version: 0.0.7+5 publish_to: none environment: @@ -17,7 +17,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_theme - ref: deriv_theme-v2.4.0 + ref: deriv_theme-v2.5.0 deriv_web_view: git: diff --git a/packages/deriv_widgetbook/CHANGELOG.md b/packages/deriv_widgetbook/CHANGELOG.md index 03b1a29fa..df3d51eef 100644 --- a/packages/deriv_widgetbook/CHANGELOG.md +++ b/packages/deriv_widgetbook/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.2+5 + + - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) + ## 0.0.2+4 - Update a dependency to the latest release. diff --git a/packages/deriv_widgetbook/pubspec.yaml b/packages/deriv_widgetbook/pubspec.yaml index 060265ab1..85838f21c 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+4 +version: 0.0.2+5 environment: sdk: ">=3.0.0 <4.0.0" @@ -16,12 +16,12 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.7+4 + ref: deriv_ui-v0.0.7+5 deriv_theme: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_theme - ref: deriv_theme-v2.4.0 + ref: deriv_theme-v2.5.0 intl: ^0.18.0 shared_preferences: ^2.2.2 From b136424f144454727d670c3076074ed0e7197ae0 Mon Sep 17 00:00:00 2001 From: abedelaziz-deriv <135210555+abedelaziz-deriv@users.noreply.github.com> Date: Fri, 7 Jun 2024 10:53:04 +0800 Subject: [PATCH 085/162] fix(deriv_passkeys): Increased iOS support to 16 (#601) --- .../deriv_passkeys/example/ios/Podfile.lock | 2 +- .../ios/Classes/DerivPasskeysManager.swift | 48 +++++++++---------- .../ios/Classes/DerivPasskeysPlugin.swift | 6 +-- .../PublicKeyCredentialRequestOptions.swift | 10 ++-- .../deriv_passkeys/ios/deriv_passkeys.podspec | 4 +- 5 files changed, 35 insertions(+), 35 deletions(-) diff --git a/packages/deriv_passkeys/example/ios/Podfile.lock b/packages/deriv_passkeys/example/ios/Podfile.lock index 81840226b..19b71dc2d 100644 --- a/packages/deriv_passkeys/example/ios/Podfile.lock +++ b/packages/deriv_passkeys/example/ios/Podfile.lock @@ -82,4 +82,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 23c5db403a9f2d103e08afd68b26a1601b49de37 -COCOAPODS: 1.15.2 +COCOAPODS: 1.13.0 diff --git a/packages/deriv_passkeys/ios/Classes/DerivPasskeysManager.swift b/packages/deriv_passkeys/ios/Classes/DerivPasskeysManager.swift index cef52b6f8..7cc97ab3d 100644 --- a/packages/deriv_passkeys/ios/Classes/DerivPasskeysManager.swift +++ b/packages/deriv_passkeys/ios/Classes/DerivPasskeysManager.swift @@ -2,8 +2,8 @@ import Flutter import UIKit import AuthenticationServices -@available(iOS 15.0, *) -public class DerivPasskeysManager{ +@available(iOS 16.0, *) +public class DerivPasskeysManager{ enum PluginError: Error { case unknownError case notFound(String) @@ -34,12 +34,12 @@ public class DerivPasskeysManager{ } } - @available(iOS 15.0, *) + @available(iOS 16.0, *) private func getPlatformPublicKeyCredentials() -> [String] { return (UserDefaults.standard.object(forKey: "platformPublicKeyCredentials") as? [String]) ?? [] } - @available(iOS 15.0, *) + @available(iOS 16.0, *) private func savePlatformPublicKeyCredential(_ credential: ASAuthorizationCredential) { var credentialID = "" if let credential = credential as? ASAuthorizationPlatformPublicKeyCredentialRegistration { @@ -58,7 +58,7 @@ public class DerivPasskeysManager{ } - @available(iOS 15.0, *) + @available(iOS 16.0, *) private func handlePlatformExcludedCredentials(_ options: PublicKeyCredentialRequestOptions) throws { let excludeCredentials = options.excludeCredentials guard excludeCredentials.count > 0 else { return } @@ -72,7 +72,7 @@ public class DerivPasskeysManager{ } } - @available(iOS 15.0, *) + @available(iOS 16.0, *) private func findPlatformCredentials(_ credentials: [Data]) -> [Data] { guard credentials.count > 0 else { return [] } var foundCredentials: [Data] = [] @@ -88,7 +88,7 @@ public class DerivPasskeysManager{ return foundCredentials } - @available(iOS 15.0, *) + @available(iOS 16.0, *) private func createPlatformPublicKeyCredentialRegistrationRequest(_ options: PublicKeyCredentialRequestOptions) throws -> ASAuthorizationPlatformPublicKeyCredentialRegistrationRequest { let rpId = try options.rpId let challenge = try options.challenge @@ -110,7 +110,7 @@ public class DerivPasskeysManager{ return registrationRequest } - @available(iOS 15.0, *) + @available(iOS 16.0, *) private func createSecurityKeyPublicKeyCredentialRegistrationRequest(_ options: PublicKeyCredentialRequestOptions) throws -> ASAuthorizationSecurityKeyPublicKeyCredentialRegistrationRequest { let rpId = try options.rpId let challenge = try options.challenge @@ -135,7 +135,7 @@ public class DerivPasskeysManager{ return registrationRequest } - @available(iOS 15.0, *) + @available(iOS 16.0, *) private func createPlatformPublicKeyCredentialAssertionRequest(_ options: PublicKeyCredentialRequestOptions) throws -> ASAuthorizationPlatformPublicKeyCredentialAssertionRequest { let rpId = try options.rpId let challenge = try options.challenge @@ -152,7 +152,7 @@ public class DerivPasskeysManager{ return assertionRequest } - @available(iOS 15.0, *) + @available(iOS 16.0, *) private func createSecurityKeyPublicKeyCredentialAssertionRequest(_ options: PublicKeyCredentialRequestOptions) throws -> ASAuthorizationSecurityKeyPublicKeyCredentialAssertionRequest { let rpId = try options.rpId let challenge = try options.challenge @@ -168,7 +168,7 @@ public class DerivPasskeysManager{ return assertionRequest } - @available(iOS 15.0, *) + @available(iOS 16.0, *) private func getPresentationContextProvider() throws -> ASAuthorizationControllerPresentationContextProviding { let keyWindow = UIApplication.shared.connectedScenes .filter({$0.activationState == .foregroundActive}) @@ -191,7 +191,7 @@ public class DerivPasskeysManager{ return contextProvider } - @available(iOS 15.0, *) + @available(iOS 16.0, *) private func requestCredential(_ authorizationRequests: [ASAuthorizationRequest]) throws -> ASAuthorizationCredential { let authController = ASAuthorizationController(authorizationRequests: authorizationRequests) let authCtrlDelete = AuthCtrlDelegate() @@ -214,7 +214,7 @@ public class DerivPasskeysManager{ return authorization.credential } - @available(iOS 15.0, *) + @available(iOS 16.0, *) private func generateCredentialRegistrationResponse(_ credentialID: Data, _ rawClientDataJSON: Data, _ rawAttestationObject: Data? = nil) throws -> [String: Any] { let response = [ "id": credentialID.base64url, @@ -230,7 +230,7 @@ public class DerivPasskeysManager{ return response } - @available(iOS 15.0, *) + @available(iOS 16.0, *) private func generateCredentialAssertionResponse(_ credentialID: Data, _ userID: Data, _ signature: Data, _ rawAuthenticatorData: Data, _ rawClientDataJSON: Data) throws -> [String: Any] { let response = [ "id": credentialID.base64url, @@ -247,7 +247,7 @@ public class DerivPasskeysManager{ return response } - @available(iOS 15.0, *) + @available(iOS 16.0, *) private func generateCredentialResponse(_ credential: ASAuthorizationCredential) throws -> [String: Any] { var response: [String: Any] = [:] switch (credential) { @@ -269,7 +269,7 @@ public class DerivPasskeysManager{ return response } - @available(iOS 15.0, *) + @available(iOS 16.0, *) private func requestCredentialRegistration(_ options: PublicKeyCredentialRequestOptions) throws -> String { var authorizationRequests: [ASAuthorizationRequest] = [] switch options.authenticatorAttachment { @@ -286,7 +286,7 @@ public class DerivPasskeysManager{ return try response.jsonString } - @available(iOS 15.0, *) + @available(iOS 16.0, *) private func requestCredentialAssertion(_ options: PublicKeyCredentialRequestOptions) throws -> String { var authorizationRequests: [ASAuthorizationRequest] = [] switch options.authenticatorAttachment { @@ -312,7 +312,7 @@ public class DerivPasskeysManager{ return try response.jsonString } - @available(iOS 15.0, *) + @available(iOS 16.0, *) public func createCredential(_ options: String, _ callback: @escaping (_ credential: String?, _ error: Error?) -> Void) { Task { do { @@ -324,7 +324,7 @@ public class DerivPasskeysManager{ } } - @available(iOS 15.0, *) + @available(iOS 16.0, *) public func getCredential(_ options: String, _ callback: @escaping (_ credential: String?, _ error: Error?) -> Void) { Task { do { @@ -337,7 +337,7 @@ public class DerivPasskeysManager{ } } -@available(iOS 15.0, *) +@available(iOS 16.0, *) extension DerivPasskeysManager.PluginError: CustomStringConvertible { var description: String { switch self { @@ -353,28 +353,28 @@ extension DerivPasskeysManager.PluginError: CustomStringConvertible { } } -@available(iOS 15.0, *) +@available(iOS 16.0, *) extension DerivPasskeysManager.PluginError: LocalizedError { private var errorDescription: String { return self.description } } -@available(iOS 15.0, *) +@available(iOS 16.0, *) extension FlutterViewController: ASAuthorizationControllerPresentationContextProviding { public func presentationAnchor(for controller: ASAuthorizationController) -> ASPresentationAnchor { return self.view.window! } } -@available(iOS 15.0, *) +@available(iOS 16.0, *) extension Data { var base64url: String { self.base64EncodedString().replacingOccurrences(of: "+", with: "-").replacingOccurrences(of: "/", with: "_").replacingOccurrences(of: "=", with: "") } } -@available(iOS 15.0, *) +@available(iOS 16.0, *) extension Dictionary where Key == String { var jsonString: String { get throws { diff --git a/packages/deriv_passkeys/ios/Classes/DerivPasskeysPlugin.swift b/packages/deriv_passkeys/ios/Classes/DerivPasskeysPlugin.swift index 73b1c5af4..b2cdeb88a 100644 --- a/packages/deriv_passkeys/ios/Classes/DerivPasskeysPlugin.swift +++ b/packages/deriv_passkeys/ios/Classes/DerivPasskeysPlugin.swift @@ -14,13 +14,13 @@ public class DerivPasskeysPlugin: NSObject, FlutterPlugin { switch call.method { case "isPlatformSupported": - if #available(iOS 15.0, *) { + if #available(iOS 16.0, *) { result(true) } else { result(false) } case "createCredential": - if #available(iOS 15.0, *) { + if #available(iOS 16.0, *) { let derivPasskeysManager = DerivPasskeysManager() if let args = call.arguments as? [String: Any], let options = args["options"] as? String { derivPasskeysManager.createCredential(options) { credential, error in @@ -43,7 +43,7 @@ public class DerivPasskeysPlugin: NSObject, FlutterPlugin { details: nil)) } case "getCredential": - if #available(iOS 15.0, *) { + if #available(iOS 16.0, *) { let derivPasskeysManager = DerivPasskeysManager() if let args = call.arguments as? [String: Any], let options = args["options"] as? String { derivPasskeysManager.getCredential(options) { credential, error in diff --git a/packages/deriv_passkeys/ios/Classes/PublicKeyCredentialRequestOptions.swift b/packages/deriv_passkeys/ios/Classes/PublicKeyCredentialRequestOptions.swift index 5cc387906..455ca75ca 100644 --- a/packages/deriv_passkeys/ios/Classes/PublicKeyCredentialRequestOptions.swift +++ b/packages/deriv_passkeys/ios/Classes/PublicKeyCredentialRequestOptions.swift @@ -1,6 +1,6 @@ import AuthenticationServices -@available(iOS 15.0, *) +@available(iOS 16.0, *) public class PublicKeyCredentialRequestOptions: NSObject { enum OptionError: Error { @@ -173,7 +173,7 @@ public class PublicKeyCredentialRequestOptions: NSObject { } } -@available(iOS 15.0, *) +@available(iOS 16.0, *) extension PublicKeyCredentialRequestOptions.OptionError: CustomStringConvertible { var description: String { switch self { @@ -185,15 +185,15 @@ extension PublicKeyCredentialRequestOptions.OptionError: CustomStringConvertible } } -@available(iOS 15.0, *) +@available(iOS 16.0, *) extension PublicKeyCredentialRequestOptions.OptionError: LocalizedError { private var errorDescription: String { return self.description } } -@available(iOS 15.0, *) -extension String { +@available(iOS 16.0, *) +extension String { var base64urlDecoded: Data? { var base64 = self.replacingOccurrences(of: "-", with: "+").replacingOccurrences(of: "_", with: "/") if base64.count % 4 != 0 { base64.append(String(repeating: "=", count: 4 - base64.count % 4)) } diff --git a/packages/deriv_passkeys/ios/deriv_passkeys.podspec b/packages/deriv_passkeys/ios/deriv_passkeys.podspec index 57554f425..4b8eaa030 100644 --- a/packages/deriv_passkeys/ios/deriv_passkeys.podspec +++ b/packages/deriv_passkeys/ios/deriv_passkeys.podspec @@ -4,8 +4,8 @@ # Pod::Spec.new do |s| s.name = 'deriv_passkeys' - s.version = '0.0.1' - s.summary = 'A new Flutter project.' + s.version = '1.0.0' + s.summary = 'Deriv Passkeys for iOS.' s.description = <<-DESC A new Flutter project. DESC From 47214e0f733334a2dafb45bd5c8a97bbb25e2b2d Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Fri, 7 Jun 2024 11:57:13 +0800 Subject: [PATCH 086/162] chore(version): bump version and update changelog (#605) --- CHANGELOG.md | 59 +++++++++++++++++++ README.md | 20 +++---- packages/deriv_auth/CHANGELOG.md | 4 ++ packages/deriv_auth/pubspec.yaml | 10 ++-- packages/deriv_date_range_picker/CHANGELOG.md | 4 ++ packages/deriv_date_range_picker/pubspec.yaml | 2 +- .../CHANGELOG.md | 4 ++ .../pubspec.yaml | 2 +- packages/deriv_language_selector/CHANGELOG.md | 4 ++ packages/deriv_language_selector/pubspec.yaml | 4 +- packages/deriv_numpad/CHANGELOG.md | 4 ++ packages/deriv_numpad/pubspec.yaml | 2 +- packages/deriv_passkeys/CHANGELOG.md | 5 ++ packages/deriv_passkeys/pubspec.yaml | 4 +- packages/deriv_ui/CHANGELOG.md | 4 ++ packages/deriv_ui/pubspec.yaml | 2 +- packages/deriv_widgetbook/CHANGELOG.md | 4 ++ packages/deriv_widgetbook/pubspec.yaml | 4 +- 18 files changed, 117 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35d73a2e5..8ae8ebebb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,65 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-06-07 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_auth` - `v6.6.4`](#deriv_auth---v664) + - [`deriv_date_range_picker` - `v0.0.1+6`](#deriv_date_range_picker---v0016) + - [`deriv_expandable_bottom_sheet` - `v0.0.1+6`](#deriv_expandable_bottom_sheet---v0016) + - [`deriv_numpad` - `v1.1.5`](#deriv_numpad---v115) + - [`deriv_passkeys` - `v0.0.1+5`](#deriv_passkeys---v0015) + - [`deriv_ui` - `v0.0.7+6`](#deriv_ui---v0076) + - [`deriv_widgetbook` - `v0.0.2+6`](#deriv_widgetbook---v0026) + - [`deriv_language_selector` - `v0.0.2+4`](#deriv_language_selector---v0024) + +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_language_selector` - `v0.0.2+4` + +--- + +#### `deriv_auth` - `v6.6.4` + + - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) + +#### `deriv_date_range_picker` - `v0.0.1+6` + + - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) + +#### `deriv_expandable_bottom_sheet` - `v0.0.1+6` + + - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) + +#### `deriv_numpad` - `v1.1.5` + + - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) + +#### `deriv_passkeys` - `v0.0.1+5` + + - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) + - **FIX**(deriv_passkeys): Increased iOS support to 16 ([#601](https://github.com/regentmarkets/flutter-deriv-packages/issues/601)). ([b136424f](https://github.com/regentmarkets/flutter-deriv-packages/commit/b136424f144454727d670c3076074ed0e7197ae0)) + +#### `deriv_ui` - `v0.0.7+6` + + - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) + +#### `deriv_widgetbook` - `v0.0.2+6` + + - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) + + ## 2024-05-30 ### Changes diff --git a/README.md b/README.md index f06f70e59..35951c110 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.6.2)`. 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.6.4)`. 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+4 #your prefered version + ref: deriv_ui-v0.0.7+6 #your prefered version ``` ## Packages @@ -20,29 +20,29 @@ deriv_ui: | Name | Description | Version | | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | | [analytics](./packages/analytics) | Used to collect and send analytical information to 'Firebase' and 'Segment'. | [v1.0.4](./packages/analytics/CHANGELOG.md) | -| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.6.3 ](./packages/deriv_auth/CHANGELOG.md) | +| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.6.4 ](./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) | -| [deriv_date_range_picker](./packages/deriv_date_range_picker) | Provides a widget that allows users to select a date range either by calendar mode or input mode. | [v0.0.1+5](./packages/deriv_date_range_picker/CHANGELOG.md) | +| [deriv_date_range_picker](./packages/deriv_date_range_picker) | Provides a widget that allows users to select a date range either by calendar mode or input mode. | [v0.0.1+6](./packages/deriv_date_range_picker/CHANGELOG.md) | | [deriv_dependency_injector](./packages/deriv_dependency_injector) | A package for handling dependency injection in Dart. | [v1.0.2](./packages/deriv_dependency_injector/CHANGELOG.md) | | [deriv_env](./packages/deriv_env) | A package to load and store environment variables. | [v0.0.1+2](./packages/deriv_env/CHANGELOG.md) | -| [deriv_expandable_bottom_sheet](./packages/deriv_expandable_bottom_sheet) | A widget that helps to display an expandable bottom sheet. | [v0.0.1+5](./packages/deriv_expandable_bottom_sheet/CHANGELOG.md) | +| [deriv_expandable_bottom_sheet](./packages/deriv_expandable_bottom_sheet) | A widget that helps to display an expandable bottom sheet. | [v0.0.1+6](./packages/deriv_expandable_bottom_sheet/CHANGELOG.md) | | [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+2](./packages/deriv_live_chat/CHANGELOG.md) | -| [deriv_language_selector](./packages/deriv_language_selector) | A package to handle language change of the app. | [v0.0.2+3](./packages/deriv_language_selector/CHANGELOG.md) | +| [deriv_language_selector](./packages/deriv_language_selector) | A package to handle language change of the app. | [v0.0.2+4](./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.4.1](./packages/deriv_localizations/CHANGELOG.md) | -| [deriv_numpad](./packages/deriv_numpad) | Number Pad Widget for number input. | [v1.1.4](./packages/deriv_numpad/CHANGELOG.md) | +| [deriv_numpad](./packages/deriv_numpad) | Number Pad Widget for number input. | [v1.1.5](./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.5.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+5](./packages/deriv_ui/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+6](./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+1](./packages/deriv_web_view/CHANGELOG.md) | -| [deriv_widgetbook](./packages/deriv_widgetbook) |Storybook for Deriv UI Widgets and Components | [v0.0.2+5](./packages/deriv_widgetbook/CHANGELOG.md) | +| [deriv_widgetbook](./packages/deriv_widgetbook) |Storybook for Deriv UI Widgets and Components | [v0.0.2+6](./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.1](./packages/deriv_feature_flag/CHANGELOG.md) | diff --git a/packages/deriv_auth/CHANGELOG.md b/packages/deriv_auth/CHANGELOG.md index f88243977..d40b88f1d 100644 --- a/packages/deriv_auth/CHANGELOG.md +++ b/packages/deriv_auth/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.6.4 + + - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) + ## 6.6.3 - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index 4bfb930e2..c2c5d4df1 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.6.3 +version: 6.6.4 environment: sdk: ">=3.0.0 <4.0.0" @@ -22,7 +22,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.7+5 + ref: deriv_ui-v0.0.7+6 deriv_http_client: git: @@ -51,13 +51,13 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: deriv_passkeys-v0.0.1+4 + ref: deriv_passkeys-v0.0.1+5 deriv_language_selector: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_language_selector - ref: deriv_language_selector-v0.0.2+3 + ref: deriv_language_selector-v0.0.2+4 flutter_bloc: ^8.1.3 flutter_svg: ^2.0.7 @@ -73,7 +73,7 @@ dependency_overrides: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.7+5 + ref: deriv_ui-v0.0.7+6 dev_dependencies: mocktail: ^1.0.3 diff --git a/packages/deriv_date_range_picker/CHANGELOG.md b/packages/deriv_date_range_picker/CHANGELOG.md index 5c1e03723..3ff19f7f3 100644 --- a/packages/deriv_date_range_picker/CHANGELOG.md +++ b/packages/deriv_date_range_picker/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.1+6 + + - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) + ## 0.0.1+5 - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) diff --git a/packages/deriv_date_range_picker/pubspec.yaml b/packages/deriv_date_range_picker/pubspec.yaml index 3474d4f2b..5b66e49e1 100644 --- a/packages/deriv_date_range_picker/pubspec.yaml +++ b/packages/deriv_date_range_picker/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_date_range_picker description: A new Flutter package project. -version: 0.0.1+5 +version: 0.0.1+6 publish_to: "none" # Remove this line if you wish to publish to pub.dev environment: diff --git a/packages/deriv_expandable_bottom_sheet/CHANGELOG.md b/packages/deriv_expandable_bottom_sheet/CHANGELOG.md index 54bee2ee9..608ca0350 100644 --- a/packages/deriv_expandable_bottom_sheet/CHANGELOG.md +++ b/packages/deriv_expandable_bottom_sheet/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.1+6 + + - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) + ## 0.0.1+5 - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) diff --git a/packages/deriv_expandable_bottom_sheet/pubspec.yaml b/packages/deriv_expandable_bottom_sheet/pubspec.yaml index 273662b53..a4890f60f 100644 --- a/packages/deriv_expandable_bottom_sheet/pubspec.yaml +++ b/packages/deriv_expandable_bottom_sheet/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_expandable_bottom_sheet description: A new Flutter package project. -version: 0.0.1+5 +version: 0.0.1+6 publish_to: none environment: diff --git a/packages/deriv_language_selector/CHANGELOG.md b/packages/deriv_language_selector/CHANGELOG.md index 67c92b8c6..4eb2f1faf 100644 --- a/packages/deriv_language_selector/CHANGELOG.md +++ b/packages/deriv_language_selector/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.2+4 + + - Update a dependency to the latest release. + ## 0.0.2+3 - Update a dependency to the latest release. diff --git a/packages/deriv_language_selector/pubspec.yaml b/packages/deriv_language_selector/pubspec.yaml index bf9d91c4d..3b0c952eb 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+3 +version: 0.0.2+4 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+5 + ref: deriv_ui-v0.0.7+6 shared_preferences: ^2.2.2 flutter_bloc: ^8.1.4 equatable: ^2.0.5 diff --git a/packages/deriv_numpad/CHANGELOG.md b/packages/deriv_numpad/CHANGELOG.md index 5c7c38568..92e0f9f7c 100644 --- a/packages/deriv_numpad/CHANGELOG.md +++ b/packages/deriv_numpad/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.1.5 + + - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) + ## 1.1.4 - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) diff --git a/packages/deriv_numpad/pubspec.yaml b/packages/deriv_numpad/pubspec.yaml index f073e7bf7..91c46ee96 100644 --- a/packages/deriv_numpad/pubspec.yaml +++ b/packages/deriv_numpad/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_numpad description: A new Flutter project. -version: 1.1.4 +version: 1.1.5 publish_to: "none" environment: diff --git a/packages/deriv_passkeys/CHANGELOG.md b/packages/deriv_passkeys/CHANGELOG.md index d96e5c1af..22d270ed0 100644 --- a/packages/deriv_passkeys/CHANGELOG.md +++ b/packages/deriv_passkeys/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.0.1+5 + + - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) + - **FIX**(deriv_passkeys): Increased iOS support to 16 ([#601](https://github.com/regentmarkets/flutter-deriv-packages/issues/601)). ([b136424f](https://github.com/regentmarkets/flutter-deriv-packages/commit/b136424f144454727d670c3076074ed0e7197ae0)) + ## 0.0.1+4 - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) diff --git a/packages/deriv_passkeys/pubspec.yaml b/packages/deriv_passkeys/pubspec.yaml index 3788add64..ea509b874 100644 --- a/packages/deriv_passkeys/pubspec.yaml +++ b/packages/deriv_passkeys/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_passkeys description: Deriv Passkeys Flutter Plugin -version: 0.0.1+4 +version: 0.0.1+5 publish_to: "none" environment: @@ -24,7 +24,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.7+5 + ref: deriv_ui-v0.0.7+6 deriv_http_client: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git diff --git a/packages/deriv_ui/CHANGELOG.md b/packages/deriv_ui/CHANGELOG.md index 4dd3eeaf2..1441b306e 100644 --- a/packages/deriv_ui/CHANGELOG.md +++ b/packages/deriv_ui/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.7+6 + + - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) + ## 0.0.7+5 - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) diff --git a/packages/deriv_ui/pubspec.yaml b/packages/deriv_ui/pubspec.yaml index e1c5e4063..f32c6ff6e 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+5 +version: 0.0.7+6 publish_to: none environment: diff --git a/packages/deriv_widgetbook/CHANGELOG.md b/packages/deriv_widgetbook/CHANGELOG.md index df3d51eef..edd0b2854 100644 --- a/packages/deriv_widgetbook/CHANGELOG.md +++ b/packages/deriv_widgetbook/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.2+6 + + - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) + ## 0.0.2+5 - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) diff --git a/packages/deriv_widgetbook/pubspec.yaml b/packages/deriv_widgetbook/pubspec.yaml index 85838f21c..9ced126dc 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+5 +version: 0.0.2+6 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+5 + ref: deriv_ui-v0.0.7+6 deriv_theme: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git From ed2a7ea958e34aa027ecb9ef6919f04fd5c7d5f1 Mon Sep 17 00:00:00 2001 From: emad-deriv <134991873+emad-deriv@users.noreply.github.com> Date: Mon, 10 Jun 2024 10:45:01 +0800 Subject: [PATCH 087/162] fix(deriv-localization): fix passkey button strings (#606) --- .../deriv_localizations/lib/l10n/deriv_passkeys/app_en.arb | 4 ++-- .../deriv_passkeys/deriv_passkeys_localizations.dart | 4 ++-- .../deriv_passkeys/deriv_passkeys_localizations_en.dart | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_en.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_en.arb index e97a76898..6a72eb09c 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_en.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_en.arb @@ -51,8 +51,8 @@ "lastUsed": "Last used", "rename": "Rename", "revoke": "Revoke", - "continueTradingButtonText": "Continue Trading", - "addMorePasskeysButtonText": "Add More Passkeys", + "continueTradingButtonText": "Continue trading", + "addMorePasskeysButtonText": "Add more passkeys", "unableToSetupPasskey": "Unable to setup passkey", "unableToSetupPasskeyDescription": "We encountered an issue while setting up your passkey. The process might have been interrupted, or the session timed out. Please try again.", "passkeysOffErrorTitle": "The Passkeys service is unavailable", 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 c694130ce..d9b9d4cfd 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 @@ -390,13 +390,13 @@ abstract class DerivPasskeysLocalizations { /// No description provided for @continueTradingButtonText. /// /// In en, this message translates to: - /// **'Continue Trading'** + /// **'Continue trading'** String get continueTradingButtonText; /// No description provided for @addMorePasskeysButtonText. /// /// In en, this message translates to: - /// **'Add More Passkeys'** + /// **'Add more passkeys'** String get addMorePasskeysButtonText; /// No description provided for @unableToSetupPasskey. diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_en.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_en.dart index 991953ef4..f7967fc63 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_en.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_en.dart @@ -139,10 +139,10 @@ class DerivPasskeysLocalizationsEn extends DerivPasskeysLocalizations { String get revoke => 'Revoke'; @override - String get continueTradingButtonText => 'Continue Trading'; + String get continueTradingButtonText => 'Continue trading'; @override - String get addMorePasskeysButtonText => 'Add More Passkeys'; + String get addMorePasskeysButtonText => 'Add more passkeys'; @override String get unableToSetupPasskey => 'Unable to setup passkey'; From 74f8d9c3a7311ec7abb1cfe76c3f6f190fbcb81a Mon Sep 17 00:00:00 2001 From: abedelaziz-deriv <135210555+abedelaziz-deriv@users.noreply.github.com> Date: Thu, 13 Jun 2024 09:25:46 +0800 Subject: [PATCH 088/162] refactor(analytics)!: added logAppOpen event (#610) --- packages/analytics/lib/analytics.dart | 148 ------------------ .../sdk/deriv_firebase_analytics.dart | 7 +- .../events/rudderstack_events.dart | 53 +++---- .../sdk/deriv_rudderstack_sdk.dart | 10 +- .../firebase/sdk/deriv_firebase_sdk_test.dart | 13 +- .../sdk/deriv_rudderstack_sdk_test.dart | 21 +-- 6 files changed, 56 insertions(+), 196 deletions(-) delete mode 100644 packages/analytics/lib/analytics.dart diff --git a/packages/analytics/lib/analytics.dart b/packages/analytics/lib/analytics.dart deleted file mode 100644 index 22574f33a..000000000 --- a/packages/analytics/lib/analytics.dart +++ /dev/null @@ -1,148 +0,0 @@ -import 'package:analytics/sdk/firebase/core/firebase_configuration.dart'; -import 'package:analytics/sdk/firebase/sdk/deriv_firebase_analytics.dart'; -import 'package:analytics/sdk/rudderstack/core/rudderstack_configuration.dart'; -import 'package:analytics/sdk/rudderstack/sdk/deriv_rudderstack_sdk.dart'; -import 'package:firebase_analytics/firebase_analytics.dart'; -import 'package:firebase_core/firebase_core.dart'; -import 'package:flutter/material.dart'; - -import 'analytics_route_observer.dart'; - -/// Class that collects and send analytical information to `Firebase` and -/// `RudderStack`. -@Deprecated( - 'Use DerivFirebaseAnalytics, DerivRudderstack, or DerivDatadog instead.') -class Analytics { - /// Initialises - @Deprecated( - 'Use DerivFirebaseAnalytics, DerivRudderstack, or DerivDatadog instead.') - factory Analytics() => _instance; - - Analytics._internal(); - - /// A public instance of the class [Analytics]. - static final Analytics _instance = Analytics._internal(); - - /// Contains ignored routes/screen names. - @Deprecated('No need to have it here as it can be done in the client app.') - List ignoredRoutes = []; - - late DerivFirebaseAnalytics _derivFirebaseAnalytics; - - /// An instance of custom route observer created for analytics. - @Deprecated( - "Use the 'navigatorObserver' in DerivFirebaseAnalytics, DerivRudderstack, or DerivDatadog instead.") - late AnalyticsRouteObserver observer; - - /// Initialises the `Analytics`. - /// Sets the device-token to `RudderStack`. - /// bool [isEnabled] enables or disables "Analytics". - @Deprecated( - "Use the 'setup' function in DerivFirebaseAnalytics, DerivRudderstack, or DerivDatadog instead.") - Future init( - {required bool isEnabled, - required FirebaseApp firebaseApp, - RudderstackConfiguration? configuration}) async { - _derivFirebaseAnalytics = - DerivFirebaseAnalytics(FirebaseAnalytics.instanceFor(app: firebaseApp)); - observer = AnalyticsRouteObserver(onNewRoute: _newRouteHandler); - - // Enable or disable the analytics on this device. - await _derivFirebaseAnalytics.setup( - FirebaseConfiguration( - isAnalyticsCollectionEnabled: isEnabled, - ), - ); - - if (configuration != null) { - await DerivRudderstack().setup(configuration); - } - - isEnabled - ? await DerivRudderstack().enable() - : await DerivRudderstack().disable(); - } - - /// Captures `screen_view` event on route changes. - void _newRouteHandler(PageRoute route) { - // ignore: deprecated_member_use_from_same_package - setCurrentScreen( - screenName: route.settings.name ?? '', - ); - } - - /// Captures `Application Backgrounded` event when the app goes to background. - @Deprecated("Use the 'track' function in DerivRudderstack instead.") - void logAppBackgrounded() { - DerivRudderstack().track(eventName: 'Application Backgrounded'); - } - - /// Captures `Application Crashed` event when the app is crashed. - @Deprecated("Use the 'track' function in DerivRudderstack instead.") - void logAppCrashed() { - DerivRudderstack().track(eventName: 'Application Crashed'); - } - - /// Captures information about current screen in use. - @Deprecated( - "Use the 'setCurrentScreen' function in DerivFirebaseAnalytics or the 'screen' function DerivRudderstack instead.") - void setCurrentScreen({ - required String screenName, - }) { - if (ignoredRoutes.contains(screenName)) { - return; - } - _derivFirebaseAnalytics.setCurrentScreen(screenName: screenName); - - DerivRudderstack().screen(screenName: screenName); - } - - /// Captures `login` event upon a successful user log in. - @Deprecated( - "Use the 'logLoginEvent' function in DerivFirebaseAnalytics or the 'identify' function in DerivRudderstack instead.") - Future logLoginEvent( - {required String deviceToken, required int userId}) async { - await _setFirebaseUserId(userId.toString()); - await _derivFirebaseAnalytics.logLogin(); - - await _setRudderStackDeviceToken(deviceToken); - - await DerivRudderstack().identify(userId: userId.toString()); - } - - /// Captures `logout` event when the user logs out. - @Deprecated( - "Use the 'logLogoutEvent' function in DerivFirebaseAnalytics instead.") - void logLogoutEvent() { - _derivFirebaseAnalytics.logEvent(name: 'logout'); - } - - /// Sets the device-token to `RudderStack`. - Future _setRudderStackDeviceToken(String deviceToken) => - DerivRudderstack().setContext(token: deviceToken); - - /// Sets the user id for `Firebase`. - Future _setFirebaseUserId(String userId) => - _derivFirebaseAnalytics.setUserId(id: userId); - - /// Logs push token. - @Deprecated("Use the 'setContext' function in DerivRudderstack instead.") - Future logPushToken(String deviceToken) async { - await _setRudderStackDeviceToken(deviceToken); - } - - /// Should be called at logout to clear up current `RudderStack` data. - @Deprecated("Use the 'reset' function in DerivRudderstack instead.") - Future reset() async => DerivRudderstack().reset(); - - /// Logs custom events to `Firebase`. - @Deprecated("Use the 'logEvent' function in DerivFirebaseAnalytics instead.") - Future logToFirebase({ - required String name, - Map? params, - }) => - _derivFirebaseAnalytics.logEvent( - name: name, - parameters: params, - ); -} diff --git a/packages/analytics/lib/sdk/firebase/sdk/deriv_firebase_analytics.dart b/packages/analytics/lib/sdk/firebase/sdk/deriv_firebase_analytics.dart index 9b840e31f..aec6040cb 100644 --- a/packages/analytics/lib/sdk/firebase/sdk/deriv_firebase_analytics.dart +++ b/packages/analytics/lib/sdk/firebase/sdk/deriv_firebase_analytics.dart @@ -48,7 +48,12 @@ class DerivFirebaseAnalytics implements BaseAnalytics { /// Successfully, otherwise, a false is returned. Future setCurrentScreen({required String screenName}) async => _execute(() async { - await _firebaseAnalytics.setCurrentScreen(screenName: screenName); + await _firebaseAnalytics.logScreenView(screenName: screenName); + }); + + /// Logs the standard app open event. + Future logAppOpen() async => _execute(() async { + await _firebaseAnalytics.logAppOpen(); }); /// Logs the standard login event. diff --git a/packages/analytics/lib/sdk/rudderstack/events/rudderstack_events.dart b/packages/analytics/lib/sdk/rudderstack/events/rudderstack_events.dart index 4840b0e90..425373151 100644 --- a/packages/analytics/lib/sdk/rudderstack/events/rudderstack_events.dart +++ b/packages/analytics/lib/sdk/rudderstack/events/rudderstack_events.dart @@ -1,6 +1,5 @@ import 'package:analytics/sdk/rudderstack/core/rudderstack_configuration.dart'; import 'package:analytics/sdk/rudderstack/sdk/deriv_rudderstack_sdk.dart'; -import 'package:rudder_sdk_flutter_platform_interface/platform.dart'; /// Class which hold events which should be monitored. class DerivRudderstackEvents { @@ -18,11 +17,11 @@ class DerivRudderstackEvents { void logAppOpened() { DerivRudderstack().track( eventName: 'ce_virtual_signup_form', - properties: RudderProperty.fromMap({ + properties: { 'action': 'open', 'form_source': 'mobile_derivgo', 'form_name': 'virtual_signup_derivgo' - }), + }, ); } @@ -30,11 +29,11 @@ class DerivRudderstackEvents { void logUserTappedLoginButton() { DerivRudderstack().track( eventName: 'ce_virtual_signup_form', - properties: RudderProperty.fromMap({ + properties: { 'action': 'go_to_login', 'form_source': 'mobile_derivgo', 'form_name': 'virtual_signup_derivgo' - }), + }, ); } @@ -42,13 +41,13 @@ class DerivRudderstackEvents { void logAppGetFreeAccount(String slideName) { DerivRudderstack().track( eventName: 'ce_virtual_signup_form', - properties: RudderProperty.fromMap({ + properties: { 'action': 'get_free_account', 'form_source': 'mobile_derivgo', 'getstarted_slide_name': '${slideName.substring(slideName.indexOf('.') + 1, slideName.length)}', 'form_name': 'virtual_signup_derivgo' - }), + }, ); } @@ -56,11 +55,11 @@ class DerivRudderstackEvents { void logReferralToggleSwitched() { DerivRudderstack().track( eventName: 'ce_virtual_signup_form', - properties: RudderProperty.fromMap({ + properties: { 'action': 'tab_referral_toggle', 'form_source': 'mobile_derivgo', 'form_name': 'virtual_signup_derivgo' - }), + }, ); } @@ -68,11 +67,11 @@ class DerivRudderstackEvents { void logTryAgainReferralCode() { DerivRudderstack().track( eventName: 'ce_virtual_signup_form', - properties: RudderProperty.fromMap({ + properties: { 'action': 'try_again_referral_code', 'form_source': 'mobile_derivgo', 'form_name': 'virtual_signup_derivgo' - }), + }, ); } @@ -80,12 +79,12 @@ class DerivRudderstackEvents { void logEmailConfirmationSent() { DerivRudderstack().track( eventName: 'ce_virtual_signup_form', - properties: RudderProperty.fromMap({ + properties: { 'action': 'email_confirmation_sent', 'signup_provider': 'email', 'form_source': 'mobile_derivgo', 'form_name': 'virtual_signup_derivgo' - }), + }, ); } @@ -93,12 +92,12 @@ class DerivRudderstackEvents { void logEmailConfirmed() { DerivRudderstack().track( eventName: 'ce_virtual_signup_form', - properties: RudderProperty.fromMap({ + properties: { 'action': 'email_confirmed', 'signup_provider': 'email', 'form_source': 'mobile_derivgo', 'form_name': 'virtual_signup_derivgo' - }), + }, ); } @@ -106,12 +105,12 @@ class DerivRudderstackEvents { void logSignupContinued() { DerivRudderstack().track( eventName: 'ce_virtual_signup_form', - properties: RudderProperty.fromMap({ + properties: { 'action': 'signup_continued', 'signup_provider': 'email', 'form_source': 'mobile_derivgo', 'form_name': 'virtual_signup_derivgo' - }), + }, ); } @@ -119,12 +118,12 @@ class DerivRudderstackEvents { void logCountrySelectionPageOpened() { DerivRudderstack().track( eventName: 'ce_virtual_signup_form', - properties: RudderProperty.fromMap({ + properties: { 'action': 'country_selection_screen_opened', 'signup_provider': 'email', 'form_source': 'mobile_derivgo', 'form_name': 'virtual_signup_derivgo' - }), + }, ); } @@ -132,12 +131,12 @@ class DerivRudderstackEvents { void logSetPasswordPageOpened() { DerivRudderstack().track( eventName: 'ce_virtual_signup_form', - properties: RudderProperty.fromMap({ + properties: { 'action': 'password_screen_opened', 'signup_provider': 'email', 'form_source': 'mobile_derivgo', 'form_name': 'virtual_signup_derivgo' - }), + }, ); } @@ -145,12 +144,12 @@ class DerivRudderstackEvents { void logSignUpDone(String signupProvider) { DerivRudderstack().track( eventName: 'ce_virtual_signup_form', - properties: RudderProperty.fromMap({ + properties: { 'action': 'signup_done', 'signup_provider': '$signupProvider', 'form_source': 'mobile_derivgo', 'form_name': 'virtual_signup_derivgo' - }), + }, ); } @@ -159,14 +158,14 @@ class DerivRudderstackEvents { [bool? isToggleOn, String? referralCode]) { DerivRudderstack().track( eventName: 'ce_virtual_signup_form', - properties: RudderProperty.fromMap({ + properties: { 'action': 'started', 'signup_provider': '$signupProvider', 'referral_toggle_mode': '${isToggleOn ?? false} ', 'referral_code': '$referralCode', 'form_source': 'mobile_derivgo', 'form_name': 'virtual_signup_derivgo' - }), + }, ); } @@ -174,13 +173,13 @@ class DerivRudderstackEvents { void logSignUpFlowError(String? errorText, [String? signupProvider]) { DerivRudderstack().track( eventName: 'ce_virtual_signup_form', - properties: RudderProperty.fromMap({ + properties: { 'action': 'signup_flow_error', 'signup_provider': '$signupProvider', 'error_message': '$errorText', 'form_source': 'mobile_derivgo', 'form_name': 'virtual_signup_derivgo' - }), + }, ); } } diff --git a/packages/analytics/lib/sdk/rudderstack/sdk/deriv_rudderstack_sdk.dart b/packages/analytics/lib/sdk/rudderstack/sdk/deriv_rudderstack_sdk.dart index 70d38834c..baa592fb2 100644 --- a/packages/analytics/lib/sdk/rudderstack/sdk/deriv_rudderstack_sdk.dart +++ b/packages/analytics/lib/sdk/rudderstack/sdk/deriv_rudderstack_sdk.dart @@ -55,9 +55,13 @@ class DerivRudderstack implements BaseAnalytics { /// Tracks an event with the given [eventName] and [properties]. Future track({ required String eventName, - RudderProperty? properties, // Change the parameter type to RudderProperty - }) async => - _execute(() => rudderClient.track(eventName, properties: properties)); + Map? properties, + }) async { + final RudderProperty? rudderProperty = + properties == null ? null : RudderProperty.fromMap(properties); + return _execute( + () => rudderClient.track(eventName, properties: rudderProperty)); + } /// Logs a screen view with the given [screenName]. Future screen({required String screenName}) async => diff --git a/packages/analytics/test/firebase/sdk/deriv_firebase_sdk_test.dart b/packages/analytics/test/firebase/sdk/deriv_firebase_sdk_test.dart index 7afa990fb..69c051360 100644 --- a/packages/analytics/test/firebase/sdk/deriv_firebase_sdk_test.dart +++ b/packages/analytics/test/firebase/sdk/deriv_firebase_sdk_test.dart @@ -31,16 +31,25 @@ void main() { test('should return correct NavigatorObserver', () async { const String screenName = 'test_screen_name'; - when(() => mockFirebaseAnalytics.setCurrentScreen(screenName: screenName)) + when(() => mockFirebaseAnalytics.logScreenView(screenName: screenName)) .thenAnswer((_) async => true); await derivFirebaseAnalytics.setCurrentScreen(screenName: screenName); verify(() => - mockFirebaseAnalytics.setCurrentScreen(screenName: screenName)) + mockFirebaseAnalytics.logScreenView(screenName: screenName)) .called(1); }); + test('should call logAppOpen', () async { + when(() => mockFirebaseAnalytics.logAppOpen()) + .thenAnswer((_) async => true); + + await derivFirebaseAnalytics.logAppOpen(); + + verify(() => mockFirebaseAnalytics.logAppOpen()).called(1); + }); + test('should call logLogin with correct parameters', () async { const String loginMethod = 'test_login_method'; diff --git a/packages/analytics/test/rudderstack/sdk/deriv_rudderstack_sdk_test.dart b/packages/analytics/test/rudderstack/sdk/deriv_rudderstack_sdk_test.dart index df856b864..e7a4e0cce 100644 --- a/packages/analytics/test/rudderstack/sdk/deriv_rudderstack_sdk_test.dart +++ b/packages/analytics/test/rudderstack/sdk/deriv_rudderstack_sdk_test.dart @@ -4,7 +4,6 @@ import 'package:analytics/sdk/rudderstack/sdk/deriv_rudderstack_sdk.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mocktail/mocktail.dart'; import 'package:rudder_sdk_flutter/RudderController.dart'; -import 'package:rudder_sdk_flutter_platform_interface/platform.dart'; class MockRudderController extends Mock implements RudderController {} @@ -35,23 +34,16 @@ void main() { test('track calls rudderClient.track', () async { const String eventName = 'test_event_name'; - const Map properties = {'action': 'open'}; - - // Convert properties to RudderProperty - final rudderProperties = RudderProperty.fromMap(properties); + const Map properties = { + 'action': 'open' + }; final bool result = await derivRudderstack.track( eventName: eventName, - properties: rudderProperties, // Pass RudderProperty directly + properties: properties, // Pass RudderProperty directly ); expect(result, isTrue); - // Verify that the track method is called with the correct parameters - verify(() => mockRudderController.track( - eventName, - properties: rudderProperties, // Pass RudderProperty directly - options: null // Assuming options is not used in this case - )).called(1); }); test('screen calls rudderClient.screen', () async { @@ -102,15 +94,14 @@ void main() { const String dataPlaneUrl = 'wrong_url'; const String writeKey = 'test_write_key'; - when(() => mockRudderController.initialize(any(), config: any(named: 'config'))) - .thenThrow(Exception()); + when(() => mockRudderController.initialize(any(), + config: any(named: 'config'))).thenThrow(Exception()); final bool result = await derivRudderstack.setup( const RudderstackConfiguration( dataPlaneUrl: dataPlaneUrl, writeKey: writeKey)); expect(result, false); - }); test('reset calls rudderClient.reset', () async { From 7a77483fd462dd5d2f0819bc83bac29e3a2b8552 Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Thu, 13 Jun 2024 09:49:22 +0800 Subject: [PATCH 089/162] chore(version): bump version and update changelog (#609) --- CHANGELOG.md | 34 +++++++++++++++++++++++ README.md | 8 +++--- packages/analytics/CHANGELOG.md | 6 ++++ packages/analytics/pubspec.yaml | 2 +- packages/deriv_auth/CHANGELOG.md | 4 +++ packages/deriv_auth/pubspec.yaml | 6 ++-- packages/deriv_localizations/CHANGELOG.md | 4 +++ packages/deriv_localizations/pubspec.yaml | 2 +- packages/deriv_passkeys/CHANGELOG.md | 4 +++ packages/deriv_passkeys/pubspec.yaml | 4 +-- 10 files changed, 63 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ae8ebebb..d537528a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,40 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-06-13 + +### Changes + +--- + +Packages with breaking changes: + + - [`analytics` - `v2.0.0`](#analytics---v200) + +Packages with other changes: + + - [`deriv_localizations` - `v1.4.2`](#deriv_localizations---v142) + - [`deriv_auth` - `v6.6.5`](#deriv_auth---v665) + - [`deriv_passkeys` - `v0.0.1+6`](#deriv_passkeys---v0016) + +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.6.5` + - `deriv_passkeys` - `v0.0.1+6` + +--- + +#### `analytics` - `v2.0.0` + + - **BREAKING** **REFACTOR**(analytics): added logAppOpen event ([#610](https://github.com/regentmarkets/flutter-deriv-packages/issues/610)). ([74f8d9c3](https://github.com/regentmarkets/flutter-deriv-packages/commit/74f8d9c3a7311ec7abb1cfe76c3f6f190fbcb81a)) + +#### `deriv_localizations` - `v1.4.2` + + - **FIX**(deriv-localization): fix passkey button strings ([#606](https://github.com/regentmarkets/flutter-deriv-packages/issues/606)). ([ed2a7ea9](https://github.com/regentmarkets/flutter-deriv-packages/commit/ed2a7ea958e34aa027ecb9ef6919f04fd5c7d5f1)) + + ## 2024-06-07 ### Changes diff --git a/README.md b/README.md index 35951c110..e99c9d14e 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.6.4)`. 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.6.5)`. To use the package, add the following to your pubspec.yaml file: ```yaml @@ -19,8 +19,8 @@ deriv_ui: | Name | Description | Version | | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | -| [analytics](./packages/analytics) | Used to collect and send analytical information to 'Firebase' and 'Segment'. | [v1.0.4](./packages/analytics/CHANGELOG.md) | -| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.6.4 ](./packages/deriv_auth/CHANGELOG.md) | +| [analytics](./packages/analytics) | Used to collect and send analytical information to 'Firebase' and 'Segment'. | [v2.0.0](./packages/analytics/CHANGELOG.md) | +| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.6.5 ](./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) | @@ -32,7 +32,7 @@ deriv_ui: | [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+2](./packages/deriv_live_chat/CHANGELOG.md) | | [deriv_language_selector](./packages/deriv_language_selector) | A package to handle language change of the app. | [v0.0.2+4](./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.4.1](./packages/deriv_localizations/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.4.2](./packages/deriv_localizations/CHANGELOG.md) | | [deriv_numpad](./packages/deriv_numpad) | Number Pad Widget for number input. | [v1.1.5](./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) | diff --git a/packages/analytics/CHANGELOG.md b/packages/analytics/CHANGELOG.md index b928744a3..37d435e42 100644 --- a/packages/analytics/CHANGELOG.md +++ b/packages/analytics/CHANGELOG.md @@ -1,3 +1,9 @@ +## 2.0.0 + +> Note: This release has breaking changes. + + - **BREAKING** **REFACTOR**(analytics): added logAppOpen event ([#610](https://github.com/regentmarkets/flutter-deriv-packages/issues/610)). ([74f8d9c3](https://github.com/regentmarkets/flutter-deriv-packages/commit/74f8d9c3a7311ec7abb1cfe76c3f6f190fbcb81a)) + ## 1.0.2 - **REVERT**(analytics): versioning and CHANGELOG. ([81a3a0df](https://github.com/regentmarkets/flutter-deriv-packages/commit/81a3a0df27208bd200009415855c6cb944d016e3)) diff --git a/packages/analytics/pubspec.yaml b/packages/analytics/pubspec.yaml index 78fad43c4..c49dcbcb8 100644 --- a/packages/analytics/pubspec.yaml +++ b/packages/analytics/pubspec.yaml @@ -1,6 +1,6 @@ name: analytics description: A new Flutter package for collecting and sending analytical information from the app. -version: 1.0.4 +version: 2.0.0 homepage: https://deriv.com/ publish_to: "none" diff --git a/packages/deriv_auth/CHANGELOG.md b/packages/deriv_auth/CHANGELOG.md index d40b88f1d..c8fa3df85 100644 --- a/packages/deriv_auth/CHANGELOG.md +++ b/packages/deriv_auth/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.6.5 + + - Update a dependency to the latest release. + ## 6.6.4 - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index c2c5d4df1..a030278b1 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.6.4 +version: 6.6.5 environment: sdk: ">=3.0.0 <4.0.0" @@ -45,13 +45,13 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_localizations - ref: deriv_localizations-v1.4.1 + ref: deriv_localizations-v1.4.2 deriv_passkeys: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: deriv_passkeys-v0.0.1+5 + ref: deriv_passkeys-v0.0.1+6 deriv_language_selector: git: diff --git a/packages/deriv_localizations/CHANGELOG.md b/packages/deriv_localizations/CHANGELOG.md index 2feffb3f2..e94a2228a 100644 --- a/packages/deriv_localizations/CHANGELOG.md +++ b/packages/deriv_localizations/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.4.2 + + - **FIX**(deriv-localization): fix passkey button strings ([#606](https://github.com/regentmarkets/flutter-deriv-packages/issues/606)). ([ed2a7ea9](https://github.com/regentmarkets/flutter-deriv-packages/commit/ed2a7ea958e34aa027ecb9ef6919f04fd5c7d5f1)) + ## 1.4.1 - **REFACTOR**(deriv_auth): update localization ([#594](https://github.com/regentmarkets/flutter-deriv-packages/issues/594)). ([5204c74f](https://github.com/regentmarkets/flutter-deriv-packages/commit/5204c74f609d946ea797e766e6bb652d82f76930)) diff --git a/packages/deriv_localizations/pubspec.yaml b/packages/deriv_localizations/pubspec.yaml index 7db5a04da..b1f2eaadd 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.4.1 +version: 1.4.2 environment: sdk: '>=3.0.2 <4.0.0' diff --git a/packages/deriv_passkeys/CHANGELOG.md b/packages/deriv_passkeys/CHANGELOG.md index 22d270ed0..af76698cc 100644 --- a/packages/deriv_passkeys/CHANGELOG.md +++ b/packages/deriv_passkeys/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.1+6 + + - Update a dependency to the latest release. + ## 0.0.1+5 - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) diff --git a/packages/deriv_passkeys/pubspec.yaml b/packages/deriv_passkeys/pubspec.yaml index ea509b874..4bbdc7a95 100644 --- a/packages/deriv_passkeys/pubspec.yaml +++ b/packages/deriv_passkeys/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_passkeys description: Deriv Passkeys Flutter Plugin -version: 0.0.1+5 +version: 0.0.1+6 publish_to: "none" environment: @@ -19,7 +19,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_localizations - ref: deriv_localizations-v1.4.1 + ref: deriv_localizations-v1.4.2 deriv_ui: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git From a4026a9d8164abc1c66beb327d48610d8ce30dde Mon Sep 17 00:00:00 2001 From: abedelaziz-deriv <135210555+abedelaziz-deriv@users.noreply.github.com> Date: Thu, 13 Jun 2024 16:25:47 +0800 Subject: [PATCH 090/162] refactor(deriv_auth): added a flag to allow hiding passkeys button (#612) --- .../login/presentation/layouts/deriv_login_layout.dart | 9 +++++++-- packages/deriv_auth/pubspec.yaml | 2 -- 2 files changed, 7 insertions(+), 4 deletions(-) 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 2e269c7d2..9bf31f9a6 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,7 +1,6 @@ import 'dart:async'; import 'package:deriv_auth/deriv_auth.dart'; -import 'package:deriv_auth/features/single_entry/core/auth_data.dart'; import 'package:deriv_passkeys/deriv_passkeys.dart'; import 'package:deriv_theme/deriv_theme.dart'; import 'package:deriv_ui/deriv_ui.dart'; @@ -23,6 +22,7 @@ class DerivLoginLayout extends StatefulWidget { this.isForgotPasswordEnabled = true, this.isCreateAccountEnabled = true, this.isSocialAuthEnabled = true, + this.isPasskeysEnabled = true, this.authErrorStateHandler, this.onLoginError, this.onLoginTapped, @@ -69,6 +69,9 @@ class DerivLoginLayout extends StatefulWidget { /// Whether to display create account section. final bool isCreateAccountEnabled; + /// Whether to display passkey button. + final bool isPasskeysEnabled; + /// Social auth state handler. final Function(SocialAuthState) socialAuthStateHandler; @@ -158,7 +161,9 @@ class _DerivLoginLayoutState extends State { ), if (widget.isSocialAuthEnabled) const SizedBox(height: ThemeProvider.margin24), - const ContinueWithPasskeyButton(), + widget.isPasskeysEnabled + ? const ContinueWithPasskeyButton() + : const SizedBox.shrink(), DerivSocialAuthPanel( socialAuthStateHandler: widget.socialAuthStateHandler, redirectURL: widget.redirectURL, diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index a030278b1..9cc2a927f 100644 --- a/packages/deriv_auth/pubspec.yaml +++ b/packages/deriv_auth/pubspec.yaml @@ -80,8 +80,6 @@ dev_dependencies: bloc_test: ^9.1.6 flutter_test: sdk: flutter - integration_test: - sdk: flutter flutter_lints: ^2.0.0 patrol_finders: ^1.0.0 From 59d9f6581cdc876cf07c3f919f9a6bc1a92d2b0a Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Fri, 14 Jun 2024 09:51:31 +0800 Subject: [PATCH 091/162] chore(deriv_localizations): Crowdin Localization Updated (#604) --- .../lib/l10n/deriv_auth/app_pt.arb | 2 +- .../lib/l10n/deriv_passkeys/app_ar.arb | 2 +- .../lib/l10n/deriv_passkeys/app_es.arb | 2 +- .../lib/l10n/deriv_passkeys/app_fr.arb | 2 +- .../lib/l10n/deriv_passkeys/app_ko.arb | 2 +- .../lib/l10n/deriv_passkeys/app_pt.arb | 12 ++++++------ .../lib/l10n/deriv_passkeys/app_th.arb | 2 +- .../lib/l10n/deriv_passkeys/app_vi.arb | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/deriv_localizations/lib/l10n/deriv_auth/app_pt.arb b/packages/deriv_localizations/lib/l10n/deriv_auth/app_pt.arb index 6778e490c..08888e070 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_auth/app_pt.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_auth/app_pt.arb @@ -13,7 +13,7 @@ "actionOk": "OK", "warnNotAvailableCountries": "Em caso de dúvidas, contacte-nos via ", "labelLiveChat": "Live chat", - "actionSignUpForFree": "Cadastre-se gratuitamente", + "actionSignUpForFree": "Registe-se gratuitamente", "actionLogin": "Iniciar sessão", "labelTwoFactorAuth": "Autenticação de dois fatores", "informEnterTwoFactorAuthCode": "Introduza o código de 6 dígitos da aplicação de autenticação no seu telemóvel.", diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_ar.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_ar.arb index 837439327..70fe56ad1 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_ar.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_ar.arb @@ -52,7 +52,7 @@ "rename": "إعادة تسمية", "revoke": "إلغاء", "continueTradingButtonText": "استمر في التداول", - "addMorePasskeysButtonText": "أضف المزيد من Passkeys", + "addMorePasskeysButtonText": "أضف المزيد من passkeys", "unableToSetupPasskey": "تعذر إعداد مفتاح Passkey", "unableToSetupPasskeyDescription": "لقد واجهنا مشكلة أثناء إعداد Passkey الخاص بك. ربما تمت مقاطعة العملية، أو ربما انتهت مهلة الجلسة. يرجى المحاولة مرة أخرى.", "passkeysOffErrorTitle": "خدمة Passkeys غير متوفرة", diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_es.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_es.arb index bd11a3527..79dbfdd44 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_es.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_es.arb @@ -51,7 +51,7 @@ "lastUsed": "Utilizado por última vez", "rename": "Renombrar", "revoke": "Revocar", - "continueTradingButtonText": "Seguir operando", + "continueTradingButtonText": "Continúe operando", "addMorePasskeysButtonText": "Añadir más Passkeys", "unableToSetupPasskey": "No se puede configurar la passkey", "unableToSetupPasskeyDescription": "Hemos encontrado un problema al configurar su passkey. Es posible que el proceso se haya interrumpido o que la sesión haya expirado. Por favor, inténtelo de nuevo.", diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_fr.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_fr.arb index a9c315fe4..735033020 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_fr.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_fr.arb @@ -52,7 +52,7 @@ "rename": "Renommer", "revoke": "Révoquer", "continueTradingButtonText": "Poursuivre les opérations de trading", - "addMorePasskeysButtonText": "Ajouter d'autres Passkeys", + "addMorePasskeysButtonText": "Ajouter plus de Passkeys", "unableToSetupPasskey": "Impossible de configurer la Passkey", "unableToSetupPasskeyDescription": "Nous avons rencontré un problème lors de l'établissement de votre Passkey. Il se peut que le processus ait été interrompu ou que la session ait expiré. Veuillez réessayer.", "passkeysOffErrorTitle": "Le service Passkeys est indisponible", diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_ko.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_ko.arb index a425d9c1f..4251a31f3 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_ko.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_ko.arb @@ -52,7 +52,7 @@ "rename": "이름 변경", "revoke": "철회", "continueTradingButtonText": "계속 거래하기", - "addMorePasskeysButtonText": "더 많은 Passkeys", + "addMorePasskeysButtonText": "더 많은 passkeys", "unableToSetupPasskey": "Passkey를 설정할 수 없습니다", "unableToSetupPasskeyDescription": "Passkey를 설정하는 동안 문제가 발생했습니다. 프로세스가 중단되었거나 세션 시간이 초과되었을 수 있습니다. 다시 시도해 주시기 바랍니다.", "passkeysOffErrorTitle": "Passkeys 서비스를 이용할 수 없습니다", diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_pt.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_pt.arb index da5958826..7ff6f085b 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_pt.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_pt.arb @@ -45,18 +45,18 @@ "noNeedToRememberPassword": "Não memorizar a palavra-passe", "useYourBiometrics": "Segurança reforçada com dados biométricos ou bloqueio do ecrã", "syncAcrossDevices": "Sincronizar entre dispositivos", - "createPasskey": "Crie passkey", + "createPasskey": "Criar passkey", "unsupportedPlatform": "Plataforma não suportada", "storedOn": "Armazenado em", "lastUsed": "Última utilização", "rename": "Renomear", "revoke": "Revogar", - "continueTradingButtonText": "Continue a negociar", - "addMorePasskeysButtonText": "Adicionar Mais Passkeys", + "continueTradingButtonText": "Continuar a negociar", + "addMorePasskeysButtonText": "Adicionar mais passkeys", "unableToSetupPasskey": "Não é possível configurar a passkey", - "unableToSetupPasskeyDescription": "Encontramos um problema ao configurar sua passkey. O processo pode ter sido interrompido ou a sessão expirou. Por favor, tente novamente.", + "unableToSetupPasskeyDescription": "Houve um problema ao configurar a sua passkey. O processo pode ter sido interrompido ou a sessão expirou. Por favor, tente novamente.", "passkeysOffErrorTitle": "O serviço de Passkeys não está disponível", "never": "Nunca", - "unable_to_process_your_request": "Não foi possível processar sua solicitação", - "unable_to_process_your_request_description": "Estamos enfrentando um problema temporário no processamento de sua solicitação. Por favor, tente novamente mais tarde." + "unable_to_process_your_request": "Não foi possível completar o processamento do seu pedido", + "unable_to_process_your_request_description": "Surgiu um problema temporário no processamento do seu pedido. Por favor, tente novamente mais tarde." } \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_th.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_th.arb index 60ecace66..8657c205d 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_th.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_th.arb @@ -51,7 +51,7 @@ "lastUsed": "ใช้ครั้งล่าสุด", "rename": "เปลี่ยนชื่อ", "revoke": "เพิกถอน", - "continueTradingButtonText": "ทำการเทรดต่อไป", + "continueTradingButtonText": "ดำเนินการเทรดต่อ", "addMorePasskeysButtonText": "เพิ่มจำนวน Passkey", "unableToSetupPasskey": "ไม่สามารถตั้งค่า Passkey ได้", "unableToSetupPasskeyDescription": "เราพบปัญหาขณะตั้งค่า Passkey ของคุณ กระบวนการอาจถูกขัดจังหวะหรือเซสชั่นหมดเวลา โปรดลองอีกครั้ง", diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_vi.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_vi.arb index 39a97ff12..d360fe3ce 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_vi.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_vi.arb @@ -52,7 +52,7 @@ "rename": "Đổi tên", "revoke": "Thu hồi", "continueTradingButtonText": "Tiếp tục giao dịch", - "addMorePasskeysButtonText": "Thêm nhiều Passkeys", + "addMorePasskeysButtonText": "Thêm passkeys", "unableToSetupPasskey": "Không thể thiết lập passkey", "unableToSetupPasskeyDescription": "Chúng tôi gặp sự cố khi thiết lập passkey của bạn. Quá trình có thể đã bị gián đoạn hoặc phiên đã hết thời gian. Vui lòng thử lại.", "passkeysOffErrorTitle": "Dịch vụ Passkeys không khả dụng", From 5fd85af24394ea68b8b0a7abc854b9c33b791c26 Mon Sep 17 00:00:00 2001 From: abedelaziz-deriv <135210555+abedelaziz-deriv@users.noreply.github.com> Date: Fri, 14 Jun 2024 10:55:30 +0800 Subject: [PATCH 092/162] refactor(deriv_localizations): Update p2p strings for passkeys (#615) --- .../lib/l10n/deriv_passkeys/app_en.arb | 3 +++ .../deriv_auth_localizations_pt.dart | 2 +- .../deriv_passkeys_localizations.dart | 18 ++++++++++++++++ .../deriv_passkeys_localizations_ar.dart | 11 +++++++++- .../deriv_passkeys_localizations_bn.dart | 9 ++++++++ .../deriv_passkeys_localizations_de.dart | 9 ++++++++ .../deriv_passkeys_localizations_en.dart | 9 ++++++++ .../deriv_passkeys_localizations_es.dart | 11 +++++++++- .../deriv_passkeys_localizations_fr.dart | 11 +++++++++- .../deriv_passkeys_localizations_it.dart | 9 ++++++++ .../deriv_passkeys_localizations_ko.dart | 11 +++++++++- .../deriv_passkeys_localizations_pl.dart | 9 ++++++++ .../deriv_passkeys_localizations_pt.dart | 21 +++++++++++++------ .../deriv_passkeys_localizations_ru.dart | 9 ++++++++ .../deriv_passkeys_localizations_si.dart | 9 ++++++++ .../deriv_passkeys_localizations_sw.dart | 9 ++++++++ .../deriv_passkeys_localizations_th.dart | 11 +++++++++- .../deriv_passkeys_localizations_tr.dart | 9 ++++++++ .../deriv_passkeys_localizations_vi.dart | 11 +++++++++- .../deriv_passkeys_localizations_zh.dart | 9 ++++++++ packages/deriv_localizations/pubspec.yaml | 10 +-------- 21 files changed, 188 insertions(+), 22 deletions(-) diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_en.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_en.arb index 6a72eb09c..6d5aa4b6c 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_en.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_en.arb @@ -26,6 +26,9 @@ "howToCreatePasskey": "How to create a passkey?", "howToCreatePasskeyDescription1": "Go to ‘Account Settings’ on Deriv.", "howToCreatePasskeyDescription2": "You can create one passkey per device.", + "p2pHowToCreatePasskey": "How to create passkey?", + "p2pHowToCreatePasskeyDescription1": "Go to ‘Profile‘ in your Deriv P2P app.", + "p2pHowToCreatePasskeyDescription2": "Tap ‘Passkeys‘ to create your passkey.", "whereArePasskeysSaved": "Where are passkeys saved?", "whereArePasskeysSavedDescriptionAndroid": "Android: Google password manager.", "whereArePasskeysSavedDescriptionIOS": "iOS: iCloud keychain.", 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 5fcaf3080..a4803dd42 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 @@ -22,7 +22,7 @@ class DerivAuthLocalizationsPt extends DerivAuthLocalizations { String get labelLiveChat => 'Live chat'; @override - String get actionSignUpForFree => 'Cadastre-se gratuitamente'; + String get actionSignUpForFree => 'Registe-se gratuitamente'; @override String get actionLogin => 'Iniciar sessão'; 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 d9b9d4cfd..731b351f9 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 @@ -237,6 +237,24 @@ abstract class DerivPasskeysLocalizations { /// **'You can create one passkey per device.'** String get howToCreatePasskeyDescription2; + /// No description provided for @p2pHowToCreatePasskey. + /// + /// In en, this message translates to: + /// **'How to create passkey?'** + String get p2pHowToCreatePasskey; + + /// No description provided for @p2pHowToCreatePasskeyDescription1. + /// + /// In en, this message translates to: + /// **'Go to ‘Profile‘ in your Deriv P2P app.'** + String get p2pHowToCreatePasskeyDescription1; + + /// No description provided for @p2pHowToCreatePasskeyDescription2. + /// + /// In en, this message translates to: + /// **'Tap ‘Passkeys‘ to create your passkey.'** + String get p2pHowToCreatePasskeyDescription2; + /// No description provided for @whereArePasskeysSaved. /// /// In en, this message translates to: diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ar.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ar.dart index e99ec19f7..8d24a63b6 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ar.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ar.dart @@ -63,6 +63,15 @@ class DerivPasskeysLocalizationsAr extends DerivPasskeysLocalizations { @override String get howToCreatePasskeyDescription2 => 'يمكنك إنشاء Passkey واحد لكل جهاز.'; + @override + String get p2pHowToCreatePasskey => 'How to create passkey?'; + + @override + String get p2pHowToCreatePasskeyDescription1 => 'Go to ‘Profile‘ in your Deriv P2P app.'; + + @override + String get p2pHowToCreatePasskeyDescription2 => 'Tap ‘Passkeys‘ to create your passkey.'; + @override String get whereArePasskeysSaved => 'أين يتم حفظ passkeys؟'; @@ -142,7 +151,7 @@ class DerivPasskeysLocalizationsAr extends DerivPasskeysLocalizations { String get continueTradingButtonText => 'استمر في التداول'; @override - String get addMorePasskeysButtonText => 'أضف المزيد من Passkeys'; + String get addMorePasskeysButtonText => 'أضف المزيد من passkeys'; @override String get unableToSetupPasskey => 'تعذر إعداد مفتاح Passkey'; diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_bn.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_bn.dart index cb67fd1b3..dd24e0b0f 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_bn.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_bn.dart @@ -63,6 +63,15 @@ class DerivPasskeysLocalizationsBn extends DerivPasskeysLocalizations { @override String get howToCreatePasskeyDescription2 => 'Passkey প্রতি ডিভাইসে একটি পাসকি তৈরি করতে পারেন।'; + @override + String get p2pHowToCreatePasskey => 'How to create passkey?'; + + @override + String get p2pHowToCreatePasskeyDescription1 => 'Go to ‘Profile‘ in your Deriv P2P app.'; + + @override + String get p2pHowToCreatePasskeyDescription2 => 'Tap ‘Passkeys‘ to create your passkey.'; + @override String get whereArePasskeysSaved => 'Passkeys কোথায় সংরক্ষণ করা হয়?'; diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_de.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_de.dart index fb68e5a10..6956e7d1c 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_de.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_de.dart @@ -63,6 +63,15 @@ class DerivPasskeysLocalizationsDe extends DerivPasskeysLocalizations { @override String get howToCreatePasskeyDescription2 => 'Sie können einen Passkey pro Gerät erstellen.'; + @override + String get p2pHowToCreatePasskey => 'How to create passkey?'; + + @override + String get p2pHowToCreatePasskeyDescription1 => 'Go to ‘Profile‘ in your Deriv P2P app.'; + + @override + String get p2pHowToCreatePasskeyDescription2 => 'Tap ‘Passkeys‘ to create your passkey.'; + @override String get whereArePasskeysSaved => 'Wo werden die Passkeys gespeichert?'; diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_en.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_en.dart index f7967fc63..e8cb6b211 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_en.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_en.dart @@ -63,6 +63,15 @@ class DerivPasskeysLocalizationsEn extends DerivPasskeysLocalizations { @override String get howToCreatePasskeyDescription2 => 'You can create one passkey per device.'; + @override + String get p2pHowToCreatePasskey => 'How to create passkey?'; + + @override + String get p2pHowToCreatePasskeyDescription1 => 'Go to ‘Profile‘ in your Deriv P2P app.'; + + @override + String get p2pHowToCreatePasskeyDescription2 => 'Tap ‘Passkeys‘ to create your passkey.'; + @override String get whereArePasskeysSaved => 'Where are passkeys saved?'; diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_es.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_es.dart index 5a7789649..24d2f4434 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_es.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_es.dart @@ -63,6 +63,15 @@ class DerivPasskeysLocalizationsEs extends DerivPasskeysLocalizations { @override String get howToCreatePasskeyDescription2 => 'Puede crear una passkey por dispositivo.'; + @override + String get p2pHowToCreatePasskey => 'How to create passkey?'; + + @override + String get p2pHowToCreatePasskeyDescription1 => 'Go to ‘Profile‘ in your Deriv P2P app.'; + + @override + String get p2pHowToCreatePasskeyDescription2 => 'Tap ‘Passkeys‘ to create your passkey.'; + @override String get whereArePasskeysSaved => '¿Dónde se guardan las passkeys?'; @@ -139,7 +148,7 @@ class DerivPasskeysLocalizationsEs extends DerivPasskeysLocalizations { String get revoke => 'Revocar'; @override - String get continueTradingButtonText => 'Seguir operando'; + String get continueTradingButtonText => 'Continúe operando'; @override String get addMorePasskeysButtonText => 'Añadir más Passkeys'; diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_fr.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_fr.dart index 5f0d05ca6..202aa1b22 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_fr.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_fr.dart @@ -63,6 +63,15 @@ class DerivPasskeysLocalizationsFr extends DerivPasskeysLocalizations { @override String get howToCreatePasskeyDescription2 => 'Vous pouvez créer une Passkey par appareil.'; + @override + String get p2pHowToCreatePasskey => 'How to create passkey?'; + + @override + String get p2pHowToCreatePasskeyDescription1 => 'Go to ‘Profile‘ in your Deriv P2P app.'; + + @override + String get p2pHowToCreatePasskeyDescription2 => 'Tap ‘Passkeys‘ to create your passkey.'; + @override String get whereArePasskeysSaved => 'Où sont enregistrées les passkeys ?'; @@ -142,7 +151,7 @@ class DerivPasskeysLocalizationsFr extends DerivPasskeysLocalizations { String get continueTradingButtonText => 'Poursuivre les opérations de trading'; @override - String get addMorePasskeysButtonText => 'Ajouter d\'autres Passkeys'; + String get addMorePasskeysButtonText => 'Ajouter plus de Passkeys'; @override String get unableToSetupPasskey => 'Impossible de configurer la Passkey'; diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_it.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_it.dart index 82d5e22b1..884191c38 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_it.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_it.dart @@ -63,6 +63,15 @@ class DerivPasskeysLocalizationsIt extends DerivPasskeysLocalizations { @override String get howToCreatePasskeyDescription2 => 'Può creare una sola Passkey per dispositivo.'; + @override + String get p2pHowToCreatePasskey => 'How to create passkey?'; + + @override + String get p2pHowToCreatePasskeyDescription1 => 'Go to ‘Profile‘ in your Deriv P2P app.'; + + @override + String get p2pHowToCreatePasskeyDescription2 => 'Tap ‘Passkeys‘ to create your passkey.'; + @override String get whereArePasskeysSaved => 'Dove vengono salvate la passkey?'; diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ko.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ko.dart index 9187c63c8..ccee517a4 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ko.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ko.dart @@ -63,6 +63,15 @@ class DerivPasskeysLocalizationsKo extends DerivPasskeysLocalizations { @override String get howToCreatePasskeyDescription2 => '기기당 하나의 Passkey를 만들 수 있습니다.'; + @override + String get p2pHowToCreatePasskey => 'How to create passkey?'; + + @override + String get p2pHowToCreatePasskeyDescription1 => 'Go to ‘Profile‘ in your Deriv P2P app.'; + + @override + String get p2pHowToCreatePasskeyDescription2 => 'Tap ‘Passkeys‘ to create your passkey.'; + @override String get whereArePasskeysSaved => 'Passkeys는 어디에 저장되나요?'; @@ -142,7 +151,7 @@ class DerivPasskeysLocalizationsKo extends DerivPasskeysLocalizations { String get continueTradingButtonText => '계속 거래하기'; @override - String get addMorePasskeysButtonText => '더 많은 Passkeys'; + String get addMorePasskeysButtonText => '더 많은 passkeys'; @override String get unableToSetupPasskey => 'Passkey를 설정할 수 없습니다'; diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_pl.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_pl.dart index 9b0255869..e0537c8c6 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_pl.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_pl.dart @@ -63,6 +63,15 @@ class DerivPasskeysLocalizationsPl extends DerivPasskeysLocalizations { @override String get howToCreatePasskeyDescription2 => 'Możesz utworzyć jedno hasło na urządzenie.'; + @override + String get p2pHowToCreatePasskey => 'How to create passkey?'; + + @override + String get p2pHowToCreatePasskeyDescription1 => 'Go to ‘Profile‘ in your Deriv P2P app.'; + + @override + String get p2pHowToCreatePasskeyDescription2 => 'Tap ‘Passkeys‘ to create your passkey.'; + @override String get whereArePasskeysSaved => 'Gdzie są zapisywane passkeys?'; diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_pt.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_pt.dart index d6d15b89a..a7f2a1aea 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_pt.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_pt.dart @@ -63,6 +63,15 @@ class DerivPasskeysLocalizationsPt extends DerivPasskeysLocalizations { @override String get howToCreatePasskeyDescription2 => 'Pode criar uma passkey por dispositivo.'; + @override + String get p2pHowToCreatePasskey => 'How to create passkey?'; + + @override + String get p2pHowToCreatePasskeyDescription1 => 'Go to ‘Profile‘ in your Deriv P2P app.'; + + @override + String get p2pHowToCreatePasskeyDescription2 => 'Tap ‘Passkeys‘ to create your passkey.'; + @override String get whereArePasskeysSaved => 'Onde são guardadas as chaves de acesso?'; @@ -121,7 +130,7 @@ class DerivPasskeysLocalizationsPt extends DerivPasskeysLocalizations { String get syncAcrossDevices => 'Sincronizar entre dispositivos'; @override - String get createPasskey => 'Crie passkey'; + String get createPasskey => 'Criar passkey'; @override String get unsupportedPlatform => 'Plataforma não suportada'; @@ -139,16 +148,16 @@ class DerivPasskeysLocalizationsPt extends DerivPasskeysLocalizations { String get revoke => 'Revogar'; @override - String get continueTradingButtonText => 'Continue a negociar'; + String get continueTradingButtonText => 'Continuar a negociar'; @override - String get addMorePasskeysButtonText => 'Adicionar Mais Passkeys'; + String get addMorePasskeysButtonText => 'Adicionar mais passkeys'; @override String get unableToSetupPasskey => 'Não é possível configurar a passkey'; @override - String get unableToSetupPasskeyDescription => 'Encontramos um problema ao configurar sua passkey. O processo pode ter sido interrompido ou a sessão expirou. Por favor, tente novamente.'; + String get unableToSetupPasskeyDescription => 'Houve um problema ao configurar a sua passkey. O processo pode ter sido interrompido ou a sessão expirou. Por favor, tente novamente.'; @override String get passkeysOffErrorTitle => 'O serviço de Passkeys não está disponível'; @@ -157,8 +166,8 @@ class DerivPasskeysLocalizationsPt extends DerivPasskeysLocalizations { String get never => 'Nunca'; @override - String get unable_to_process_your_request => 'Não foi possível processar sua solicitação'; + String get unable_to_process_your_request => 'Não foi possível completar o processamento do seu pedido'; @override - String get unable_to_process_your_request_description => 'Estamos enfrentando um problema temporário no processamento de sua solicitação. Por favor, tente novamente mais tarde.'; + String get unable_to_process_your_request_description => 'Surgiu um problema temporário no processamento do seu pedido. Por favor, tente novamente mais tarde.'; } diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ru.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ru.dart index a3bc588c9..20b92c8b6 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ru.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ru.dart @@ -63,6 +63,15 @@ class DerivPasskeysLocalizationsRu extends DerivPasskeysLocalizations { @override String get howToCreatePasskeyDescription2 => 'Вы можете создать один passkey для каждого устройства.'; + @override + String get p2pHowToCreatePasskey => 'How to create passkey?'; + + @override + String get p2pHowToCreatePasskeyDescription1 => 'Go to ‘Profile‘ in your Deriv P2P app.'; + + @override + String get p2pHowToCreatePasskeyDescription2 => 'Tap ‘Passkeys‘ to create your passkey.'; + @override String get whereArePasskeysSaved => 'Где хранятся passkeys?'; diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_si.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_si.dart index a6e443611..b33feca49 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_si.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_si.dart @@ -63,6 +63,15 @@ class DerivPasskeysLocalizationsSi extends DerivPasskeysLocalizations { @override String get howToCreatePasskeyDescription2 => 'ඔබට එක් උපාංගයකට එක් passkey එකක් සෑදිය හැක.'; + @override + String get p2pHowToCreatePasskey => 'How to create passkey?'; + + @override + String get p2pHowToCreatePasskeyDescription1 => 'Go to ‘Profile‘ in your Deriv P2P app.'; + + @override + String get p2pHowToCreatePasskeyDescription2 => 'Tap ‘Passkeys‘ to create your passkey.'; + @override String get whereArePasskeysSaved => 'Passkey සුරකින්නේ කොහේද?'; diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_sw.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_sw.dart index d60317234..d942e619a 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_sw.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_sw.dart @@ -63,6 +63,15 @@ class DerivPasskeysLocalizationsSw extends DerivPasskeysLocalizations { @override String get howToCreatePasskeyDescription2 => 'Unaweza kuunda passkey moja kwa kila kifaa.'; + @override + String get p2pHowToCreatePasskey => 'How to create passkey?'; + + @override + String get p2pHowToCreatePasskeyDescription1 => 'Go to ‘Profile‘ in your Deriv P2P app.'; + + @override + String get p2pHowToCreatePasskeyDescription2 => 'Tap ‘Passkeys‘ to create your passkey.'; + @override String get whereArePasskeysSaved => 'Passkeys zimehifadhiwa wapi?'; diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_th.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_th.dart index 8fcd074a0..d12b1e280 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_th.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_th.dart @@ -63,6 +63,15 @@ class DerivPasskeysLocalizationsTh extends DerivPasskeysLocalizations { @override String get howToCreatePasskeyDescription2 => 'คุณสามารถสร้างหนึ่ง Passkey ต่ออุปกรณ์'; + @override + String get p2pHowToCreatePasskey => 'How to create passkey?'; + + @override + String get p2pHowToCreatePasskeyDescription1 => 'Go to ‘Profile‘ in your Deriv P2P app.'; + + @override + String get p2pHowToCreatePasskeyDescription2 => 'Tap ‘Passkeys‘ to create your passkey.'; + @override String get whereArePasskeysSaved => 'Passkey จะถูกบันทึกไว้ที่ไหน?'; @@ -139,7 +148,7 @@ class DerivPasskeysLocalizationsTh extends DerivPasskeysLocalizations { String get revoke => 'เพิกถอน'; @override - String get continueTradingButtonText => 'ทำการเทรดต่อไป'; + String get continueTradingButtonText => 'ดำเนินการเทรดต่อ'; @override String get addMorePasskeysButtonText => 'เพิ่มจำนวน Passkey'; diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_tr.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_tr.dart index 23bf72ae7..cab12d4e8 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_tr.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_tr.dart @@ -63,6 +63,15 @@ class DerivPasskeysLocalizationsTr extends DerivPasskeysLocalizations { @override String get howToCreatePasskeyDescription2 => 'Cihaz başına bir passkey oluşturabilirsiniz.'; + @override + String get p2pHowToCreatePasskey => 'How to create passkey?'; + + @override + String get p2pHowToCreatePasskeyDescription1 => 'Go to ‘Profile‘ in your Deriv P2P app.'; + + @override + String get p2pHowToCreatePasskeyDescription2 => 'Tap ‘Passkeys‘ to create your passkey.'; + @override String get whereArePasskeysSaved => 'Passkeys nereye kaydedilir?'; diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_vi.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_vi.dart index beabf3ffc..c017a18cc 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_vi.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_vi.dart @@ -63,6 +63,15 @@ class DerivPasskeysLocalizationsVi extends DerivPasskeysLocalizations { @override String get howToCreatePasskeyDescription2 => 'Bạn có thể tạo một passkey cho mỗi thiết bị.'; + @override + String get p2pHowToCreatePasskey => 'How to create passkey?'; + + @override + String get p2pHowToCreatePasskeyDescription1 => 'Go to ‘Profile‘ in your Deriv P2P app.'; + + @override + String get p2pHowToCreatePasskeyDescription2 => 'Tap ‘Passkeys‘ to create your passkey.'; + @override String get whereArePasskeysSaved => 'Passkeys được lưu ở đâu?'; @@ -142,7 +151,7 @@ class DerivPasskeysLocalizationsVi extends DerivPasskeysLocalizations { String get continueTradingButtonText => 'Tiếp tục giao dịch'; @override - String get addMorePasskeysButtonText => 'Thêm nhiều Passkeys'; + String get addMorePasskeysButtonText => 'Thêm passkeys'; @override String get unableToSetupPasskey => 'Không thể thiết lập passkey'; diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_zh.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_zh.dart index 6e63c2652..31de71f2e 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_zh.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_zh.dart @@ -63,6 +63,15 @@ class DerivPasskeysLocalizationsZh extends DerivPasskeysLocalizations { @override String get howToCreatePasskeyDescription2 => '可以為每個裝置建立一個金鑰。'; + @override + String get p2pHowToCreatePasskey => 'How to create passkey?'; + + @override + String get p2pHowToCreatePasskeyDescription1 => 'Go to ‘Profile‘ in your Deriv P2P app.'; + + @override + String get p2pHowToCreatePasskeyDescription2 => 'Tap ‘Passkeys‘ to create your passkey.'; + @override String get whereArePasskeysSaved => '金鑰儲存在哪裡?'; diff --git a/packages/deriv_localizations/pubspec.yaml b/packages/deriv_localizations/pubspec.yaml index b1f2eaadd..1009897b9 100644 --- a/packages/deriv_localizations/pubspec.yaml +++ b/packages/deriv_localizations/pubspec.yaml @@ -8,7 +8,6 @@ version: 1.4.2 environment: sdk: '>=3.0.2 <4.0.0' - dependencies: flutter: sdk: flutter @@ -17,18 +16,11 @@ dependencies: sdk: flutter intl: ^0.18.0 - - - cupertino_icons: ^1.0.2 - dev_dependencies: flutter_test: - sdk: flutter - - + sdk: flutter flutter_lints: ^2.0.0 - flutter: uses-material-design: true generate: true From 37157e86a1e37a621a9a9281e959b7d66c7bb71c Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Fri, 14 Jun 2024 11:20:54 +0800 Subject: [PATCH 093/162] chore(version): bump version and update changelog (#614) Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: abedelaziz-deriv --- CHANGELOG.md | 33 +++++++++++++++++++++++ README.md | 6 ++--- packages/deriv_auth/CHANGELOG.md | 4 +++ packages/deriv_auth/pubspec.yaml | 6 ++--- packages/deriv_localizations/CHANGELOG.md | 4 +++ packages/deriv_localizations/pubspec.yaml | 2 +- packages/deriv_passkeys/CHANGELOG.md | 4 +++ packages/deriv_passkeys/pubspec.yaml | 4 +-- 8 files changed, 54 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d537528a9..d19979ad5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,39 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-06-14 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_auth` - `v6.6.6`](#deriv_auth---v666) + - [`deriv_localizations` - `v1.4.3`](#deriv_localizations---v143) + - [`deriv_passkeys` - `v0.0.1+7`](#deriv_passkeys---v0017) + +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_passkeys` - `v0.0.1+7` + +--- + +#### `deriv_auth` - `v6.6.6` + + - **REFACTOR**(deriv_auth): added a flag to allow hiding passkeys button ([#612](https://github.com/regentmarkets/flutter-deriv-packages/issues/612)). ([a4026a9d](https://github.com/regentmarkets/flutter-deriv-packages/commit/a4026a9d8164abc1c66beb327d48610d8ce30dde)) + +#### `deriv_localizations` - `v1.4.3` + + - **REFACTOR**(deriv_localizations): Update p2p strings for passkeys ([#615](https://github.com/regentmarkets/flutter-deriv-packages/issues/615)). ([5fd85af2](https://github.com/regentmarkets/flutter-deriv-packages/commit/5fd85af24394ea68b8b0a7abc854b9c33b791c26)) + + ## 2024-06-13 ### Changes diff --git a/README.md b/README.md index e99c9d14e..aaf519522 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.6.5)`. 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.6.6)`. To use the package, add the following to your pubspec.yaml file: ```yaml @@ -20,7 +20,7 @@ deriv_ui: | Name | Description | Version | | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | | [analytics](./packages/analytics) | Used to collect and send analytical information to 'Firebase' and 'Segment'. | [v2.0.0](./packages/analytics/CHANGELOG.md) | -| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.6.5 ](./packages/deriv_auth/CHANGELOG.md) | +| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.6.6 ](./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) | @@ -32,7 +32,7 @@ deriv_ui: | [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+2](./packages/deriv_live_chat/CHANGELOG.md) | | [deriv_language_selector](./packages/deriv_language_selector) | A package to handle language change of the app. | [v0.0.2+4](./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.4.2](./packages/deriv_localizations/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.4.3](./packages/deriv_localizations/CHANGELOG.md) | | [deriv_numpad](./packages/deriv_numpad) | Number Pad Widget for number input. | [v1.1.5](./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) | diff --git a/packages/deriv_auth/CHANGELOG.md b/packages/deriv_auth/CHANGELOG.md index c8fa3df85..7450f4532 100644 --- a/packages/deriv_auth/CHANGELOG.md +++ b/packages/deriv_auth/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.6.6 + + - **REFACTOR**(deriv_auth): added a flag to allow hiding passkeys button ([#612](https://github.com/regentmarkets/flutter-deriv-packages/issues/612)). ([a4026a9d](https://github.com/regentmarkets/flutter-deriv-packages/commit/a4026a9d8164abc1c66beb327d48610d8ce30dde)) + ## 6.6.5 - Update a dependency to the latest release. diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index 9cc2a927f..c0290fbbe 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.6.5 +version: 6.6.6 environment: sdk: ">=3.0.0 <4.0.0" @@ -45,13 +45,13 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_localizations - ref: deriv_localizations-v1.4.2 + ref: deriv_localizations-v1.4.3 deriv_passkeys: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: deriv_passkeys-v0.0.1+6 + ref: deriv_passkeys-v0.0.1+7 deriv_language_selector: git: diff --git a/packages/deriv_localizations/CHANGELOG.md b/packages/deriv_localizations/CHANGELOG.md index e94a2228a..87b8793f9 100644 --- a/packages/deriv_localizations/CHANGELOG.md +++ b/packages/deriv_localizations/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.4.3 + + - **REFACTOR**(deriv_localizations): Update p2p strings for passkeys ([#615](https://github.com/regentmarkets/flutter-deriv-packages/issues/615)). ([5fd85af2](https://github.com/regentmarkets/flutter-deriv-packages/commit/5fd85af24394ea68b8b0a7abc854b9c33b791c26)) + ## 1.4.2 - **FIX**(deriv-localization): fix passkey button strings ([#606](https://github.com/regentmarkets/flutter-deriv-packages/issues/606)). ([ed2a7ea9](https://github.com/regentmarkets/flutter-deriv-packages/commit/ed2a7ea958e34aa027ecb9ef6919f04fd5c7d5f1)) diff --git a/packages/deriv_localizations/pubspec.yaml b/packages/deriv_localizations/pubspec.yaml index 1009897b9..9bc5fadc3 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.4.2 +version: 1.4.3 environment: sdk: '>=3.0.2 <4.0.0' diff --git a/packages/deriv_passkeys/CHANGELOG.md b/packages/deriv_passkeys/CHANGELOG.md index af76698cc..0affb2840 100644 --- a/packages/deriv_passkeys/CHANGELOG.md +++ b/packages/deriv_passkeys/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.1+7 + + - Update a dependency to the latest release. + ## 0.0.1+6 - Update a dependency to the latest release. diff --git a/packages/deriv_passkeys/pubspec.yaml b/packages/deriv_passkeys/pubspec.yaml index 4bbdc7a95..eed8431a6 100644 --- a/packages/deriv_passkeys/pubspec.yaml +++ b/packages/deriv_passkeys/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_passkeys description: Deriv Passkeys Flutter Plugin -version: 0.0.1+6 +version: 0.0.1+7 publish_to: "none" environment: @@ -19,7 +19,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_localizations - ref: deriv_localizations-v1.4.2 + ref: deriv_localizations-v1.4.3 deriv_ui: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git From 8d2c9f3533435ae8af448d777373aa9dffbedf2b Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Fri, 14 Jun 2024 13:37:07 +0800 Subject: [PATCH 094/162] chore(deriv_localizations): Crowdin Localization Updated (#616) --- .../deriv_localizations/lib/l10n/deriv_passkeys/app_ar.arb | 3 +++ .../deriv_localizations/lib/l10n/deriv_passkeys/app_bn.arb | 3 +++ .../deriv_localizations/lib/l10n/deriv_passkeys/app_de.arb | 3 +++ .../deriv_localizations/lib/l10n/deriv_passkeys/app_es.arb | 3 +++ .../deriv_localizations/lib/l10n/deriv_passkeys/app_fr.arb | 3 +++ .../deriv_localizations/lib/l10n/deriv_passkeys/app_it.arb | 3 +++ .../deriv_localizations/lib/l10n/deriv_passkeys/app_ko.arb | 3 +++ .../deriv_localizations/lib/l10n/deriv_passkeys/app_pl.arb | 3 +++ .../deriv_localizations/lib/l10n/deriv_passkeys/app_pt.arb | 3 +++ .../deriv_localizations/lib/l10n/deriv_passkeys/app_ru.arb | 3 +++ .../deriv_localizations/lib/l10n/deriv_passkeys/app_si.arb | 3 +++ .../deriv_localizations/lib/l10n/deriv_passkeys/app_sw.arb | 3 +++ .../deriv_localizations/lib/l10n/deriv_passkeys/app_th.arb | 3 +++ .../deriv_localizations/lib/l10n/deriv_passkeys/app_tr.arb | 3 +++ .../deriv_localizations/lib/l10n/deriv_passkeys/app_vi.arb | 3 +++ .../deriv_localizations/lib/l10n/deriv_passkeys/app_zh.arb | 3 +++ 16 files changed, 48 insertions(+) diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_ar.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_ar.arb index 70fe56ad1..a8fcb379d 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_ar.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_ar.arb @@ -26,6 +26,9 @@ "howToCreatePasskey": "كيفية إنشاء passkey؟", "howToCreatePasskeyDescription1": "انتقل إلى \"إعدادات الحساب\" على المشتقات.", "howToCreatePasskeyDescription2": "يمكنك إنشاء Passkey واحد لكل جهاز.", + "p2pHowToCreatePasskey": "كيفية إنشاء مفتاح مرور؟", + "p2pHowToCreatePasskeyDescription1": "انتقل إلى «الملف الشخصي» في تطبيق Deriv P2P الخاص بك.", + "p2pHowToCreatePasskeyDescription2": "انقر فوق «مفاتيح المرور» لإنشاء مفتاح المرور الخاص بك.", "whereArePasskeysSaved": "أين يتم حفظ passkeys؟", "whereArePasskeysSavedDescriptionAndroid": "أندرويد: مدير كلمات مرور Google.", "whereArePasskeysSavedDescriptionIOS": "iOS: سلسلة مفاتيح iCloud.", diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_bn.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_bn.arb index b77e53953..a6c54216d 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_bn.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_bn.arb @@ -26,6 +26,9 @@ "howToCreatePasskey": "Passkey একটি পাসকি তৈরি করবেন?", "howToCreatePasskeyDescription1": "Deriv 'অ্যাকাউন্ট সেটিংস' এ যান।", "howToCreatePasskeyDescription2": "Passkey প্রতি ডিভাইসে একটি পাসকি তৈরি করতে পারেন।", + "p2pHowToCreatePasskey": "কিভাবে পাসকি তৈরি করবেন?", + "p2pHowToCreatePasskeyDescription1": "আপনার ডেরিভ পি 2 পি অ্যাপের 'প্রোফাইল' এ যান।", + "p2pHowToCreatePasskeyDescription2": "আপনার পাসকি তৈরি করতে 'পাসকিস' এ আলতো চাপুন।", "whereArePasskeysSaved": "Passkeys কোথায় সংরক্ষণ করা হয়?", "whereArePasskeysSavedDescriptionAndroid": "Android: Google পাসওয়ার্ড ম্যানেজার।", "whereArePasskeysSavedDescriptionIOS": "iOS: iCloud কীচেন।", diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_de.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_de.arb index 4a01dff0d..089fdada3 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_de.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_de.arb @@ -26,6 +26,9 @@ "howToCreatePasskey": "Wie erstelle ich einen Passkey?", "howToCreatePasskeyDescription1": "Gehen Sie zu 'Kontoeinstellungen' auf Deriv.", "howToCreatePasskeyDescription2": "Sie können einen Passkey pro Gerät erstellen.", + "p2pHowToCreatePasskey": "Wie erstelle ich einen Passkey?", + "p2pHowToCreatePasskeyDescription1": "Gehen Sie in Ihrer Deriv P2P-App zu „Profil“.", + "p2pHowToCreatePasskeyDescription2": "Tippen Sie auf „Hauptschlüssel“, um Ihren Hauptschlüssel zu erstellen.", "whereArePasskeysSaved": "Wo werden die Passkeys gespeichert?", "whereArePasskeysSavedDescriptionAndroid": "Android: Google Passwort-Manager.", "whereArePasskeysSavedDescriptionIOS": "iOS: iCloud-Schlüsselbund.", diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_es.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_es.arb index 79dbfdd44..6e38a39d4 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_es.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_es.arb @@ -26,6 +26,9 @@ "howToCreatePasskey": "¿Cómo crear una passkey?", "howToCreatePasskeyDescription1": "Vaya a \"Configuración de la cuenta\" en Deriv.", "howToCreatePasskeyDescription2": "Puede crear una passkey por dispositivo.", + "p2pHowToCreatePasskey": "¿Cómo crear una clave de paso?", + "p2pHowToCreatePasskeyDescription1": "Ir a «Perfil» en tu aplicación Deriv P2P.", + "p2pHowToCreatePasskeyDescription2": "Pulsa «Claves de paso» para crear tu clave de paso.", "whereArePasskeysSaved": "¿Dónde se guardan las passkeys?", "whereArePasskeysSavedDescriptionAndroid": "Android: Gestor de contraseñas de Google.", "whereArePasskeysSavedDescriptionIOS": "iOS: Llavero de iCloud.", diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_fr.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_fr.arb index 735033020..8587cdec4 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_fr.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_fr.arb @@ -26,6 +26,9 @@ "howToCreatePasskey": "Comment créer une passkey ?", "howToCreatePasskeyDescription1": "Allez dans \"Paramètres du compte\" sur Deriv.", "howToCreatePasskeyDescription2": "Vous pouvez créer une Passkey par appareil.", + "p2pHowToCreatePasskey": "Comment créer une clé d'accès ?", + "p2pHowToCreatePasskeyDescription1": "Accéder à « Profil » dans votre application Deriv P2P.", + "p2pHowToCreatePasskeyDescription2": "Appuyez sur « Clés d'accès » pour créer votre clé d'accès.", "whereArePasskeysSaved": "Où sont enregistrées les passkeys ?", "whereArePasskeysSavedDescriptionAndroid": "Android : Gestionnaire de mots de passe Google.", "whereArePasskeysSavedDescriptionIOS": "iOS : trousseau iCloud.", diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_it.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_it.arb index 74e475fb9..fef533b5a 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_it.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_it.arb @@ -26,6 +26,9 @@ "howToCreatePasskey": "Come creare una passkey?", "howToCreatePasskeyDescription1": "Vada a 'Impostazioni del conto' su Deriv.", "howToCreatePasskeyDescription2": "Può creare una sola Passkey per dispositivo.", + "p2pHowToCreatePasskey": "Come creare una passkey?", + "p2pHowToCreatePasskeyDescription1": "Vai a «Profilo» nella tua app Deriv P2P.", + "p2pHowToCreatePasskeyDescription2": "Tocca «Passkey» per creare la tua passkey.", "whereArePasskeysSaved": "Dove vengono salvate la passkey?", "whereArePasskeysSavedDescriptionAndroid": "Android: Gestore di password di Google.", "whereArePasskeysSavedDescriptionIOS": "iOS: Portachiavi iCloud.", diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_ko.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_ko.arb index 4251a31f3..632590e26 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_ko.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_ko.arb @@ -26,6 +26,9 @@ "howToCreatePasskey": "Passkey는 어떻게 생성할 수 있나요?", "howToCreatePasskeyDescription1": "Deriv의 '계정 설정'으로 이동하세요.", "howToCreatePasskeyDescription2": "기기당 하나의 Passkey를 만들 수 있습니다.", + "p2pHowToCreatePasskey": "암호 키는 어떻게 만드나요?", + "p2pHowToCreatePasskeyDescription1": "Deriv P2P 앱에서 '프로필'로 이동합니다.", + "p2pHowToCreatePasskeyDescription2": "'암호'를 눌러 암호를 생성합니다.", "whereArePasskeysSaved": "Passkeys는 어디에 저장되나요?", "whereArePasskeysSavedDescriptionAndroid": "Android: Google 비밀번호 관리자.", "whereArePasskeysSavedDescriptionIOS": "iOS: iCloud 키체인.", diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_pl.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_pl.arb index 366ed3337..e33a4c2ec 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_pl.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_pl.arb @@ -26,6 +26,9 @@ "howToCreatePasskey": "Jak utworzyć passkey?", "howToCreatePasskeyDescription1": "Przejdź do ‘Ustawień konta’ na Deriv.", "howToCreatePasskeyDescription2": "Możesz utworzyć jedno hasło na urządzenie.", + "p2pHowToCreatePasskey": "Jak utworzyć klucz hasłowy?", + "p2pHowToCreatePasskeyDescription1": "Przejdź do „Profil” w aplikacji Deriv P2P.", + "p2pHowToCreatePasskeyDescription2": "Stuknij „Kody haseł”, aby utworzyć klucz hasła.", "whereArePasskeysSaved": "Gdzie są zapisywane passkeys?", "whereArePasskeysSavedDescriptionAndroid": "Android: menedżer haseł Google.", "whereArePasskeysSavedDescriptionIOS": "iOS: pęk kluczy iCloud.", diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_pt.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_pt.arb index 7ff6f085b..dc5e97cbb 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_pt.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_pt.arb @@ -26,6 +26,9 @@ "howToCreatePasskey": "Como criar uma chave de acesso?", "howToCreatePasskeyDescription1": "Aceda às \"Definições de conta\" na Deriv.", "howToCreatePasskeyDescription2": "Pode criar uma passkey por dispositivo.", + "p2pHowToCreatePasskey": "Como criar uma chave de acesso?", + "p2pHowToCreatePasskeyDescription1": "Vá para 'Perfil' em seu aplicativo Deriv P2P.", + "p2pHowToCreatePasskeyDescription2": "Toque em “Chaves de acesso” para criar sua chave de acesso.", "whereArePasskeysSaved": "Onde são guardadas as chaves de acesso?", "whereArePasskeysSavedDescriptionAndroid": "Android: Gestor de palavras-passe do Google.", "whereArePasskeysSavedDescriptionIOS": "iOS: iCloud keychain.", diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_ru.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_ru.arb index 28784d534..2f15a3805 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_ru.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_ru.arb @@ -26,6 +26,9 @@ "howToCreatePasskey": "Как создать passkey?", "howToCreatePasskeyDescription1": "Перейдите в ‘Настройки учетной записи’ на Deriv.", "howToCreatePasskeyDescription2": "Вы можете создать один passkey для каждого устройства.", + "p2pHowToCreatePasskey": "Как создать пароль?", + "p2pHowToCreatePasskeyDescription1": "Перейдите на «Профиль» в приложении Deriv P2P.", + "p2pHowToCreatePasskeyDescription2": "Нажмите «Пароли», чтобы создать свой пароль.", "whereArePasskeysSaved": "Где хранятся passkeys?", "whereArePasskeysSavedDescriptionAndroid": "Android: Менеджер паролей Google.", "whereArePasskeysSavedDescriptionIOS": "iOS: связка ключей iCloud.", diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_si.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_si.arb index e25b89ec8..578e61384 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_si.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_si.arb @@ -26,6 +26,9 @@ "howToCreatePasskey": "නිර්මාණය Passkey කෙසේද?", "howToCreatePasskeyDescription1": "Deriv හි 'ගිණුම් සැකසීම්' වෙත යන්න.", "howToCreatePasskeyDescription2": "ඔබට එක් උපාංගයකට එක් passkey එකක් සෑදිය හැක.", + "p2pHowToCreatePasskey": "මුරපද නිර්මාණය කරන්නේ කෙසේද?", + "p2pHowToCreatePasskeyDescription1": "ඔබේ ඩෙරිව් පී 2 පී යෙදුමේ 'පැතිකඩ' වෙත යන්න.", + "p2pHowToCreatePasskeyDescription2": "ඔබගේ මුරපද නිර්මාණය කිරීම සඳහා 'මුරපද' තට්ටු කරන්න.", "whereArePasskeysSaved": "Passkey සුරකින්නේ කොහේද?", "whereArePasskeysSavedDescriptionAndroid": "Android: Google මුරපද කළමනාකරු.", "whereArePasskeysSavedDescriptionIOS": "iOS: iCloud යතුරු දාමය.", diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_sw.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_sw.arb index de772c07f..048f310de 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_sw.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_sw.arb @@ -26,6 +26,9 @@ "howToCreatePasskey": "Jinsi ya kuunda passkey?", "howToCreatePasskeyDescription1": "Nenda katika 'Mipangilio ya Akaunti' kwenye Deriv.", "howToCreatePasskeyDescription2": "Unaweza kuunda passkey moja kwa kila kifaa.", + "p2pHowToCreatePasskey": "Jinsi ya kuunda passkey?", + "p2pHowToCreatePasskeyDescription1": "Nenda kwenye 'Profaili' katika programu yako ya Deriv P2P.", + "p2pHowToCreatePasskeyDescription2": "Gonga 'Passkeys' ili kuunda nenosiri lako.", "whereArePasskeysSaved": "Passkeys zimehifadhiwa wapi?", "whereArePasskeysSavedDescriptionAndroid": "Android: Google password manager.", "whereArePasskeysSavedDescriptionIOS": "iOS: iCloud keychain.", diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_th.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_th.arb index 8657c205d..b4a8d5c12 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_th.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_th.arb @@ -26,6 +26,9 @@ "howToCreatePasskey": "จะสร้าง Passkey ได้อย่างไร?", "howToCreatePasskeyDescription1": "ไปที่ 'การตั้งค่าบัญชี' บน Deriv", "howToCreatePasskeyDescription2": "คุณสามารถสร้างหนึ่ง Passkey ต่ออุปกรณ์", + "p2pHowToCreatePasskey": "วิธีการสร้างรหัสผ่าน", + "p2pHowToCreatePasskeyDescription1": "ไปที่ 'โปรไฟล์' ในแอป Deriv P2P ของคุณ", + "p2pHowToCreatePasskeyDescription2": "แตะ 'รหัสผ่าน' เพื่อสร้างรหัสผ่านของคุณ", "whereArePasskeysSaved": "Passkey จะถูกบันทึกไว้ที่ไหน?", "whereArePasskeysSavedDescriptionAndroid": "Android: ตัวจัดการรหัสผ่าน Google", "whereArePasskeysSavedDescriptionIOS": "iOS: พวงกุญแจ iCloud", diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_tr.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_tr.arb index cd9c5aa29..5fd54dbdc 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_tr.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_tr.arb @@ -26,6 +26,9 @@ "howToCreatePasskey": "Passkey nasıl oluşturulur?", "howToCreatePasskeyDescription1": "Deriv'de 'Hesap Ayarları'na gidin.", "howToCreatePasskeyDescription2": "Cihaz başına bir passkey oluşturabilirsiniz.", + "p2pHowToCreatePasskey": "Parola nasıl oluşturulur?", + "p2pHowToCreatePasskeyDescription1": "Deriv P2P uygulamanızdaki 'Profil' bölümüne gidin.", + "p2pHowToCreatePasskeyDescription2": "Parola anahtarınızı oluşturmak için 'Parola Tuşları'na dokunun.", "whereArePasskeysSaved": "Passkeys nereye kaydedilir?", "whereArePasskeysSavedDescriptionAndroid": "Android: Google şifre yöneticisi.", "whereArePasskeysSavedDescriptionIOS": "iOS: iCloud anahtar zinciri.", diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_vi.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_vi.arb index d360fe3ce..328e50aaa 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_vi.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_vi.arb @@ -26,6 +26,9 @@ "howToCreatePasskey": "Làm thế nào để tạo passkey?", "howToCreatePasskeyDescription1": "Chuyển đến 'Cài đặt tài khoản' trên Deriv.", "howToCreatePasskeyDescription2": "Bạn có thể tạo một passkey cho mỗi thiết bị.", + "p2pHowToCreatePasskey": "Làm thế nào để tạo mật khẩu?", + "p2pHowToCreatePasskeyDescription1": "Chuyển đến 'Hồ sơ' trong ứng dụng Deriv P2P của bạn.", + "p2pHowToCreatePasskeyDescription2": "Nhấn vào 'Phím mật khẩu' để tạo mật khẩu của bạn.", "whereArePasskeysSaved": "Passkeys được lưu ở đâu?", "whereArePasskeysSavedDescriptionAndroid": "Android: Trình quản lý mật khẩu Google.", "whereArePasskeysSavedDescriptionIOS": "iOS: Móc khóa iCloud.", diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_zh.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_zh.arb index d04752476..a49322481 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_zh.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_zh.arb @@ -26,6 +26,9 @@ "howToCreatePasskey": "如何建立金鑰?", "howToCreatePasskeyDescription1": "轉到 Deriv 的‘帳戶設定‘。", "howToCreatePasskeyDescription2": "可以為每個裝置建立一個金鑰。", + "p2pHowToCreatePasskey": "如何建立密碼?", + "p2pHowToCreatePasskeyDescription1": "在您的 Deriv P2P 應用程序中轉到「個人資料」。", + "p2pHowToCreatePasskeyDescription2": "點擊「密碼」以建立您的密碼。", "whereArePasskeysSaved": "金鑰儲存在哪裡?", "whereArePasskeysSavedDescriptionAndroid": "Android: Google 密碼管理器。", "whereArePasskeysSavedDescriptionIOS": "iOS:iCloud 鑰匙圈。", From 1d5e5f141640aa00546dcbb31d2db8eb9a994452 Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Fri, 14 Jun 2024 13:53:56 +0800 Subject: [PATCH 095/162] refactor(deriv_localizations): Crowdin Localization Generated (#617) --- .../deriv_passkeys/deriv_passkeys_localizations_ar.dart | 6 +++--- .../deriv_passkeys/deriv_passkeys_localizations_bn.dart | 6 +++--- .../deriv_passkeys/deriv_passkeys_localizations_de.dart | 6 +++--- .../deriv_passkeys/deriv_passkeys_localizations_es.dart | 6 +++--- .../deriv_passkeys/deriv_passkeys_localizations_fr.dart | 6 +++--- .../deriv_passkeys/deriv_passkeys_localizations_it.dart | 6 +++--- .../deriv_passkeys/deriv_passkeys_localizations_ko.dart | 6 +++--- .../deriv_passkeys/deriv_passkeys_localizations_pl.dart | 6 +++--- .../deriv_passkeys/deriv_passkeys_localizations_pt.dart | 6 +++--- .../deriv_passkeys/deriv_passkeys_localizations_ru.dart | 6 +++--- .../deriv_passkeys/deriv_passkeys_localizations_si.dart | 6 +++--- .../deriv_passkeys/deriv_passkeys_localizations_sw.dart | 6 +++--- .../deriv_passkeys/deriv_passkeys_localizations_th.dart | 6 +++--- .../deriv_passkeys/deriv_passkeys_localizations_tr.dart | 6 +++--- .../deriv_passkeys/deriv_passkeys_localizations_vi.dart | 6 +++--- .../deriv_passkeys/deriv_passkeys_localizations_zh.dart | 6 +++--- 16 files changed, 48 insertions(+), 48 deletions(-) diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ar.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ar.dart index 8d24a63b6..125ab7043 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ar.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ar.dart @@ -64,13 +64,13 @@ class DerivPasskeysLocalizationsAr extends DerivPasskeysLocalizations { String get howToCreatePasskeyDescription2 => 'يمكنك إنشاء Passkey واحد لكل جهاز.'; @override - String get p2pHowToCreatePasskey => 'How to create passkey?'; + String get p2pHowToCreatePasskey => 'كيفية إنشاء مفتاح مرور؟'; @override - String get p2pHowToCreatePasskeyDescription1 => 'Go to ‘Profile‘ in your Deriv P2P app.'; + String get p2pHowToCreatePasskeyDescription1 => 'انتقل إلى «الملف الشخصي» في تطبيق Deriv P2P الخاص بك.'; @override - String get p2pHowToCreatePasskeyDescription2 => 'Tap ‘Passkeys‘ to create your passkey.'; + String get p2pHowToCreatePasskeyDescription2 => 'انقر فوق «مفاتيح المرور» لإنشاء مفتاح المرور الخاص بك.'; @override String get whereArePasskeysSaved => 'أين يتم حفظ passkeys؟'; diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_bn.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_bn.dart index dd24e0b0f..35a823892 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_bn.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_bn.dart @@ -64,13 +64,13 @@ class DerivPasskeysLocalizationsBn extends DerivPasskeysLocalizations { String get howToCreatePasskeyDescription2 => 'Passkey প্রতি ডিভাইসে একটি পাসকি তৈরি করতে পারেন।'; @override - String get p2pHowToCreatePasskey => 'How to create passkey?'; + String get p2pHowToCreatePasskey => 'কিভাবে পাসকি তৈরি করবেন?'; @override - String get p2pHowToCreatePasskeyDescription1 => 'Go to ‘Profile‘ in your Deriv P2P app.'; + String get p2pHowToCreatePasskeyDescription1 => 'আপনার ডেরিভ পি 2 পি অ্যাপের \'প্রোফাইল\' এ যান।'; @override - String get p2pHowToCreatePasskeyDescription2 => 'Tap ‘Passkeys‘ to create your passkey.'; + String get p2pHowToCreatePasskeyDescription2 => 'আপনার পাসকি তৈরি করতে \'পাসকিস\' এ আলতো চাপুন।'; @override String get whereArePasskeysSaved => 'Passkeys কোথায় সংরক্ষণ করা হয়?'; diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_de.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_de.dart index 6956e7d1c..c7daa5576 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_de.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_de.dart @@ -64,13 +64,13 @@ class DerivPasskeysLocalizationsDe extends DerivPasskeysLocalizations { String get howToCreatePasskeyDescription2 => 'Sie können einen Passkey pro Gerät erstellen.'; @override - String get p2pHowToCreatePasskey => 'How to create passkey?'; + String get p2pHowToCreatePasskey => 'Wie erstelle ich einen Passkey?'; @override - String get p2pHowToCreatePasskeyDescription1 => 'Go to ‘Profile‘ in your Deriv P2P app.'; + String get p2pHowToCreatePasskeyDescription1 => 'Gehen Sie in Ihrer Deriv P2P-App zu „Profil“.'; @override - String get p2pHowToCreatePasskeyDescription2 => 'Tap ‘Passkeys‘ to create your passkey.'; + String get p2pHowToCreatePasskeyDescription2 => 'Tippen Sie auf „Hauptschlüssel“, um Ihren Hauptschlüssel zu erstellen.'; @override String get whereArePasskeysSaved => 'Wo werden die Passkeys gespeichert?'; diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_es.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_es.dart index 24d2f4434..a3a229182 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_es.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_es.dart @@ -64,13 +64,13 @@ class DerivPasskeysLocalizationsEs extends DerivPasskeysLocalizations { String get howToCreatePasskeyDescription2 => 'Puede crear una passkey por dispositivo.'; @override - String get p2pHowToCreatePasskey => 'How to create passkey?'; + String get p2pHowToCreatePasskey => '¿Cómo crear una clave de paso?'; @override - String get p2pHowToCreatePasskeyDescription1 => 'Go to ‘Profile‘ in your Deriv P2P app.'; + String get p2pHowToCreatePasskeyDescription1 => 'Ir a «Perfil» en tu aplicación Deriv P2P.'; @override - String get p2pHowToCreatePasskeyDescription2 => 'Tap ‘Passkeys‘ to create your passkey.'; + String get p2pHowToCreatePasskeyDescription2 => 'Pulsa «Claves de paso» para crear tu clave de paso.'; @override String get whereArePasskeysSaved => '¿Dónde se guardan las passkeys?'; diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_fr.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_fr.dart index 202aa1b22..7eca2189e 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_fr.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_fr.dart @@ -64,13 +64,13 @@ class DerivPasskeysLocalizationsFr extends DerivPasskeysLocalizations { String get howToCreatePasskeyDescription2 => 'Vous pouvez créer une Passkey par appareil.'; @override - String get p2pHowToCreatePasskey => 'How to create passkey?'; + String get p2pHowToCreatePasskey => 'Comment créer une clé d\'accès ?'; @override - String get p2pHowToCreatePasskeyDescription1 => 'Go to ‘Profile‘ in your Deriv P2P app.'; + String get p2pHowToCreatePasskeyDescription1 => 'Accéder à « Profil » dans votre application Deriv P2P.'; @override - String get p2pHowToCreatePasskeyDescription2 => 'Tap ‘Passkeys‘ to create your passkey.'; + String get p2pHowToCreatePasskeyDescription2 => 'Appuyez sur « Clés d\'accès » pour créer votre clé d\'accès.'; @override String get whereArePasskeysSaved => 'Où sont enregistrées les passkeys ?'; diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_it.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_it.dart index 884191c38..56180bfa2 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_it.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_it.dart @@ -64,13 +64,13 @@ class DerivPasskeysLocalizationsIt extends DerivPasskeysLocalizations { String get howToCreatePasskeyDescription2 => 'Può creare una sola Passkey per dispositivo.'; @override - String get p2pHowToCreatePasskey => 'How to create passkey?'; + String get p2pHowToCreatePasskey => 'Come creare una passkey?'; @override - String get p2pHowToCreatePasskeyDescription1 => 'Go to ‘Profile‘ in your Deriv P2P app.'; + String get p2pHowToCreatePasskeyDescription1 => 'Vai a «Profilo» nella tua app Deriv P2P.'; @override - String get p2pHowToCreatePasskeyDescription2 => 'Tap ‘Passkeys‘ to create your passkey.'; + String get p2pHowToCreatePasskeyDescription2 => 'Tocca «Passkey» per creare la tua passkey.'; @override String get whereArePasskeysSaved => 'Dove vengono salvate la passkey?'; diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ko.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ko.dart index ccee517a4..9634249f2 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ko.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ko.dart @@ -64,13 +64,13 @@ class DerivPasskeysLocalizationsKo extends DerivPasskeysLocalizations { String get howToCreatePasskeyDescription2 => '기기당 하나의 Passkey를 만들 수 있습니다.'; @override - String get p2pHowToCreatePasskey => 'How to create passkey?'; + String get p2pHowToCreatePasskey => '암호 키는 어떻게 만드나요?'; @override - String get p2pHowToCreatePasskeyDescription1 => 'Go to ‘Profile‘ in your Deriv P2P app.'; + String get p2pHowToCreatePasskeyDescription1 => 'Deriv P2P 앱에서 \'프로필\'로 이동합니다.'; @override - String get p2pHowToCreatePasskeyDescription2 => 'Tap ‘Passkeys‘ to create your passkey.'; + String get p2pHowToCreatePasskeyDescription2 => '\'암호\'를 눌러 암호를 생성합니다.'; @override String get whereArePasskeysSaved => 'Passkeys는 어디에 저장되나요?'; diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_pl.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_pl.dart index e0537c8c6..6dc9f0359 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_pl.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_pl.dart @@ -64,13 +64,13 @@ class DerivPasskeysLocalizationsPl extends DerivPasskeysLocalizations { String get howToCreatePasskeyDescription2 => 'Możesz utworzyć jedno hasło na urządzenie.'; @override - String get p2pHowToCreatePasskey => 'How to create passkey?'; + String get p2pHowToCreatePasskey => 'Jak utworzyć klucz hasłowy?'; @override - String get p2pHowToCreatePasskeyDescription1 => 'Go to ‘Profile‘ in your Deriv P2P app.'; + String get p2pHowToCreatePasskeyDescription1 => 'Przejdź do „Profil” w aplikacji Deriv P2P.'; @override - String get p2pHowToCreatePasskeyDescription2 => 'Tap ‘Passkeys‘ to create your passkey.'; + String get p2pHowToCreatePasskeyDescription2 => 'Stuknij „Kody haseł”, aby utworzyć klucz hasła.'; @override String get whereArePasskeysSaved => 'Gdzie są zapisywane passkeys?'; diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_pt.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_pt.dart index a7f2a1aea..962bf194d 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_pt.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_pt.dart @@ -64,13 +64,13 @@ class DerivPasskeysLocalizationsPt extends DerivPasskeysLocalizations { String get howToCreatePasskeyDescription2 => 'Pode criar uma passkey por dispositivo.'; @override - String get p2pHowToCreatePasskey => 'How to create passkey?'; + String get p2pHowToCreatePasskey => 'Como criar uma chave de acesso?'; @override - String get p2pHowToCreatePasskeyDescription1 => 'Go to ‘Profile‘ in your Deriv P2P app.'; + String get p2pHowToCreatePasskeyDescription1 => 'Vá para \'Perfil\' em seu aplicativo Deriv P2P.'; @override - String get p2pHowToCreatePasskeyDescription2 => 'Tap ‘Passkeys‘ to create your passkey.'; + String get p2pHowToCreatePasskeyDescription2 => 'Toque em “Chaves de acesso” para criar sua chave de acesso.'; @override String get whereArePasskeysSaved => 'Onde são guardadas as chaves de acesso?'; diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ru.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ru.dart index 20b92c8b6..00bf11e67 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ru.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ru.dart @@ -64,13 +64,13 @@ class DerivPasskeysLocalizationsRu extends DerivPasskeysLocalizations { String get howToCreatePasskeyDescription2 => 'Вы можете создать один passkey для каждого устройства.'; @override - String get p2pHowToCreatePasskey => 'How to create passkey?'; + String get p2pHowToCreatePasskey => 'Как создать пароль?'; @override - String get p2pHowToCreatePasskeyDescription1 => 'Go to ‘Profile‘ in your Deriv P2P app.'; + String get p2pHowToCreatePasskeyDescription1 => 'Перейдите на «Профиль» в приложении Deriv P2P.'; @override - String get p2pHowToCreatePasskeyDescription2 => 'Tap ‘Passkeys‘ to create your passkey.'; + String get p2pHowToCreatePasskeyDescription2 => 'Нажмите «Пароли», чтобы создать свой пароль.'; @override String get whereArePasskeysSaved => 'Где хранятся passkeys?'; diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_si.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_si.dart index b33feca49..fd38c8398 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_si.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_si.dart @@ -64,13 +64,13 @@ class DerivPasskeysLocalizationsSi extends DerivPasskeysLocalizations { String get howToCreatePasskeyDescription2 => 'ඔබට එක් උපාංගයකට එක් passkey එකක් සෑදිය හැක.'; @override - String get p2pHowToCreatePasskey => 'How to create passkey?'; + String get p2pHowToCreatePasskey => 'මුරපද නිර්මාණය කරන්නේ කෙසේද?'; @override - String get p2pHowToCreatePasskeyDescription1 => 'Go to ‘Profile‘ in your Deriv P2P app.'; + String get p2pHowToCreatePasskeyDescription1 => 'ඔබේ ඩෙරිව් පී 2 පී යෙදුමේ \'පැතිකඩ\' වෙත යන්න.'; @override - String get p2pHowToCreatePasskeyDescription2 => 'Tap ‘Passkeys‘ to create your passkey.'; + String get p2pHowToCreatePasskeyDescription2 => 'ඔබගේ මුරපද නිර්මාණය කිරීම සඳහා \'මුරපද\' තට්ටු කරන්න.'; @override String get whereArePasskeysSaved => 'Passkey සුරකින්නේ කොහේද?'; diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_sw.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_sw.dart index d942e619a..2c04831cc 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_sw.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_sw.dart @@ -64,13 +64,13 @@ class DerivPasskeysLocalizationsSw extends DerivPasskeysLocalizations { String get howToCreatePasskeyDescription2 => 'Unaweza kuunda passkey moja kwa kila kifaa.'; @override - String get p2pHowToCreatePasskey => 'How to create passkey?'; + String get p2pHowToCreatePasskey => 'Jinsi ya kuunda passkey?'; @override - String get p2pHowToCreatePasskeyDescription1 => 'Go to ‘Profile‘ in your Deriv P2P app.'; + String get p2pHowToCreatePasskeyDescription1 => 'Nenda kwenye \'Profaili\' katika programu yako ya Deriv P2P.'; @override - String get p2pHowToCreatePasskeyDescription2 => 'Tap ‘Passkeys‘ to create your passkey.'; + String get p2pHowToCreatePasskeyDescription2 => 'Gonga \'Passkeys\' ili kuunda nenosiri lako.'; @override String get whereArePasskeysSaved => 'Passkeys zimehifadhiwa wapi?'; diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_th.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_th.dart index d12b1e280..283e39200 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_th.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_th.dart @@ -64,13 +64,13 @@ class DerivPasskeysLocalizationsTh extends DerivPasskeysLocalizations { String get howToCreatePasskeyDescription2 => 'คุณสามารถสร้างหนึ่ง Passkey ต่ออุปกรณ์'; @override - String get p2pHowToCreatePasskey => 'How to create passkey?'; + String get p2pHowToCreatePasskey => 'วิธีการสร้างรหัสผ่าน'; @override - String get p2pHowToCreatePasskeyDescription1 => 'Go to ‘Profile‘ in your Deriv P2P app.'; + String get p2pHowToCreatePasskeyDescription1 => 'ไปที่ \'โปรไฟล์\' ในแอป Deriv P2P ของคุณ'; @override - String get p2pHowToCreatePasskeyDescription2 => 'Tap ‘Passkeys‘ to create your passkey.'; + String get p2pHowToCreatePasskeyDescription2 => 'แตะ \'รหัสผ่าน\' เพื่อสร้างรหัสผ่านของคุณ'; @override String get whereArePasskeysSaved => 'Passkey จะถูกบันทึกไว้ที่ไหน?'; diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_tr.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_tr.dart index cab12d4e8..00d289dbc 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_tr.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_tr.dart @@ -64,13 +64,13 @@ class DerivPasskeysLocalizationsTr extends DerivPasskeysLocalizations { String get howToCreatePasskeyDescription2 => 'Cihaz başına bir passkey oluşturabilirsiniz.'; @override - String get p2pHowToCreatePasskey => 'How to create passkey?'; + String get p2pHowToCreatePasskey => 'Parola nasıl oluşturulur?'; @override - String get p2pHowToCreatePasskeyDescription1 => 'Go to ‘Profile‘ in your Deriv P2P app.'; + String get p2pHowToCreatePasskeyDescription1 => 'Deriv P2P uygulamanızdaki \'Profil\' bölümüne gidin.'; @override - String get p2pHowToCreatePasskeyDescription2 => 'Tap ‘Passkeys‘ to create your passkey.'; + String get p2pHowToCreatePasskeyDescription2 => 'Parola anahtarınızı oluşturmak için \'Parola Tuşları\'na dokunun.'; @override String get whereArePasskeysSaved => 'Passkeys nereye kaydedilir?'; diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_vi.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_vi.dart index c017a18cc..91b548515 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_vi.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_vi.dart @@ -64,13 +64,13 @@ class DerivPasskeysLocalizationsVi extends DerivPasskeysLocalizations { String get howToCreatePasskeyDescription2 => 'Bạn có thể tạo một passkey cho mỗi thiết bị.'; @override - String get p2pHowToCreatePasskey => 'How to create passkey?'; + String get p2pHowToCreatePasskey => 'Làm thế nào để tạo mật khẩu?'; @override - String get p2pHowToCreatePasskeyDescription1 => 'Go to ‘Profile‘ in your Deriv P2P app.'; + String get p2pHowToCreatePasskeyDescription1 => 'Chuyển đến \'Hồ sơ\' trong ứng dụng Deriv P2P của bạn.'; @override - String get p2pHowToCreatePasskeyDescription2 => 'Tap ‘Passkeys‘ to create your passkey.'; + String get p2pHowToCreatePasskeyDescription2 => 'Nhấn vào \'Phím mật khẩu\' để tạo mật khẩu của bạn.'; @override String get whereArePasskeysSaved => 'Passkeys được lưu ở đâu?'; diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_zh.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_zh.dart index 31de71f2e..6fd607651 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_zh.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_zh.dart @@ -64,13 +64,13 @@ class DerivPasskeysLocalizationsZh extends DerivPasskeysLocalizations { String get howToCreatePasskeyDescription2 => '可以為每個裝置建立一個金鑰。'; @override - String get p2pHowToCreatePasskey => 'How to create passkey?'; + String get p2pHowToCreatePasskey => '如何建立密碼?'; @override - String get p2pHowToCreatePasskeyDescription1 => 'Go to ‘Profile‘ in your Deriv P2P app.'; + String get p2pHowToCreatePasskeyDescription1 => '在您的 Deriv P2P 應用程序中轉到「個人資料」。'; @override - String get p2pHowToCreatePasskeyDescription2 => 'Tap ‘Passkeys‘ to create your passkey.'; + String get p2pHowToCreatePasskeyDescription2 => '點擊「密碼」以建立您的密碼。'; @override String get whereArePasskeysSaved => '金鑰儲存在哪裡?'; From 7d1b620d3bc2cb838c6850ea94c4ad23eb94b1ca Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Fri, 14 Jun 2024 15:34:09 +0800 Subject: [PATCH 096/162] chore(version): bump version and update changelog (#618) --- CHANGELOG.md | 30 +++++++++++++++++++++++ README.md | 6 ++--- packages/deriv_auth/CHANGELOG.md | 4 +++ packages/deriv_auth/pubspec.yaml | 6 ++--- packages/deriv_localizations/CHANGELOG.md | 4 +++ packages/deriv_localizations/pubspec.yaml | 2 +- packages/deriv_passkeys/CHANGELOG.md | 4 +++ packages/deriv_passkeys/pubspec.yaml | 4 +-- 8 files changed, 51 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d19979ad5..12d955c80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,36 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-06-14 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_localizations` - `v1.4.4`](#deriv_localizations---v144) + - [`deriv_auth` - `v6.6.7`](#deriv_auth---v667) + - [`deriv_passkeys` - `v0.0.1+8`](#deriv_passkeys---v0018) + +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.6.7` + - `deriv_passkeys` - `v0.0.1+8` + +--- + +#### `deriv_localizations` - `v1.4.4` + + - **REFACTOR**(deriv_localizations): Crowdin Localization Generated ([#617](https://github.com/regentmarkets/flutter-deriv-packages/issues/617)). ([1d5e5f14](https://github.com/regentmarkets/flutter-deriv-packages/commit/1d5e5f141640aa00546dcbb31d2db8eb9a994452)) + + ## 2024-06-14 ### Changes diff --git a/README.md b/README.md index aaf519522..564d181a1 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.6.6)`. 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.6.7)`. To use the package, add the following to your pubspec.yaml file: ```yaml @@ -20,7 +20,7 @@ deriv_ui: | Name | Description | Version | | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | | [analytics](./packages/analytics) | Used to collect and send analytical information to 'Firebase' and 'Segment'. | [v2.0.0](./packages/analytics/CHANGELOG.md) | -| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.6.6 ](./packages/deriv_auth/CHANGELOG.md) | +| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.6.7 ](./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) | @@ -32,7 +32,7 @@ deriv_ui: | [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+2](./packages/deriv_live_chat/CHANGELOG.md) | | [deriv_language_selector](./packages/deriv_language_selector) | A package to handle language change of the app. | [v0.0.2+4](./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.4.3](./packages/deriv_localizations/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.4.4](./packages/deriv_localizations/CHANGELOG.md) | | [deriv_numpad](./packages/deriv_numpad) | Number Pad Widget for number input. | [v1.1.5](./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) | diff --git a/packages/deriv_auth/CHANGELOG.md b/packages/deriv_auth/CHANGELOG.md index 7450f4532..c6e1aba6d 100644 --- a/packages/deriv_auth/CHANGELOG.md +++ b/packages/deriv_auth/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.6.7 + + - Update a dependency to the latest release. + ## 6.6.6 - **REFACTOR**(deriv_auth): added a flag to allow hiding passkeys button ([#612](https://github.com/regentmarkets/flutter-deriv-packages/issues/612)). ([a4026a9d](https://github.com/regentmarkets/flutter-deriv-packages/commit/a4026a9d8164abc1c66beb327d48610d8ce30dde)) diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index c0290fbbe..1f953e4b9 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.6.6 +version: 6.6.7 environment: sdk: ">=3.0.0 <4.0.0" @@ -45,13 +45,13 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_localizations - ref: deriv_localizations-v1.4.3 + ref: deriv_localizations-v1.4.4 deriv_passkeys: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: deriv_passkeys-v0.0.1+7 + ref: deriv_passkeys-v0.0.1+8 deriv_language_selector: git: diff --git a/packages/deriv_localizations/CHANGELOG.md b/packages/deriv_localizations/CHANGELOG.md index 87b8793f9..d162f2858 100644 --- a/packages/deriv_localizations/CHANGELOG.md +++ b/packages/deriv_localizations/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.4.4 + + - **REFACTOR**(deriv_localizations): Crowdin Localization Generated ([#617](https://github.com/regentmarkets/flutter-deriv-packages/issues/617)). ([1d5e5f14](https://github.com/regentmarkets/flutter-deriv-packages/commit/1d5e5f141640aa00546dcbb31d2db8eb9a994452)) + ## 1.4.3 - **REFACTOR**(deriv_localizations): Update p2p strings for passkeys ([#615](https://github.com/regentmarkets/flutter-deriv-packages/issues/615)). ([5fd85af2](https://github.com/regentmarkets/flutter-deriv-packages/commit/5fd85af24394ea68b8b0a7abc854b9c33b791c26)) diff --git a/packages/deriv_localizations/pubspec.yaml b/packages/deriv_localizations/pubspec.yaml index 9bc5fadc3..aa2b18e4f 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.4.3 +version: 1.4.4 environment: sdk: '>=3.0.2 <4.0.0' diff --git a/packages/deriv_passkeys/CHANGELOG.md b/packages/deriv_passkeys/CHANGELOG.md index 0affb2840..467720e5b 100644 --- a/packages/deriv_passkeys/CHANGELOG.md +++ b/packages/deriv_passkeys/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.1+8 + + - Update a dependency to the latest release. + ## 0.0.1+7 - Update a dependency to the latest release. diff --git a/packages/deriv_passkeys/pubspec.yaml b/packages/deriv_passkeys/pubspec.yaml index eed8431a6..a5fe81267 100644 --- a/packages/deriv_passkeys/pubspec.yaml +++ b/packages/deriv_passkeys/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_passkeys description: Deriv Passkeys Flutter Plugin -version: 0.0.1+7 +version: 0.0.1+8 publish_to: "none" environment: @@ -19,7 +19,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_localizations - ref: deriv_localizations-v1.4.3 + ref: deriv_localizations-v1.4.4 deriv_ui: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git From ee1b223b9b1b122e6764467054060a275c399241 Mon Sep 17 00:00:00 2001 From: abedelaziz-deriv <135210555+abedelaziz-deriv@users.noreply.github.com> Date: Wed, 19 Jun 2024 10:41:46 +0800 Subject: [PATCH 097/162] chore(deriv_passkeys): Removed unneeded context provider code (#613) --- .../deriv_passkeys/example/ios/Podfile.lock | 4 +-- .../ios/Classes/DerivPasskeysManager.swift | 25 ------------------- .../pages/learn_more_passkeys_page.dart | 21 +++++++++++----- .../states/bloc/deriv_passkeys_bloc.dart | 15 +++++++++-- .../widgets/continue_with_passkey_button.dart | 1 + .../pages/learn_more_passkeys_page_test.dart | 3 +++ 6 files changed, 34 insertions(+), 35 deletions(-) diff --git a/packages/deriv_passkeys/example/ios/Podfile.lock b/packages/deriv_passkeys/example/ios/Podfile.lock index 19b71dc2d..1de363a36 100644 --- a/packages/deriv_passkeys/example/ios/Podfile.lock +++ b/packages/deriv_passkeys/example/ios/Podfile.lock @@ -2,7 +2,7 @@ PODS: - connectivity_plus (0.0.1): - Flutter - ReachabilitySwift - - deriv_passkeys (0.0.1): + - deriv_passkeys (1.0.0): - Flutter - device_info_plus (0.0.1): - Flutter @@ -68,7 +68,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: connectivity_plus: bf0076dd84a130856aa636df1c71ccaff908fa1d - deriv_passkeys: fadd039a48bae6f15ba8b955481a0f8f2b5bdede + deriv_passkeys: beeafb308b654fcbec61b567697c2b21c797037d device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 flutter_deriv_api: 9e29abd7cc5091b72303f9c8be549618415f1437 diff --git a/packages/deriv_passkeys/ios/Classes/DerivPasskeysManager.swift b/packages/deriv_passkeys/ios/Classes/DerivPasskeysManager.swift index 7cc97ab3d..7b42151d1 100644 --- a/packages/deriv_passkeys/ios/Classes/DerivPasskeysManager.swift +++ b/packages/deriv_passkeys/ios/Classes/DerivPasskeysManager.swift @@ -168,36 +168,11 @@ public class DerivPasskeysManager{ return assertionRequest } - @available(iOS 16.0, *) - private func getPresentationContextProvider() throws -> ASAuthorizationControllerPresentationContextProviding { - let keyWindow = UIApplication.shared.connectedScenes - .filter({$0.activationState == .foregroundActive}) - .map({$0 as? UIWindowScene}) - .compactMap({$0}) - .first?.windows - .filter({$0.isKeyWindow}).first - guard var topController = keyWindow?.rootViewController else { - throw PluginError.notFound("Root view controller") - } - while let presentedViewController = topController.presentedViewController { - topController = presentedViewController - } - if let nav = topController as? UINavigationController { - topController = nav.visibleViewController ?? topController - } - guard let contextProvider = topController as? ASAuthorizationControllerPresentationContextProviding else { - throw PluginError.notFound("Presentation context provider") - } - return contextProvider - } - @available(iOS 16.0, *) private func requestCredential(_ authorizationRequests: [ASAuthorizationRequest]) throws -> ASAuthorizationCredential { let authController = ASAuthorizationController(authorizationRequests: authorizationRequests) let authCtrlDelete = AuthCtrlDelegate() - let contextProvider = try getPresentationContextProvider() authController.delegate = authCtrlDelete - authController.presentationContextProvider = contextProvider authController.performRequests() let result = try authCtrlDelete.getResult() diff --git a/packages/deriv_passkeys/lib/src/presentation/pages/learn_more_passkeys_page.dart b/packages/deriv_passkeys/lib/src/presentation/pages/learn_more_passkeys_page.dart index cc308d638..d4cf3f49b 100644 --- a/packages/deriv_passkeys/lib/src/presentation/pages/learn_more_passkeys_page.dart +++ b/packages/deriv_passkeys/lib/src/presentation/pages/learn_more_passkeys_page.dart @@ -111,13 +111,22 @@ class LearnMorePasskeysPage extends StatelessWidget { ), ), SectionTitleAndContent( - title: context - .derivPasskeysLocalizations.howToCreatePasskey, + title: context.read().isDp2p + ? context.derivPasskeysLocalizations + .p2pHowToCreatePasskey + : context.derivPasskeysLocalizations + .howToCreatePasskey, texts: [ - context.derivPasskeysLocalizations - .howToCreatePasskeyDescription1, - context.derivPasskeysLocalizations - .howToCreatePasskeyDescription2 + context.read().isDp2p + ? context.derivPasskeysLocalizations + .p2pHowToCreatePasskeyDescription1 + : context.derivPasskeysLocalizations + .howToCreatePasskeyDescription1, + context.read().isDp2p + ? context.derivPasskeysLocalizations + .p2pHowToCreatePasskeyDescription2 + : context.derivPasskeysLocalizations + .howToCreatePasskeyDescription2 ], ), Padding( diff --git a/packages/deriv_passkeys/lib/src/presentation/states/bloc/deriv_passkeys_bloc.dart b/packages/deriv_passkeys/lib/src/presentation/states/bloc/deriv_passkeys_bloc.dart index a3dfe172d..cbe09a784 100644 --- a/packages/deriv_passkeys/lib/src/presentation/states/bloc/deriv_passkeys_bloc.dart +++ b/packages/deriv_passkeys/lib/src/presentation/states/bloc/deriv_passkeys_bloc.dart @@ -10,6 +10,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:deriv_passkeys/src/domain/entities/deriv_passkeys_verify_credentials_response_entity.dart'; part 'deriv_passkeys_state.dart'; + part 'deriv_passkeys_event.dart'; /// [DerivPasskeysBloc] handles the state within the DerivPasskeys flow. @@ -17,7 +18,7 @@ class DerivPasskeysBloc extends Bloc { /// Creates a [DerivPasskeysBloc]. DerivPasskeysBloc({ required DerivPasskeysService derivPasskeysService, - required PasskeysConnectionInfoEntity connectionInfo, + required this.connectionInfo, required Future Function() getJwtToken, }) : super(DerivPasskeysLoadingState()) { on( @@ -46,7 +47,7 @@ class DerivPasskeysBloc extends Bloc { await derivPasskeysService .verifyCredential( jwtToken: jwtToken, - passkeysConnectionInfoEntity: connectionInfo, + passkeysConnectionInfoEntity: passkeysConnectionInfo ?? connectionInfo, userAgent: WebSocket.userAgent, ) .then((DerivPasskeysVerifyCredentialsResponseEntity @@ -146,6 +147,16 @@ class DerivPasskeysBloc extends Bloc { }); } + /// Passkeys connection info entity. + final PasskeysConnectionInfoEntity connectionInfo; + /// The list of passkeys. List passkeysList = []; + + /// Passkeys info entity which can be used to assign new changes to the + /// connection info at anytime. + PasskeysConnectionInfoEntity? passkeysConnectionInfo; + + /// Determines whether the app is DP2P or not. + bool get isDp2p => connectionInfo.appId == '1408'; } diff --git a/packages/deriv_passkeys/lib/src/presentation/widgets/continue_with_passkey_button.dart b/packages/deriv_passkeys/lib/src/presentation/widgets/continue_with_passkey_button.dart index c739f35f9..ff9a58655 100644 --- a/packages/deriv_passkeys/lib/src/presentation/widgets/continue_with_passkey_button.dart +++ b/packages/deriv_passkeys/lib/src/presentation/widgets/continue_with_passkey_button.dart @@ -28,6 +28,7 @@ class ContinueWithPasskeyButton extends StatelessWidget { } return InkWell( + key: const Key('continueWithPasskeysButtonKey'), child: Container( padding: const EdgeInsets.symmetric( horizontal: 16, diff --git a/packages/deriv_passkeys/test/presentation/pages/learn_more_passkeys_page_test.dart b/packages/deriv_passkeys/test/presentation/pages/learn_more_passkeys_page_test.dart index b6ae89df7..adc491d2a 100644 --- a/packages/deriv_passkeys/test/presentation/pages/learn_more_passkeys_page_test.dart +++ b/packages/deriv_passkeys/test/presentation/pages/learn_more_passkeys_page_test.dart @@ -43,6 +43,9 @@ void main() { when(() => derivPasskeysBloc.state).thenReturn( DerivPasskeysInitializedState(), ); + when(() => derivPasskeysBloc.isDp2p).thenReturn( + false, + ); }); testWidgets('renders page correctly', (WidgetTester tester) async { From 5a91c24bde607ff37940edf18f8dfac67d3fc4fa Mon Sep 17 00:00:00 2001 From: sagar-deriv <146091240+sagar-deriv@users.noreply.github.com> Date: Thu, 20 Jun 2024 10:36:16 +0400 Subject: [PATCH 098/162] feat(deriv_logger): add ability to print prettified logs in console and UI (#608) --- packages/deriv_logger/.gitignore | 30 + packages/deriv_logger/.metadata | 10 + packages/deriv_logger/CHANGELOG.md | 3 + packages/deriv_logger/LICENSE | 1 + packages/deriv_logger/README.md | 68 ++ packages/deriv_logger/analysis_options.yaml | 4 + .../plugins/GeneratedPluginRegistrant.java | 23 + packages/deriv_logger/example/.gitignore | 44 ++ packages/deriv_logger/example/.metadata | 45 ++ packages/deriv_logger/example/README.md | 16 + .../example/analysis_options.yaml | 29 + .../deriv_logger/example/android/.gitignore | 13 + .../example/android/app/build.gradle | 72 ++ .../android/app/src/debug/AndroidManifest.xml | 7 + .../android/app/src/main/AndroidManifest.xml | 33 + .../com/example/example/MainActivity.kt | 6 + .../res/drawable-v21/launch_background.xml | 12 + .../main/res/drawable/launch_background.xml | 12 + .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 544 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 442 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 721 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 1031 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 1443 bytes .../app/src/main/res/values-night/styles.xml | 18 + .../app/src/main/res/values/styles.xml | 18 + .../app/src/profile/AndroidManifest.xml | 7 + .../deriv_logger/example/android/build.gradle | 31 + .../example/android/gradle.properties | 3 + .../example/android/settings.gradle | 11 + packages/deriv_logger/example/ios/.gitignore | 34 + .../ios/Flutter/AppFrameworkInfo.plist | 26 + .../example/ios/Flutter/Debug.xcconfig | 1 + .../example/ios/Flutter/Release.xcconfig | 1 + .../ios/Runner.xcodeproj/project.pbxproj | 616 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../xcshareddata/WorkspaceSettings.xcsettings | 8 + .../xcshareddata/xcschemes/Runner.xcscheme | 98 +++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../xcshareddata/WorkspaceSettings.xcsettings | 8 + .../example/ios/Runner/AppDelegate.swift | 13 + .../AppIcon.appiconset/Contents.json | 122 ++++ .../Icon-App-1024x1024@1x.png | Bin 0 -> 10932 bytes .../AppIcon.appiconset/Icon-App-20x20@1x.png | Bin 0 -> 295 bytes .../AppIcon.appiconset/Icon-App-20x20@2x.png | Bin 0 -> 406 bytes .../AppIcon.appiconset/Icon-App-20x20@3x.png | Bin 0 -> 450 bytes .../AppIcon.appiconset/Icon-App-29x29@1x.png | Bin 0 -> 282 bytes .../AppIcon.appiconset/Icon-App-29x29@2x.png | Bin 0 -> 462 bytes .../AppIcon.appiconset/Icon-App-29x29@3x.png | Bin 0 -> 704 bytes .../AppIcon.appiconset/Icon-App-40x40@1x.png | Bin 0 -> 406 bytes .../AppIcon.appiconset/Icon-App-40x40@2x.png | Bin 0 -> 586 bytes .../AppIcon.appiconset/Icon-App-40x40@3x.png | Bin 0 -> 862 bytes .../AppIcon.appiconset/Icon-App-60x60@2x.png | Bin 0 -> 862 bytes .../AppIcon.appiconset/Icon-App-60x60@3x.png | Bin 0 -> 1674 bytes .../AppIcon.appiconset/Icon-App-76x76@1x.png | Bin 0 -> 762 bytes .../AppIcon.appiconset/Icon-App-76x76@2x.png | Bin 0 -> 1226 bytes .../Icon-App-83.5x83.5@2x.png | Bin 0 -> 1418 bytes .../LaunchImage.imageset/Contents.json | 23 + .../LaunchImage.imageset/LaunchImage.png | Bin 0 -> 68 bytes .../LaunchImage.imageset/LaunchImage@2x.png | Bin 0 -> 68 bytes .../LaunchImage.imageset/LaunchImage@3x.png | Bin 0 -> 68 bytes .../LaunchImage.imageset/README.md | 5 + .../Runner/Base.lproj/LaunchScreen.storyboard | 37 ++ .../ios/Runner/Base.lproj/Main.storyboard | 26 + .../example/ios/Runner/Info.plist | 51 ++ .../ios/Runner/Runner-Bridging-Header.h | 1 + .../example/ios/RunnerTests/RunnerTests.swift | 12 + packages/deriv_logger/example/lib/main.dart | 93 +++ packages/deriv_logger/example/pubspec.yaml | 90 +++ .../example/test/widget_test.dart | 30 + .../lib/controllers/logger_controller.dart | 116 ++++ .../deriv_logger/lib/core/app_logger.dart | 171 +++++ packages/deriv_logger/lib/deriv_logger.dart | 5 + .../lib/views/console_log_view.dart | 138 ++++ .../deriv_logger/lib/views/debug_button.dart | 109 ++++ .../deriv_logger/lib/views/debug_overlay.dart | 81 +++ .../deriv_logger/lib/views/logger_theme.dart | 55 ++ packages/deriv_logger/lib/views/views.dart | 4 + packages/deriv_logger/pubspec.yaml | 53 ++ packages/update_checker/pubspec.lock | 42 +- 81 files changed, 2590 insertions(+), 25 deletions(-) create mode 100644 packages/deriv_logger/.gitignore create mode 100644 packages/deriv_logger/.metadata create mode 100644 packages/deriv_logger/CHANGELOG.md create mode 100644 packages/deriv_logger/LICENSE create mode 100644 packages/deriv_logger/README.md create mode 100644 packages/deriv_logger/analysis_options.yaml create mode 100644 packages/deriv_logger/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java create mode 100644 packages/deriv_logger/example/.gitignore create mode 100644 packages/deriv_logger/example/.metadata create mode 100644 packages/deriv_logger/example/README.md create mode 100644 packages/deriv_logger/example/analysis_options.yaml create mode 100644 packages/deriv_logger/example/android/.gitignore create mode 100644 packages/deriv_logger/example/android/app/build.gradle create mode 100644 packages/deriv_logger/example/android/app/src/debug/AndroidManifest.xml create mode 100644 packages/deriv_logger/example/android/app/src/main/AndroidManifest.xml create mode 100644 packages/deriv_logger/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt create mode 100644 packages/deriv_logger/example/android/app/src/main/res/drawable-v21/launch_background.xml create mode 100644 packages/deriv_logger/example/android/app/src/main/res/drawable/launch_background.xml create mode 100644 packages/deriv_logger/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 packages/deriv_logger/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 packages/deriv_logger/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 packages/deriv_logger/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 packages/deriv_logger/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 packages/deriv_logger/example/android/app/src/main/res/values-night/styles.xml create mode 100644 packages/deriv_logger/example/android/app/src/main/res/values/styles.xml create mode 100644 packages/deriv_logger/example/android/app/src/profile/AndroidManifest.xml create mode 100644 packages/deriv_logger/example/android/build.gradle create mode 100644 packages/deriv_logger/example/android/gradle.properties create mode 100644 packages/deriv_logger/example/android/settings.gradle create mode 100644 packages/deriv_logger/example/ios/.gitignore create mode 100644 packages/deriv_logger/example/ios/Flutter/AppFrameworkInfo.plist create mode 100644 packages/deriv_logger/example/ios/Flutter/Debug.xcconfig create mode 100644 packages/deriv_logger/example/ios/Flutter/Release.xcconfig create mode 100644 packages/deriv_logger/example/ios/Runner.xcodeproj/project.pbxproj create mode 100644 packages/deriv_logger/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 packages/deriv_logger/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 packages/deriv_logger/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings create mode 100644 packages/deriv_logger/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme create mode 100644 packages/deriv_logger/example/ios/Runner.xcworkspace/contents.xcworkspacedata create mode 100644 packages/deriv_logger/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 packages/deriv_logger/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings create mode 100644 packages/deriv_logger/example/ios/Runner/AppDelegate.swift create mode 100644 packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png create mode 100644 packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png create mode 100644 packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png create mode 100644 packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png create mode 100644 packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png create mode 100644 packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png create mode 100644 packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png create mode 100644 packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png create mode 100644 packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png create mode 100644 packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png create mode 100644 packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png create mode 100644 packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png create mode 100644 packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png create mode 100644 packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png create mode 100644 packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png create mode 100644 packages/deriv_logger/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json create mode 100644 packages/deriv_logger/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png create mode 100644 packages/deriv_logger/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png create mode 100644 packages/deriv_logger/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png create mode 100644 packages/deriv_logger/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md create mode 100644 packages/deriv_logger/example/ios/Runner/Base.lproj/LaunchScreen.storyboard create mode 100644 packages/deriv_logger/example/ios/Runner/Base.lproj/Main.storyboard create mode 100644 packages/deriv_logger/example/ios/Runner/Info.plist create mode 100644 packages/deriv_logger/example/ios/Runner/Runner-Bridging-Header.h create mode 100644 packages/deriv_logger/example/ios/RunnerTests/RunnerTests.swift create mode 100644 packages/deriv_logger/example/lib/main.dart create mode 100644 packages/deriv_logger/example/pubspec.yaml create mode 100644 packages/deriv_logger/example/test/widget_test.dart create mode 100644 packages/deriv_logger/lib/controllers/logger_controller.dart create mode 100644 packages/deriv_logger/lib/core/app_logger.dart create mode 100644 packages/deriv_logger/lib/deriv_logger.dart create mode 100644 packages/deriv_logger/lib/views/console_log_view.dart create mode 100644 packages/deriv_logger/lib/views/debug_button.dart create mode 100644 packages/deriv_logger/lib/views/debug_overlay.dart create mode 100644 packages/deriv_logger/lib/views/logger_theme.dart create mode 100644 packages/deriv_logger/lib/views/views.dart create mode 100644 packages/deriv_logger/pubspec.yaml diff --git a/packages/deriv_logger/.gitignore b/packages/deriv_logger/.gitignore new file mode 100644 index 000000000..96486fd93 --- /dev/null +++ b/packages/deriv_logger/.gitignore @@ -0,0 +1,30 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. +/pubspec.lock +**/doc/api/ +.dart_tool/ +.packages +build/ diff --git a/packages/deriv_logger/.metadata b/packages/deriv_logger/.metadata new file mode 100644 index 000000000..10542d27f --- /dev/null +++ b/packages/deriv_logger/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 9cd3d0d9ff05768afa249e036acc66e8abe93bff + channel: stable + +project_type: package diff --git a/packages/deriv_logger/CHANGELOG.md b/packages/deriv_logger/CHANGELOG.md new file mode 100644 index 000000000..41cc7d819 --- /dev/null +++ b/packages/deriv_logger/CHANGELOG.md @@ -0,0 +1,3 @@ +## 0.0.1 + +* TODO: Describe initial release. diff --git a/packages/deriv_logger/LICENSE b/packages/deriv_logger/LICENSE new file mode 100644 index 000000000..ba75c69f7 --- /dev/null +++ b/packages/deriv_logger/LICENSE @@ -0,0 +1 @@ +TODO: Add your license here. diff --git a/packages/deriv_logger/README.md b/packages/deriv_logger/README.md new file mode 100644 index 000000000..495f3c9df --- /dev/null +++ b/packages/deriv_logger/README.md @@ -0,0 +1,68 @@ + + +A debugging package that prints console and network logs in the UI. + +## Features + +- preetify terminal logs +- prints terminal logs in UI + +## Getting started + +Add the package to your pubspec.yaml file + +```yaml +deriv_logger: + git: + url: git@github.com:regentmarkets/flutter-deriv-packages.git + path: packages/deriv_logger +``` + +## Usage + +#### Initialize the App Logger + +```dart +AppLogger.initialize(); +``` + +#### View console logs in UI (Optional) + +In order to enable this, Root widget under `MaterialApp` should be wrapped with DebugOverlay widget. + +```dart +DebugOverlay( + builder: (_) => SplashPage(), + enabled: true, + ), +``` + +#### Use its methods + +```dart +/// Log for information +AppLogger.i('Log message', title: 'Title of logs'); + +/// Log for error +AppLogger.e('Log message', title: 'Title of logs'); + +/// Log for fatal +AppLogger.f('Log message', title: 'Title of logs'); + +/// Log for success +AppLogger.s('Log message', title: 'Title of logs'); + +/// Log for warning +AppLogger.w('Log message', title: 'Title of logs'); +``` diff --git a/packages/deriv_logger/analysis_options.yaml b/packages/deriv_logger/analysis_options.yaml new file mode 100644 index 000000000..a5744c1cf --- /dev/null +++ b/packages/deriv_logger/analysis_options.yaml @@ -0,0 +1,4 @@ +include: package:flutter_lints/flutter.yaml + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/packages/deriv_logger/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/packages/deriv_logger/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java new file mode 100644 index 000000000..d007606a4 --- /dev/null +++ b/packages/deriv_logger/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java @@ -0,0 +1,23 @@ +package io.flutter.plugins; + +import io.flutter.plugin.common.PluginRegistry; + +/** + * Generated file. Do not edit. + */ +public final class GeneratedPluginRegistrant { + public static void registerWith(PluginRegistry registry) { + if (alreadyRegisteredWith(registry)) { + return; + } + } + + private static boolean alreadyRegisteredWith(PluginRegistry registry) { + final String key = GeneratedPluginRegistrant.class.getCanonicalName(); + if (registry.hasPlugin(key)) { + return true; + } + registry.registrarFor(key); + return false; + } +} diff --git a/packages/deriv_logger/example/.gitignore b/packages/deriv_logger/example/.gitignore new file mode 100644 index 000000000..24476c5d1 --- /dev/null +++ b/packages/deriv_logger/example/.gitignore @@ -0,0 +1,44 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/packages/deriv_logger/example/.metadata b/packages/deriv_logger/example/.metadata new file mode 100644 index 000000000..0cffca3b7 --- /dev/null +++ b/packages/deriv_logger/example/.metadata @@ -0,0 +1,45 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled. + +version: + revision: 9cd3d0d9ff05768afa249e036acc66e8abe93bff + channel: stable + +project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: 9cd3d0d9ff05768afa249e036acc66e8abe93bff + base_revision: 9cd3d0d9ff05768afa249e036acc66e8abe93bff + - platform: android + create_revision: 9cd3d0d9ff05768afa249e036acc66e8abe93bff + base_revision: 9cd3d0d9ff05768afa249e036acc66e8abe93bff + - platform: ios + create_revision: 9cd3d0d9ff05768afa249e036acc66e8abe93bff + base_revision: 9cd3d0d9ff05768afa249e036acc66e8abe93bff + - platform: linux + create_revision: 9cd3d0d9ff05768afa249e036acc66e8abe93bff + base_revision: 9cd3d0d9ff05768afa249e036acc66e8abe93bff + - platform: macos + create_revision: 9cd3d0d9ff05768afa249e036acc66e8abe93bff + base_revision: 9cd3d0d9ff05768afa249e036acc66e8abe93bff + - platform: web + create_revision: 9cd3d0d9ff05768afa249e036acc66e8abe93bff + base_revision: 9cd3d0d9ff05768afa249e036acc66e8abe93bff + - platform: windows + create_revision: 9cd3d0d9ff05768afa249e036acc66e8abe93bff + base_revision: 9cd3d0d9ff05768afa249e036acc66e8abe93bff + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/packages/deriv_logger/example/README.md b/packages/deriv_logger/example/README.md new file mode 100644 index 000000000..2b3fce4c8 --- /dev/null +++ b/packages/deriv_logger/example/README.md @@ -0,0 +1,16 @@ +# example + +A new Flutter project. + +## Getting Started + +This project is a starting point for a Flutter application. + +A few resources to get you started if this is your first Flutter project: + +- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) +- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) + +For help getting started with Flutter development, view the +[online documentation](https://docs.flutter.dev/), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/packages/deriv_logger/example/analysis_options.yaml b/packages/deriv_logger/example/analysis_options.yaml new file mode 100644 index 000000000..61b6c4de1 --- /dev/null +++ b/packages/deriv_logger/example/analysis_options.yaml @@ -0,0 +1,29 @@ +# This file configures the analyzer, which statically analyzes Dart code to +# check for errors, warnings, and lints. +# +# The issues identified by the analyzer are surfaced in the UI of Dart-enabled +# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be +# invoked from the command line by running `flutter analyze`. + +# The following line activates a set of recommended lints for Flutter apps, +# packages, and plugins designed to encourage good coding practices. +include: package:flutter_lints/flutter.yaml + +linter: + # The lint rules applied to this project can be customized in the + # section below to disable rules from the `package:flutter_lints/flutter.yaml` + # included above or to enable additional rules. A list of all available lints + # and their documentation is published at + # https://dart-lang.github.io/linter/lints/index.html. + # + # Instead of disabling a lint rule for the entire project in the + # section below, it can also be suppressed for a single line of code + # or a specific dart file by using the `// ignore: name_of_lint` and + # `// ignore_for_file: name_of_lint` syntax on the line or in the file + # producing the lint. + rules: + # avoid_print: false # Uncomment to disable the `avoid_print` rule + # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/packages/deriv_logger/example/android/.gitignore b/packages/deriv_logger/example/android/.gitignore new file mode 100644 index 000000000..6f568019d --- /dev/null +++ b/packages/deriv_logger/example/android/.gitignore @@ -0,0 +1,13 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java + +# Remember to never publicly share your keystore. +# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +key.properties +**/*.keystore +**/*.jks diff --git a/packages/deriv_logger/example/android/app/build.gradle b/packages/deriv_logger/example/android/app/build.gradle new file mode 100644 index 000000000..4c908ebc1 --- /dev/null +++ b/packages/deriv_logger/example/android/app/build.gradle @@ -0,0 +1,72 @@ +def localProperties = new Properties() +def localPropertiesFile = rootProject.file('local.properties') +if (localPropertiesFile.exists()) { + localPropertiesFile.withReader('UTF-8') { reader -> + localProperties.load(reader) + } +} + +def flutterRoot = localProperties.getProperty('flutter.sdk') +if (flutterRoot == null) { + throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") +} + +def flutterVersionCode = localProperties.getProperty('flutter.versionCode') +if (flutterVersionCode == null) { + flutterVersionCode = '1' +} + +def flutterVersionName = localProperties.getProperty('flutter.versionName') +if (flutterVersionName == null) { + flutterVersionName = '1.0' +} + +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' +apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" + +android { + namespace "com.example.example" + compileSdkVersion flutter.compileSdkVersion + ndkVersion flutter.ndkVersion + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = '1.8' + } + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId "com.example.example" + // You can update the following values to match your application needs. + // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. + minSdkVersion flutter.minSdkVersion + targetSdkVersion flutter.targetSdkVersion + versionCode flutterVersionCode.toInteger() + versionName flutterVersionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig signingConfigs.debug + } + } +} + +flutter { + source '../..' +} + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" +} diff --git a/packages/deriv_logger/example/android/app/src/debug/AndroidManifest.xml b/packages/deriv_logger/example/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 000000000..399f6981d --- /dev/null +++ b/packages/deriv_logger/example/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/packages/deriv_logger/example/android/app/src/main/AndroidManifest.xml b/packages/deriv_logger/example/android/app/src/main/AndroidManifest.xml new file mode 100644 index 000000000..19b862ec8 --- /dev/null +++ b/packages/deriv_logger/example/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + diff --git a/packages/deriv_logger/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt b/packages/deriv_logger/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt new file mode 100644 index 000000000..e793a000d --- /dev/null +++ b/packages/deriv_logger/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt @@ -0,0 +1,6 @@ +package com.example.example + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() { +} diff --git a/packages/deriv_logger/example/android/app/src/main/res/drawable-v21/launch_background.xml b/packages/deriv_logger/example/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 000000000..f74085f3f --- /dev/null +++ b/packages/deriv_logger/example/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/packages/deriv_logger/example/android/app/src/main/res/drawable/launch_background.xml b/packages/deriv_logger/example/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 000000000..304732f88 --- /dev/null +++ b/packages/deriv_logger/example/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/packages/deriv_logger/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/deriv_logger/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..db77bb4b7b0906d62b1847e87f15cdcacf6a4f29 GIT binary patch literal 544 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY3?!3`olAj~WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2!h8bpbvhu0Wd6uZuB!w&u2PAxD2eNXD>P5D~Wn-+_Wa#27Xc zC?Zj|6r#X(-D3u$NCt}(Ms06KgJ4FxJVv{GM)!I~&n8Bnc94O7-Hd)cjDZswgC;Qs zO=b+9!WcT8F?0rF7!Uys2bs@gozCP?z~o%U|N3vA*22NaGQG zlg@K`O_XuxvZ&Ks^m&R!`&1=spLvfx7oGDKDwpwW`#iqdw@AL`7MR}m`rwr|mZgU`8P7SBkL78fFf!WnuYWm$5Z0 zNXhDbCv&49sM544K|?c)WrFfiZvCi9h0O)B3Pgg&ebxsLQ05GG~ AQ2+n{ literal 0 HcmV?d00001 diff --git a/packages/deriv_logger/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/deriv_logger/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..17987b79bb8a35cc66c3c1fd44f5a5526c1b78be GIT binary patch literal 442 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-sk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5Xx&nMcT!A!W`0S9QKQy;}1Cl^CgaH=;G9cpY;r$Q>i*pfB zP2drbID<_#qf;rPZx^FqH)F_D#*k@@q03KywUtLX8Ua?`H+NMzkczFPK3lFz@i_kW%1NOn0|D2I9n9wzH8m|-tHjsw|9>@K=iMBhxvkv6m8Y-l zytQ?X=U+MF$@3 zt`~i=@j|6y)RWMK--}M|=T`o&^Ni>IoWKHEbBXz7?A@mgWoL>!*SXo`SZH-*HSdS+ yn*9;$7;m`l>wYBC5bq;=U}IMqLzqbYCidGC!)_gkIk_C@Uy!y&wkt5C($~2D>~)O*cj@FGjOCM)M>_ixfudOh)?xMu#Fs z#}Y=@YDTwOM)x{K_j*Q;dPdJ?Mz0n|pLRx{4n|)f>SXlmV)XB04CrSJn#dS5nK2lM zrZ9#~WelCp7&e13Y$jvaEXHskn$2V!!DN-nWS__6T*l;H&Fopn?A6HZ-6WRLFP=R` zqG+CE#d4|IbyAI+rJJ`&x9*T`+a=p|0O(+s{UBcyZdkhj=yS1>AirP+0R;mf2uMgM zC}@~JfByORAh4SyRgi&!(cja>F(l*O+nd+@4m$|6K6KDn_&uvCpV23&>G9HJp{xgg zoq1^2_p9@|WEo z*X_Uko@K)qYYv~>43eQGMdbiGbo>E~Q& zrYBH{QP^@Sti!`2)uG{irBBq@y*$B zi#&(U-*=fp74j)RyIw49+0MRPMRU)+a2r*PJ$L5roHt2$UjExCTZSbq%V!HeS7J$N zdG@vOZB4v_lF7Plrx+hxo7(fCV&}fHq)$ literal 0 HcmV?d00001 diff --git a/packages/deriv_logger/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/deriv_logger/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..d5f1c8d34e7a88e3f88bea192c3a370d44689c3c GIT binary patch literal 1031 zcmeAS@N?(olHy`uVBq!ia0vp^6F``Q8Ax83A=Cw=BuiW)N`mv#O3D+9QW+dm@{>{( zJaZG%Q-e|yQz{EjrrIztFa`(sgt!6~Yi|1%a`XoT0ojZ}lNrNjb9xjc(B0U1_% zz5^97Xt*%oq$rQy4?0GKNfJ44uvxI)gC`h-NZ|&0-7(qS@?b!5r36oQ}zyZrNO3 zMO=Or+<~>+A&uN&E!^Sl+>xE!QC-|oJv`ApDhqC^EWD|@=#J`=d#Xzxs4ah}w&Jnc z$|q_opQ^2TrnVZ0o~wh<3t%W&flvYGe#$xqda2bR_R zvPYgMcHgjZ5nSA^lJr%;<&0do;O^tDDh~=pIxA#coaCY>&N%M2^tq^U%3DB@ynvKo}b?yu-bFc-u0JHzced$sg7S3zqI(2 z#Km{dPr7I=pQ5>FuK#)QwK?Y`E`B?nP+}U)I#c1+FM*1kNvWG|a(TpksZQ3B@sD~b zpQ2)*V*TdwjFOtHvV|;OsiDqHi=6%)o4b!)x$)%9pGTsE z-JL={-Ffv+T87W(Xpooq<`r*VzWQcgBN$$`u}f>-ZQI1BB8ykN*=e4rIsJx9>z}*o zo~|9I;xof literal 0 HcmV?d00001 diff --git a/packages/deriv_logger/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/deriv_logger/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..4d6372eebdb28e45604e46eeda8dd24651419bc0 GIT binary patch literal 1443 zcmb`G{WsKk6vsdJTdFg%tJav9_E4vzrOaqkWF|A724Nly!y+?N9`YV6wZ}5(X(D_N(?!*n3`|_r0Hc?=PQw&*vnU?QTFY zB_MsH|!j$PP;I}?dppoE_gA(4uc!jV&0!l7_;&p2^pxNo>PEcNJv za5_RT$o2Mf!<+r?&EbHH6nMoTsDOa;mN(wv8RNsHpG)`^ymG-S5By8=l9iVXzN_eG%Xg2@Xeq76tTZ*dGh~Lo9vl;Zfs+W#BydUw zCkZ$o1LqWQO$FC9aKlLl*7x9^0q%0}$OMlp@Kk_jHXOjofdePND+j!A{q!8~Jn+s3 z?~~w@4?egS02}8NuulUA=L~QQfm;MzCGd)XhiftT;+zFO&JVyp2mBww?;QByS_1w! zrQlx%{^cMj0|Bo1FjwY@Q8?Hx0cIPF*@-ZRFpPc#bBw{5@tD(5%sClzIfl8WU~V#u zm5Q;_F!wa$BSpqhN>W@2De?TKWR*!ujY;Yylk_X5#~V!L*Gw~;$%4Q8~Mad z@`-kG?yb$a9cHIApZDVZ^U6Xkp<*4rU82O7%}0jjHlK{id@?-wpN*fCHXyXh(bLt* zPc}H-x0e4E&nQ>y%B-(EL=9}RyC%MyX=upHuFhAk&MLbsF0LP-q`XnH78@fT+pKPW zu72MW`|?8ht^tz$iC}ZwLp4tB;Q49K!QCF3@!iB1qOI=?w z7In!}F~ij(18UYUjnbmC!qKhPo%24?8U1x{7o(+?^Zu0Hx81|FuS?bJ0jgBhEMzf< zCgUq7r2OCB(`XkKcN-TL>u5y#dD6D!)5W?`O5)V^>jb)P)GBdy%t$uUMpf$SNV31$ zb||OojAbvMP?T@$h_ZiFLFVHDmbyMhJF|-_)HX3%m=CDI+ID$0^C>kzxprBW)hw(v zr!Gmda);ICoQyhV_oP5+C%?jcG8v+D@9f?Dk*!BxY}dazmrT@64UrP3hlslANK)bq z$67n83eh}OeW&SV@HG95P|bjfqJ7gw$e+`Hxo!4cx`jdK1bJ>YDSpGKLPZ^1cv$ek zIB?0S<#tX?SJCLWdMd{-ME?$hc7A$zBOdIJ)4!KcAwb=VMov)nK;9z>x~rfT1>dS+ zZ6#`2v@`jgbqq)P22H)Tx2CpmM^o1$B+xT6`(v%5xJ(?j#>Q$+rx_R|7TzDZe{J6q zG1*EcU%tE?!kO%^M;3aM6JN*LAKUVb^xz8-Pxo#jR5(-KBeLJvA@-gxNHx0M-ZJLl z;#JwQoh~9V?`UVo#}{6ka@II>++D@%KqGpMdlQ}?9E*wFcf5(#XQnP$Dk5~%iX^>f z%$y;?M0BLp{O3a(-4A?ewryHrrD%cx#Q^%KY1H zNre$ve+vceSLZcNY4U(RBX&)oZn*Py()h)XkE?PL$!bNb{N5FVI2Y%LKEm%yvpyTP z(1P?z~7YxD~Rf<(a@_y` literal 0 HcmV?d00001 diff --git a/packages/deriv_logger/example/android/app/src/main/res/values-night/styles.xml b/packages/deriv_logger/example/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 000000000..06952be74 --- /dev/null +++ b/packages/deriv_logger/example/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/packages/deriv_logger/example/android/app/src/main/res/values/styles.xml b/packages/deriv_logger/example/android/app/src/main/res/values/styles.xml new file mode 100644 index 000000000..cb1ef8805 --- /dev/null +++ b/packages/deriv_logger/example/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/packages/deriv_logger/example/android/app/src/profile/AndroidManifest.xml b/packages/deriv_logger/example/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 000000000..399f6981d --- /dev/null +++ b/packages/deriv_logger/example/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/packages/deriv_logger/example/android/build.gradle b/packages/deriv_logger/example/android/build.gradle new file mode 100644 index 000000000..f7eb7f63c --- /dev/null +++ b/packages/deriv_logger/example/android/build.gradle @@ -0,0 +1,31 @@ +buildscript { + ext.kotlin_version = '1.7.10' + repositories { + google() + mavenCentral() + } + + dependencies { + classpath 'com.android.tools.build:gradle:7.3.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +allprojects { + repositories { + google() + mavenCentral() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(':app') +} + +tasks.register("clean", Delete) { + delete rootProject.buildDir +} diff --git a/packages/deriv_logger/example/android/gradle.properties b/packages/deriv_logger/example/android/gradle.properties new file mode 100644 index 000000000..94adc3a3f --- /dev/null +++ b/packages/deriv_logger/example/android/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.jvmargs=-Xmx1536M +android.useAndroidX=true +android.enableJetifier=true diff --git a/packages/deriv_logger/example/android/settings.gradle b/packages/deriv_logger/example/android/settings.gradle new file mode 100644 index 000000000..44e62bcf0 --- /dev/null +++ b/packages/deriv_logger/example/android/settings.gradle @@ -0,0 +1,11 @@ +include ':app' + +def localPropertiesFile = new File(rootProject.projectDir, "local.properties") +def properties = new Properties() + +assert localPropertiesFile.exists() +localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + +def flutterSdkPath = properties.getProperty("flutter.sdk") +assert flutterSdkPath != null, "flutter.sdk not set in local.properties" +apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" diff --git a/packages/deriv_logger/example/ios/.gitignore b/packages/deriv_logger/example/ios/.gitignore new file mode 100644 index 000000000..7a7f9873a --- /dev/null +++ b/packages/deriv_logger/example/ios/.gitignore @@ -0,0 +1,34 @@ +**/dgph +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/ephemeral/ +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/packages/deriv_logger/example/ios/Flutter/AppFrameworkInfo.plist b/packages/deriv_logger/example/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 000000000..9625e105d --- /dev/null +++ b/packages/deriv_logger/example/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 11.0 + + diff --git a/packages/deriv_logger/example/ios/Flutter/Debug.xcconfig b/packages/deriv_logger/example/ios/Flutter/Debug.xcconfig new file mode 100644 index 000000000..592ceee85 --- /dev/null +++ b/packages/deriv_logger/example/ios/Flutter/Debug.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/packages/deriv_logger/example/ios/Flutter/Release.xcconfig b/packages/deriv_logger/example/ios/Flutter/Release.xcconfig new file mode 100644 index 000000000..592ceee85 --- /dev/null +++ b/packages/deriv_logger/example/ios/Flutter/Release.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/packages/deriv_logger/example/ios/Runner.xcodeproj/project.pbxproj b/packages/deriv_logger/example/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 000000000..529e6fec8 --- /dev/null +++ b/packages/deriv_logger/example/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,616 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 97C146E61CF9000F007C117D /* Project object */; + proxyType = 1; + remoteGlobalIDString = 97C146ED1CF9000F007C117D; + remoteInfo = Runner; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 331C8082294A63A400263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C807B294A618700263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + 331C8082294A63A400263BE5 /* RunnerTests */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + 331C8081294A63A400263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C8080294A63A400263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 331C807D294A63A400263BE5 /* Sources */, + 331C807E294A63A400263BE5 /* Frameworks */, + 331C807F294A63A400263BE5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 331C8086294A63A400263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1300; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C8080294A63A400263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 97C146ED1CF9000F007C117D; + }; + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + 331C8080294A63A400263BE5 /* RunnerTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C807F294A63A400263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C807D294A63A400263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C8086294A63A400263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 97C146ED1CF9000F007C117D /* Runner */; + targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = ZD5K9ZP6F4; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.example; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 331C8088294A63A400263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = AE0B7B92F70575B8D7E0D07E /* Pods-RunnerTests.debug.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.example.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Debug; + }; + 331C8089294A63A400263BE5 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 89B67EB44CE7B6631473024E /* Pods-RunnerTests.release.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.example.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Release; + }; + 331C808A294A63A400263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 640959BDD8F10B91D80A66BE /* Pods-RunnerTests.profile.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.example.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = ZD5K9ZP6F4; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.example; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = ZD5K9ZP6F4; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.example; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C8088294A63A400263BE5 /* Debug */, + 331C8089294A63A400263BE5 /* Release */, + 331C808A294A63A400263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/packages/deriv_logger/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/deriv_logger/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..919434a62 --- /dev/null +++ b/packages/deriv_logger/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/packages/deriv_logger/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/deriv_logger/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000..18d981003 --- /dev/null +++ b/packages/deriv_logger/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/packages/deriv_logger/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/packages/deriv_logger/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 000000000..f9b0d7c5e --- /dev/null +++ b/packages/deriv_logger/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/packages/deriv_logger/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/deriv_logger/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 000000000..e42adcb34 --- /dev/null +++ b/packages/deriv_logger/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/deriv_logger/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/deriv_logger/example/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..1d526a16e --- /dev/null +++ b/packages/deriv_logger/example/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/packages/deriv_logger/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/deriv_logger/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000..18d981003 --- /dev/null +++ b/packages/deriv_logger/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/packages/deriv_logger/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/packages/deriv_logger/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 000000000..f9b0d7c5e --- /dev/null +++ b/packages/deriv_logger/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/packages/deriv_logger/example/ios/Runner/AppDelegate.swift b/packages/deriv_logger/example/ios/Runner/AppDelegate.swift new file mode 100644 index 000000000..70693e4a8 --- /dev/null +++ b/packages/deriv_logger/example/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import UIKit +import Flutter + +@UIApplicationMain +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..d36b1fab2 --- /dev/null +++ b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 0000000000000000000000000000000000000000..dc9ada4725e9b0ddb1deab583e5b5102493aa332 GIT binary patch literal 10932 zcmeHN2~<R zh`|8`A_PQ1nSu(UMFx?8j8PC!!VDphaL#`F42fd#7Vlc`zIE4n%Y~eiz4y1j|NDpi z?<@|pSJ-HM`qifhf@m%MamgwK83`XpBA<+azdF#2QsT{X@z0A9Bq>~TVErigKH1~P zRX-!h-f0NJ4Mh++{D}J+K>~~rq}d%o%+4dogzXp7RxX4C>Km5XEI|PAFDmo;DFm6G zzjVoB`@qW98Yl0Kvc-9w09^PrsobmG*Eju^=3f?0o-t$U)TL1B3;sZ^!++3&bGZ!o-*6w?;oOhf z=A+Qb$scV5!RbG+&2S}BQ6YH!FKb0``VVX~T$dzzeSZ$&9=X$3)_7Z{SspSYJ!lGE z7yig_41zpQ)%5dr4ff0rh$@ky3-JLRk&DK)NEIHecf9c*?Z1bUB4%pZjQ7hD!A0r-@NF(^WKdr(LXj|=UE7?gBYGgGQV zidf2`ZT@pzXf7}!NH4q(0IMcxsUGDih(0{kRSez&z?CFA0RVXsVFw3^u=^KMtt95q z43q$b*6#uQDLoiCAF_{RFc{!H^moH_cmll#Fc^KXi{9GDl{>%+3qyfOE5;Zq|6#Hb zp^#1G+z^AXfRKaa9HK;%b3Ux~U@q?xg<2DXP%6k!3E)PA<#4$ui8eDy5|9hA5&{?v z(-;*1%(1~-NTQ`Is1_MGdQ{+i*ccd96ab$R$T3=% zw_KuNF@vI!A>>Y_2pl9L{9h1-C6H8<)J4gKI6{WzGBi<@u3P6hNsXG=bRq5c+z;Gc3VUCe;LIIFDmQAGy+=mRyF++u=drBWV8-^>0yE9N&*05XHZpPlE zxu@?8(ZNy7rm?|<+UNe0Vs6&o?l`Pt>P&WaL~M&#Eh%`rg@Mbb)J&@DA-wheQ>hRV z<(XhigZAT z>=M;URcdCaiO3d^?H<^EiEMDV+7HsTiOhoaMX%P65E<(5xMPJKxf!0u>U~uVqnPN7T!X!o@_gs3Ct1 zlZ_$5QXP4{Aj645wG_SNT&6m|O6~Tsl$q?nK*)(`{J4b=(yb^nOATtF1_aS978$x3 zx>Q@s4i3~IT*+l{@dx~Hst21fR*+5}S1@cf>&8*uLw-0^zK(+OpW?cS-YG1QBZ5q! zgTAgivzoF#`cSz&HL>Ti!!v#?36I1*l^mkrx7Y|K6L#n!-~5=d3;K<;Zqi|gpNUn_ z_^GaQDEQ*jfzh;`j&KXb66fWEk1K7vxQIMQ_#Wu_%3 z4Oeb7FJ`8I>Px;^S?)}2+4D_83gHEq>8qSQY0PVP?o)zAv3K~;R$fnwTmI-=ZLK`= zTm+0h*e+Yfr(IlH3i7gUclNH^!MU>id$Jw>O?2i0Cila#v|twub21@e{S2v}8Z13( zNDrTXZVgris|qYm<0NU(tAPouG!QF4ZNpZPkX~{tVf8xY690JqY1NVdiTtW+NqyRP zZ&;T0ikb8V{wxmFhlLTQ&?OP7 z;(z*<+?J2~z*6asSe7h`$8~Se(@t(#%?BGLVs$p``;CyvcT?7Y!{tIPva$LxCQ&4W z6v#F*);|RXvI%qnoOY&i4S*EL&h%hP3O zLsrFZhv&Hu5tF$Lx!8(hs&?!Kx5&L(fdu}UI5d*wn~A`nPUhG&Rv z2#ixiJdhSF-K2tpVL=)5UkXRuPAFrEW}7mW=uAmtVQ&pGE-&az6@#-(Te^n*lrH^m@X-ftVcwO_#7{WI)5v(?>uC9GG{lcGXYJ~Q8q zbMFl7;t+kV;|;KkBW2!P_o%Czhw&Q(nXlxK9ak&6r5t_KH8#1Mr-*0}2h8R9XNkr zto5-b7P_auqTJb(TJlmJ9xreA=6d=d)CVbYP-r4$hDn5|TIhB>SReMfh&OVLkMk-T zYf%$taLF0OqYF?V{+6Xkn>iX@TuqQ?&cN6UjC9YF&%q{Ut3zv{U2)~$>-3;Dp)*(? zg*$mu8^i=-e#acaj*T$pNowo{xiGEk$%DusaQiS!KjJH96XZ-hXv+jk%ard#fu=@Q z$AM)YWvE^{%tDfK%nD49=PI|wYu}lYVbB#a7wtN^Nml@CE@{Gv7+jo{_V?I*jkdLD zJE|jfdrmVbkfS>rN*+`#l%ZUi5_bMS<>=MBDNlpiSb_tAF|Zy`K7kcp@|d?yaTmB^ zo?(vg;B$vxS|SszusORgDg-*Uitzdi{dUV+glA~R8V(?`3GZIl^egW{a919!j#>f` znL1o_^-b`}xnU0+~KIFLQ)$Q6#ym%)(GYC`^XM*{g zv3AM5$+TtDRs%`2TyR^$(hqE7Y1b&`Jd6dS6B#hDVbJlUXcG3y*439D8MrK!2D~6gn>UD4Imctb z+IvAt0iaW73Iq$K?4}H`7wq6YkTMm`tcktXgK0lKPmh=>h+l}Y+pDtvHnG>uqBA)l zAH6BV4F}v$(o$8Gfo*PB>IuaY1*^*`OTx4|hM8jZ?B6HY;F6p4{`OcZZ(us-RVwDx zUzJrCQlp@mz1ZFiSZ*$yX3c_#h9J;yBE$2g%xjmGF4ca z&yL`nGVs!Zxsh^j6i%$a*I3ZD2SoNT`{D%mU=LKaEwbN(_J5%i-6Va?@*>=3(dQy` zOv%$_9lcy9+(t>qohkuU4r_P=R^6ME+wFu&LA9tw9RA?azGhjrVJKy&8=*qZT5Dr8g--d+S8zAyJ$1HlW3Olryt`yE zFIph~Z6oF&o64rw{>lgZISC6p^CBer9C5G6yq%?8tC+)7*d+ib^?fU!JRFxynRLEZ zj;?PwtS}Ao#9whV@KEmwQgM0TVP{hs>dg(1*DiMUOKHdQGIqa0`yZnHk9mtbPfoLx zo;^V6pKUJ!5#n`w2D&381#5#_t}AlTGEgDz$^;u;-vxDN?^#5!zN9ngytY@oTv!nc zp1Xn8uR$1Z;7vY`-<*?DfPHB;x|GUi_fI9@I9SVRv1)qETbNU_8{5U|(>Du84qP#7 z*l9Y$SgA&wGbj>R1YeT9vYjZuC@|{rajTL0f%N@>3$DFU=`lSPl=Iv;EjuGjBa$Gw zHD-;%YOE@<-!7-Mn`0WuO3oWuL6tB2cpPw~Nvuj|KM@))ixuDK`9;jGMe2d)7gHin zS<>k@!x;!TJEc#HdL#RF(`|4W+H88d4V%zlh(7#{q2d0OQX9*FW^`^_<3r$kabWAB z$9BONo5}*(%kx zOXi-yM_cmB3>inPpI~)duvZykJ@^^aWzQ=eQ&STUa}2uT@lV&WoRzkUoE`rR0)`=l zFT%f|LA9fCw>`enm$p7W^E@U7RNBtsh{_-7vVz3DtB*y#*~(L9+x9*wn8VjWw|Q~q zKFsj1Yl>;}%MG3=PY`$g$_mnyhuV&~O~u~)968$0b2!Jkd;2MtAP#ZDYw9hmK_+M$ zb3pxyYC&|CuAbtiG8HZjj?MZJBFbt`ryf+c1dXFuC z0*ZQhBzNBd*}s6K_G}(|Z_9NDV162#y%WSNe|FTDDhx)K!c(mMJh@h87@8(^YdK$&d*^WQe8Z53 z(|@MRJ$Lk-&ii74MPIs80WsOFZ(NX23oR-?As+*aq6b?~62@fSVmM-_*cb1RzZ)`5$agEiL`-E9s7{GM2?(KNPgK1(+c*|-FKoy}X(D_b#etO|YR z(BGZ)0Ntfv-7R4GHoXp?l5g#*={S1{u-QzxCGng*oWr~@X-5f~RA14b8~B+pLKvr4 zfgL|7I>jlak9>D4=(i(cqYf7#318!OSR=^`xxvI!bBlS??`xxWeg?+|>MxaIdH1U~#1tHu zB{QMR?EGRmQ_l4p6YXJ{o(hh-7Tdm>TAX380TZZZyVkqHNzjUn*_|cb?T? zt;d2s-?B#Mc>T-gvBmQZx(y_cfkXZO~{N zT6rP7SD6g~n9QJ)8F*8uHxTLCAZ{l1Y&?6v)BOJZ)=R-pY=Y=&1}jE7fQ>USS}xP#exo57uND0i*rEk@$;nLvRB@u~s^dwRf?G?_enN@$t* zbL%JO=rV(3Ju8#GqUpeE3l_Wu1lN9Y{D4uaUe`g>zlj$1ER$6S6@{m1!~V|bYkhZA z%CvrDRTkHuajMU8;&RZ&itnC~iYLW4DVkP<$}>#&(`UO>!n)Po;Mt(SY8Yb`AS9lt znbX^i?Oe9r_o=?})IHKHoQGKXsps_SE{hwrg?6dMI|^+$CeC&z@*LuF+P`7LfZ*yr+KN8B4{Nzv<`A(wyR@!|gw{zB6Ha ziwPAYh)oJ(nlqSknu(8g9N&1hu0$vFK$W#mp%>X~AU1ay+EKWcFdif{% z#4!4aoVVJ;ULmkQf!ke2}3hqxLK>eq|-d7Ly7-J9zMpT`?dxo6HdfJA|t)?qPEVBDv z{y_b?4^|YA4%WW0VZd8C(ZgQzRI5(I^)=Ub`Y#MHc@nv0w-DaJAqsbEHDWG8Ia6ju zo-iyr*sq((gEwCC&^TYBWt4_@|81?=B-?#P6NMff(*^re zYqvDuO`K@`mjm_Jd;mW_tP`3$cS?R$jR1ZN09$YO%_iBqh5ftzSpMQQtxKFU=FYmP zeY^jph+g<4>YO;U^O>-NFLn~-RqlHvnZl2yd2A{Yc1G@Ga$d+Q&(f^tnPf+Z7serIU};17+2DU_f4Z z@GaPFut27d?!YiD+QP@)T=77cR9~MK@bd~pY%X(h%L={{OIb8IQmf-!xmZkm8A0Ga zQSWONI17_ru5wpHg3jI@i9D+_Y|pCqVuHJNdHUauTD=R$JcD2K_liQisqG$(sm=k9;L* z!L?*4B~ql7uioSX$zWJ?;q-SWXRFhz2Jt4%fOHA=Bwf|RzhwqdXGr78y$J)LR7&3T zE1WWz*>GPWKZ0%|@%6=fyx)5rzUpI;bCj>3RKzNG_1w$fIFCZ&UR0(7S?g}`&Pg$M zf`SLsz8wK82Vyj7;RyKmY{a8G{2BHG%w!^T|Njr!h9TO2LaP^_f22Q1=l$QiU84ao zHe_#{S6;qrC6w~7{y(hs-?-j?lbOfgH^E=XcSgnwW*eEz{_Z<_xN#0001NP)t-s|Ns9~ z#rXRE|M&d=0au&!`~QyF`q}dRnBDt}*!qXo`c{v z{Djr|@Adh0(D_%#_&mM$D6{kE_x{oE{l@J5@%H*?%=t~i_`ufYOPkAEn!pfkr2$fs z652Tz0001XNklqeeKN4RM4i{jKqmiC$?+xN>3Apn^ z0QfuZLym_5b<*QdmkHjHlj811{If)dl(Z2K0A+ekGtrFJb?g|wt#k#pV-#A~bK=OT ts8>{%cPtyC${m|1#B1A6#u!Q;umknL1chzTM$P~L002ovPDHLkV1lTfnu!1a literal 0 HcmV?d00001 diff --git a/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..797d452e458972bab9d994556c8305db4c827017 GIT binary patch literal 406 zcmV;H0crk;P))>cdjpWt&rLJgVp-t?DREyuq1A%0Z4)6_WsQ7{nzjN zo!X zGXV)2i3kcZIL~_j>uIKPK_zib+3T+Nt3Mb&Br)s)UIaA}@p{wDda>7=Q|mGRp7pqY zkJ!7E{MNz$9nOwoVqpFb)}$IP24Wn2JJ=Cw(!`OXJBr45rP>>AQr$6c7slJWvbpNW z@KTwna6d?PP>hvXCcp=4F;=GR@R4E7{4VU^0p4F>v^#A|>07*qoM6N<$f*5nx ACIA2c literal 0 HcmV?d00001 diff --git a/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..6ed2d933e1120817fe9182483a228007b18ab6ae GIT binary patch literal 450 zcmV;z0X_bSP)iGWQ_5NJQ_~rNh*z)}eT%KUb z`7gNk0#AwF^#0T0?hIa^`~Ck;!}#m+_uT050aTR(J!bU#|IzRL%^UsMS#KsYnTF*!YeDOytlP4VhV?b} z%rz_<=#CPc)tU1MZTq~*2=8~iZ!lSa<{9b@2Jl;?IEV8)=fG217*|@)CCYgFze-x? zIFODUIA>nWKpE+bn~n7;-89sa>#DR>TSlqWk*!2hSN6D~Qb#VqbP~4Fk&m`@1$JGr zXPIdeRE&b2Thd#{MtDK$px*d3-Wx``>!oimf%|A-&-q*6KAH)e$3|6JV%HX{Hig)k suLT-RhftRq8b9;(V=235Wa|I=027H2wCDra;{X5v07*qoM6N<$f;9x^2LJ#7 literal 0 HcmV?d00001 diff --git a/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 0000000000000000000000000000000000000000..4cd7b0099ca80c806f8fe495613e8d6c69460d76 GIT binary patch literal 282 zcmV+#0p(^bcu7P-R4C8Q z&e;xxFbF_Vrezo%_kH*OKhshZ6BFpG-Y1e10`QXJKbND7AMQ&cMj60B5TNObaZxYybcN07*qoM6N<$g3m;S%K!iX literal 0 HcmV?d00001 diff --git a/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..fe730945a01f64a61e2235dbe3f45b08f7729182 GIT binary patch literal 462 zcmV;<0WtoGP)-}iV`2<;=$?g5M=KQbZ{F&YRNy7Nn@%_*5{gvDM0aKI4?ESmw z{NnZg)A0R`+4?NF_RZexyVB&^^ZvN!{I28tr{Vje;QNTz`dG&Jz0~Ek&f2;*Z7>B|cg}xYpxEFY+0YrKLF;^Q+-HreN0P{&i zK~zY`?b7ECf-n?@;d<&orQ*Q7KoR%4|C>{W^h6@&01>0SKS`dn{Q}GT%Qj_{PLZ_& zs`MFI#j-(>?bvdZ!8^xTwlY{qA)T4QLbY@j(!YJ7aXJervHy6HaG_2SB`6CC{He}f zHVw(fJWApwPq!6VY7r1w-Fs)@ox~N+q|w~e;JI~C4Vf^@d>Wvj=fl`^u9x9wd9 zR%3*Q+)t%S!MU_`id^@&Y{y7-r98lZX0?YrHlfmwb?#}^1b{8g&KzmkE(L>Z&)179 zp<)v6Y}pRl100G2FL_t(o!|l{-Q-VMg#&MKg7c{O0 z2wJImOS3Gy*Z2Qifdv~JYOp;v+U)a|nLoc7hNH;I$;lzDt$}rkaFw1mYK5_0Q(Sut zvbEloxON7$+HSOgC9Z8ltuC&0OSF!-mXv5caV>#bc3@hBPX@I$58-z}(ZZE!t-aOG zpjNkbau@>yEzH(5Yj4kZiMH32XI!4~gVXNnjAvRx;Sdg^`>2DpUEwoMhTs_st8pKG z(%SHyHdU&v%f36~uERh!bd`!T2dw;z6PrOTQ7Vt*#9F2uHlUVnb#ev_o^fh}Dzmq} zWtlk35}k=?xj28uO|5>>$yXadTUE@@IPpgH`gJ~Ro4>jd1IF|(+IX>8M4Ps{PNvmI zNj4D+XgN83gPt_Gm}`Ybv{;+&yu-C(Grdiahmo~BjG-l&mWM+{e5M1sm&=xduwgM9 z`8OEh`=F3r`^E{n_;%9weN{cf2%7=VzC@cYj+lg>+3|D|_1C@{hcU(DyQG_BvBWe? zvTv``=%b1zrol#=R`JB)>cdjpWt&rLJgVp-t?DREyuq1A%0Z4)6_WsQ7{nzjN zo!X zGXV)2i3kcZIL~_j>uIKPK_zib+3T+Nt3Mb&Br)s)UIaA}@p{wDda>7=Q|mGRp7pqY zkJ!7E{MNz$9nOwoVqpFb)}$IP24Wn2JJ=Cw(!`OXJBr45rP>>AQr$6c7slJWvbpNW z@KTwna6d?PP>hvXCcp=4F;=GR@R4E7{4VU^0p4F>v^#A|>07*qoM6N<$f*5nx ACIA2c literal 0 HcmV?d00001 diff --git a/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..502f463a9bc882b461c96aadf492d1729e49e725 GIT binary patch literal 586 zcmV-Q0=4~#P)+}#`wDE{8-2Mebf5<{{PqV{TgVcv*r8?UZ3{-|G?_}T*&y;@cqf{ z{Q*~+qr%%p!1pS*_Uicl#q9lc(D`!D`LN62sNwq{oYw(Wmhk)k<@f$!$@ng~_5)Ru z0Z)trIA5^j{DIW^c+vT2%lW+2<(RtE2wR;4O@)Tm`Xr*?A(qYoM}7i5Yxw>D(&6ou zxz!_Xr~yNF+waPe00049Nkl*;a!v6h%{rlvIH#gW3s8p;bFr=l}mRqpW2h zw=OA%hdyL~z+UHOzl0eKhEr$YYOL-c-%Y<)=j?(bzDweB7{b+%_ypvm_cG{SvM=DK zhv{K@m>#Bw>2W$eUI#iU)Wdgs8Y3U+A$Gd&{+j)d)BmGKx+43U_!tik_YlN)>$7G! zhkE!s;%oku3;IwG3U^2kw?z+HM)jB{@zFhK8P#KMSytSthr+4!c(5c%+^UBn`0X*2 zy3(k600_CSZj?O$Qu%&$;|TGUJrptR(HzyIx>5E(2r{eA(<6t3e3I0B)7d6s7?Z5J zZ!rtKvA{MiEBm&KFtoifx>5P^Z=vl)95XJn()aS5%ad(s?4-=Tkis9IGu{`Fy8r+H07*qoM6N<$f20Z)wqMt%V?S?~D#06};F zA3KcL`Wb+>5ObvgQIG&ig8(;V04hz?@cqy3{mSh8o!|U|)cI!1_+!fWH@o*8vh^CU z^ws0;(c$gI+2~q^tO#GDHf@=;DncUw00J^eL_t(&-tE|HQ`%4vfZ;WsBqu-$0nu1R zq^Vj;p$clf^?twn|KHO+IGt^q#a3X?w9dXC@*yxhv&l}F322(8Y1&=P&I}~G@#h6; z1CV9ecD9ZEe87{{NtI*)_aJ<`kJa z?5=RBtFF50s;jQLFil-`)m2wrb=6h(&brpj%nG_U&ut~$?8Rokzxi8zJoWr#2dto5 zOX_URcc<1`Iky+jc;A%Vzx}1QU{2$|cKPom2Vf1{8m`vja4{F>HS?^Nc^rp}xo+Nh zxd}eOm`fm3@MQC1< zIk&aCjb~Yh%5+Yq0`)D;q{#-Uqlv*o+Oor zE!I71Z@ASH3grl8&P^L0WpavHoP|UX4e?!igT`4?AZk$hu*@%6WJ;zDOGlw7kj@ zY5!B-0ft0f?Lgb>C;$Ke07*qoM6N<$f~t1N9smFU literal 0 HcmV?d00001 diff --git a/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..0ec303439225b78712f49115768196d8d76f6790 GIT binary patch literal 862 zcmV-k1EKthP)20Z)wqMt%V?S?~D#06};F zA3KcL`Wb+>5ObvgQIG&ig8(;V04hz?@cqy3{mSh8o!|U|)cI!1_+!fWH@o*8vh^CU z^ws0;(c$gI+2~q^tO#GDHf@=;DncUw00J^eL_t(&-tE|HQ`%4vfZ;WsBqu-$0nu1R zq^Vj;p$clf^?twn|KHO+IGt^q#a3X?w9dXC@*yxhv&l}F322(8Y1&=P&I}~G@#h6; z1CV9ecD9ZEe87{{NtI*)_aJ<`kJa z?5=RBtFF50s;jQLFil-`)m2wrb=6h(&brpj%nG_U&ut~$?8Rokzxi8zJoWr#2dto5 zOX_URcc<1`Iky+jc;A%Vzx}1QU{2$|cKPom2Vf1{8m`vja4{F>HS?^Nc^rp}xo+Nh zxd}eOm`fm3@MQC1< zIk&aCjb~Yh%5+Yq0`)D;q{#-Uqlv*o+Oor zE!I71Z@ASH3grl8&P^L0WpavHoP|UX4e?!igT`4?AZk$hu*@%6WJ;zDOGlw7kj@ zY5!B-0ft0f?Lgb>C;$Ke07*qoM6N<$f~t1N9smFU literal 0 HcmV?d00001 diff --git a/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..e9f5fea27c705180eb716271f41b582e76dcbd90 GIT binary patch literal 1674 zcmV;526g#~P){YQnis^a@{&-nmRmq)<&%Mztj67_#M}W?l>kYSliK<%xAp;0j{!}J0!o7b zE>q9${Lb$D&h7k=+4=!ek^n+`0zq>LL1O?lVyea53S5x`Nqqo2YyeuIrQrJj9XjOp z{;T5qbj3}&1vg1VK~#9!?b~^C5-}JC@Pyrv-6dSEqJqT}#j9#dJ@GzT@B8}x zU&J@bBI>f6w6en+CeI)3^kC*U?}X%OD8$Fd$H&LV$H&LV$H&LV#|K5~mLYf|VqzOc zkc7qL~0sOYuM{tG`rYEDV{DWY`Z8&)kW*hc2VkBuY+^Yx&92j&StN}Wp=LD zxoGxXw6f&8sB^u})h@b@z0RBeD`K7RMR9deyL(ZJu#39Z>rT)^>v}Khq8U-IbIvT> z?4pV9qGj=2)TNH3d)=De<+^w;>S7m_eFKTvzeaBeir45xY!^m!FmxnljbSS_3o=g( z->^wC9%qkR{kbGnW8MfFew_o9h3(r55Is`L$8KI@d+*%{=Nx+FXJ98L0PjFIu;rGnnfY zn1R5Qnp<{Jq0M1vX=X&F8gtLmcWv$1*M@4ZfF^9``()#hGTeKeP`1!iED ztNE(TN}M5}3Bbc*d=FIv`DNv&@|C6yYj{sSqUj5oo$#*0$7pu|Dd2TLI>t5%I zIa4Dvr(iayb+5x=j*Vum9&irk)xV1`t509lnPO0%skL8_1c#Xbamh(2@f?4yUI zhhuT5<#8RJhGz4%b$`PJwKPAudsm|at?u;*hGgnA zU1;9gnxVBC)wA(BsB`AW54N{|qmikJR*%x0c`{LGsSfa|NK61pYH(r-UQ4_JXd!Rsz)=k zL{GMc5{h138)fF5CzHEDM>+FqY)$pdN3}Ml+riTgJOLN0F*Vh?{9ESR{SVVg>*>=# zix;VJHPtvFFCRY$Ks*F;VX~%*r9F)W`PmPE9F!(&s#x07n2<}?S{(ygpXgX-&B&OM zONY&BRQ(#%0%jeQs?oJ4P!p*R98>qCy5p8w>_gpuh39NcOlp)(wOoz0sY-Qz55eB~ z7OC-fKBaD1sE3$l-6QgBJO!n?QOTza`!S_YK z_v-lm^7{VO^8Q@M_^8F)09Ki6%=s?2_5eupee(w1FB%aqSweusQ-T+CH0Xt{` zFjMvW{@C&TB)k25()nh~_yJ9coBRL(0oO@HK~z}7?bm5j;y@69;bvlHb2tf!$ReA~x{22wTq550 z?f?Hnw(;m3ip30;QzdV~7pi!wyMYhDtXW#cO7T>|f=bdFhu+F!zMZ2UFj;GUKX7tI z;hv3{q~!*pMj75WP_c}>6)IWvg5_yyg<9Op()eD1hWC19M@?_9_MHec{Z8n3FaF{8 z;u`Mw0ly(uE>*CgQYv{be6ab2LWhlaH1^iLIM{olnag$78^Fd}%dR7;JECQ+hmk|o z!u2&!3MqPfP5ChDSkFSH8F2WVOEf0(E_M(JL17G}Y+fg0_IuW%WQ zG(mG&u?|->YSdk0;8rc{yw2@2Z&GA}z{Wb91Ooz9VhA{b2DYE7RmG zjL}?eq#iX%3#k;JWMx_{^2nNax`xPhByFiDX+a7uTGU|otOvIAUy|dEKkXOm-`aWS z27pUzD{a)Ct<6p{{3)+lq@i`t@%>-wT4r?*S}k)58e09WZYP0{{R3FC5Sl00039P)t-s|Ns9~ z#rP?<_5oL$Q^olD{r_0T`27C={r>*`|Nj71npVa5OTzc(_WfbW_({R{p56NV{r*M2 z_xt?)2V0#0NsfV0u>{42ctGP(8vQj-Btk1n|O0ZD=YLwd&R{Ko41Gr9H= zY@z@@bOAMB5Ltl$E>bJJ{>JP30ZxkmI%?eW{k`b?Wy<&gOo;dS`~CR$Vwb@XWtR|N zi~t=w02?-0&j0TD{>bb6sNwsK*!p?V`RMQUl(*DVjk-9Cx+-z1KXab|Ka2oXhX5f% z`$|e!000AhNklrxs)5QTeTVRiEmz~MKK1WAjCw(c-JK6eox;2O)?`? zTG`AHia671e^vgmp!llKp|=5sVHk#C7=~epA~VAf-~%aPC=%Qw01h8mnSZ|p?hz91 z7p83F3%LVu9;S$tSI$C^%^yud1dfTM_6p2|+5Ejp$bd`GDvbR|xit>i!ZD&F>@CJrPmu*UjD&?DfZs=$@e3FQA(vNiU+$A*%a} z?`XcG2jDxJ_ZQ#Md`H{4Lpf6QBDp81_KWZ6Tk#yCy1)32zO#3<7>b`eT7UyYH1eGz z;O(rH$=QR*L%%ZcBpc=eGua?N55nD^K(8<#gl2+pN_j~b2MHs4#mcLmv%DkspS-3< zpI1F=^9siI0s-;IN_IrA;5xm~3?3!StX}pUv0vkxMaqm+zxrg7X7(I&*N~&dEd0kD z-FRV|g=|QuUsuh>-xCI}vD2imzYIOIdcCVV=$Bz@*u0+Bs<|L^)32nN*=wu3n%Ynw z@1|eLG>!8ruU1pFXUfb`j>(=Gy~?Rn4QJ-c3%3T|(Frd!bI`9u&zAnyFYTqlG#&J7 zAkD(jpw|oZLNiA>;>hgp1KX7-wxC~31II47gc zHcehD6Uxlf%+M^^uN5Wc*G%^;>D5qT{>=uxUhX%WJu^Z*(_Wq9y}npFO{Hhb>s6<9 zNi0pHXWFaVZnb)1+RS&F)xOv6&aeILcI)`k#0YE+?e)5&#r7J#c`3Z7x!LpTc01dx zrdC3{Z;joZ^KN&))zB_i)I9fWedoN>Zl-6_Iz+^G&*ak2jpF07*qoM6N<$f;w%0(f|Me literal 0 HcmV?d00001 diff --git a/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..0467bf12aa4d28f374bb26596605a46dcbb3e7c8 GIT binary patch literal 1418 zcmV;51$Fv~P)q zKfU)WzW*n(@|xWGCA9ScMt*e9`2kdxPQ&&>|-UCa7_51w+ zLUsW@ZzZSW0y$)Hp~e9%PvP|a03ks1`~K?q{u;6NC8*{AOqIUq{CL&;p56Lf$oQGq z^={4hPQv)y=I|4n+?>7Fim=dxt1 z2H+Dm+1+fh+IF>G0SjJMkQQre1x4|G*Z==(Ot&kCnUrL4I(rf(ucITwmuHf^hXiJT zkdTm&kdTm&kdTm&kdP`esgWG0BcWCVkVZ&2dUwN`cgM8QJb`Z7Z~e<&Yj2(}>Tmf` zm1{eLgw!b{bXkjWbF%dTkTZEJWyWOb##Lfw4EK2}<0d6%>AGS{po>WCOy&f$Tay_> z?NBlkpo@s-O;0V%Y_Xa-G#_O08q5LR*~F%&)}{}r&L%Sbs8AS4t7Y0NEx*{soY=0MZExqA5XHQkqi#4gW3 zqODM^iyZl;dvf)-bOXtOru(s)Uc7~BFx{w-FK;2{`VA?(g&@3z&bfLFyctOH!cVsF z7IL=fo-qBndRUm;kAdXR4e6>k-z|21AaN%ubeVrHl*<|s&Ax@W-t?LR(P-24A5=>a z*R9#QvjzF8n%@1Nw@?CG@6(%>+-0ASK~jEmCV|&a*7-GKT72W<(TbSjf)&Eme6nGE z>Gkj4Sq&2e+-G%|+NM8OOm5zVl9{Z8Dd8A5z3y8mZ=4Bv4%>as_{9cN#bm~;h>62( zdqY93Zy}v&c4n($Vv!UybR8ocs7#zbfX1IY-*w~)p}XyZ-SFC~4w>BvMVr`dFbelV{lLL0bx7@*ZZdebr3`sP;? zVImji)kG)(6Juv0lz@q`F!k1FE;CQ(D0iG$wchPbKZQELlsZ#~rt8#90Y_Xh&3U-< z{s<&cCV_1`^TD^ia9!*mQDq& zn2{r`j};V|uV%_wsP!zB?m%;FeaRe+X47K0e+KE!8C{gAWF8)lCd1u1%~|M!XNRvw zvtqy3iz0WSpWdhn6$hP8PaRBmp)q`#PCA`Vd#Tc$@f1tAcM>f_I@bC)hkI9|o(Iqv zo}Piadq!j76}004RBio<`)70k^`K1NK)q>w?p^C6J2ZC!+UppiK6&y3Kmbv&O!oYF z34$0Z;QO!JOY#!`qyGH<3Pd}Pt@q*A0V=3SVtWKRR8d8Z&@)3qLPA19LPA19LPEUC YUoZo%k(ykuW&i*H07*qoM6N<$f+CH{y8r+H literal 0 HcmV?d00001 diff --git a/packages/deriv_logger/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 000000000..0bedcf2fd --- /dev/null +++ b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/packages/deriv_logger/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 0000000000000000000000000000000000000000..9da19eacad3b03bb08bbddbbf4ac48dd78b3d838 GIT binary patch literal 68 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx0wlM}@Gt=>Zci7-kcv6Uzs@r-FtIZ-&5|)J Q1PU{Fy85}Sb4q9e0B4a5jsO4v literal 0 HcmV?d00001 diff --git a/packages/deriv_logger/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..9da19eacad3b03bb08bbddbbf4ac48dd78b3d838 GIT binary patch literal 68 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx0wlM}@Gt=>Zci7-kcv6Uzs@r-FtIZ-&5|)J Q1PU{Fy85}Sb4q9e0B4a5jsO4v literal 0 HcmV?d00001 diff --git a/packages/deriv_logger/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..9da19eacad3b03bb08bbddbbf4ac48dd78b3d838 GIT binary patch literal 68 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx0wlM}@Gt=>Zci7-kcv6Uzs@r-FtIZ-&5|)J Q1PU{Fy85}Sb4q9e0B4a5jsO4v literal 0 HcmV?d00001 diff --git a/packages/deriv_logger/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 000000000..89c2725b7 --- /dev/null +++ b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/packages/deriv_logger/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/deriv_logger/example/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000..f2e259c7c --- /dev/null +++ b/packages/deriv_logger/example/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/deriv_logger/example/ios/Runner/Base.lproj/Main.storyboard b/packages/deriv_logger/example/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 000000000..f3c28516f --- /dev/null +++ b/packages/deriv_logger/example/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/deriv_logger/example/ios/Runner/Info.plist b/packages/deriv_logger/example/ios/Runner/Info.plist new file mode 100644 index 000000000..7f553465b --- /dev/null +++ b/packages/deriv_logger/example/ios/Runner/Info.plist @@ -0,0 +1,51 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Example + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + example + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + + + diff --git a/packages/deriv_logger/example/ios/Runner/Runner-Bridging-Header.h b/packages/deriv_logger/example/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 000000000..308a2a560 --- /dev/null +++ b/packages/deriv_logger/example/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/packages/deriv_logger/example/ios/RunnerTests/RunnerTests.swift b/packages/deriv_logger/example/ios/RunnerTests/RunnerTests.swift new file mode 100644 index 000000000..86a7c3b1b --- /dev/null +++ b/packages/deriv_logger/example/ios/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Flutter +import UIKit +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/packages/deriv_logger/example/lib/main.dart b/packages/deriv_logger/example/lib/main.dart new file mode 100644 index 000000000..4c799e920 --- /dev/null +++ b/packages/deriv_logger/example/lib/main.dart @@ -0,0 +1,93 @@ +import 'package:deriv_logger/deriv_logger.dart'; +import 'package:flutter/material.dart'; + +void main() { + AppLogger.initialize(); + runApp(const MyApp()); +} + +class MyApp extends StatelessWidget { + const MyApp({super.key}); + + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Flutter Demo', + theme: ThemeData( + colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), + useMaterial3: true, + ), + home: DebugOverlay( + enabled: true, + builder: (_) => const MyHomePage( + title: 'Flutter Demo Home Page', + ), + ), + ); + } +} + +class MyHomePage extends StatefulWidget { + const MyHomePage({super.key, required this.title}); + + final String title; + + @override + State createState() => _MyHomePageState(); +} + +class _MyHomePageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + backgroundColor: Theme.of(context).colorScheme.inversePrimary, + title: Text(widget.title), + ), + body: const Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + 'Run this app in debug mode, press any button below and check the debug button and your terminal', + textAlign: TextAlign.center, + ), + ], + ), + ), + floatingActionButton: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + FloatingActionButton( + onPressed: () => AppLogger.i('Information', title: 'Main page'), + tooltip: 'information', + child: const Text('Information'), + ), + FloatingActionButton( + onPressed: () => AppLogger.e('This is error!!', title: 'Main page'), + tooltip: 'error', + child: const Text('Error'), + ), + FloatingActionButton( + onPressed: () => + AppLogger.w('Showing some warning!!', title: 'Main page'), + tooltip: 'warning', + child: const Text('Warning'), + ), + FloatingActionButton( + onPressed: () => + AppLogger.f('This is a fatal message', title: ' Main Page'), + tooltip: 'fatal', + child: const Text('Fatal'), + ), + FloatingActionButton( + onPressed: () => + AppLogger.s('This is a success', title: ' Main Page'), + tooltip: 'success', + child: const Text('Success'), + ), + ], + ), + ); + } +} diff --git a/packages/deriv_logger/example/pubspec.yaml b/packages/deriv_logger/example/pubspec.yaml new file mode 100644 index 000000000..279fd887a --- /dev/null +++ b/packages/deriv_logger/example/pubspec.yaml @@ -0,0 +1,90 @@ +name: example +description: A new Flutter project. +# The following line prevents the package from being accidentally published to +# pub.dev using `flutter pub publish`. This is preferred for private packages. +publish_to: "none" # Remove this line if you wish to publish to pub.dev + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +# In Windows, build-name is used as the major, minor, and patch parts +# of the product and file versions while build-number is used as the build suffix. +version: 1.0.0+1 + +environment: + sdk: ">=3.0.2 <4.0.0" + +# Dependencies specify other packages that your package needs in order to work. +# To automatically upgrade your package dependencies to the latest versions +# consider running `flutter pub upgrade --major-versions`. Alternatively, +# dependencies can be manually updated by changing the version numbers below to +# the latest version available on pub.dev. To see which dependencies have newer +# versions available, run `flutter pub outdated`. +dependencies: + flutter: + sdk: flutter + deriv_logger: + path: ../ + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.2 + +dev_dependencies: + flutter_test: + sdk: flutter + + # The "flutter_lints" package below contains a set of recommended lints to + # encourage good coding practices. The lint set provided by the package is + # activated in the `analysis_options.yaml` file located at the root of your + # package. See that file for information about deactivating specific lint + # rules and activating additional ones. + flutter_lints: ^2.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter packages. +flutter: + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + # To add assets to your application, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/assets-and-images/#from-packages + + # To add custom fonts to your application, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/custom-fonts/#from-packages diff --git a/packages/deriv_logger/example/test/widget_test.dart b/packages/deriv_logger/example/test/widget_test.dart new file mode 100644 index 000000000..092d222f7 --- /dev/null +++ b/packages/deriv_logger/example/test/widget_test.dart @@ -0,0 +1,30 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility in the flutter_test package. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'package:example/main.dart'; + +void main() { + testWidgets('Counter increments smoke test', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(const MyApp()); + + // Verify that our counter starts at 0. + expect(find.text('0'), findsOneWidget); + expect(find.text('1'), findsNothing); + + // Tap the '+' icon and trigger a frame. + await tester.tap(find.byIcon(Icons.add)); + await tester.pump(); + + // Verify that our counter has incremented. + expect(find.text('0'), findsNothing); + expect(find.text('1'), findsOneWidget); + }); +} diff --git a/packages/deriv_logger/lib/controllers/logger_controller.dart b/packages/deriv_logger/lib/controllers/logger_controller.dart new file mode 100644 index 000000000..d556c53f2 --- /dev/null +++ b/packages/deriv_logger/lib/controllers/logger_controller.dart @@ -0,0 +1,116 @@ +import 'dart:convert'; + +import 'package:deriv_logger/core/app_logger.dart'; +import 'package:flutter/material.dart'; + +/// The controller for console logs that is responsible for managing the logs +/// into readable streams. +class ConsoleLogController extends ChangeNotifier { + /// Creates an instance of the controller. + ConsoleLogController(); + + final List _logs = []; + + /// This returns the logs in reverse order. + List get logs => _logs.reversed.toList(); + + /// This will initialize the controller. + void initialize() { + AppLogger.logStream.listen((LogDetails log) { + _logs.add( + ConsoleLogVM( + color: _getColorFromLevel(log.logLevel), + level: log.logLevel.name.toUpperCase(), + text: _getFormattedLog(log.message), + time: _getFormattedTime(log.time), + title: log.title, + stackTrace: log.stackTrace?.toString(), + ), + ); + notifyListeners(); + }); + } + + /// Clears all the logs from the log list. + void clearLogs() { + _logs.clear(); + notifyListeners(); + } + + String _getFormattedLog(dynamic object) { + try { + if (object is String) { + return object; + } else if (object is List || object is Map) { + final String spaces = ' ' * 2; + return JsonEncoder.withIndent(spaces).convert(object); + } else { + return object.toString(); + } + } on Exception catch (_) { + return object.toString(); + } + } + + String _getFormattedTime(DateTime dateTime) { + final DateTime dateInLocal = dateTime.toLocal(); + return dateInLocal.toString(); + } + + Color _getColorFromLevel(AppLogLevel level) { + switch (level) { + case AppLogLevel.debug: + return Colors.black; + case AppLogLevel.info: + return Colors.blue; + case AppLogLevel.warning: + return Colors.orange; + case AppLogLevel.error: + return Colors.red; + case AppLogLevel.fatal: + return Colors.pink; + case AppLogLevel.success: + return Colors.green; + } + } +} + +/// This is the view model for the console log. +class ConsoleLogVM { + /// This is the view model for the console log. + ConsoleLogVM({ + required this.level, + required this.text, + required this.time, + required this.color, + this.title, + this.stackTrace, + }); + + /// The color of the log based on its severity. + final Color color; + + /// The level of the log i.e + final String level; + + /// The actual message to print in the console. + final String text; + + /// THe time stamp + final String time; + + /// Title of the log. + final String? title; + + /// Stack trace of the log. + final String? stackTrace; + + @override + String toString() => jsonEncode({ + 'level': level, + 'time': time, + 'title': title, + 'text': text, + 'stackTrace': stackTrace, + }); +} diff --git a/packages/deriv_logger/lib/core/app_logger.dart b/packages/deriv_logger/lib/core/app_logger.dart new file mode 100644 index 000000000..99c2e40b6 --- /dev/null +++ b/packages/deriv_logger/lib/core/app_logger.dart @@ -0,0 +1,171 @@ +import 'dart:async'; + +import 'package:logger/logger.dart'; + +enum AppLogLevel { + debug, + info, + warning, + error, + fatal, + success, +} + +const Map _packageLogLevelToAppLogLevel = { + Level.trace: AppLogLevel.success, + Level.info: AppLogLevel.info, + Level.warning: AppLogLevel.warning, + Level.error: AppLogLevel.error, + Level.fatal: AppLogLevel.fatal, +}; + +class AppLogger { + AppLogger._(); + static late Logger _logger; + static bool _enableDebugging = false; + + static late StreamController _logController; + + /// Initialize the logger. + static void initialize({bool enableDebugging = true}) { + _enableDebugging = enableDebugging; + + _logger = Logger( + filter: DevelopmentFilter(), + printer: PrettyPrinter( + methodCount: 0, + levelColors: { + Level.trace: const AnsiColor.fg(2), + }, + ), + ); + _logController = StreamController.broadcast(); + } + + /// Stream of logs. + static Stream get logStream => _logController.stream; + + /// This logs [error] messages with red color. + static void e( + dynamic message, { + DateTime? time, + String? title, + StackTrace? stackTrace, + }) { + _log( + level: Level.error, + message: message, + title: title, + time: time, + stackTrace: stackTrace ?? StackTrace.current, + ); + } + + /// This logs [information] message with blue color. + static void i( + dynamic message, { + DateTime? time, + String? title, + StackTrace? stackTrace, + }) { + _log( + message: message, + stackTrace: stackTrace ?? StackTrace.empty, + title: title, + time: time, + ); + } + + /// This logs [warning] message with yellow color. + static void w( + dynamic message, { + DateTime? time, + String? title, + StackTrace? stackTrace, + }) { + _log( + level: Level.warning, + message: message, + title: title, + time: time, + stackTrace: stackTrace ?? StackTrace.empty, + ); + } + + /// This logs [fatal] messages with purple color. + static void f( + dynamic message, { + DateTime? time, + String? title, + StackTrace? stackTrace, + }) { + _log( + level: Level.fatal, + message: message, + title: title, + stackTrace: stackTrace ?? StackTrace.current, + ); + } + + /// This logs [successful] events/message with green color. + static void s( + dynamic message, { + DateTime? time, + String? title, + }) { + _log( + level: Level.trace, + message: message, + title: title, + stackTrace: StackTrace.empty, + time: time, + ); + } + + void dispose() { + _logController.close(); + } + + static void _log({ + Level level = Level.info, + dynamic message, + DateTime? time, + String? title, + StackTrace? stackTrace, + }) { + if (!_enableDebugging) return; + _logger.log( + level, + message, + time: time, + error: title, + stackTrace: stackTrace, + ); + _logController.sink.add( + LogDetails( + title: title ?? '', + message: message, + time: time ?? DateTime.now(), + stackTrace: stackTrace, + logLevel: _packageLogLevelToAppLogLevel[level]!, + ), + ); + } +} + +class LogDetails { + /// Details of the logs. + LogDetails({ + required this.title, + required this.message, + required this.time, + required this.logLevel, + this.stackTrace, + }); + + final DateTime time; + final String title; + final dynamic message; + final AppLogLevel logLevel; + final StackTrace? stackTrace; +} diff --git a/packages/deriv_logger/lib/deriv_logger.dart b/packages/deriv_logger/lib/deriv_logger.dart new file mode 100644 index 000000000..4b0032aa9 --- /dev/null +++ b/packages/deriv_logger/lib/deriv_logger.dart @@ -0,0 +1,5 @@ +library deriv_logger; + +export './controllers/logger_controller.dart'; +export './core/app_logger.dart'; +export './views/views.dart'; diff --git a/packages/deriv_logger/lib/views/console_log_view.dart b/packages/deriv_logger/lib/views/console_log_view.dart new file mode 100644 index 000000000..3f2db50c0 --- /dev/null +++ b/packages/deriv_logger/lib/views/console_log_view.dart @@ -0,0 +1,138 @@ +import 'package:deriv_logger/controllers/logger_controller.dart'; +import 'package:deriv_logger/views/logger_theme.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; + +/// Page for Console logs. +class ConsoleLogsView extends StatelessWidget { + /// Creates a new instance of the ConsoleLogsView. + const ConsoleLogsView({ + required this.consoleLogsController, + required this.theme, + super.key, + }); + + /// The console log controller. + final ConsoleLogController consoleLogsController; + + /// theme + final DebugOverlayTheme theme; + + @override + Widget build(BuildContext context) => AnimatedBuilder( + animation: consoleLogsController, + builder: (BuildContext context, _) => SafeArea( + child: Scaffold( + appBar: AppBar(title: const Text('Console logs')), + floatingActionButton: consoleLogsController.logs.isEmpty + ? const SizedBox() + : FloatingActionButton( + onPressed: () => consoleLogsController.clearLogs(), + child: const Icon(Icons.delete), + ), + backgroundColor: theme.backgroundColor, + body: consoleLogsController.logs.isEmpty + ? Center( + child: Text( + 'No logs available!', + style: theme.bodyTextStyle, + ), + ) + : ListView.separated( + physics: const BouncingScrollPhysics(), + itemCount: consoleLogsController.logs.length, + padding: const EdgeInsets.symmetric(vertical: 16), + separatorBuilder: (_, __) => const SizedBox(height: 12), + itemBuilder: (_, int index) => ConsoleLogCard( + log: consoleLogsController.logs[index], + theme: theme, + ), + ), + ), + ), + ); +} + +/// Log item UI. +class ConsoleLogCard extends StatelessWidget { + /// Creates a UI for log messages. + const ConsoleLogCard({ + super.key, + required this.log, + required this.theme, + }); + final ConsoleLogVM log; + final DebugOverlayTheme theme; + + @override + Widget build(BuildContext context) => Container( + padding: const EdgeInsets.all(12), + margin: const EdgeInsets.symmetric(horizontal: 12), + decoration: BoxDecoration( + color: log.color.withOpacity(0.1), + borderRadius: BorderRadius.circular(8), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + _buildHeader(context), + Divider(thickness: 0.2, height: 12, color: log.color), + if (log.title != null) ...[ + _buildLogTitle(context), + const SizedBox(height: 8), + ], + _buildLogContent(context), + if (log.stackTrace != null) ...[ + const Divider(thickness: 0.5, height: 12), + _buildStackTrace(context), + ], + ], + ), + ); + + Widget _buildHeader(BuildContext context) => Row( + children: [ + Text( + log.level, + style: TextStyle(fontWeight: FontWeight.bold, color: log.color), + ), + const Spacer(), + const SizedBox(width: 16), + Text( + log.time, + style: theme.subtitleTextStyle + .copyWith(fontStyle: FontStyle.italic, color: log.color), + ), + const SizedBox(width: 16), + GestureDetector( + onTap: () => Clipboard.setData(ClipboardData(text: log.toString())), + child: Icon( + Icons.copy, + size: 18, + color: log.color, + ), + ), + ], + ); + + Widget _buildLogTitle(BuildContext context) => Text( + log.title!, + style: theme.bodyTextStyle + .copyWith(fontWeight: FontWeight.bold, color: log.color), + ); + + Widget _buildLogContent(BuildContext context) => + Text(log.text, style: theme.bodyTextStyle); + + Widget _buildStackTrace(BuildContext context) => Scrollbar( + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + physics: const BouncingScrollPhysics(), + child: Text( + log.stackTrace!, + style: theme.subtitleTextStyle.copyWith(), + maxLines: 10, + ), + ), + ); +} diff --git a/packages/deriv_logger/lib/views/debug_button.dart b/packages/deriv_logger/lib/views/debug_button.dart new file mode 100644 index 000000000..477962326 --- /dev/null +++ b/packages/deriv_logger/lib/views/debug_button.dart @@ -0,0 +1,109 @@ +import 'package:deriv_logger/views/logger_theme.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/physics.dart'; + +/// Button for debug overlay +class DebugOverlayButton extends StatefulWidget { + /// Instance of BUtton + const DebugOverlayButton({ + required this.child, + required this.onTap, + required this.theme, + super.key, + }); + final Widget child; + final Function() onTap; + final DebugOverlayTheme theme; + + @override + State createState() => _DebugOverlayButtonState(); +} + +class _DebugOverlayButtonState extends State + with SingleTickerProviderStateMixin { + late AnimationController _controller; + final SimulationCalculator _simulationCalculator = SimulationCalculator(); + Alignment _dragAlignment = Alignment.centerRight; + + void _runAnimation(Offset pixelsPerSecond, Size size) { + _controller + .drive(AlignmentTween(begin: _dragAlignment, end: _dragAlignment)); + _setSide(); + final SpringSimulation simulation = + _simulationCalculator.calculateSimulation(pixelsPerSecond, size); + _controller.animateWith(simulation); + } + + @override + void initState() { + super.initState(); + _controller = AnimationController(vsync: this); + _setSide(); + } + + @override + void dispose() { + _controller.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + final Size size = MediaQuery.of(context).size; + + return GestureDetector( + onPanDown: (DragDownDetails details) => _controller.stop(), + onPanUpdate: (DragUpdateDetails details) => _setPosition(details, size), + onPanEnd: (DragEndDetails details) => + _runAnimation(details.velocity.pixelsPerSecond, size), + onTap: widget.onTap, + child: Align( + alignment: _dragAlignment, + child: DecoratedBox( + decoration: BoxDecoration( + color: widget.theme.primaryColor, + shape: BoxShape.circle, + ), + child: widget.child, + ), + ), + ); + } + + void _setSide() { + final bool isLeft = _dragAlignment.x < 0.0; + if (isLeft) { + setState(() => _dragAlignment = Alignment(-0.95, _dragAlignment.y)); + } else { + setState(() => _dragAlignment = Alignment(0.95, _dragAlignment.y)); + } + } + + void _setPosition(DragUpdateDetails details, Size size) { + setState( + () { + _dragAlignment += Alignment( + details.delta.dx / (size.width / 2), + details.delta.dy / (size.height / 2), + ); + }, + ); + } +} + +/// Simulation calculator for UI. +class SimulationCalculator { + /// Calculates the position of the gesture. + SpringSimulation calculateSimulation(Offset pixelsPerSecond, Size size) { + final double unitsPerSecondX = pixelsPerSecond.dx / size.width; + final double unitsPerSecondY = pixelsPerSecond.dy / size.height; + final Offset unitsPerSecond = Offset(unitsPerSecondX, unitsPerSecondY); + final double unitVelocity = unitsPerSecond.distance; + + const SpringDescription spring = + SpringDescription(mass: 30, stiffness: 1, damping: 1); + final SpringSimulation simulation = + SpringSimulation(spring, 0, 1, -unitVelocity); + return simulation; + } +} diff --git a/packages/deriv_logger/lib/views/debug_overlay.dart b/packages/deriv_logger/lib/views/debug_overlay.dart new file mode 100644 index 000000000..aaedd04e3 --- /dev/null +++ b/packages/deriv_logger/lib/views/debug_overlay.dart @@ -0,0 +1,81 @@ +import 'package:deriv_logger/controllers/logger_controller.dart'; +import 'package:deriv_logger/views/console_log_view.dart'; +import 'package:deriv_logger/views/debug_button.dart'; +import 'package:deriv_logger/views/logger_theme.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; + +/// DebugOverlay +class DebugOverlay extends StatefulWidget { + /// Overlay UI + const DebugOverlay({ + required this.builder, + super.key, + this.icon = const Icon(Icons.bug_report_outlined), + this.enabled = kDebugMode, + }); + + /// Widget that is displayed at DebugOverlay action header. + final Widget icon; + + /// Should return your application widget for which DebugOverlay is applied. + final WidgetBuilder builder; + + /// When this field is [true] - debug overlay is running in your app. + /// By default, this field get value from const [kDebugMode]. + final bool enabled; + + @override + State createState() => _DebugOverlayState(); +} + +class _DebugOverlayState extends State { + final ConsoleLogController consoleLogsController = ConsoleLogController(); + + @override + void initState() { + super.initState(); + + if (widget.enabled) { + WidgetsBinding.instance.addPostFrameCallback( + (Duration timeStamp) => _insertOverlay(context)); + } + + consoleLogsController.initialize(); + } + + @override + Widget build(BuildContext context) => widget.builder.call(context); + + void _insertOverlay(BuildContext context) { + const DebugOverlayTheme theme = DebugOverlayTheme(); + + return Overlay.of(context).insert( + OverlayEntry( + builder: (BuildContext context) => DebugOverlayButton( + theme: theme, + onTap: () => _onButtonTap(context, theme), + child: widget.icon, + ), + ), + ); + } + + void _onButtonTap(BuildContext context, DebugOverlayTheme theme) { + showModalBottomSheet( + context: context, + isScrollControlled: true, + backgroundColor: theme.backgroundColor, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.vertical(top: Radius.circular(12)), + ), + builder: (BuildContext ctx) => FractionallySizedBox( + heightFactor: 0.9, + child: ConsoleLogsView( + theme: theme, + consoleLogsController: consoleLogsController, + ), + ), + ); + } +} diff --git a/packages/deriv_logger/lib/views/logger_theme.dart b/packages/deriv_logger/lib/views/logger_theme.dart new file mode 100644 index 000000000..df3496a5c --- /dev/null +++ b/packages/deriv_logger/lib/views/logger_theme.dart @@ -0,0 +1,55 @@ +import 'package:flutter/material.dart'; + +/// Theme for debug. +class DebugOverlayTheme { + /// Creates a mini theme for debug UI. + const DebugOverlayTheme({ + this.primaryColor = Colors.green, + this.backgroundColor = Colors.white, + this.cardColor = Colors.white, + this.headerTextStyle = const TextStyle( + color: Colors.black, + fontSize: 20, + fontWeight: FontWeight.w600, + fontFamily: 'Monospace', + ), + this.bodyTextStyle = const TextStyle( + color: Colors.black, + fontSize: 14, + fontWeight: FontWeight.w400, + fontFamily: 'Monospace', + ), + this.subtitleTextStyle = const TextStyle( + color: Colors.black, + fontSize: 12, + fontWeight: FontWeight.w400, + fontFamily: 'Monospace', + ), + }); + + /// Primary color for the ui. + final Color primaryColor; + + /// Background color + final Color backgroundColor; + + ///color of the card. + final Color cardColor; + + /// Text style for the header. + final TextStyle headerTextStyle; + + /// Body text style + final TextStyle bodyTextStyle; + + /// subtitle text style. + final TextStyle subtitleTextStyle; +} + +final List defaultShadow = [ + BoxShadow( + blurRadius: 12, + offset: const Offset(0, 2), + color: Colors.black.withOpacity(0.1), + ) +]; diff --git a/packages/deriv_logger/lib/views/views.dart b/packages/deriv_logger/lib/views/views.dart new file mode 100644 index 000000000..a12c2f3cc --- /dev/null +++ b/packages/deriv_logger/lib/views/views.dart @@ -0,0 +1,4 @@ +export 'console_log_view.dart'; +export 'debug_button.dart'; +export 'debug_overlay.dart'; +export 'logger_theme.dart'; diff --git a/packages/deriv_logger/pubspec.yaml b/packages/deriv_logger/pubspec.yaml new file mode 100644 index 000000000..a339ff738 --- /dev/null +++ b/packages/deriv_logger/pubspec.yaml @@ -0,0 +1,53 @@ +name: deriv_logger +description: A debugging tool for deriv applications. +version: 0.0.1 + +environment: + sdk: ">=3.0.2 <4.0.0" + +dependencies: + flutter: + sdk: flutter + logger: ^2.3.0 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^2.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter packages. +flutter: + + # To add assets to your package, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + # + # For details regarding assets in packages, see + # https://flutter.dev/assets-and-images/#from-packages + # + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware + + # To add custom fonts to your package, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts in packages, see + # https://flutter.dev/custom-fonts/#from-packages diff --git a/packages/update_checker/pubspec.lock b/packages/update_checker/pubspec.lock index 6a9f8499d..e0a3ee603 100644 --- a/packages/update_checker/pubspec.lock +++ b/packages/update_checker/pubspec.lock @@ -85,10 +85,10 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.17.1" convert: dependency: transitive description: @@ -316,18 +316,18 @@ packages: dependency: transitive description: name: matcher - sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" url: "https://pub.dev" source: hosted - version: "0.12.16" + version: "0.12.15" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.2.0" meta: dependency: transitive description: @@ -380,10 +380,10 @@ packages: dependency: "direct main" description: name: package_info_plus - sha256: cbff87676c352d97116af6dbea05aa28c4d65eb0f6d5677a520c11a69ca9a24d + sha256: "7e76fad405b3e4016cd39d08f455a4eb5199723cf594cd1b8916d47140d93017" url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "4.2.0" package_info_plus_platform_interface: dependency: transitive description: @@ -489,10 +489,10 @@ packages: dependency: transitive description: name: source_span - sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.9.1" stack_trace: dependency: transitive description: @@ -529,26 +529,26 @@ packages: dependency: "direct dev" description: name: test - sha256: "13b41f318e2a5751c3169137103b60c584297353d4b1761b66029bae6411fe46" + sha256: "3dac9aecf2c3991d09b9cdde4f98ded7b30804a88a0d7e4e7e1678e78d6b97f4" url: "https://pub.dev" source: hosted - version: "1.24.3" + version: "1.24.1" test_api: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.5.1" test_core: dependency: transitive description: name: test_core - sha256: "99806e9e6d95c7b059b7a0fc08f07fc53fabe54a829497f0d9676299f1e8637e" + sha256: "5138dbffb77b2289ecb12b81c11ba46036590b72a64a7a90d6ffb880f1a29e93" url: "https://pub.dev" source: hosted - version: "0.5.3" + version: "0.5.1" typed_data: dependency: transitive description: @@ -581,14 +581,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.2" - web: - dependency: transitive - description: - name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 - url: "https://pub.dev" - source: hosted - version: "0.1.4-beta" web_socket_channel: dependency: transitive description: @@ -622,5 +614,5 @@ packages: source: hosted version: "3.1.1" sdks: - dart: ">=3.1.0-185.0.dev <4.0.0" + dart: ">=3.0.0 <4.0.0" flutter: ">=3.10.2" From 6ed8b96a9b2c8bb7b1a7036bcf0acad4baf3e791 Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Thu, 20 Jun 2024 17:19:49 +0800 Subject: [PATCH 099/162] chore(deriv_logger): bump version and update changelog (#622) Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: sagar-deriv --- CHANGELOG.md | 26 ++++++++++++++++++++++++++ README.md | 2 +- packages/deriv_logger/CHANGELOG.md | 4 ++++ packages/deriv_logger/pubspec.yaml | 2 +- packages/update_checker/CHANGELOG.md | 4 ++++ packages/update_checker/pubspec.yaml | 2 +- 6 files changed, 37 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12d955c80..a87df2a72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,32 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-06-20 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_logger` - `v0.0.2`](#deriv_logger---v002) + - [`update_checker` - `v1.3.0`](#update_checker---v130) + +--- + +#### `deriv_logger` - `v0.0.2` + + - **FEAT**(deriv_logger): add ability to print prettified logs in console and UI ([#608](https://github.com/regentmarkets/flutter-deriv-packages/issues/608)). ([5a91c24b](https://github.com/regentmarkets/flutter-deriv-packages/commit/5a91c24bde607ff37940edf18f8dfac67d3fc4fa)) + +#### `update_checker` - `v1.3.0` + + - **FEAT**(deriv_logger): add ability to print prettified logs in console and UI ([#608](https://github.com/regentmarkets/flutter-deriv-packages/issues/608)). ([5a91c24b](https://github.com/regentmarkets/flutter-deriv-packages/commit/5a91c24bde607ff37940edf18f8dfac67d3fc4fa)) + + ## 2024-06-14 ### Changes diff --git a/README.md b/README.md index 564d181a1..28ded8060 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ deriv_ui: | [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+6](./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) | +| [update_checker](./packages/update_checker) | Check and retrieve update information from the server for the given package. | [v1.3.0](./packages/update_checker/CHANGELOG.md) | | [deriv_feature_flag](./packages/deriv_feature_flag) | A package to provide feature flag functionality for apps. | [v0.1.1](./packages/deriv_feature_flag/CHANGELOG.md) | ## Environment Setup diff --git a/packages/deriv_logger/CHANGELOG.md b/packages/deriv_logger/CHANGELOG.md index 41cc7d819..ac0b885f0 100644 --- a/packages/deriv_logger/CHANGELOG.md +++ b/packages/deriv_logger/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.2 + + - **FEAT**(deriv_logger): add ability to print prettified logs in console and UI ([#608](https://github.com/regentmarkets/flutter-deriv-packages/issues/608)). ([5a91c24b](https://github.com/regentmarkets/flutter-deriv-packages/commit/5a91c24bde607ff37940edf18f8dfac67d3fc4fa)) + ## 0.0.1 * TODO: Describe initial release. diff --git a/packages/deriv_logger/pubspec.yaml b/packages/deriv_logger/pubspec.yaml index a339ff738..8b85a3d84 100644 --- a/packages/deriv_logger/pubspec.yaml +++ b/packages/deriv_logger/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_logger description: A debugging tool for deriv applications. -version: 0.0.1 +version: 0.0.2 environment: sdk: ">=3.0.2 <4.0.0" diff --git a/packages/update_checker/CHANGELOG.md b/packages/update_checker/CHANGELOG.md index b20c8edde..04eae25e0 100644 --- a/packages/update_checker/CHANGELOG.md +++ b/packages/update_checker/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.3.0 + + - **FEAT**(deriv_logger): add ability to print prettified logs in console and UI ([#608](https://github.com/regentmarkets/flutter-deriv-packages/issues/608)). ([5a91c24b](https://github.com/regentmarkets/flutter-deriv-packages/commit/5a91c24bde607ff37940edf18f8dfac67d3fc4fa)) + ## 1.2.2 - **FIX**(update_checker): fix optional update issue in remote config [#475](https://github.com/regentmarkets/flutter-deriv-packages/issues/475). ([ac0dc26b](https://github.com/regentmarkets/flutter-deriv-packages/commit/ac0dc26b46b478248ea81d1dba6b7c6844b88995)) diff --git a/packages/update_checker/pubspec.yaml b/packages/update_checker/pubspec.yaml index 9f0fde39d..ea68d1f23 100644 --- a/packages/update_checker/pubspec.yaml +++ b/packages/update_checker/pubspec.yaml @@ -1,6 +1,6 @@ name: update_checker description: Check and retrieve update information from the server for the given package. -version: 1.2.2 +version: 1.3.0 homepage: https://deriv.com/ publish_to: "none" From d86b51e2fe4ca4d18768d0ba17567a388a8d360d Mon Sep 17 00:00:00 2001 From: naif-deriv <112558231+naif-deriv@users.noreply.github.com> Date: Thu, 20 Jun 2024 13:54:33 +0400 Subject: [PATCH 100/162] feat(deriv_passkeys): add user tracking events. (#607) --- melos.yaml | 1 + packages/deriv_passkeys/example/lib/main.dart | 4 +- .../constants/analytics_actions_enums.dart | 59 +++ .../tracking_event_params_helper.dart | 158 +++++++ .../extensions/context_extensions.dart | 0 .../passkey_analytics_repository.dart | 286 ++++++++++++ .../base_passkey_analytics_repository.dart | 47 ++ .../mixins/passkey_event_tracking_mixin.dart | 65 +++ .../pages/effortless_passkeys_login_page.dart | 349 ++++++++------- .../pages/learn_more_passkeys_page.dart | 421 +++++++++--------- .../pages/manage_passkeys_page.dart | 196 ++++---- .../pages/passkey_created_page.dart | 12 +- .../states/bloc/deriv_passkeys_bloc.dart | 8 + .../utils/handle_errors_utils.dart | 2 +- .../presentation/utils/platform_utils.dart | 2 +- .../widgets/continue_with_passkey_button.dart | 5 + .../passkey_created_call_to_action.dart | 2 +- .../presentation/widgets/passkey_widget.dart | 2 +- packages/deriv_passkeys/pubspec.yaml | 10 + .../tracking_event_params_helper_test.dart | 277 ++++++++++++ .../passkey_analytics_repository_test.dart | 168 +++++++ .../passkey_event_tracking_mixin_test.dart | 146 ++++++ .../pages/learn_more_passkeys_page_test.dart | 28 +- .../bloc/deriv_passkeys_bloc_setup.dart | 11 +- .../continue_with_passkey_button_test.dart | 10 +- 25 files changed, 1795 insertions(+), 474 deletions(-) create mode 100644 packages/deriv_passkeys/lib/src/core/constants/analytics_actions_enums.dart create mode 100644 packages/deriv_passkeys/lib/src/core/constants/tracking_event_params_helper.dart rename packages/deriv_passkeys/lib/src/{ => core}/extensions/context_extensions.dart (100%) create mode 100644 packages/deriv_passkeys/lib/src/data/repositories/passkey_analytics_repository.dart create mode 100644 packages/deriv_passkeys/lib/src/domain/base_repositories/base_passkey_analytics_repository.dart create mode 100644 packages/deriv_passkeys/lib/src/presentation/mixins/passkey_event_tracking_mixin.dart create mode 100644 packages/deriv_passkeys/test/core/constants/tracking_event_params_helper_test.dart create mode 100644 packages/deriv_passkeys/test/data/passkey_analytics_repository_test.dart create mode 100644 packages/deriv_passkeys/test/presentation/mixins/passkey_event_tracking_mixin_test.dart diff --git a/melos.yaml b/melos.yaml index 8e75065c7..256370441 100644 --- a/melos.yaml +++ b/melos.yaml @@ -43,3 +43,4 @@ scripts: ignore: # Ignore until we have a proper test. - "deriv_feature_flag" + - "deriv_auth" diff --git a/packages/deriv_passkeys/example/lib/main.dart b/packages/deriv_passkeys/example/lib/main.dart index 4baf1c3f8..8047aeed3 100644 --- a/packages/deriv_passkeys/example/lib/main.dart +++ b/packages/deriv_passkeys/example/lib/main.dart @@ -89,7 +89,9 @@ class MyPage extends StatelessWidget { body: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - const ContinueWithPasskeyButton(), + ContinueWithPasskeyButton( + onTap: () {}, + ), SizedBox( width: double.infinity, child: Padding( diff --git a/packages/deriv_passkeys/lib/src/core/constants/analytics_actions_enums.dart b/packages/deriv_passkeys/lib/src/core/constants/analytics_actions_enums.dart new file mode 100644 index 000000000..4fa6a010b --- /dev/null +++ b/packages/deriv_passkeys/lib/src/core/constants/analytics_actions_enums.dart @@ -0,0 +1,59 @@ +/// The list of actions that can be performed on the Effortless page. +enum EffortlessPageActions { + /// The user opened the effortless login page. + openEffortlessLoginPage, + + /// The user closed the effortless login page. + closeEffortlessLoginPage, + + /// The user pressed the maybe later button. + maybeLater, +} + +/// The list of actions that can be performed on the Learn more page. +enum LearnMorePageActions { + /// The user opened the learn more page. + openLearnMorePage, + + /// The user closed the learn more page. + closeLearnMorePage, +} + +/// The list of actions that can be performed on the Create passkey page. +enum CreatePasskeyFlowActions { + /// The user pressed the create passkey button. + createPasskey, + + /// Create passkey success. + createPasskeySuccess, + + /// The user faces an error. + error, + + /// The user presses the continue trading button. + continueTrading, + + /// The user presses the add more passkeys button. + addMorePasskeys, +} + +/// The list of actions that can be performed on the Rename passkey page. +enum RenamePasskeyFlowActions { + /// The user presses the rename passkey button. + renamePasskey, + + /// The user cancels rename passkey. + cancelRenamePasskey, + + /// Rename passkey success. + renamePasskeySuccess, +} + +/// The list of actions that can be performed on the Manage Passkeys page. +enum ManagePasskeysPageActions { + /// The user opened the manage passkeys page. + openManagePasskeysPage, + + /// The user closed the manage passkeys page. + closeManagePasskeysPage, +} diff --git a/packages/deriv_passkeys/lib/src/core/constants/tracking_event_params_helper.dart b/packages/deriv_passkeys/lib/src/core/constants/tracking_event_params_helper.dart new file mode 100644 index 000000000..5693a7a83 --- /dev/null +++ b/packages/deriv_passkeys/lib/src/core/constants/tracking_event_params_helper.dart @@ -0,0 +1,158 @@ +import 'package:deriv_passkeys/src/core/constants/analytics_actions_enums.dart'; +import 'package:flutter/foundation.dart'; + +/// Platform type string. +String _platform = defaultTargetPlatform == TargetPlatform.android + ? 'Android' + : defaultTargetPlatform == TargetPlatform.iOS + ? 'IOS' + : 'other'; + +/// Function to get all the Effortless page params. +Map getEffortlessLoginTrackingParams(T eventName) => + switch (eventName) { + EffortlessPageActions.openEffortlessLoginPage => { + 'event_name': 'open', + 'params': { + 'form_name': 'ce_passkey_effortless_form_', + 'operating_system': _platform, + }, + }, + EffortlessPageActions.closeEffortlessLoginPage => { + 'event_name': 'close', + 'params': { + 'form_name': 'ce_passkey_effortless_form_', + 'operating_system': _platform, + }, + }, + EffortlessPageActions.maybeLater => { + 'event_name': 'maybe_later', + 'params': { + 'form_name': 'ce_passkey_effortless_form_', + 'operating_system': _platform, + }, + }, + _ => throw Exception('Invalid event name'), + }; + +/// Function to get all the Learn More page params. +Map getLearnMoreTrackingParams( + T eventName, + String mainFormName, +) => + switch (eventName) { + LearnMorePageActions.openLearnMorePage => { + 'event_name': 'info_open', + 'params': { + 'form_name': mainFormName, + 'operating_system': _platform, + }, + }, + LearnMorePageActions.closeLearnMorePage => { + 'event_name': 'info_back', + 'params': { + 'form_name': mainFormName, + 'operating_system': _platform, + }, + }, + _ => throw Exception('Invalid event name'), + }; + +/// Function to get all the Manage passkeys page params. +Map getManagePasskeysTrackingParams(T eventName) => + switch (eventName) { + ManagePasskeysPageActions.openManagePasskeysPage => { + 'event_name': 'open', + 'params': { + 'form_name': 'ce_passkey_account_settings_form_', + 'operating_system': _platform, + }, + }, + ManagePasskeysPageActions.closeManagePasskeysPage => { + 'event_name': 'close', + 'params': { + 'form_name': 'ce_passkey_account_settings_form_', + 'operating_system': _platform, + }, + }, + _ => throw Exception('Invalid event name'), + }; + +/// Function to get all the Create passkey page params. +Map getCreatePasskeyTrackingParams( + T eventName, { + String? mainFormName, + String? subFormName, + String? errorMessage, +}) => + switch (eventName) { + CreatePasskeyFlowActions.createPasskey => { + 'event_name': 'create_passkey_started', + 'params': { + 'form_name': mainFormName, + 'subform_name': subFormName, + 'operating_system': _platform, + }, + }, + CreatePasskeyFlowActions.createPasskeySuccess => { + 'event_name': 'create_passkey_finished', + 'params': { + 'form_name': mainFormName, + 'subform_name': subFormName, + 'operating_system': _platform, + }, + }, + CreatePasskeyFlowActions.error => { + 'event_name': 'error', + 'params': { + 'form_name': mainFormName, + 'subform_name': subFormName, + 'operating_system': _platform, + 'error_message': errorMessage, + }, + }, + CreatePasskeyFlowActions.continueTrading => { + 'event_name': 'create_passkey_continue_trading', + 'params': { + 'form_name': mainFormName, + 'subform_name': subFormName, + 'operating_system': _platform, + }, + }, + CreatePasskeyFlowActions.addMorePasskeys => { + 'event_name': 'create_passkey_add_more_passkeys', + 'params': { + 'form_name': mainFormName, + 'subform_name': subFormName, + 'operating_system': _platform, + }, + }, + _ => throw Exception('Invalid event name'), + }; + +/// Function to get all the Rename passkey page params. +Map getRenamePasskeyTrackingParams(T eventName) => + switch (eventName) { + RenamePasskeyFlowActions.renamePasskey => { + 'event_name': 'passkey_rename_open', + 'params': { + 'form_name': 'ce_passkey_account_settings_form_', + 'operating_system': _platform, + }, + }, + RenamePasskeyFlowActions.renamePasskeySuccess => { + 'event_name': 'passkey_rename_success', + 'params': { + 'form_name': 'ce_passkey_account_settings_form_', + 'operating_system': _platform, + }, + }, + RenamePasskeyFlowActions.cancelRenamePasskey => { + 'event_name': 'passkey_rename_back', + 'params': { + 'form_name': 'ce_passkey_account_settings_form_', + 'operating_system': _platform, + }, + }, + _ => throw Exception('Invalid event name'), + }; diff --git a/packages/deriv_passkeys/lib/src/extensions/context_extensions.dart b/packages/deriv_passkeys/lib/src/core/extensions/context_extensions.dart similarity index 100% rename from packages/deriv_passkeys/lib/src/extensions/context_extensions.dart rename to packages/deriv_passkeys/lib/src/core/extensions/context_extensions.dart diff --git a/packages/deriv_passkeys/lib/src/data/repositories/passkey_analytics_repository.dart b/packages/deriv_passkeys/lib/src/data/repositories/passkey_analytics_repository.dart new file mode 100644 index 000000000..a72f33172 --- /dev/null +++ b/packages/deriv_passkeys/lib/src/data/repositories/passkey_analytics_repository.dart @@ -0,0 +1,286 @@ +import 'package:analytics/sdk/rudderstack/sdk/deriv_rudderstack_sdk.dart'; +import 'package:deriv_passkeys/src/core/constants/analytics_actions_enums.dart'; +import 'package:deriv_passkeys/src/core/constants/tracking_event_params_helper.dart'; +import 'package:deriv_passkeys/src/domain/base_repositories/base_passkey_analytics_repository.dart'; + +/// [AnalyticsRepository] is an implementation of [BasePasskeyAnalyticsRepository]. +class AnalyticsRepository extends BasePasskeyAnalyticsRepository { + /// Constructor for [AnalyticsRepository]. + AnalyticsRepository._( + this._appId, { + required this.derivRudderstack, + }); + + static AnalyticsRepository? _instance; + + /// Singleton instance of [AnalyticsRepository]. + static AnalyticsRepository get instance => + _instance ??= throw Exception('AnalyticsRepository is not initialized'); + + /// Instance of [DerivRudderstack]. + final DerivRudderstack derivRudderstack; + + /// Initialize [AnalyticsRepository]. + static void init( + String appId, { + required DerivRudderstack derivRudderstack, + }) => + _instance = AnalyticsRepository._( + appId, + derivRudderstack: derivRudderstack, + ); + + String? _mainFormName; + + String? _subFormName; + + /// Deriv client app ID. + final String _appId; + + @override + void trackOpenEffortlessLoginPage() { + final Map trackingData = getEffortlessLoginTrackingParams( + EffortlessPageActions.openEffortlessLoginPage, + ); + + _mainFormName = trackingData['params']['form_name']; + _subFormName = 'passkey_effortless'; + + _addAppName(trackingData); + + derivRudderstack.track( + eventName: trackingData['event_name'], + properties: trackingData['params'], + ); + } + + @override + void trackCloseEffortlessLoginPage() { + final Map trackingData = getEffortlessLoginTrackingParams( + EffortlessPageActions.closeEffortlessLoginPage, + ); + + _addAppName(trackingData); + + derivRudderstack.track( + eventName: trackingData['event_name'], + properties: trackingData['params'], + ); + } + + @override + void trackMaybeLater() { + final Map trackingData = getEffortlessLoginTrackingParams( + EffortlessPageActions.maybeLater, + ); + + _addAppName(trackingData); + + derivRudderstack.track( + eventName: trackingData['event_name'], + properties: trackingData['params'], + ); + } + + @override + void trackOpenLearnMorePage() { + final Map trackingData = getLearnMoreTrackingParams( + LearnMorePageActions.openLearnMorePage, + _mainFormName ?? 'testing_main_form', + ); + + _subFormName = 'passkey_info'; + + _addAppName(trackingData); + + derivRudderstack.track( + eventName: trackingData['event_name'], + properties: trackingData['params'], + ); + } + + @override + void trackCloseLearnMorePage() { + final Map trackingData = getLearnMoreTrackingParams( + LearnMorePageActions.closeLearnMorePage, + _mainFormName ?? 'testing_main_form', + ); + + if (_mainFormName == null) { + _mainFormName = 'testing_main_form'; + } else { + _subFormName = _mainFormName!.contains('account_settings') + ? 'passkey_main' + : 'passkey_effortless'; + } + + _addAppName(trackingData); + + derivRudderstack.track( + eventName: trackingData['event_name'], + properties: trackingData['params'], + ); + } + + @override + void trackOpenManagePasskeysPage() { + final Map trackingData = getManagePasskeysTrackingParams( + ManagePasskeysPageActions.openManagePasskeysPage, + ); + + _mainFormName = trackingData['params']['form_name']; + _subFormName = 'passkey_main'; + + _addAppName(trackingData); + + derivRudderstack.track( + eventName: trackingData['event_name'], + properties: trackingData['params'], + ); + } + + @override + void trackCloseManagePasskeysPage() { + final Map trackingData = getManagePasskeysTrackingParams( + ManagePasskeysPageActions.closeManagePasskeysPage, + ); + + _addAppName(trackingData); + + derivRudderstack.track( + eventName: trackingData['event_name'], + properties: trackingData['params'], + ); + } + + @override + void trackCreatePasskey() { + final Map trackingData = getCreatePasskeyTrackingParams( + CreatePasskeyFlowActions.createPasskey, + mainFormName: _mainFormName, + subFormName: _subFormName, + ); + + _addAppName(trackingData); + + derivRudderstack.track( + eventName: trackingData['event_name'], + properties: trackingData['params'], + ); + } + + @override + void trackCreatePasskeySuccess() { + final Map trackingData = getCreatePasskeyTrackingParams( + CreatePasskeyFlowActions.createPasskeySuccess, + mainFormName: _mainFormName, + subFormName: _subFormName, + ); + + _addAppName(trackingData); + + derivRudderstack.track( + eventName: trackingData['event_name'], + properties: trackingData['params'], + ); + } + + @override + void trackPasskeyError(String errorMessage) { + final Map trackingData = getCreatePasskeyTrackingParams( + CreatePasskeyFlowActions.error, + mainFormName: _mainFormName, + subFormName: _subFormName, + errorMessage: errorMessage, + ); + + _addAppName(trackingData); + + derivRudderstack.track( + eventName: trackingData['event_name'], + properties: trackingData['params'], + ); + } + + @override + void trackContinueTrading() { + final Map trackingData = getCreatePasskeyTrackingParams( + CreatePasskeyFlowActions.continueTrading, + mainFormName: _mainFormName, + subFormName: _subFormName, + ); + + _addAppName(trackingData); + + derivRudderstack.track( + eventName: trackingData['event_name'], + properties: trackingData['params'], + ); + } + + @override + void trackAddMorePasskeys() { + final Map trackingData = getCreatePasskeyTrackingParams( + CreatePasskeyFlowActions.addMorePasskeys, + mainFormName: _mainFormName, + subFormName: _subFormName, + ); + + _addAppName(trackingData); + + derivRudderstack.track( + eventName: trackingData['event_name'], + properties: trackingData['params'], + ); + } + + @override + void trackRenamePasskey() { + final Map trackingData = getRenamePasskeyTrackingParams( + RenamePasskeyFlowActions.renamePasskey, + ); + + _addAppName(trackingData); + + derivRudderstack.track( + eventName: trackingData['event_name'], + properties: trackingData['params'], + ); + } + + @override + void trackCancelRenamePasskey() { + final Map trackingData = getRenamePasskeyTrackingParams( + RenamePasskeyFlowActions.cancelRenamePasskey, + ); + + _addAppName(trackingData); + + derivRudderstack.track( + eventName: trackingData['event_name'], + properties: trackingData['params'], + ); + } + + @override + void trackRenamePasskeySuccess() { + final Map trackingData = getRenamePasskeyTrackingParams( + RenamePasskeyFlowActions.renamePasskeySuccess, + ); + + _addAppName(trackingData); + + derivRudderstack.track( + eventName: trackingData['event_name'], + properties: trackingData['params'], + ); + } + + void _addAppName(Map data) { + data['params']['form_name'] += _appId == '23789' + ? 'derivgo' + : _appId == '1408' + ? 'p2p' + : 'unsupported'; + } +} diff --git a/packages/deriv_passkeys/lib/src/domain/base_repositories/base_passkey_analytics_repository.dart b/packages/deriv_passkeys/lib/src/domain/base_repositories/base_passkey_analytics_repository.dart new file mode 100644 index 000000000..e1a4addc1 --- /dev/null +++ b/packages/deriv_passkeys/lib/src/domain/base_repositories/base_passkey_analytics_repository.dart @@ -0,0 +1,47 @@ +/// [BasePasskeyAnalyticsRepository] defines the interface for analytics repositories. +abstract class BasePasskeyAnalyticsRepository { + /// Track opening effortless login page. + void trackOpenEffortlessLoginPage(); + + /// Track closing effortless login page. + void trackCloseEffortlessLoginPage(); + + /// Track pressing maybe later button. + void trackMaybeLater(); + + /// Track opening learn more page. + void trackOpenLearnMorePage(); + + /// Track closing learn more page. + void trackCloseLearnMorePage(); + + /// Track opening manage passkeys page. + void trackOpenManagePasskeysPage(); + + /// Track closing manage passkeys page. + void trackCloseManagePasskeysPage(); + + /// Track pressing create passkey button. + void trackCreatePasskey(); + + /// Track create passkey success. + void trackCreatePasskeySuccess(); + + /// Track passkey error. + void trackPasskeyError(String errorMessage); + + /// Track pressing continue trading button. + void trackContinueTrading(); + + /// Track pressing add more passkeys button. + void trackAddMorePasskeys(); + + /// Track pressing rename passkey button. + void trackRenamePasskey(); + + /// Track cancel rename passkey. + void trackCancelRenamePasskey(); + + /// Track rename passkey success. + void trackRenamePasskeySuccess(); +} diff --git a/packages/deriv_passkeys/lib/src/presentation/mixins/passkey_event_tracking_mixin.dart b/packages/deriv_passkeys/lib/src/presentation/mixins/passkey_event_tracking_mixin.dart new file mode 100644 index 000000000..b5a8a4e51 --- /dev/null +++ b/packages/deriv_passkeys/lib/src/presentation/mixins/passkey_event_tracking_mixin.dart @@ -0,0 +1,65 @@ +import 'package:deriv_passkeys/src/data/repositories/passkey_analytics_repository.dart'; +import 'package:deriv_passkeys/src/domain/base_repositories/base_passkey_analytics_repository.dart'; +import 'package:flutter/foundation.dart'; + +/// Mixin that provides analytics tracking functions. +mixin PasskeyEventTrackingMixin implements BasePasskeyAnalyticsRepository { + /// The analytics repository. + @visibleForTesting + BasePasskeyAnalyticsRepository get analyticsRepository => + AnalyticsRepository.instance; + + @override + void trackOpenEffortlessLoginPage() => + analyticsRepository.trackOpenEffortlessLoginPage(); + + @override + void trackCloseEffortlessLoginPage() => + analyticsRepository.trackCloseEffortlessLoginPage(); + + @override + void trackMaybeLater() => analyticsRepository.trackMaybeLater(); + + @override + void trackOpenLearnMorePage() => analyticsRepository.trackOpenLearnMorePage(); + + @override + void trackCloseLearnMorePage() => + analyticsRepository.trackCloseLearnMorePage(); + + @override + void trackOpenManagePasskeysPage() => + analyticsRepository.trackOpenManagePasskeysPage(); + + @override + void trackCloseManagePasskeysPage() => + analyticsRepository.trackCloseManagePasskeysPage(); + + @override + void trackCreatePasskey() => analyticsRepository.trackCreatePasskey(); + + @override + void trackCreatePasskeySuccess() => + analyticsRepository.trackCreatePasskeySuccess(); + + @override + void trackPasskeyError(String errorMessage) => + analyticsRepository.trackPasskeyError(errorMessage); + + @override + void trackContinueTrading() => analyticsRepository.trackContinueTrading(); + + @override + void trackAddMorePasskeys() => analyticsRepository.trackAddMorePasskeys(); + + @override + void trackRenamePasskey() => analyticsRepository.trackRenamePasskey(); + + @override + void trackCancelRenamePasskey() => + analyticsRepository.trackCancelRenamePasskey(); + + @override + void trackRenamePasskeySuccess() => + analyticsRepository.trackRenamePasskeySuccess(); +} diff --git a/packages/deriv_passkeys/lib/src/presentation/pages/effortless_passkeys_login_page.dart b/packages/deriv_passkeys/lib/src/presentation/pages/effortless_passkeys_login_page.dart index 69b03215e..7fd1f0f51 100644 --- a/packages/deriv_passkeys/lib/src/presentation/pages/effortless_passkeys_login_page.dart +++ b/packages/deriv_passkeys/lib/src/presentation/pages/effortless_passkeys_login_page.dart @@ -1,5 +1,6 @@ -import 'package:deriv_passkeys/src/extensions/context_extensions.dart'; +import 'package:deriv_passkeys/src/core/extensions/context_extensions.dart'; import 'package:deriv_passkeys/src/presentation/constants/assets.dart'; +import 'package:deriv_passkeys/src/presentation/mixins/passkey_event_tracking_mixin.dart'; import 'package:deriv_passkeys/src/presentation/pages/learn_more_passkeys_page.dart'; import 'package:deriv_passkeys/src/presentation/pages/passkey_created_page.dart'; import 'package:deriv_passkeys/src/presentation/states/bloc/deriv_passkeys_bloc.dart'; @@ -13,14 +14,17 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_svg/svg.dart'; /// A stateless widget to build the Effortless Passkeys page. -class EffortlessPasskeysPage extends StatelessWidget { +class EffortlessPasskeysPage extends StatelessWidget + with PasskeyEventTrackingMixin { /// Creates a [EffortlessPasskeysPage]. - const EffortlessPasskeysPage({ + EffortlessPasskeysPage({ required this.onPageClosed, required this.addMorePasskeysNavigationCallback, required this.continueTradingNavigationCallback, super.key, - }); + }) { + trackOpenEffortlessLoginPage(); + } /// The route name for the effortless passkeys page. static const String routeName = 'effortless_passkeys_page'; @@ -34,180 +38,207 @@ class EffortlessPasskeysPage extends StatelessWidget { /// Callback to be called when the flow is complete. final void Function(BuildContext context) onPageClosed; - /// - @override - Widget build(BuildContext context) => - BlocListener( - listener: (BuildContext context, DerivPasskeysState state) { - if (state is DerivPasskeysCreatedSuccessfullyState) { - Navigator.pushReplacement( - context, - MaterialPageRoute( - builder: (BuildContext context) => PasskeyCreatedPage( - onPageClose: onPageClosed, - bottomCallToAction: PasskeysCreatedCallToAction( - addMorePasskeysNavigationCallback: - addMorePasskeysNavigationCallback, - continueTradingNavigationCallback: - continueTradingNavigationCallback, - ), - )), - ); - } else if (state is DerivPasskeysErrorState) { - handlePasskeysError(context, state); - } + Widget build(BuildContext context) => WillPopScope( + onWillPop: () async { + trackCloseEffortlessLoginPage(); + return true; }, - child: Scaffold( - body: SafeArea( - child: LayoutBuilder( - builder: (_, BoxConstraints constraints) => - SingleChildScrollView( - child: ConstrainedBox( - constraints: BoxConstraints( - minWidth: constraints.maxWidth, - minHeight: constraints.maxHeight), - child: IntrinsicHeight( - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - alignment: Alignment.topRight, - child: Padding( - padding: const EdgeInsets.all(16), - child: TextButton( - onPressed: () => onPageClosed(context), - child: Text( - context - .derivPasskeysLocalizations.maybeLater - .toUpperCase(), - style: TextStyle( - color: context.theme.colors.coral, + child: BlocListener( + listener: (BuildContext context, DerivPasskeysState state) { + if (state is DerivPasskeysCreatedSuccessfullyState) { + Navigator.pushReplacement( + context, + MaterialPageRoute( + builder: (BuildContext context) => PasskeyCreatedPage( + onPageClose: (BuildContext context) { + onPageClosed(context); + }, + bottomCallToAction: PasskeysCreatedCallToAction( + addMorePasskeysNavigationCallback: + (BuildContext context) { + trackAddMorePasskeys(); + addMorePasskeysNavigationCallback(context); + }, + continueTradingNavigationCallback: + (BuildContext context) { + trackContinueTrading(); + continueTradingNavigationCallback(context); + }, + ), + )), + ); + } else if (state is DerivPasskeysErrorState) { + trackPasskeyError('${state.errorCode}: ${state.message}'); + handlePasskeysError(context, state); + } + }, + child: Scaffold( + body: SafeArea( + child: LayoutBuilder( + builder: (_, BoxConstraints constraints) => + SingleChildScrollView( + child: ConstrainedBox( + constraints: BoxConstraints( + minWidth: constraints.maxWidth, + minHeight: constraints.maxHeight), + child: IntrinsicHeight( + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + alignment: Alignment.topRight, + child: Padding( + padding: const EdgeInsets.all(16), + child: TextButton( + onPressed: () { + trackMaybeLater(); + onPageClosed(context); + }, + child: Text( + context.derivPasskeysLocalizations + .maybeLater + .toUpperCase(), + style: TextStyle( + color: context.theme.colors.coral, + ), ), ), ), ), - ), - Expanded( - child: Container( - padding: const EdgeInsets.symmetric( - horizontal: 24, vertical: 96), - child: Column( - mainAxisAlignment: - MainAxisAlignment.spaceEvenly, - children: [ - SvgPicture.asset( - Assets.effortlessPasskeysIcon, - package: 'deriv_passkeys', - ), - Text( - context.derivPasskeysLocalizations - .effortlessLoginWithPasskeys, - style: const TextStyle(fontSize: 20), - ), - const SizedBox( - height: 24, - ), - IconTextRowWidget( - assetName: Assets.fingerPrintIcon, - text: context.derivPasskeysLocalizations - .noNeedToRememberPassword, - ), - Divider( - color: context.theme.colors.hover, - ), - IconTextRowWidget( - assetName: Assets.syncIcon, - text: context.derivPasskeysLocalizations - .syncAcrossDevices, - ), - Divider( - color: context.theme.colors.hover, - ), - IconTextRowWidget( - assetName: Assets.lockIcon, - text: context.derivPasskeysLocalizations - .useYourBiometrics, - ), - Divider( - color: context.theme.colors.hover, - ), - SizedBox( - width: double.infinity, - child: RichText( - text: TextSpan( - children: [ - TextSpan( - text: - '${context.derivPasskeysLocalizations.learnMoreAboutPasskeys} ', - style: TextStyle( - color: context - .theme.colors.general, - )), - WidgetSpan( - alignment: - PlaceholderAlignment.middle, - child: InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (_) => - LearnMorePasskeysPage( - onPageClosed: - (BuildContext - context) { + Expanded( + child: Container( + padding: const EdgeInsets.symmetric( + horizontal: 24, vertical: 96), + child: Column( + mainAxisAlignment: + MainAxisAlignment.spaceEvenly, + children: [ + SvgPicture.asset( + Assets.effortlessPasskeysIcon, + package: 'deriv_passkeys', + ), + Text( + context.derivPasskeysLocalizations + .effortlessLoginWithPasskeys, + style: const TextStyle(fontSize: 20), + ), + const SizedBox( + height: 24, + ), + IconTextRowWidget( + assetName: Assets.fingerPrintIcon, + text: context + .derivPasskeysLocalizations + .noNeedToRememberPassword, + ), + Divider( + color: context.theme.colors.hover, + ), + IconTextRowWidget( + assetName: Assets.syncIcon, + text: context + .derivPasskeysLocalizations + .syncAcrossDevices, + ), + Divider( + color: context.theme.colors.hover, + ), + IconTextRowWidget( + assetName: Assets.lockIcon, + text: context + .derivPasskeysLocalizations + .useYourBiometrics, + ), + Divider( + color: context.theme.colors.hover, + ), + SizedBox( + width: double.infinity, + child: RichText( + text: TextSpan( + children: [ + TextSpan( + text: + '${context.derivPasskeysLocalizations.learnMoreAboutPasskeys} ', + style: TextStyle( + color: context + .theme.colors.general, + )), + WidgetSpan( + alignment: + PlaceholderAlignment + .middle, + child: InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute< + Widget>( + builder: (_) => LearnMorePasskeysPage( + onPageClosed: + (BuildContext + context) { Navigator.pop( context); - }, - addMorePasskeysNavigationCallback: - addMorePasskeysNavigationCallback, - continueTradingNavigationCallback: - continueTradingNavigationCallback, + }, addMorePasskeysNavigationCallback: + (BuildContext + context) { + trackAddMorePasskeys(); + addMorePasskeysNavigationCallback( + context); + }, continueTradingNavigationCallback: + (BuildContext + context) { + trackContinueTrading(); + continueTradingNavigationCallback( + context); + }), ), - ), - ); - }, - child: Text( - '${context.derivPasskeysLocalizations.here}.', - style: TextStyle( - color: context.theme - .colors.coral), + ); + }, + child: Text( + '${context.derivPasskeysLocalizations.here}.', + style: TextStyle( + color: context.theme + .colors.coral), + ), ), ), - ), - ], + ], + ), ), - ), - ) - ], + ) + ], + ), ), ), - ), - Container( - width: double.infinity, - child: Padding( - padding: const EdgeInsets.all(16), - child: PrimaryButton( - onPressed: () { - context.read().add( - DerivPasskeysCreateCredentialEvent()); - }, - child: Text( - context.derivPasskeysLocalizations - .createPasskey, - style: TextStyle( - color: context.theme.colors.prominent, + Container( + width: double.infinity, + child: Padding( + padding: const EdgeInsets.all(16), + child: PrimaryButton( + onPressed: () { + trackCreatePasskey(); + context.read().add( + DerivPasskeysCreateCredentialEvent()); + }, + child: Text( + context.derivPasskeysLocalizations + .createPasskey, + style: TextStyle( + color: context.theme.colors.prominent, + ), ), ), ), - ), - ) - ], + ) + ], + ), ), ), - ), - )), + )), + ), ), ), ); diff --git a/packages/deriv_passkeys/lib/src/presentation/pages/learn_more_passkeys_page.dart b/packages/deriv_passkeys/lib/src/presentation/pages/learn_more_passkeys_page.dart index d4cf3f49b..3dc033233 100644 --- a/packages/deriv_passkeys/lib/src/presentation/pages/learn_more_passkeys_page.dart +++ b/packages/deriv_passkeys/lib/src/presentation/pages/learn_more_passkeys_page.dart @@ -1,6 +1,7 @@ import 'package:deriv_passkeys/deriv_passkeys.dart'; -import 'package:deriv_passkeys/src/extensions/context_extensions.dart'; +import 'package:deriv_passkeys/src/core/extensions/context_extensions.dart'; import 'package:deriv_passkeys/src/presentation/constants/assets.dart'; +import 'package:deriv_passkeys/src/presentation/mixins/passkey_event_tracking_mixin.dart'; import 'package:deriv_passkeys/src/presentation/pages/passkey_created_page.dart'; import 'package:deriv_passkeys/src/presentation/widgets/passkey_created_call_to_action.dart'; import 'package:deriv_passkeys/src/presentation/widgets/section_title_and_content.dart'; @@ -12,14 +13,17 @@ import 'package:flutter_svg/svg.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; /// A stateless widget to build the Learn More Passkeys page. -class LearnMorePasskeysPage extends StatelessWidget { +class LearnMorePasskeysPage extends StatelessWidget + with PasskeyEventTrackingMixin { /// Creates a [LearnMorePasskeysPage]. - const LearnMorePasskeysPage({ + LearnMorePasskeysPage({ required this.onPageClosed, required this.addMorePasskeysNavigationCallback, required this.continueTradingNavigationCallback, super.key, - }); + }) { + trackOpenLearnMorePage(); + } /// Callback to be called when the flow is complete. final void Function(BuildContext context) onPageClosed; @@ -31,231 +35,238 @@ class LearnMorePasskeysPage extends StatelessWidget { final void Function(BuildContext context) continueTradingNavigationCallback; @override - Widget build(BuildContext context) => - BlocListener( - listener: (BuildContext context, DerivPasskeysState state) { - if (state is DerivPasskeysCreatedSuccessfullyState) { - Navigator.pop(context); - Navigator.pushReplacement( - context, - MaterialPageRoute( - builder: (BuildContext context) => PasskeyCreatedPage( - onPageClose: onPageClosed, - bottomCallToAction: PasskeysCreatedCallToAction( - addMorePasskeysNavigationCallback: - addMorePasskeysNavigationCallback, - continueTradingNavigationCallback: - continueTradingNavigationCallback, - ), - )), - ); - } + Widget build(BuildContext context) => WillPopScope( + onWillPop: () async { + trackCloseLearnMorePage(); + return true; }, - child: Scaffold( - appBar: AppBar(), - body: Column( - children: [ - Expanded( - child: SingleChildScrollView( - child: SafeArea( - child: Padding( - padding: const EdgeInsets.all(24), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.symmetric(horizontal: 14), - child: SvgPicture.asset( - Assets.effortlessPasskeysIcon, - package: 'deriv_passkeys', - ), + child: BlocListener( + listener: (BuildContext context, DerivPasskeysState state) { + if (state is DerivPasskeysCreatedSuccessfullyState) { + Navigator.pop(context); + Navigator.pushReplacement( + context, + MaterialPageRoute( + builder: (BuildContext context) => PasskeyCreatedPage( + onPageClose: onPageClosed, + bottomCallToAction: PasskeysCreatedCallToAction( + addMorePasskeysNavigationCallback: + addMorePasskeysNavigationCallback, + continueTradingNavigationCallback: + continueTradingNavigationCallback, ), - Padding( - padding: const EdgeInsets.symmetric(vertical: 24), - child: Text( - context - .derivPasskeysLocalizations.effortlessLogin, - style: const TextStyle(fontSize: 20), + )), + ); + } + }, + child: Scaffold( + appBar: AppBar(), + body: Column( + children: [ + Expanded( + child: SingleChildScrollView( + child: SafeArea( + child: Padding( + padding: const EdgeInsets.all(24), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: + const EdgeInsets.symmetric(horizontal: 14), + child: SvgPicture.asset( + Assets.effortlessPasskeysIcon, + package: 'deriv_passkeys', + ), ), - ), - SectionTitleAndContent( - title: context - .derivPasskeysLocalizations.whatArePasskeys, - texts: [ - context.derivPasskeysLocalizations - .whatArePasskeysDescriptionPoint1, - context.derivPasskeysLocalizations - .whatArePasskeysDescriptionPoint2 - ], - ), - Padding( - padding: const EdgeInsets.symmetric(vertical: 16), - child: Divider( - color: context.theme.colors.hover, + Padding( + padding: const EdgeInsets.symmetric(vertical: 24), + child: Text( + context + .derivPasskeysLocalizations.effortlessLogin, + style: const TextStyle(fontSize: 20), + ), ), - ), - SectionTitleAndContent( - title: - context.derivPasskeysLocalizations.whyPasskeys, - texts: [ - context.derivPasskeysLocalizations - .whyPasskeysDescription1, - context.derivPasskeysLocalizations - .whyPasskeysDescription2 - ], - ), - Padding( - padding: const EdgeInsets.symmetric(vertical: 16), - child: Divider( - color: context.theme.colors.hover, + SectionTitleAndContent( + title: context + .derivPasskeysLocalizations.whatArePasskeys, + texts: [ + context.derivPasskeysLocalizations + .whatArePasskeysDescriptionPoint1, + context.derivPasskeysLocalizations + .whatArePasskeysDescriptionPoint2 + ], ), - ), - SectionTitleAndContent( - title: context.read().isDp2p - ? context.derivPasskeysLocalizations - .p2pHowToCreatePasskey - : context.derivPasskeysLocalizations - .howToCreatePasskey, - texts: [ - context.read().isDp2p - ? context.derivPasskeysLocalizations - .p2pHowToCreatePasskeyDescription1 - : context.derivPasskeysLocalizations - .howToCreatePasskeyDescription1, - context.read().isDp2p + Padding( + padding: const EdgeInsets.symmetric(vertical: 16), + child: Divider( + color: context.theme.colors.hover, + ), + ), + SectionTitleAndContent( + title: context + .derivPasskeysLocalizations.whyPasskeys, + texts: [ + context.derivPasskeysLocalizations + .whyPasskeysDescription1, + context.derivPasskeysLocalizations + .whyPasskeysDescription2 + ], + ), + Padding( + padding: const EdgeInsets.symmetric(vertical: 16), + child: Divider( + color: context.theme.colors.hover, + ), + ), + SectionTitleAndContent( + title: context.read().isDp2p ? context.derivPasskeysLocalizations - .p2pHowToCreatePasskeyDescription2 + .p2pHowToCreatePasskey : context.derivPasskeysLocalizations - .howToCreatePasskeyDescription2 - ], - ), - Padding( - padding: const EdgeInsets.symmetric(vertical: 16), - child: Divider( - color: context.theme.colors.hover, + .howToCreatePasskey, + texts: [ + context.read().isDp2p + ? context.derivPasskeysLocalizations + .p2pHowToCreatePasskeyDescription1 + : context.derivPasskeysLocalizations + .howToCreatePasskeyDescription1, + context.read().isDp2p + ? context.derivPasskeysLocalizations + .p2pHowToCreatePasskeyDescription2 + : context.derivPasskeysLocalizations + .howToCreatePasskeyDescription2 + ], ), - ), - SectionTitleAndContent( - title: context.derivPasskeysLocalizations - .whereArePasskeysSaved, - texts: [ - context.derivPasskeysLocalizations - .whereArePasskeysSavedDescriptionAndroid, - context.derivPasskeysLocalizations - .whereArePasskeysSavedDescriptionIOS - ], - ), - Padding( - padding: const EdgeInsets.symmetric(vertical: 16), - child: Divider( - color: context.theme.colors.hover, + Padding( + padding: const EdgeInsets.symmetric(vertical: 16), + child: Divider( + color: context.theme.colors.hover, + ), ), - ), - SectionTitleAndContent( - title: context.derivPasskeysLocalizations - .whatHappensIfEmailChanged, - texts: [ - context.derivPasskeysLocalizations - .whatHappensIfEmailChangedDescription1, - context.derivPasskeysLocalizations - .whatHappensIfEmailChangedDescription2 - ], - ), - Container( - width: double.infinity, - padding: const EdgeInsets.all(16), - margin: const EdgeInsets.only(top: 16), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8), - border: Border.all( - color: context.theme.colors.active, + SectionTitleAndContent( + title: context.derivPasskeysLocalizations + .whereArePasskeysSaved, + texts: [ + context.derivPasskeysLocalizations + .whereArePasskeysSavedDescriptionAndroid, + context.derivPasskeysLocalizations + .whereArePasskeysSavedDescriptionIOS + ], + ), + Padding( + padding: const EdgeInsets.symmetric(vertical: 16), + child: Divider( + color: context.theme.colors.hover, ), ), - child: FittedBox( - fit: BoxFit.scaleDown, - alignment: Alignment.centerLeft, - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SvgPicture.asset( - Assets.lightBulbIcon, - package: 'deriv_passkeys', - ), - const SizedBox( - width: 8, - ), - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - '${context.derivPasskeysLocalizations.tips}:', - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w500, - color: context.theme.colors.prominent, + SectionTitleAndContent( + title: context.derivPasskeysLocalizations + .whatHappensIfEmailChanged, + texts: [ + context.derivPasskeysLocalizations + .whatHappensIfEmailChangedDescription1, + context.derivPasskeysLocalizations + .whatHappensIfEmailChangedDescription2 + ], + ), + Container( + width: double.infinity, + padding: const EdgeInsets.all(16), + margin: const EdgeInsets.only(top: 16), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + border: Border.all( + color: context.theme.colors.active, + ), + ), + child: FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerLeft, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SvgPicture.asset( + Assets.lightBulbIcon, + package: 'deriv_passkeys', + ), + const SizedBox( + width: 8, + ), + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + '${context.derivPasskeysLocalizations.tips}:', + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w500, + color: + context.theme.colors.prominent, + ), + ), + Text( + '${context.derivPasskeysLocalizations.beforeUsingPasskeys}:', + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w500, + color: context.theme.colors.general, + ), ), - ), - Text( - '${context.derivPasskeysLocalizations.beforeUsingPasskeys}:', - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.w500, - color: context.theme.colors.general, + const SizedBox( + height: 4, ), - ), - const SizedBox( - height: 4, - ), - UnorderedList( - texts: [ - context.derivPasskeysLocalizations - .enableScreenLock, - context.derivPasskeysLocalizations - .signInGoogleOrIcloud, - context.derivPasskeysLocalizations - .enableBluetooth - ], - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.w500, - color: context.theme.colors.general, + UnorderedList( + texts: [ + context.derivPasskeysLocalizations + .enableScreenLock, + context.derivPasskeysLocalizations + .signInGoogleOrIcloud, + context.derivPasskeysLocalizations + .enableBluetooth + ], + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w500, + color: context.theme.colors.general, + ), ), - ), - ], - ), - ], + ], + ), + ], + ), ), ), - ), - ], + ], + ), ), ), ), ), - ), - Container( - color: context.theme.colors.secondary, - width: double.infinity, - child: Padding( - padding: const EdgeInsets.only( - left: 24, right: 24, bottom: 24, top: 16), - child: PrimaryButton( - onPressed: () { - context - .read() - .add(DerivPasskeysCreateCredentialEvent()); - }, - child: Text( - context.derivPasskeysLocalizations.createPasskey, - style: TextStyle( - color: context.theme.colors.prominent, + Container( + color: context.theme.colors.secondary, + width: double.infinity, + child: Padding( + padding: const EdgeInsets.only( + left: 24, right: 24, bottom: 24, top: 16), + child: PrimaryButton( + onPressed: () { + context + .read() + .add(DerivPasskeysCreateCredentialEvent()); + }, + child: Text( + context.derivPasskeysLocalizations.createPasskey, + style: TextStyle( + color: context.theme.colors.prominent, + ), ), ), ), ), - ), - ], + ], + ), ), ), ); diff --git a/packages/deriv_passkeys/lib/src/presentation/pages/manage_passkeys_page.dart b/packages/deriv_passkeys/lib/src/presentation/pages/manage_passkeys_page.dart index fa28503bb..86071a04b 100644 --- a/packages/deriv_passkeys/lib/src/presentation/pages/manage_passkeys_page.dart +++ b/packages/deriv_passkeys/lib/src/presentation/pages/manage_passkeys_page.dart @@ -1,5 +1,6 @@ -import 'package:deriv_passkeys/src/extensions/context_extensions.dart'; +import 'package:deriv_passkeys/src/core/extensions/context_extensions.dart'; import 'package:deriv_passkeys/src/presentation/constants/assets.dart'; +import 'package:deriv_passkeys/src/presentation/mixins/passkey_event_tracking_mixin.dart'; import 'package:deriv_passkeys/src/presentation/pages/learn_more_passkeys_page.dart'; import 'package:deriv_passkeys/src/presentation/pages/passkey_created_page.dart'; import 'package:deriv_passkeys/src/presentation/states/bloc/deriv_passkeys_bloc.dart'; @@ -34,110 +35,137 @@ class ManagePasskeysPage extends StatefulWidget { State createState() => _ManagePasskeysPageState(); } -class _ManagePasskeysPageState extends State { +class _ManagePasskeysPageState extends State + with PasskeyEventTrackingMixin { @override void initState() { super.initState(); + trackOpenManagePasskeysPage(); context .read() .add(const DerivPasskeysGetPasskeysListEvent()); } @override - Widget build(BuildContext context) => Scaffold( - backgroundColor: context.theme.colors.primary, - appBar: AppBar( - title: const Text('Passkeys', style: TextStyle(fontSize: 20)), - actions: [ - InkWell( - child: Padding( - padding: const EdgeInsets.all(16), - child: SvgPicture.asset( - Assets.learnMorePasskeysIcon, - package: 'deriv_passkeys', + Widget build(BuildContext context) => WillPopScope( + onWillPop: () async { + trackCloseManagePasskeysPage(); + return true; + }, + child: Scaffold( + backgroundColor: context.theme.colors.primary, + appBar: AppBar( + title: const Text('Passkeys', style: TextStyle(fontSize: 20)), + actions: [ + InkWell( + child: Padding( + padding: const EdgeInsets.all(16), + child: SvgPicture.asset( + Assets.learnMorePasskeysIcon, + package: 'deriv_passkeys', + ), ), - ), - onTap: () { - Navigator.push( - context, - MaterialPageRoute( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( builder: (BuildContext context) => LearnMorePasskeysPage( - onPageClosed: (BuildContext context) { - Navigator.pop(context); - }, - addMorePasskeysNavigationCallback: - widget.addMorePasskeysNavigationCallback, - continueTradingNavigationCallback: - widget.continueTradingNavigationCallback, - )), - ); - }, - ), - ], - ), - body: BlocConsumer( - listener: (BuildContext context, DerivPasskeysState state) { - if (state is DerivPasskeysCreatedSuccessfullyState) { - Navigator.push( - context, - MaterialPageRoute( - builder: (BuildContext context) => PasskeyCreatedPage( - onPageClose: (BuildContext context) { + onPageClosed: (BuildContext context) { Navigator.pop(context); }, - bottomCallToAction: PasskeysCreatedCallToAction( - addMorePasskeysNavigationCallback: - widget.addMorePasskeysNavigationCallback, - continueTradingNavigationCallback: - widget.continueTradingNavigationCallback, - ), - )), - ); - } else if (state is DerivPasskeysErrorState) { - handlePasskeysError(context, state); - } - }, builder: (BuildContext context, DerivPasskeysState state) { - if (state is DerivPasskeysLoadedState) { - return SafeArea( - child: SizedBox( - width: double.infinity, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - _buildDerivPasskeysLoadedContent( - context, - state, + addMorePasskeysNavigationCallback: + (BuildContext context) { + trackAddMorePasskeys(); + widget.addMorePasskeysNavigationCallback(context); + }, + continueTradingNavigationCallback: + (BuildContext context) { + trackContinueTrading(); + widget.continueTradingNavigationCallback(context); + }, + ), ), - Container( - width: double.infinity, - child: Padding( - padding: const EdgeInsets.all(16), - child: PrimaryButton( - onPressed: () { - context - .read() - .add(DerivPasskeysCreateCredentialEvent()); - }, - child: Text( - context.derivPasskeysLocalizations.createPasskey, - style: TextStyle( - color: context.theme.colors.prominent, + ); + }, + ), + ], + ), + body: BlocConsumer( + listener: (BuildContext context, DerivPasskeysState state) { + if (state is DerivPasskeysCreatedSuccessfullyState) { + trackCreatePasskeySuccess(); + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => PasskeyCreatedPage( + onPageClose: (BuildContext context) { + Navigator.pop(context); + }, + bottomCallToAction: PasskeysCreatedCallToAction( + addMorePasskeysNavigationCallback: + (BuildContext context) { + trackAddMorePasskeys(); + widget.addMorePasskeysNavigationCallback(context); + }, + continueTradingNavigationCallback: + (BuildContext context) { + trackContinueTrading(); + widget.continueTradingNavigationCallback(context); + }, + ), + ), + ), + ); + } else if (state is DerivPasskeysErrorState) { + trackPasskeyError('${state.errorCode}: ${state.message}'); + handlePasskeysError(context, state); + } + }, builder: (BuildContext context, DerivPasskeysState state) { + if (state is DerivPasskeysLoadedState) { + return SafeArea( + child: SizedBox( + width: double.infinity, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + _buildDerivPasskeysLoadedContent( + context, + state, + ), + Container( + width: double.infinity, + child: Padding( + padding: const EdgeInsets.all(16), + child: PrimaryButton( + onPressed: () { + trackCreatePasskey(); + context + .read() + .add(DerivPasskeysCreateCredentialEvent()); + }, + child: Text( + context.derivPasskeysLocalizations.createPasskey, + style: TextStyle( + color: context.theme.colors.prominent, + ), ), ), ), - ), - ) - ], + ) + ], + ), ), - ), - ); - } - return const SizedBox(); - }), + ); + } + return const SizedBox(); + }), + ), ); Widget _buildDerivPasskeysListContent( - BuildContext context, DerivPasskeysLoadedState state) => + BuildContext context, + DerivPasskeysLoadedState state, + ) => Expanded( child: Padding( padding: const EdgeInsets.all(24), diff --git a/packages/deriv_passkeys/lib/src/presentation/pages/passkey_created_page.dart b/packages/deriv_passkeys/lib/src/presentation/pages/passkey_created_page.dart index b9000812e..db9b0c3fc 100644 --- a/packages/deriv_passkeys/lib/src/presentation/pages/passkey_created_page.dart +++ b/packages/deriv_passkeys/lib/src/presentation/pages/passkey_created_page.dart @@ -1,18 +1,22 @@ -import 'package:deriv_passkeys/src/extensions/context_extensions.dart'; +import 'package:deriv_passkeys/src/core/extensions/context_extensions.dart'; import 'package:deriv_passkeys/src/presentation/constants/assets.dart'; +import 'package:deriv_passkeys/src/presentation/mixins/passkey_event_tracking_mixin.dart'; import 'package:deriv_passkeys/src/presentation/utils/platform_utils.dart'; import 'package:deriv_theme/deriv_theme.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; /// A stateless widget to build the passkey created successfully page. -class PasskeyCreatedPage extends StatelessWidget { +class PasskeyCreatedPage extends StatelessWidget + with PasskeyEventTrackingMixin { /// Creates a [PasskeyCreatedPage]. - const PasskeyCreatedPage({ + PasskeyCreatedPage({ required this.onPageClose, required this.bottomCallToAction, super.key, - }); + }) { + trackCreatePasskeySuccess(); + } /// A callback function that will be called when the user clicks on the 'Continue' button. final void Function(BuildContext context) onPageClose; diff --git a/packages/deriv_passkeys/lib/src/presentation/states/bloc/deriv_passkeys_bloc.dart b/packages/deriv_passkeys/lib/src/presentation/states/bloc/deriv_passkeys_bloc.dart index cbe09a784..ea167db91 100644 --- a/packages/deriv_passkeys/lib/src/presentation/states/bloc/deriv_passkeys_bloc.dart +++ b/packages/deriv_passkeys/lib/src/presentation/states/bloc/deriv_passkeys_bloc.dart @@ -1,5 +1,7 @@ import 'dart:io'; +import 'package:analytics/sdk/rudderstack/sdk/deriv_rudderstack_sdk.dart'; +import 'package:deriv_passkeys/src/data/repositories/passkey_analytics_repository.dart'; import 'package:deriv_passkeys/src/exceptions/platform_exceptions.dart'; import 'package:deriv_passkeys/src/domain/entities/passkeys_connection_info_entity.dart'; import 'package:deriv_passkeys/src/domain/entities/deriv_passkey_entity.dart'; @@ -145,6 +147,12 @@ class DerivPasskeysBloc extends Bloc { add(const SetDerivPasskeysNotSupportedEvent()); } }); + + /// Initialize the analytics repository. + AnalyticsRepository.init( + connectionInfo.appId, + derivRudderstack: DerivRudderstack(), + ); } /// Passkeys connection info entity. diff --git a/packages/deriv_passkeys/lib/src/presentation/utils/handle_errors_utils.dart b/packages/deriv_passkeys/lib/src/presentation/utils/handle_errors_utils.dart index 192db00e2..7358e6d8f 100644 --- a/packages/deriv_passkeys/lib/src/presentation/utils/handle_errors_utils.dart +++ b/packages/deriv_passkeys/lib/src/presentation/utils/handle_errors_utils.dart @@ -1,6 +1,6 @@ //handlePasskeysError import 'package:deriv_passkeys/deriv_passkeys.dart'; -import 'package:deriv_passkeys/src/extensions/context_extensions.dart'; +import 'package:deriv_passkeys/src/core/extensions/context_extensions.dart'; import 'package:deriv_ui/widgets/popup_alert_dialog.dart'; import 'package:flutter/material.dart'; diff --git a/packages/deriv_passkeys/lib/src/presentation/utils/platform_utils.dart b/packages/deriv_passkeys/lib/src/presentation/utils/platform_utils.dart index 4dbd2c265..1e217a7e9 100644 --- a/packages/deriv_passkeys/lib/src/presentation/utils/platform_utils.dart +++ b/packages/deriv_passkeys/lib/src/presentation/utils/platform_utils.dart @@ -1,6 +1,6 @@ import 'dart:io'; -import 'package:deriv_passkeys/src/extensions/context_extensions.dart'; +import 'package:deriv_passkeys/src/core/extensions/context_extensions.dart'; import 'package:flutter/widgets.dart'; /// Returns the platform name. diff --git a/packages/deriv_passkeys/lib/src/presentation/widgets/continue_with_passkey_button.dart b/packages/deriv_passkeys/lib/src/presentation/widgets/continue_with_passkey_button.dart index ff9a58655..9bbfa6ca0 100644 --- a/packages/deriv_passkeys/lib/src/presentation/widgets/continue_with_passkey_button.dart +++ b/packages/deriv_passkeys/lib/src/presentation/widgets/continue_with_passkey_button.dart @@ -11,9 +11,13 @@ import 'package:flutter_bloc/flutter_bloc.dart'; class ContinueWithPasskeyButton extends StatelessWidget { /// constructs a [ContinueWithPasskeyButton] const ContinueWithPasskeyButton({ + required this.onTap, super.key, }); + /// Function to handle on tap event. + final VoidCallback onTap; + @override Widget build(BuildContext context) => BlocConsumer( @@ -71,6 +75,7 @@ class ContinueWithPasskeyButton extends StatelessWidget { ), ), onTap: () async { + onTap(); context .read() .add(DerivPasskeysVerifyCredentialEvent()); diff --git a/packages/deriv_passkeys/lib/src/presentation/widgets/passkey_created_call_to_action.dart b/packages/deriv_passkeys/lib/src/presentation/widgets/passkey_created_call_to_action.dart index 50591285c..2555e0bf1 100644 --- a/packages/deriv_passkeys/lib/src/presentation/widgets/passkey_created_call_to_action.dart +++ b/packages/deriv_passkeys/lib/src/presentation/widgets/passkey_created_call_to_action.dart @@ -1,4 +1,4 @@ -import 'package:deriv_passkeys/src/extensions/context_extensions.dart'; +import 'package:deriv_passkeys/src/core/extensions/context_extensions.dart'; import 'package:deriv_theme/deriv_theme.dart'; import 'package:deriv_ui/deriv_ui.dart'; import 'package:flutter/material.dart'; diff --git a/packages/deriv_passkeys/lib/src/presentation/widgets/passkey_widget.dart b/packages/deriv_passkeys/lib/src/presentation/widgets/passkey_widget.dart index f6d1a7340..5b7f954f5 100644 --- a/packages/deriv_passkeys/lib/src/presentation/widgets/passkey_widget.dart +++ b/packages/deriv_passkeys/lib/src/presentation/widgets/passkey_widget.dart @@ -1,5 +1,5 @@ import 'package:deriv_passkeys/src/domain/entities/deriv_passkey_entity.dart'; -import 'package:deriv_passkeys/src/extensions/context_extensions.dart'; +import 'package:deriv_passkeys/src/core/extensions/context_extensions.dart'; import 'package:deriv_passkeys/src/presentation/constants/assets.dart'; import 'package:deriv_passkeys/src/presentation/utils/date_time_utils.dart'; import 'package:deriv_theme/deriv_theme.dart'; diff --git a/packages/deriv_passkeys/pubspec.yaml b/packages/deriv_passkeys/pubspec.yaml index a5fe81267..a4c7ecab5 100644 --- a/packages/deriv_passkeys/pubspec.yaml +++ b/packages/deriv_passkeys/pubspec.yaml @@ -10,26 +10,36 @@ dependencies: flutter: sdk: flutter + analytics: + git: + url: git@github.com:regentmarkets/flutter-deriv-packages.git + path: packages/analytics + ref: analytics-v2.0.0 + deriv_theme: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_theme ref: deriv_theme-v2.5.0 + deriv_localizations: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_localizations ref: deriv_localizations-v1.4.4 + deriv_ui: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui ref: deriv_ui-v0.0.7+6 + deriv_http_client: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_http_client ref: deriv_http_client-v2.0.1 + flutter_deriv_api: git: url: git@github.com:deriv-com/flutter-deriv-api.git diff --git a/packages/deriv_passkeys/test/core/constants/tracking_event_params_helper_test.dart b/packages/deriv_passkeys/test/core/constants/tracking_event_params_helper_test.dart new file mode 100644 index 000000000..183505ba9 --- /dev/null +++ b/packages/deriv_passkeys/test/core/constants/tracking_event_params_helper_test.dart @@ -0,0 +1,277 @@ +import 'package:deriv_passkeys/src/core/constants/analytics_actions_enums.dart'; +import 'package:deriv_passkeys/src/core/constants/tracking_event_params_helper.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + group('getTrackingParams tests:\n\t', () { + group('efforless login flow -> ', () { + test('should return correct params for openEffortlessLoginPage', () { + debugDefaultTargetPlatformOverride = TargetPlatform.iOS; + + final Map result = getEffortlessLoginTrackingParams( + EffortlessPageActions.openEffortlessLoginPage, + ); + + expect(result, { + 'event_name': 'open', + 'params': { + 'form_name': 'ce_passkey_effortless_form_', + 'operating_system': 'IOS', + }, + }); + }); + + test('should return correct params for closeEffortlessLoginPage', () { + debugDefaultTargetPlatformOverride = TargetPlatform.iOS; + + final Map result = getEffortlessLoginTrackingParams( + EffortlessPageActions.closeEffortlessLoginPage, + ); + + expect(result, { + 'event_name': 'close', + 'params': { + 'form_name': 'ce_passkey_effortless_form_', + 'operating_system': 'IOS', + }, + }); + }); + + test('should return correct params for maybeLater', () { + debugDefaultTargetPlatformOverride = TargetPlatform.iOS; + + final Map result = getEffortlessLoginTrackingParams( + EffortlessPageActions.maybeLater, + ); + + expect(result, { + 'event_name': 'maybe_later', + 'params': { + 'form_name': 'ce_passkey_effortless_form_', + 'operating_system': 'IOS', + }, + }); + }); + }); + + group('tracking learn more page actions ->', () { + test('should return correct params for openLearnMorePage', () { + debugDefaultTargetPlatformOverride = TargetPlatform.iOS; + + final Map result = getLearnMoreTrackingParams( + LearnMorePageActions.openLearnMorePage, + 'main_form_name', + ); + + expect(result, { + 'event_name': 'info_open', + 'params': { + 'form_name': 'main_form_name', + 'operating_system': 'IOS', + }, + }); + }); + + test('should return correct params for closeLearnMorePage', () { + debugDefaultTargetPlatformOverride = TargetPlatform.iOS; + + final Map result = getLearnMoreTrackingParams( + LearnMorePageActions.closeLearnMorePage, + 'main_form_name', + ); + + expect(result, { + 'event_name': 'info_back', + 'params': { + 'form_name': 'main_form_name', + 'operating_system': 'IOS', + }, + }); + }); + }); + + group('tracking manage passkeys page actions ->', () { + test('should return correct params for openManagePasskeysPage', () { + debugDefaultTargetPlatformOverride = TargetPlatform.iOS; + + final Map result = getManagePasskeysTrackingParams( + ManagePasskeysPageActions.openManagePasskeysPage, + ); + + expect(result, { + 'event_name': 'open', + 'params': { + 'form_name': 'ce_passkey_account_settings_form_', + 'operating_system': 'IOS', + }, + }); + }); + + test('should return correct params for closeManagePasskeysPage', () { + debugDefaultTargetPlatformOverride = TargetPlatform.iOS; + + final Map result = getManagePasskeysTrackingParams( + ManagePasskeysPageActions.closeManagePasskeysPage, + ); + + expect(result, { + 'event_name': 'close', + 'params': { + 'form_name': 'ce_passkey_account_settings_form_', + 'operating_system': 'IOS', + }, + }); + }); + }); + + group('tracking create passkey actions ->', () { + test('should return correct params for createPasskey', () { + debugDefaultTargetPlatformOverride = TargetPlatform.iOS; + + final Map result = getCreatePasskeyTrackingParams( + CreatePasskeyFlowActions.createPasskey, + mainFormName: 'main_form_name', + subFormName: 'sub_form_name', + ); + + expect(result, { + 'event_name': 'create_passkey_started', + 'params': { + 'form_name': 'main_form_name', + 'subform_name': 'sub_form_name', + 'operating_system': 'IOS', + }, + }); + }); + + test('should return correct params for createPasskeySuccess', () { + debugDefaultTargetPlatformOverride = TargetPlatform.iOS; + + final Map result = getCreatePasskeyTrackingParams( + CreatePasskeyFlowActions.createPasskeySuccess, + mainFormName: 'main_form_name', + subFormName: 'sub_form_name', + ); + + expect(result, { + 'event_name': 'create_passkey_finished', + 'params': { + 'form_name': 'main_form_name', + 'subform_name': 'sub_form_name', + 'operating_system': 'IOS', + }, + }); + }); + + test('should return correct params for error', () { + debugDefaultTargetPlatformOverride = TargetPlatform.iOS; + + final Map result = getCreatePasskeyTrackingParams( + CreatePasskeyFlowActions.error, + mainFormName: 'main_form_name', + subFormName: 'sub_form_name', + errorMessage: 'error_message', + ); + + expect(result, { + 'event_name': 'error', + 'params': { + 'form_name': 'main_form_name', + 'subform_name': 'sub_form_name', + 'error_message': 'error_message', + 'operating_system': 'IOS', + }, + }); + }); + + test('should return correct params for continueTrading', () { + debugDefaultTargetPlatformOverride = TargetPlatform.iOS; + + final Map result = getCreatePasskeyTrackingParams( + CreatePasskeyFlowActions.continueTrading, + mainFormName: 'main_form_name', + subFormName: 'sub_form_name', + ); + + expect(result, { + 'event_name': 'create_passkey_continue_trading', + 'params': { + 'form_name': 'main_form_name', + 'subform_name': 'sub_form_name', + 'operating_system': 'IOS', + }, + }); + }); + + test('should return correct params for addMorePasskeys', () { + debugDefaultTargetPlatformOverride = TargetPlatform.iOS; + + final Map result = getCreatePasskeyTrackingParams( + CreatePasskeyFlowActions.addMorePasskeys, + mainFormName: 'main_form_name', + subFormName: 'sub_form_name', + ); + + expect(result, { + 'event_name': 'create_passkey_add_more_passkeys', + 'params': { + 'form_name': 'main_form_name', + 'subform_name': 'sub_form_name', + 'operating_system': 'IOS', + }, + }); + }); + }); + + group('tracking rename passkey page actions ->', () { + test('should return correct params for renamePasskey', () { + debugDefaultTargetPlatformOverride = TargetPlatform.iOS; + + final Map result = getRenamePasskeyTrackingParams( + RenamePasskeyFlowActions.renamePasskey, + ); + + expect(result, { + 'event_name': 'passkey_rename_open', + 'params': { + 'form_name': 'ce_passkey_account_settings_form_', + 'operating_system': 'IOS', + }, + }); + }); + + test('should return correct params for cancelRenamePasskey', () { + debugDefaultTargetPlatformOverride = TargetPlatform.iOS; + + final Map result = getRenamePasskeyTrackingParams( + RenamePasskeyFlowActions.cancelRenamePasskey, + ); + + expect(result, { + 'event_name': 'passkey_rename_back', + 'params': { + 'form_name': 'ce_passkey_account_settings_form_', + 'operating_system': 'IOS', + }, + }); + }); + + test('should return correct params for renamePasskeySuccess', () { + debugDefaultTargetPlatformOverride = TargetPlatform.iOS; + + final Map result = getRenamePasskeyTrackingParams( + RenamePasskeyFlowActions.renamePasskeySuccess, + ); + + expect(result, { + 'event_name': 'passkey_rename_success', + 'params': { + 'form_name': 'ce_passkey_account_settings_form_', + 'operating_system': 'IOS', + }, + }); + }); + }); + }); +} diff --git a/packages/deriv_passkeys/test/data/passkey_analytics_repository_test.dart b/packages/deriv_passkeys/test/data/passkey_analytics_repository_test.dart new file mode 100644 index 000000000..3ea8f51fc --- /dev/null +++ b/packages/deriv_passkeys/test/data/passkey_analytics_repository_test.dart @@ -0,0 +1,168 @@ +import 'package:analytics/sdk/rudderstack/sdk/deriv_rudderstack_sdk.dart'; +import 'package:deriv_passkeys/src/data/repositories/passkey_analytics_repository.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mocktail/mocktail.dart'; + +final class MockDerivRudderstack extends Mock implements DerivRudderstack {} + +void main() { + group('AnalyticsRepository test.', () { + /// [AnalyticsRepository] instance. + late final AnalyticsRepository analyticsRepository; + + /// [MockDerivRudderstack] instance. + late final MockDerivRudderstack mockDerivRudderstack; + + setUpAll(() { + mockDerivRudderstack = MockDerivRudderstack(); + + when(() => mockDerivRudderstack.track( + eventName: any(named: 'eventName'), + properties: any(named: 'properties'), + )).thenAnswer( + (_) => Future.value(true), + ); + + AnalyticsRepository.init( + 'test', + derivRudderstack: mockDerivRudderstack, + ); + + analyticsRepository = AnalyticsRepository.instance; + }); + + test('should track opening effortlessLoginPage.', () { + analyticsRepository.trackOpenEffortlessLoginPage(); + + verify(() => mockDerivRudderstack.track( + eventName: any(named: 'eventName'), + properties: any(named: 'properties'), + )).called(1); + }); + + test('should track closing effortlessLoginPage.', () { + analyticsRepository.trackCloseEffortlessLoginPage(); + + verify(() => mockDerivRudderstack.track( + eventName: any(named: 'eventName'), + properties: any(named: 'properties'), + )).called(1); + }); + + test('should track maybe later is pressed.', () { + analyticsRepository.trackMaybeLater(); + + verify(() => mockDerivRudderstack.track( + eventName: any(named: 'eventName'), + properties: any(named: 'properties'), + )).called(1); + }); + + test('should track opening learn more page.', () { + analyticsRepository.trackOpenLearnMorePage(); + + verify(() => mockDerivRudderstack.track( + eventName: any(named: 'eventName'), + properties: any(named: 'properties'), + )).called(1); + }); + + test('should track closing learn more page.', () { + analyticsRepository.trackCloseLearnMorePage(); + + verify(() => mockDerivRudderstack.track( + eventName: any(named: 'eventName'), + properties: any(named: 'properties'), + )).called(1); + }); + + test('should track opening manage passkeys page.', () { + analyticsRepository.trackOpenManagePasskeysPage(); + + verify(() => mockDerivRudderstack.track( + eventName: any(named: 'eventName'), + properties: any(named: 'properties'), + )).called(1); + }); + + test('should track closing manage passkeys page.', () { + analyticsRepository.trackCloseManagePasskeysPage(); + + verify(() => mockDerivRudderstack.track( + eventName: any(named: 'eventName'), + properties: any(named: 'properties'), + )).called(1); + }); + + test('should track create passkey.', () { + analyticsRepository.trackCreatePasskey(); + + verify(() => mockDerivRudderstack.track( + eventName: any(named: 'eventName'), + properties: any(named: 'properties'), + )).called(1); + }); + test('should track passkey error.', () { + analyticsRepository.trackPasskeyError('error message'); + + verify(() => mockDerivRudderstack.track( + eventName: any(named: 'eventName'), + properties: any(named: 'properties'), + )).called(1); + }); + + test('should track continue trading.', () { + analyticsRepository.trackContinueTrading(); + + verify(() => mockDerivRudderstack.track( + eventName: any(named: 'eventName'), + properties: any(named: 'properties'), + )).called(1); + }); + + test('should track add more passkeys.', () { + analyticsRepository.trackAddMorePasskeys(); + + verify(() => mockDerivRudderstack.track( + eventName: any(named: 'eventName'), + properties: any(named: 'properties'), + )).called(1); + }); + + test('should track create passkey success.', () { + analyticsRepository.trackCreatePasskeySuccess(); + + verify(() => mockDerivRudderstack.track( + eventName: any(named: 'eventName'), + properties: any(named: 'properties'), + )).called(1); + }); + + test('should track rename passkey.', () { + analyticsRepository.trackRenamePasskey(); + + verify(() => mockDerivRudderstack.track( + eventName: any(named: 'eventName'), + properties: any(named: 'properties'), + )).called(1); + }); + + test('should track cancel rename passkey.', () { + analyticsRepository.trackCancelRenamePasskey(); + + verify(() => mockDerivRudderstack.track( + eventName: any(named: 'eventName'), + properties: any(named: 'properties'), + )).called(1); + }); + + test('should track rename passkey success.', () { + analyticsRepository.trackRenamePasskeySuccess(); + + verify(() => mockDerivRudderstack.track( + eventName: any(named: 'eventName'), + properties: any(named: 'properties'), + )).called(1); + }); + }); +} diff --git a/packages/deriv_passkeys/test/presentation/mixins/passkey_event_tracking_mixin_test.dart b/packages/deriv_passkeys/test/presentation/mixins/passkey_event_tracking_mixin_test.dart new file mode 100644 index 000000000..c04e8aa07 --- /dev/null +++ b/packages/deriv_passkeys/test/presentation/mixins/passkey_event_tracking_mixin_test.dart @@ -0,0 +1,146 @@ +import 'package:analytics/sdk/rudderstack/sdk/deriv_rudderstack_sdk.dart'; +import 'package:deriv_passkeys/src/data/repositories/passkey_analytics_repository.dart'; +import 'package:deriv_passkeys/src/presentation/mixins/passkey_event_tracking_mixin.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mocktail/mocktail.dart'; + +final class MockDerivRudderstack extends Mock implements DerivRudderstack {} + +// class AnalyticsMixinObject = Object with AnalyticsMixin; + +class AnalyticsMixinObject with PasskeyEventTrackingMixin {} + +void main() { + group('Analytics mixin tests:\n', () { + late final MockDerivRudderstack mockRudderStack; + late final AnalyticsMixinObject analyticsMixin; + + setUpAll(() { + analyticsMixin = AnalyticsMixinObject(); + mockRudderStack = MockDerivRudderstack(); + + AnalyticsRepository.init( + 'test', + derivRudderstack: mockRudderStack, + ); + when( + () => mockRudderStack.track( + eventName: any(named: 'eventName'), + properties: any(named: 'properties'), + ), + ).thenAnswer( + (_) => Future.value(true), + ); + }); + + test('Analytics mixin has a AnalyticsRepository parameter.', () { + expect( + analyticsMixin.analyticsRepository, + AnalyticsRepository.instance, + ); + }); + + test('should track opening effortlessLoginPage.', () { + analyticsMixin.trackOpenEffortlessLoginPage(); + + verify(() => AnalyticsRepository.instance.trackOpenEffortlessLoginPage()) + .called(1); + }); + + test('should track closing effortlessLoginPage.', () { + analyticsMixin.trackCloseEffortlessLoginPage(); + + verify(() => AnalyticsRepository.instance.trackCloseEffortlessLoginPage()) + .called(1); + }); + + test('should track maybe later is pressed.', () { + analyticsMixin.trackMaybeLater(); + + verify(() => AnalyticsRepository.instance.trackMaybeLater()).called(1); + }); + + test('should track opening learn more page.', () { + analyticsMixin.trackOpenLearnMorePage(); + + verify(() => AnalyticsRepository.instance.trackOpenLearnMorePage()) + .called(1); + }); + + test('should track closing learn more page.', () { + analyticsMixin.trackCloseLearnMorePage(); + + verify(() => AnalyticsRepository.instance.trackCloseLearnMorePage()) + .called(1); + }); + + test('should track opening manage passkeys page.', () { + analyticsMixin.trackOpenManagePasskeysPage(); + + verify(() => AnalyticsRepository.instance.trackOpenManagePasskeysPage()) + .called(1); + }); + + test('should track closing manage passkeys page.', () { + analyticsMixin.trackCloseManagePasskeysPage(); + + verify(() => AnalyticsRepository.instance.trackCloseManagePasskeysPage()) + .called(1); + }); + + test('should track create passkey.', () { + analyticsMixin.trackCreatePasskey(); + + verify(() => AnalyticsRepository.instance.trackCreatePasskey()).called(1); + }); + + test('should track create passkey success.', () { + analyticsMixin.trackCreatePasskeySuccess(); + + verify(() => AnalyticsRepository.instance.trackCreatePasskeySuccess()) + .called(1); + }); + + test('should track passkey error.', () { + analyticsMixin.trackPasskeyError('error message'); + + verify(() => + AnalyticsRepository.instance.trackPasskeyError('error message')) + .called(1); + }); + + test('should track continue trading.', () { + analyticsMixin.trackContinueTrading(); + + verify(() => AnalyticsRepository.instance.trackContinueTrading()) + .called(1); + }); + + test('should track add more passkeys.', () { + analyticsMixin.trackAddMorePasskeys(); + + verify(() => AnalyticsRepository.instance.trackAddMorePasskeys()) + .called(1); + }); + + test('should track rename passkey.', () { + analyticsMixin.trackRenamePasskey(); + + verify(() => AnalyticsRepository.instance.trackRenamePasskey()).called(1); + }); + + test('should track cancel rename passkey.', () { + analyticsMixin.trackCancelRenamePasskey(); + + verify(() => AnalyticsRepository.instance.trackCancelRenamePasskey()) + .called(1); + }); + + test('should track rename passkey success.', () { + analyticsMixin.trackRenamePasskeySuccess(); + + verify(() => AnalyticsRepository.instance.trackRenamePasskeySuccess()) + .called(1); + }); + }); +} diff --git a/packages/deriv_passkeys/test/presentation/pages/learn_more_passkeys_page_test.dart b/packages/deriv_passkeys/test/presentation/pages/learn_more_passkeys_page_test.dart index adc491d2a..f6abb7bbe 100644 --- a/packages/deriv_passkeys/test/presentation/pages/learn_more_passkeys_page_test.dart +++ b/packages/deriv_passkeys/test/presentation/pages/learn_more_passkeys_page_test.dart @@ -1,7 +1,8 @@ -import 'package:bloc_test/bloc_test.dart'; +import 'package:analytics/sdk/rudderstack/sdk/deriv_rudderstack_sdk.dart'; import 'package:deriv_localizations/l10n/generated/deriv_passkeys/deriv_passkeys_localizations.dart'; import 'package:deriv_localizations/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_en.dart'; import 'package:deriv_passkeys/deriv_passkeys.dart'; +import 'package:deriv_passkeys/src/data/repositories/passkey_analytics_repository.dart'; import 'package:deriv_passkeys/src/presentation/widgets/section_title_and_content.dart'; import 'package:deriv_passkeys/src/presentation/widgets/unordered_list_widget.dart'; import 'package:flutter/material.dart'; @@ -11,9 +12,9 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:deriv_passkeys/src/presentation/pages/learn_more_passkeys_page.dart'; import 'package:mocktail/mocktail.dart'; -class MockDerivPasskeysBloc - extends MockBloc - implements DerivPasskeysBloc {} +import '../states/bloc/deriv_passkeys_bloc_setup.dart'; + +final class MockDerivRudderstack extends Mock implements DerivRudderstack {} class _TestPage extends StatelessWidget { const _TestPage(); @@ -35,16 +36,23 @@ class _TestPage extends StatelessWidget { } void main() { + late MockDerivRudderstack derivRudderstack; group('LearnMorePasskeysPage', () { - late MockDerivPasskeysBloc derivPasskeysBloc; setUp(() { - derivPasskeysBloc = MockDerivPasskeysBloc(); + setupDerivPasskeysBloc(); + + derivRudderstack = MockDerivRudderstack(); - when(() => derivPasskeysBloc.state).thenReturn( - DerivPasskeysInitializedState(), + when(() => derivRudderstack.track( + eventName: any(named: 'eventName'), + properties: any(named: 'properties'), + )).thenAnswer( + (_) => Future.value(true), ); - when(() => derivPasskeysBloc.isDp2p).thenReturn( - false, + + AnalyticsRepository.init( + 'test', + derivRudderstack: derivRudderstack, ); }); diff --git a/packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_bloc_setup.dart b/packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_bloc_setup.dart index 6f96991a7..0c8e906c7 100644 --- a/packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_bloc_setup.dart +++ b/packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_bloc_setup.dart @@ -3,8 +3,10 @@ import 'package:mocktail/mocktail.dart'; class MockDerivPasskeysService extends Mock implements DerivPasskeysService {} -class MockPasskeysConnectionInfoEntity extends Mock - implements PasskeysConnectionInfoEntity {} +class MockPasskeysConnectionInfoEntity extends PasskeysConnectionInfoEntity { + MockPasskeysConnectionInfoEntity( + {required super.endpoint, required super.appId}); +} late DerivPasskeysBloc derivPasskeysBloc; late MockDerivPasskeysService mockDerivPasskeysService; @@ -12,7 +14,10 @@ late MockPasskeysConnectionInfoEntity mockPasskeysConnectionInfoEntity; void setupDerivPasskeysBloc() { mockDerivPasskeysService = MockDerivPasskeysService(); - mockPasskeysConnectionInfoEntity = MockPasskeysConnectionInfoEntity(); + mockPasskeysConnectionInfoEntity = MockPasskeysConnectionInfoEntity( + appId: 'appId', + endpoint: '', + ); when(() => mockDerivPasskeysService.isSupported()) .thenAnswer((_) async => true); derivPasskeysBloc = DerivPasskeysBloc( diff --git a/packages/deriv_passkeys/test/presentation/widgets/continue_with_passkey_button_test.dart b/packages/deriv_passkeys/test/presentation/widgets/continue_with_passkey_button_test.dart index 70c973c68..f3f580ed6 100644 --- a/packages/deriv_passkeys/test/presentation/widgets/continue_with_passkey_button_test.dart +++ b/packages/deriv_passkeys/test/presentation/widgets/continue_with_passkey_button_test.dart @@ -17,13 +17,15 @@ class _TestPage extends StatelessWidget { const _TestPage(); @override - Widget build(BuildContext context) => const MaterialApp( - localizationsDelegates: >[ + Widget build(BuildContext context) => MaterialApp( + localizationsDelegates: const >[ DerivPasskeysLocalizations.delegate, ], - locale: Locale('en'), + locale: const Locale('en'), home: Scaffold( - body: ContinueWithPasskeyButton(), + body: ContinueWithPasskeyButton( + onTap: () {}, + ), ), ); } From a28ecab9de16a212a3ce29ac63067f33c093b476 Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Thu, 20 Jun 2024 20:46:25 +0800 Subject: [PATCH 101/162] chore(deriv_localizations): Crowdin Localization Updated (#619) --- .../deriv_localizations/lib/l10n/deriv_passkeys/app_pt.arb | 6 +++--- .../deriv_localizations/lib/l10n/deriv_passkeys/app_th.arb | 4 ++-- .../deriv_localizations/lib/l10n/deriv_passkeys/app_tr.arb | 6 +++--- .../deriv_localizations/lib/l10n/deriv_passkeys/app_zh.arb | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_pt.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_pt.arb index dc5e97cbb..97df1c81e 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_pt.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_pt.arb @@ -26,9 +26,9 @@ "howToCreatePasskey": "Como criar uma chave de acesso?", "howToCreatePasskeyDescription1": "Aceda às \"Definições de conta\" na Deriv.", "howToCreatePasskeyDescription2": "Pode criar uma passkey por dispositivo.", - "p2pHowToCreatePasskey": "Como criar uma chave de acesso?", - "p2pHowToCreatePasskeyDescription1": "Vá para 'Perfil' em seu aplicativo Deriv P2P.", - "p2pHowToCreatePasskeyDescription2": "Toque em “Chaves de acesso” para criar sua chave de acesso.", + "p2pHowToCreatePasskey": "Como pode criar uma passkey?", + "p2pHowToCreatePasskeyDescription1": "Aceda à secção \"Perfil\" na sua aplicação Deriv P2P.", + "p2pHowToCreatePasskeyDescription2": "Selecione \"Passkeys\" para criar a sua chave de acesso.", "whereArePasskeysSaved": "Onde são guardadas as chaves de acesso?", "whereArePasskeysSavedDescriptionAndroid": "Android: Gestor de palavras-passe do Google.", "whereArePasskeysSavedDescriptionIOS": "iOS: iCloud keychain.", diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_th.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_th.arb index b4a8d5c12..60425dc8b 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_th.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_th.arb @@ -26,9 +26,9 @@ "howToCreatePasskey": "จะสร้าง Passkey ได้อย่างไร?", "howToCreatePasskeyDescription1": "ไปที่ 'การตั้งค่าบัญชี' บน Deriv", "howToCreatePasskeyDescription2": "คุณสามารถสร้างหนึ่ง Passkey ต่ออุปกรณ์", - "p2pHowToCreatePasskey": "วิธีการสร้างรหัสผ่าน", + "p2pHowToCreatePasskey": "จะสร้าง Passkey ได้อย่างไร?", "p2pHowToCreatePasskeyDescription1": "ไปที่ 'โปรไฟล์' ในแอป Deriv P2P ของคุณ", - "p2pHowToCreatePasskeyDescription2": "แตะ 'รหัสผ่าน' เพื่อสร้างรหัสผ่านของคุณ", + "p2pHowToCreatePasskeyDescription2": "แตะ 'Passkeys' เพื่อสร้าง Passkey ของคุณ", "whereArePasskeysSaved": "Passkey จะถูกบันทึกไว้ที่ไหน?", "whereArePasskeysSavedDescriptionAndroid": "Android: ตัวจัดการรหัสผ่าน Google", "whereArePasskeysSavedDescriptionIOS": "iOS: พวงกุญแจ iCloud", diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_tr.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_tr.arb index 5fd54dbdc..d6b3ed6b1 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_tr.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_tr.arb @@ -26,9 +26,9 @@ "howToCreatePasskey": "Passkey nasıl oluşturulur?", "howToCreatePasskeyDescription1": "Deriv'de 'Hesap Ayarları'na gidin.", "howToCreatePasskeyDescription2": "Cihaz başına bir passkey oluşturabilirsiniz.", - "p2pHowToCreatePasskey": "Parola nasıl oluşturulur?", + "p2pHowToCreatePasskey": "Passkey nasıl oluşturulur?", "p2pHowToCreatePasskeyDescription1": "Deriv P2P uygulamanızdaki 'Profil' bölümüne gidin.", - "p2pHowToCreatePasskeyDescription2": "Parola anahtarınızı oluşturmak için 'Parola Tuşları'na dokunun.", + "p2pHowToCreatePasskeyDescription2": "Passkey'inizi oluşturmak için \"Passkeys\" ögesine dokunun.", "whereArePasskeysSaved": "Passkeys nereye kaydedilir?", "whereArePasskeysSavedDescriptionAndroid": "Android: Google şifre yöneticisi.", "whereArePasskeysSavedDescriptionIOS": "iOS: iCloud anahtar zinciri.", @@ -55,7 +55,7 @@ "rename": "Yeniden Adlandır", "revoke": "İptal", "continueTradingButtonText": "Alım satıma devam", - "addMorePasskeysButtonText": "Daha fazla passkeys", + "addMorePasskeysButtonText": "Daha fazla passkeys ekle", "unableToSetupPasskey": "Passkey ayarlanamıyor", "unableToSetupPasskeyDescription": "Passkey ayarlarken bir sorunla karşılaştık. İşlem yarıda kesilmiş veya oturum zaman aşımına uğramış olabilir. Lütfen tekrar deneyin.", "passkeysOffErrorTitle": "Passkeys hizmeti kullanılamıyor", diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_zh.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_zh.arb index a49322481..670eaea44 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_zh.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_zh.arb @@ -26,9 +26,9 @@ "howToCreatePasskey": "如何建立金鑰?", "howToCreatePasskeyDescription1": "轉到 Deriv 的‘帳戶設定‘。", "howToCreatePasskeyDescription2": "可以為每個裝置建立一個金鑰。", - "p2pHowToCreatePasskey": "如何建立密碼?", - "p2pHowToCreatePasskeyDescription1": "在您的 Deriv P2P 應用程序中轉到「個人資料」。", - "p2pHowToCreatePasskeyDescription2": "點擊「密碼」以建立您的密碼。", + "p2pHowToCreatePasskey": "如何建立金鑰?", + "p2pHowToCreatePasskeyDescription1": "在 Deriv P2P 應用程式中轉到‘個人資料‘。", + "p2pHowToCreatePasskeyDescription2": "點選‘密鑰‘以建立密鑰。", "whereArePasskeysSaved": "金鑰儲存在哪裡?", "whereArePasskeysSavedDescriptionAndroid": "Android: Google 密碼管理器。", "whereArePasskeysSavedDescriptionIOS": "iOS:iCloud 鑰匙圈。", From 2fdc28f20b8efe2ddc3a9a261c40b533307f25e3 Mon Sep 17 00:00:00 2001 From: abedelaziz-deriv <135210555+abedelaziz-deriv@users.noreply.github.com> Date: Fri, 21 Jun 2024 10:18:18 +0800 Subject: [PATCH 102/162] refactor(deriv_passkeys): Removed deprecated linter rules (#625) --- melos.yaml | 1 + packages/deriv_passkeys/analysis_options.yaml | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/melos.yaml b/melos.yaml index 256370441..c2d73fcdb 100644 --- a/melos.yaml +++ b/melos.yaml @@ -36,6 +36,7 @@ scripts: description: Run flutter test for all packages. run: flutter test --coverage exec: + concurrency: 6 failFast: true packageFilters: dirExists: diff --git a/packages/deriv_passkeys/analysis_options.yaml b/packages/deriv_passkeys/analysis_options.yaml index fb40ccd5d..aea7c9654 100644 --- a/packages/deriv_passkeys/analysis_options.yaml +++ b/packages/deriv_passkeys/analysis_options.yaml @@ -7,7 +7,6 @@ linter: - always_declare_return_types - always_put_control_body_on_new_line - always_put_required_named_parameters_first - - always_require_non_null_named_parameters - always_specify_types - annotate_overrides - avoid_bool_literals_in_conditional_expressions @@ -24,8 +23,6 @@ linter: - avoid_relative_lib_imports - avoid_renaming_method_parameters - avoid_return_types_on_setters - - avoid_returning_null - - avoid_returning_null_for_future - avoid_returning_null_for_void - avoid_setters_without_getters - avoid_shadowing_type_parameters From 90260eabb92d851d7f77ac45e4caffb5ca66429b Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Fri, 21 Jun 2024 11:29:32 +0800 Subject: [PATCH 103/162] chore(version): bump version and update changelog (#623) --- CHANGELOG.md | 29 ++++++++++++++++++++++++++++ packages/deriv_auth/CHANGELOG.md | 4 ++++ packages/deriv_auth/pubspec.yaml | 4 ++-- packages/deriv_passkeys/CHANGELOG.md | 5 +++++ packages/deriv_passkeys/pubspec.yaml | 2 +- 5 files changed, 41 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a87df2a72..f149e381e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,35 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-06-21 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_passkeys` - `v0.0.2`](#deriv_passkeys---v002) + - [`deriv_auth` - `v6.6.8`](#deriv_auth---v668) + +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.6.8` + +--- + +#### `deriv_passkeys` - `v0.0.2` + + - **REFACTOR**(deriv_passkeys): Removed deprecated linter rules ([#625](https://github.com/regentmarkets/flutter-deriv-packages/issues/625)). ([2fdc28f2](https://github.com/regentmarkets/flutter-deriv-packages/commit/2fdc28f20b8efe2ddc3a9a261c40b533307f25e3)) + - **FEAT**(deriv_passkeys): add user tracking events. ([#607](https://github.com/regentmarkets/flutter-deriv-packages/issues/607)). ([d86b51e2](https://github.com/regentmarkets/flutter-deriv-packages/commit/d86b51e2fe4ca4d18768d0ba17567a388a8d360d)) + + ## 2024-06-20 ### Changes diff --git a/packages/deriv_auth/CHANGELOG.md b/packages/deriv_auth/CHANGELOG.md index c6e1aba6d..f6108faa2 100644 --- a/packages/deriv_auth/CHANGELOG.md +++ b/packages/deriv_auth/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.6.8 + + - Update a dependency to the latest release. + ## 6.6.7 - Update a dependency to the latest release. diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index 1f953e4b9..7d058b6b5 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.6.7 +version: 6.6.8 environment: sdk: ">=3.0.0 <4.0.0" @@ -51,7 +51,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: deriv_passkeys-v0.0.1+8 + ref: deriv_passkeys-v0.0.2 deriv_language_selector: git: diff --git a/packages/deriv_passkeys/CHANGELOG.md b/packages/deriv_passkeys/CHANGELOG.md index 467720e5b..4a8a4e3b9 100644 --- a/packages/deriv_passkeys/CHANGELOG.md +++ b/packages/deriv_passkeys/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.0.2 + + - **REFACTOR**(deriv_passkeys): Removed deprecated linter rules ([#625](https://github.com/regentmarkets/flutter-deriv-packages/issues/625)). ([2fdc28f2](https://github.com/regentmarkets/flutter-deriv-packages/commit/2fdc28f20b8efe2ddc3a9a261c40b533307f25e3)) + - **FEAT**(deriv_passkeys): add user tracking events. ([#607](https://github.com/regentmarkets/flutter-deriv-packages/issues/607)). ([d86b51e2](https://github.com/regentmarkets/flutter-deriv-packages/commit/d86b51e2fe4ca4d18768d0ba17567a388a8d360d)) + ## 0.0.1+8 - Update a dependency to the latest release. diff --git a/packages/deriv_passkeys/pubspec.yaml b/packages/deriv_passkeys/pubspec.yaml index a4c7ecab5..f51b9c42d 100644 --- a/packages/deriv_passkeys/pubspec.yaml +++ b/packages/deriv_passkeys/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_passkeys description: Deriv Passkeys Flutter Plugin -version: 0.0.1+8 +version: 0.0.2 publish_to: "none" environment: From fdf4df1979ddb8710dba8925ef779cca25d60615 Mon Sep 17 00:00:00 2001 From: sagar-deriv <146091240+sagar-deriv@users.noreply.github.com> Date: Mon, 24 Jun 2024 21:54:22 +0400 Subject: [PATCH 104/162] refactor(deriv_ui): [DERG-3500] return inputted amount based on the formatter in numpad (#624) --- .../numpad/core/exchange_notifier.dart | 4 ++-- .../numpad/models/currency_detail.dart | 17 ++++++++++------- .../components/numpad/widgets/number_pad.dart | 2 +- 3 files changed, 13 insertions(+), 10 deletions(-) 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 e823e458b..29decb525 100644 --- a/packages/deriv_ui/lib/components/numpad/core/exchange_notifier.dart +++ b/packages/deriv_ui/lib/components/numpad/core/exchange_notifier.dart @@ -118,9 +118,9 @@ class ExchangeController extends ChangeNotifier { /// what user send by default in primaryCurrency when coming to numpad.) double finalAmount() { if (_exchangeRate.baseCurrency == primaryCurrency.currencyType) { - return primaryCurrency.amount; + return primaryCurrency.formattedAmount; } else { - return secondaryCurrency.amount; + return secondaryCurrency.formattedAmount; } } } 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 1cb784034..15f388a0d 100644 --- a/packages/deriv_ui/lib/components/numpad/models/currency_detail.dart +++ b/packages/deriv_ui/lib/components/numpad/models/currency_detail.dart @@ -20,7 +20,7 @@ class CurrencyDetail { ]; /// Available stable coin currency that Deriv supports. - static List stableCurrencies = [ + static List stableCryptoCurrencies = [ 'USDC', 'USDT', 'TUSDT', @@ -37,8 +37,11 @@ class CurrencyDetail { 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()); + bool get isStableCryptoCurrency => + stableCryptoCurrencies.contains(currencyType.toUpperCase()); + + /// This will give the formatted amount to do processing based on type of currency it is like fiat or crypto currency. + double get formattedAmount => double.parse(formatter.format(amount)); /// Amount that is used to display for user. String get displayAmount { @@ -46,17 +49,17 @@ class CurrencyDetail { return ''; } - return isFiat || isStableCurrency + return isFiat || isStableCryptoCurrency ? 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; + if (isFiat || isStableCryptoCurrency) { + return NumberFormat('#0.##', 'en_US'); } else { - return NumberFormat.decimalPattern()..maximumFractionDigits = 8; + return NumberFormat('#0.########', 'en_US'); } } 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 5bbd15020..24472b652 100644 --- a/packages/deriv_ui/lib/components/numpad/widgets/number_pad.dart +++ b/packages/deriv_ui/lib/components/numpad/widgets/number_pad.dart @@ -661,7 +661,7 @@ class _NumpadWithExchange extends NumberPad { NumberPadCloseCallback? onClose, }) : super( numberPadType: NumberPadWidgetType.singleInput, - formatter: NumberFormat.decimalPattern()..maximumFractionDigits = 8, + formatter: primaryCurrency.formatter, label: label, firstInputTitle: title, onClose: onClose, From 5ac1e5285f66e388dcf44990c7ebf372d7a1cf03 Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Tue, 25 Jun 2024 02:10:54 +0800 Subject: [PATCH 105/162] chore(version): bump version and update changelog (#632) Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: sagar-deriv --- CHANGELOG.md | 34 +++++++++++++++++++ README.md | 12 +++---- packages/deriv_auth/CHANGELOG.md | 4 +++ packages/deriv_auth/pubspec.yaml | 10 +++--- packages/deriv_language_selector/CHANGELOG.md | 4 +++ packages/deriv_language_selector/pubspec.yaml | 4 +-- packages/deriv_passkeys/CHANGELOG.md | 4 +++ packages/deriv_passkeys/pubspec.yaml | 4 +-- packages/deriv_ui/CHANGELOG.md | 4 +++ packages/deriv_ui/pubspec.yaml | 2 +- packages/deriv_widgetbook/CHANGELOG.md | 4 +++ packages/deriv_widgetbook/pubspec.yaml | 4 +-- 12 files changed, 72 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f149e381e..648ca89cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,40 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-06-24 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_ui` - `v0.0.7+7`](#deriv_ui---v0077) + - [`deriv_auth` - `v6.6.9`](#deriv_auth---v669) + - [`deriv_passkeys` - `v0.0.2+1`](#deriv_passkeys---v0021) + - [`deriv_widgetbook` - `v0.0.2+7`](#deriv_widgetbook---v0027) + - [`deriv_language_selector` - `v0.0.2+5`](#deriv_language_selector---v0025) + +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.6.9` + - `deriv_passkeys` - `v0.0.2+1` + - `deriv_widgetbook` - `v0.0.2+7` + - `deriv_language_selector` - `v0.0.2+5` + +--- + +#### `deriv_ui` - `v0.0.7+7` + + - **REFACTOR**(deriv_ui): [DERG-3500] return inputted amount based on the formatter in numpad ([#624](https://github.com/regentmarkets/flutter-deriv-packages/issues/624)). ([fdf4df19](https://github.com/regentmarkets/flutter-deriv-packages/commit/fdf4df1979ddb8710dba8925ef779cca25d60615)) + + ## 2024-06-21 ### Changes diff --git a/README.md b/README.md index 28ded8060..1d6a3ea04 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.6.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.6.9)`. 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+6 #your prefered version + ref: deriv_ui-v0.0.7+7 #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'. | [v2.0.0](./packages/analytics/CHANGELOG.md) | -| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.6.7 ](./packages/deriv_auth/CHANGELOG.md) | +| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.6.9 ](./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+2](./packages/deriv_live_chat/CHANGELOG.md) | -| [deriv_language_selector](./packages/deriv_language_selector) | A package to handle language change of the app. | [v0.0.2+4](./packages/deriv_language_selector/CHANGELOG.md) | +| [deriv_language_selector](./packages/deriv_language_selector) | A package to handle language change of the app. | [v0.0.2+5](./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.4.4](./packages/deriv_localizations/CHANGELOG.md) | | [deriv_numpad](./packages/deriv_numpad) | Number Pad Widget for number input. | [v1.1.5](./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+6](./packages/deriv_ui/CHANGELOG.md) | +| [deriv_ui](./packages/deriv_ui) | A package that contains the UI components used by Deriv products. | [v0.0.7+7](./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+1](./packages/deriv_web_view/CHANGELOG.md) | -| [deriv_widgetbook](./packages/deriv_widgetbook) |Storybook for Deriv UI Widgets and Components | [v0.0.2+6](./packages/deriv_widgetbook/CHANGELOG.md) | +| [deriv_widgetbook](./packages/deriv_widgetbook) |Storybook for Deriv UI Widgets and Components | [v0.0.2+7](./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.3.0](./packages/update_checker/CHANGELOG.md) | | [deriv_feature_flag](./packages/deriv_feature_flag) | A package to provide feature flag functionality for apps. | [v0.1.1](./packages/deriv_feature_flag/CHANGELOG.md) | diff --git a/packages/deriv_auth/CHANGELOG.md b/packages/deriv_auth/CHANGELOG.md index f6108faa2..4c1180287 100644 --- a/packages/deriv_auth/CHANGELOG.md +++ b/packages/deriv_auth/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.6.9 + + - Update a dependency to the latest release. + ## 6.6.8 - Update a dependency to the latest release. diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index 7d058b6b5..6b66d4e4a 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.6.8 +version: 6.6.9 environment: sdk: ">=3.0.0 <4.0.0" @@ -22,7 +22,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.7+6 + ref: deriv_ui-v0.0.7+7 deriv_http_client: git: @@ -51,13 +51,13 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: deriv_passkeys-v0.0.2 + ref: deriv_passkeys-v0.0.2+1 deriv_language_selector: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_language_selector - ref: deriv_language_selector-v0.0.2+4 + ref: deriv_language_selector-v0.0.2+5 flutter_bloc: ^8.1.3 flutter_svg: ^2.0.7 @@ -73,7 +73,7 @@ dependency_overrides: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.7+6 + ref: deriv_ui-v0.0.7+7 dev_dependencies: mocktail: ^1.0.3 diff --git a/packages/deriv_language_selector/CHANGELOG.md b/packages/deriv_language_selector/CHANGELOG.md index 4eb2f1faf..527f6375f 100644 --- a/packages/deriv_language_selector/CHANGELOG.md +++ b/packages/deriv_language_selector/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.2+5 + + - Update a dependency to the latest release. + ## 0.0.2+4 - Update a dependency to the latest release. diff --git a/packages/deriv_language_selector/pubspec.yaml b/packages/deriv_language_selector/pubspec.yaml index 3b0c952eb..a1e11f930 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+4 +version: 0.0.2+5 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+6 + ref: deriv_ui-v0.0.7+7 shared_preferences: ^2.2.2 flutter_bloc: ^8.1.4 equatable: ^2.0.5 diff --git a/packages/deriv_passkeys/CHANGELOG.md b/packages/deriv_passkeys/CHANGELOG.md index 4a8a4e3b9..863c60366 100644 --- a/packages/deriv_passkeys/CHANGELOG.md +++ b/packages/deriv_passkeys/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.2+1 + + - Update a dependency to the latest release. + ## 0.0.2 - **REFACTOR**(deriv_passkeys): Removed deprecated linter rules ([#625](https://github.com/regentmarkets/flutter-deriv-packages/issues/625)). ([2fdc28f2](https://github.com/regentmarkets/flutter-deriv-packages/commit/2fdc28f20b8efe2ddc3a9a261c40b533307f25e3)) diff --git a/packages/deriv_passkeys/pubspec.yaml b/packages/deriv_passkeys/pubspec.yaml index f51b9c42d..353df4251 100644 --- a/packages/deriv_passkeys/pubspec.yaml +++ b/packages/deriv_passkeys/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_passkeys description: Deriv Passkeys Flutter Plugin -version: 0.0.2 +version: 0.0.2+1 publish_to: "none" environment: @@ -32,7 +32,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.7+6 + ref: deriv_ui-v0.0.7+7 deriv_http_client: git: diff --git a/packages/deriv_ui/CHANGELOG.md b/packages/deriv_ui/CHANGELOG.md index 1441b306e..567ab709b 100644 --- a/packages/deriv_ui/CHANGELOG.md +++ b/packages/deriv_ui/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.7+7 + + - **REFACTOR**(deriv_ui): [DERG-3500] return inputted amount based on the formatter in numpad ([#624](https://github.com/regentmarkets/flutter-deriv-packages/issues/624)). ([fdf4df19](https://github.com/regentmarkets/flutter-deriv-packages/commit/fdf4df1979ddb8710dba8925ef779cca25d60615)) + ## 0.0.7+6 - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) diff --git a/packages/deriv_ui/pubspec.yaml b/packages/deriv_ui/pubspec.yaml index f32c6ff6e..39c84205d 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+6 +version: 0.0.7+7 publish_to: none environment: diff --git a/packages/deriv_widgetbook/CHANGELOG.md b/packages/deriv_widgetbook/CHANGELOG.md index edd0b2854..55de88fb6 100644 --- a/packages/deriv_widgetbook/CHANGELOG.md +++ b/packages/deriv_widgetbook/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.2+7 + + - Update a dependency to the latest release. + ## 0.0.2+6 - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) diff --git a/packages/deriv_widgetbook/pubspec.yaml b/packages/deriv_widgetbook/pubspec.yaml index 9ced126dc..8a08de817 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+6 +version: 0.0.2+7 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+6 + ref: deriv_ui-v0.0.7+7 deriv_theme: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git From 9b857999f479486830671f8b8e8b7fc26dcd769b Mon Sep 17 00:00:00 2001 From: emad-deriv <134991873+emad-deriv@users.noreply.github.com> Date: Tue, 25 Jun 2024 09:57:06 +0800 Subject: [PATCH 106/162] fix(deriv_webview): add language parameter to needed classes (#600) --- packages/deriv_web_view/lib/deriv_web_view.dart | 9 +++++++++ packages/deriv_web_view/lib/helper.dart | 2 ++ .../lib/models/pta_login_request_model.dart | 5 +++++ 3 files changed, 16 insertions(+) diff --git a/packages/deriv_web_view/lib/deriv_web_view.dart b/packages/deriv_web_view/lib/deriv_web_view.dart index 8580ac4e7..e8777a60a 100644 --- a/packages/deriv_web_view/lib/deriv_web_view.dart +++ b/packages/deriv_web_view/lib/deriv_web_view.dart @@ -154,6 +154,7 @@ Future openLoggedInWebPage({ required String appToken, required String userAgent, required String platform, + String? languageCode, HttpClientPredicate? getHttpClient, String destinationAppId = '16929', String? action, @@ -179,6 +180,7 @@ Future openLoggedInWebPage({ action: action, code: code, platform: platform, + languageCode: languageCode ); if (oneTimeToken == null) { @@ -219,6 +221,7 @@ Future openLoggedInWebPage({ action: action, code: code, platform: platform, + languageCode: languageCode, ); } @@ -252,6 +255,7 @@ Future _fetchOneTimeToken({ HttpClientPredicate? getHttpClient, String? action, String? code, + String? languageCode, }) async { loadingDialog(context); @@ -267,6 +271,7 @@ Future _fetchOneTimeToken({ code: code, getHttpClient: getHttpClient, platform: platform, + languageCode: languageCode, ); Navigator.of(context, rootNavigator: rootNavigator).pop(); @@ -287,6 +292,7 @@ Future _getOneTimeToken({ HttpClientPredicate? getHttpClient, String? action, String? code, + String? languageCode, }) async { try { final String? token = await performPassThroughAuthentication( @@ -301,6 +307,7 @@ Future _getOneTimeToken({ code: code, getHttpClient: getHttpClient, platform: platform, + languageCode: languageCode, ); return token; @@ -327,6 +334,7 @@ Future _validateCredentials({ HttpClientPredicate? getHttpClient, String? action, String? code, + String? languageCode, }) async { final String? oneTimeToken = await _fetchOneTimeToken( context: context, @@ -343,6 +351,7 @@ Future _validateCredentials({ action: action, code: code, platform: platform, + languageCode: languageCode, ); if (oneTimeToken == null) { diff --git a/packages/deriv_web_view/lib/helper.dart b/packages/deriv_web_view/lib/helper.dart index 37a4ed291..1860b7b61 100644 --- a/packages/deriv_web_view/lib/helper.dart +++ b/packages/deriv_web_view/lib/helper.dart @@ -26,6 +26,7 @@ Future performPassThroughAuthentication({ HttpClientPredicate? getHttpClient, String? action, String? code, + String? languageCode, }) async { final url = getPtaLoginUrl(host: endpoint); @@ -47,6 +48,7 @@ Future performPassThroughAuthentication({ platform: platform, action: action, code: code, + languageCode: languageCode, ), ).toJson(); 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 4dfee0910..3edce537f 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 @@ -33,6 +33,7 @@ class UrlParamsModel { required this.platform, this.action, this.code, + this.languageCode, }); /// URL that user should be redirected to for example `/cashier`. @@ -50,6 +51,9 @@ class UrlParamsModel { /// Code. final String? code; + /// language code + final String? languageCode; + /// Converts a instance of this class to json. Map toJson() => { 'redirect_url': redirectUrl, @@ -57,5 +61,6 @@ class UrlParamsModel { if (action != null) 'action': action, if (code != null) 'code': code, 'platform': platform, + if (languageCode != null) 'lang': languageCode, }; } From 2379af73c5c6c6b6ee8c4a5ce4466a08261a4894 Mon Sep 17 00:00:00 2001 From: emad-deriv <134991873+emad-deriv@users.noreply.github.com> Date: Tue, 25 Jun 2024 11:01:48 +0800 Subject: [PATCH 107/162] chore(deriv_web_view): update deriv view readme file (#636) --- packages/deriv_web_view/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/deriv_web_view/README.md b/packages/deriv_web_view/README.md index 9b9bbfd61..95c78de3b 100644 --- a/packages/deriv_web_view/README.md +++ b/packages/deriv_web_view/README.md @@ -239,4 +239,4 @@ Future showTokenExpiredDialog(BuildContext context) => showAlertDialog( dismissible: false, onPositiveActionPressed: () { ... }, // Redirect to login page. ); -``` +``` \ No newline at end of file From b0b66dadb6cb1b30dc3ad759f2eee031673b6bbf Mon Sep 17 00:00:00 2001 From: emad-deriv <134991873+emad-deriv@users.noreply.github.com> Date: Tue, 25 Jun 2024 11:11:49 +0800 Subject: [PATCH 108/162] fix(deriv_web_view): update deriv web view readme file (#637) --- packages/deriv_web_view/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/deriv_web_view/README.md b/packages/deriv_web_view/README.md index 95c78de3b..9b9bbfd61 100644 --- a/packages/deriv_web_view/README.md +++ b/packages/deriv_web_view/README.md @@ -239,4 +239,4 @@ Future showTokenExpiredDialog(BuildContext context) => showAlertDialog( dismissible: false, onPositiveActionPressed: () { ... }, // Redirect to login page. ); -``` \ No newline at end of file +``` From ae9556cf3af98196bb22e351d9a8eccbf534889c Mon Sep 17 00:00:00 2001 From: naif-deriv <112558231+naif-deriv@users.noreply.github.com> Date: Tue, 25 Jun 2024 08:13:31 +0400 Subject: [PATCH 109/162] feat(deriv_auth): add log in user tracking events. (#620) --- .../analytics/data/auth_tracking_data.dart | 164 ++++++++++++++++++ .../data/auth_tracking_repository.dart | 131 ++++++++++++++ .../domain/auth_user_tracking_interface.dart | 24 +++ .../deriv_auth/lib/core/analytics/enums.dart | 32 ++++ .../service/auth_tracking_mixin.dart | 36 ++++ .../features/auth/cubit/deriv_auth_cubit.dart | 35 +++- .../auth/services/base_auth_service.dart | 3 + .../auth/services/deriv_auth_service.dart | 2 +- .../layouts/deriv_get_started_layout.dart | 9 +- .../layouts/deriv_login_layout.dart | 8 +- .../widgets/deriv_social_auth_panel.dart | 17 +- packages/deriv_auth/pubspec.yaml | 6 + .../auth/cubit/deriv_auth_cubit_test.dart | 19 ++ .../deriv_get_started_layout_test.dart | 23 +++ .../layouts/deriv_login_layout_test.dart | 18 ++ .../layouts/deriv_signup_layout_test.dart | 18 ++ 16 files changed, 537 insertions(+), 8 deletions(-) create mode 100644 packages/deriv_auth/lib/core/analytics/data/auth_tracking_data.dart create mode 100644 packages/deriv_auth/lib/core/analytics/data/auth_tracking_repository.dart create mode 100644 packages/deriv_auth/lib/core/analytics/domain/auth_user_tracking_interface.dart create mode 100644 packages/deriv_auth/lib/core/analytics/enums.dart create mode 100644 packages/deriv_auth/lib/core/analytics/service/auth_tracking_mixin.dart diff --git a/packages/deriv_auth/lib/core/analytics/data/auth_tracking_data.dart b/packages/deriv_auth/lib/core/analytics/data/auth_tracking_data.dart new file mode 100644 index 000000000..9ce8e5491 --- /dev/null +++ b/packages/deriv_auth/lib/core/analytics/data/auth_tracking_data.dart @@ -0,0 +1,164 @@ +import 'package:deriv_auth/core/analytics/enums.dart'; + +/// Get user tracking data. +Map getUserTrackingData( + LoginAction action, + String appId, { + LoginProvider? provider, + String? errorMessage, +}) => + switch (action) { + LoginAction.openLoginForm => { + 'event': 'open', + 'properties': { + 'app_id': appId, + }, + }, + LoginAction.startLogin => _getLoginStartedTrackingData( + provider, + appId, + ), + LoginAction.finishLogin => _getLoginFinishedTrackingData( + provider, + appId, + ), + LoginAction.loginError => _getLoginErrorTrackingData( + provider, + appId, + errorMessage ?? (throw Exception('Error message is required.')), + ), + }; + +/// Get login started tracking data. +Map _getLoginStartedTrackingData( + LoginProvider? provider, String appId) => + switch (provider) { + LoginProvider.email => { + 'event': 'login_started', + 'properties': { + 'app_id': appId, + 'login_provider': 'email', + }, + }, + LoginProvider.passkey => { + 'event': 'login_started', + 'properties': { + 'app_id': appId, + 'login_provider': 'passkey', + }, + }, + LoginProvider.google => { + 'event': 'login_started', + 'properties': { + 'app_id': appId, + 'login_provider': 'google', + }, + }, + LoginProvider.facebook => { + 'event': 'login_started', + 'properties': { + 'app_id': appId, + 'login_provider': 'facebook', + }, + }, + LoginProvider.apple => { + 'event': 'login_started', + 'properties': { + 'app_id': appId, + 'login_provider': 'apple', + }, + }, + null => throw Exception('Null LoginProvider is being passed.'), + }; + +/// Get login finished tracking data. +Map _getLoginFinishedTrackingData( + LoginProvider? provider, String appId) => + switch (provider) { + LoginProvider.email => { + 'event': 'login_finished', + 'properties': { + 'app_id': appId, + 'login_provider': 'email', + }, + }, + LoginProvider.passkey => { + 'event': 'login_finished', + 'properties': { + 'app_id': appId, + 'login_provider': 'passkey', + }, + }, + LoginProvider.google => { + 'event': 'login_finished', + 'properties': { + 'app_id': appId, + 'login_provider': 'google', + }, + }, + LoginProvider.facebook => { + 'event': 'login_finished', + 'properties': { + 'app_id': appId, + 'login_provider': 'facebook', + }, + }, + LoginProvider.apple => { + 'event': 'login_finished', + 'properties': { + 'app_id': appId, + 'login_provider': 'apple', + }, + }, + null => throw Exception('Null LoginProvider is being passed.'), + }; + +/// Get login error tracking data. +Map _getLoginErrorTrackingData( + LoginProvider? provider, + String appId, + String errorMessage, +) => + switch (provider) { + LoginProvider.email => { + 'event': 'login_flow_error', + 'properties': { + 'app_id': appId, + 'login_provider': 'email', + 'error_message': errorMessage, + }, + }, + LoginProvider.passkey => { + 'event': 'login_flow_error', + 'properties': { + 'app_id': appId, + 'login_provider': 'passkey', + 'error_message': errorMessage, + }, + }, + LoginProvider.google => { + 'event': 'login_flow_error', + 'properties': { + 'app_id': appId, + 'login_provider': 'google', + 'error_message': errorMessage, + }, + }, + LoginProvider.facebook => { + 'event': 'login_flow_error', + 'properties': { + 'app_id': appId, + 'login_provider': 'facebook', + 'error_message': errorMessage, + }, + }, + LoginProvider.apple => { + 'event': 'login_flow_error', + 'properties': { + 'app_id': appId, + 'login_provider': 'apple', + 'error_message': errorMessage, + }, + }, + null => throw Exception('Null LoginProvider is being passed.'), + }; diff --git a/packages/deriv_auth/lib/core/analytics/data/auth_tracking_repository.dart b/packages/deriv_auth/lib/core/analytics/data/auth_tracking_repository.dart new file mode 100644 index 000000000..f5fbe2757 --- /dev/null +++ b/packages/deriv_auth/lib/core/analytics/data/auth_tracking_repository.dart @@ -0,0 +1,131 @@ +import 'package:analytics/sdk/rudderstack/sdk/deriv_rudderstack_sdk.dart'; +import 'package:deriv_auth/core/services/token/models/enums.dart'; +import 'package:deriv_auth/core/analytics/data/auth_tracking_data.dart'; +import 'package:deriv_auth/core/analytics/domain/auth_user_tracking_interface.dart'; +import 'package:deriv_auth/core/analytics/enums.dart'; + +/// Repository to track user events. +class AuthTrackingRepository implements AuthUserTrackingInterface { + /// Constructor for [AnalyticsRepository]. + AuthTrackingRepository._( + this._appId, + this._derivRudderstack, + ); + + static AuthTrackingRepository? _instance; + + /// Singleton instance of [AnalyticsRepository]. + static AuthTrackingRepository get instance => _instance ??= + throw Exception('AuthTrackingRepository is not initialized'); + + /// Instance of [DerivRudderstack]. + final DerivRudderstack _derivRudderstack; + + /// Initialize [AnalyticsRepository]. + static void init( + String appId, { + required DerivRudderstack derivRudderstack, + }) => + _instance = AuthTrackingRepository._( + appId, + derivRudderstack, + ); + + /// Deriv client app ID. + final String _appId; + + LoginProvider? _loginProvider; + + @override + void trackUserOpenedLoginForm() { + final Map data = getUserTrackingData( + LoginAction.openLoginForm, + _appId, + ); + + _derivRudderstack.track( + eventName: data['event'] as String, + properties: data['properties'] as Map, + ); + } + + @override + void trackError(String errorMessage) { + final Map data = getUserTrackingData( + LoginAction.loginError, + _appId, + errorMessage: errorMessage, + ); + + _derivRudderstack.track( + eventName: data['event'] as String, + properties: data['properties'] as Map, + ); + } + + @override + void trackSystemLoginPressed() { + final Map data = getUserTrackingData( + LoginAction.startLogin, + _appId, + provider: LoginProvider.email, + ); + + _loginProvider = LoginProvider.email; + + _derivRudderstack.track( + eventName: data['event'] as String, + properties: data['properties'] as Map, + ); + } + + @override + void trackPasskeyLoginPressed() { + final Map data = getUserTrackingData( + LoginAction.startLogin, + _appId, + provider: LoginProvider.passkey, + ); + + _loginProvider = LoginProvider.passkey; + + _derivRudderstack.track( + eventName: data['event'] as String, + properties: data['properties'] as Map, + ); + } + + @override + void trackSocialLoginPressed(SocialAuthProvider type) { + _loginProvider = switch (type) { + SocialAuthProvider.google => LoginProvider.google, + SocialAuthProvider.facebook => LoginProvider.facebook, + SocialAuthProvider.apple => LoginProvider.apple, + }; + + final Map data = getUserTrackingData( + LoginAction.startLogin, + _appId, + provider: _loginProvider, + ); + + _derivRudderstack.track( + eventName: data['event'] as String, + properties: data['properties'] as Map, + ); + } + + @override + void trackLoginFinished() { + final Map data = getUserTrackingData( + LoginAction.finishLogin, + _appId, + provider: _loginProvider, + ); + + _derivRudderstack.track( + eventName: data['event'] as String, + properties: data['properties'] as Map, + ); + } +} diff --git a/packages/deriv_auth/lib/core/analytics/domain/auth_user_tracking_interface.dart b/packages/deriv_auth/lib/core/analytics/domain/auth_user_tracking_interface.dart new file mode 100644 index 000000000..3db7ab4f6 --- /dev/null +++ b/packages/deriv_auth/lib/core/analytics/domain/auth_user_tracking_interface.dart @@ -0,0 +1,24 @@ +import 'package:deriv_auth/deriv_auth.dart'; + +/// Interface to define the methods for tracking user events. +abstract interface class AuthUserTrackingInterface { + /// Track user opened login form. + void trackUserOpenedLoginForm(); + + /// Track user clicks log after entering email and password. + void trackSystemLoginPressed(); + + /// Track user clicks on Passkey login button. + void trackPasskeyLoginPressed(); + + /// Track user clicks on social login button. + void trackSocialLoginPressed( + SocialAuthProvider type, + ); + + /// Track login finished. + void trackLoginFinished(); + + /// Track login error. + void trackError(String errorMessage); +} diff --git a/packages/deriv_auth/lib/core/analytics/enums.dart b/packages/deriv_auth/lib/core/analytics/enums.dart new file mode 100644 index 000000000..7d0d6c118 --- /dev/null +++ b/packages/deriv_auth/lib/core/analytics/enums.dart @@ -0,0 +1,32 @@ +/// Enum for login actions +enum LoginAction { + /// Open login form. + openLoginForm, + + /// Start system login. + startLogin, + + /// Finish login. + finishLogin, + + /// Login error. + loginError, +} + +/// Enum for login provider. +enum LoginProvider { + /// Email login. + email, + + /// Passkey login. + passkey, + + /// Google login. + google, + + /// Facebook login. + facebook, + + /// Apple login. + apple, +} diff --git a/packages/deriv_auth/lib/core/analytics/service/auth_tracking_mixin.dart b/packages/deriv_auth/lib/core/analytics/service/auth_tracking_mixin.dart new file mode 100644 index 000000000..5c5c931de --- /dev/null +++ b/packages/deriv_auth/lib/core/analytics/service/auth_tracking_mixin.dart @@ -0,0 +1,36 @@ +import 'package:deriv_auth/deriv_auth.dart'; +import 'package:deriv_auth/core/analytics/data/auth_tracking_repository.dart'; + +/// Mixin for tracking user authentication actions. +mixin AuthTrackingMixin { + late final AuthTrackingRepository _repository = + AuthTrackingRepository.instance; + + /// Track user opened login form. + void trackUserOpenedLoginForm() => _repository.trackUserOpenedLoginForm(); + + /// Track login error. + void trackError(String errorMessage) => _repository.trackError(errorMessage); + + /// Track login started. + void trackLoginWithEmailAndPassword() => + _repository.trackSystemLoginPressed(); + + /// Track Passkey login started. + void trackLoginWithPasskey() => _repository.trackPasskeyLoginPressed(); + + /// Track Google login started. + void trackLoginWithGoogle() => + _repository.trackSocialLoginPressed(SocialAuthProvider.google); + + /// Track Facebook login started. + void trackLoginWithFacebook() => + _repository.trackSocialLoginPressed(SocialAuthProvider.facebook); + + /// Track Apple login started. + void trackLoginWithApple() => + _repository.trackSocialLoginPressed(SocialAuthProvider.apple); + + /// Track login finished. + void trackLoginFinished() => _repository.trackLoginFinished(); +} diff --git a/packages/deriv_auth/lib/features/auth/cubit/deriv_auth_cubit.dart b/packages/deriv_auth/lib/features/auth/cubit/deriv_auth_cubit.dart index 8d83d5a56..53eb7fb2a 100644 --- a/packages/deriv_auth/lib/features/auth/cubit/deriv_auth_cubit.dart +++ b/packages/deriv_auth/lib/features/auth/cubit/deriv_auth_cubit.dart @@ -1,4 +1,7 @@ +import 'package:analytics/sdk/rudderstack/sdk/deriv_rudderstack_sdk.dart'; import 'package:bloc/bloc.dart'; +import 'package:deriv_auth/core/analytics/data/auth_tracking_repository.dart'; +import 'package:deriv_auth/core/analytics/service/auth_tracking_mixin.dart'; import 'package:deriv_auth/core/exceptions/deriv_auth_exception.dart'; import 'package:deriv_auth/core/models/account_model.dart'; @@ -9,17 +12,27 @@ import 'package:deriv_auth/core/services/token/models/enums.dart'; import 'package:deriv_auth/core/services/token/models/login_request.dart'; import 'package:deriv_auth/features/auth/deriv_auth_io.dart'; import 'package:deriv_auth/features/auth/services/base_auth_service.dart'; +import 'package:deriv_auth/features/auth/services/deriv_auth_service.dart'; import 'package:deriv_auth/features/social_auth/models/social_auth_dto.dart'; part 'deriv_auth_state.dart'; /// This Cubit is the single source of truth for user login status, /// and it is responsible for all login functionality. -class DerivAuthCubit extends Cubit implements DerivAuthIO { +class DerivAuthCubit extends Cubit + with AuthTrackingMixin + implements DerivAuthIO { /// Initialize a [DerivAuthCubit]. DerivAuthCubit({ required this.authService, - }) : super(DerivAuthLoadingState()); + }) : super(DerivAuthLoadingState()) { + AuthTrackingRepository.init( + authService is DerivAuthService + ? (authService as DerivAuthService).connectionInfo.appId + : (throw Exception('Connection Info is not provided.')), + derivRudderstack: DerivRudderstack(), + ); + } /// [BaseAuthService] handles all login logic of cubit. final BaseAuthService authService; @@ -33,6 +46,8 @@ class DerivAuthCubit extends Cubit implements DerivAuthIO { String? otp, String? userAgent, }) async { + trackLoginWithEmailAndPassword(); + emit(DerivAuthLoadingState()); await _loginRequest( @@ -110,6 +125,9 @@ class DerivAuthCubit extends Cubit implements DerivAuthIO { final LandingCompanyEntity landingCompanyEntity = await authService.getLandingCompany(authorizeEntity.country); _isUserMigrated = _checkUserMigrated(authorizeEntity); + + trackLoginFinished(); + emit(DerivAuthLoggedInState( DerivAuthModel( authorizeEntity: authorizeEntity, @@ -136,6 +154,8 @@ class DerivAuthCubit extends Cubit implements DerivAuthIO { await authService.getLandingCompany(authorizeEntity.country); _isUserMigrated = _checkUserMigrated(authorizeEntity); + trackLoginFinished(); + emit( DerivAuthLoggedInState( DerivAuthModel( @@ -204,4 +224,15 @@ class DerivAuthCubit extends Cubit implements DerivAuthIO { @override Stream get output => stream; + + @override + void onChange(Change change) { + if (change.nextState is DerivAuthErrorState) { + trackError( + (change.nextState as DerivAuthErrorState).message, + ); + } + + super.onChange(change); + } } diff --git a/packages/deriv_auth/lib/features/auth/services/base_auth_service.dart b/packages/deriv_auth/lib/features/auth/services/base_auth_service.dart index f3df80e13..184acc869 100644 --- a/packages/deriv_auth/lib/features/auth/services/base_auth_service.dart +++ b/packages/deriv_auth/lib/features/auth/services/base_auth_service.dart @@ -5,6 +5,9 @@ import 'package:deriv_auth/core/services/token/models/login_request.dart'; /// Interface to define all authentication-related functionality. abstract class BaseAuthService { + /// Constructor for [BaseAuthService]. + BaseAuthService(); + /// Function before logging user in. Future onLoginRequest({ required GetTokensRequestModel request, diff --git a/packages/deriv_auth/lib/features/auth/services/deriv_auth_service.dart b/packages/deriv_auth/lib/features/auth/services/deriv_auth_service.dart index 573bb7567..1a0d6c697 100644 --- a/packages/deriv_auth/lib/features/auth/services/deriv_auth_service.dart +++ b/packages/deriv_auth/lib/features/auth/services/deriv_auth_service.dart @@ -1,6 +1,6 @@ import 'package:collection/collection.dart'; - import 'package:deriv_auth/core/connection_info.dart'; + import 'package:deriv_auth/core/constants/constants.dart'; import 'package:deriv_auth/core/exceptions/deriv_auth_exception.dart'; import 'package:deriv_auth/core/extensions/extensions.dart'; 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 07cdabe9e..f9ec33a6d 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 @@ -3,6 +3,7 @@ import 'dart:async'; import 'dart:math' as math; +import 'package:deriv_auth/core/analytics/service/auth_tracking_mixin.dart'; import 'package:deriv_auth/core/extensions/context_extension.dart'; import 'package:deriv_auth/core/helpers/semantic_labels.dart'; import 'package:deriv_auth/features/get_started/models/deriv_get_started_slide_model.dart'; @@ -48,7 +49,8 @@ class DerivGetStartedLayout extends StatefulWidget { State createState() => _DerivGetStartedLayoutState(); } -class _DerivGetStartedLayoutState extends State { +class _DerivGetStartedLayoutState extends State + with AuthTrackingMixin { static const Duration _autoScrollInterval = Duration(seconds: 4); static const Duration _scrollAnimationDuration = Duration(seconds: 1); static const Alignment _slideImageAlignment = Alignment.center; @@ -172,7 +174,10 @@ class _DerivGetStartedLayoutState extends State { explicitChildNodes: true, label: SemanticsLabels.starterPageLoginButtonSemantic, child: SecondaryButton( - onPressed: widget.onLoginTapped, + onPressed: () { + trackUserOpenedLoginForm(); + widget.onLoginTapped(); + }, child: Center( child: Text( context.derivAuthLocalization.actionLogin, 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 9bf31f9a6..5ec252b9c 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,5 +1,6 @@ import 'dart:async'; +import 'package:deriv_auth/core/analytics/service/auth_tracking_mixin.dart'; import 'package:deriv_auth/deriv_auth.dart'; import 'package:deriv_passkeys/deriv_passkeys.dart'; import 'package:deriv_theme/deriv_theme.dart'; @@ -100,7 +101,8 @@ class DerivLoginLayout extends StatefulWidget { State createState() => _DerivLoginLayoutState(); } -class _DerivLoginLayoutState extends State { +class _DerivLoginLayoutState extends State + with AuthTrackingMixin { final GlobalKey _formKey = GlobalKey(); final TextEditingController _emailController = TextEditingController(); @@ -162,7 +164,9 @@ class _DerivLoginLayoutState extends State { if (widget.isSocialAuthEnabled) const SizedBox(height: ThemeProvider.margin24), widget.isPasskeysEnabled - ? const ContinueWithPasskeyButton() + ? ContinueWithPasskeyButton( + onTap: trackLoginWithPasskey, + ) : const SizedBox.shrink(), DerivSocialAuthPanel( socialAuthStateHandler: widget.socialAuthStateHandler, 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 ea2241f4e..b8f4f32b6 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 @@ -1,3 +1,4 @@ +import 'package:deriv_auth/core/analytics/service/auth_tracking_mixin.dart'; import 'package:deriv_auth/deriv_auth.dart'; import 'package:deriv_theme/deriv_theme.dart'; import 'package:flutter/material.dart'; @@ -48,7 +49,8 @@ class DerivSocialAuthPanel extends StatefulWidget { State createState() => _DerivSocialAuthPanelState(); } -class _DerivSocialAuthPanelState extends State { +class _DerivSocialAuthPanelState extends State + with AuthTrackingMixin { late SocialAuthCubit _socialAuthCubit; @override @@ -121,6 +123,19 @@ class _DerivSocialAuthPanelState extends State { ), onTap: widget.isEnabled ? () async { + switch (socialAuthProvider) { + case SocialAuthProvider.google: + trackLoginWithGoogle(); + break; + case SocialAuthProvider.facebook: + trackLoginWithFacebook(); + break; + case SocialAuthProvider.apple: + trackLoginWithApple(); + break; + default: + break; + } final List? socialAuthProviders = await _socialAuthCubit.getSocialAuthProviders(); diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index 6b66d4e4a..a9fc818da 100644 --- a/packages/deriv_auth/pubspec.yaml +++ b/packages/deriv_auth/pubspec.yaml @@ -12,6 +12,12 @@ dependencies: flutter: sdk: flutter + analytics: + git: + url: git@github.com:regentmarkets/flutter-deriv-packages.git + path: packages/analytics + ref: analytics-v2.0.0 + deriv_theme: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git diff --git a/packages/deriv_auth/test/features/auth/cubit/deriv_auth_cubit_test.dart b/packages/deriv_auth/test/features/auth/cubit/deriv_auth_cubit_test.dart index 73829497f..cffb70907 100644 --- a/packages/deriv_auth/test/features/auth/cubit/deriv_auth_cubit_test.dart +++ b/packages/deriv_auth/test/features/auth/cubit/deriv_auth_cubit_test.dart @@ -1,4 +1,6 @@ +import 'package:analytics/sdk/rudderstack/sdk/deriv_rudderstack_sdk.dart'; import 'package:bloc_test/bloc_test.dart'; +import 'package:deriv_auth/core/analytics/data/auth_tracking_repository.dart'; import 'package:deriv_auth/core/exceptions/deriv_auth_exception.dart'; import 'package:deriv_auth/core/models/account_model.dart'; import 'package:deriv_auth/core/models/auth_error/auth_error.dart'; @@ -16,11 +18,28 @@ import '../mocked_data/mocked_auth_models.dart'; class MockAuthService extends Mock implements BaseAuthService {} +class MockDerivRudderStack extends Mock implements DerivRudderstack {} + void main() { + late final MockDerivRudderStack mockDerivRudderstack; + late final DerivAuthCubit authCubit; late final MockAuthService service; setUpAll(() async { + mockDerivRudderstack = MockDerivRudderStack(); + + AuthTrackingRepository.init( + 'test', + derivRudderstack: mockDerivRudderstack, + ); + + when(() => mockDerivRudderstack.track( + eventName: any(named: 'eventName'), + properties: any(named: 'properties'))).thenAnswer( + (_) => Future.value(true), + ); + service = MockAuthService(); authCubit = DerivAuthCubit(authService: service); }); 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 23aa26b08..3e9271705 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 @@ -1,6 +1,8 @@ // ignore_for_file: always_specify_types +import 'package:analytics/sdk/rudderstack/sdk/deriv_rudderstack_sdk.dart'; import 'package:bloc_test/bloc_test.dart'; +import 'package:deriv_auth/core/analytics/data/auth_tracking_repository.dart'; import 'package:deriv_auth/features/get_started/models/deriv_get_started_slide_model.dart'; import 'package:deriv_auth/features/get_started/presentation/layouts/deriv_get_started_layout.dart'; import 'package:deriv_language_selector/deriv_language_selector.dart'; @@ -14,6 +16,8 @@ import 'package:patrol_finders/patrol_finders.dart'; import '../../../../pump_app.dart'; +class MockDerivRudderStack extends Mock implements DerivRudderstack {} + class MockDerivGetStartedSlideModel extends Mock implements DerivGetStartedSlideModel {} @@ -22,6 +26,8 @@ class MockLanguageCubit extends MockCubit void main() { group('DerivGetStartedLayout', () { + late final MockDerivRudderStack mockDerivRudderstack; + late MockDerivGetStartedSlideModel mockSlideModel; const String appLogoIconPath = 'assets/icons/ic_logo_extended.svg'; @@ -31,6 +37,23 @@ void main() { setUpAll(() { mockSlideModel = MockDerivGetStartedSlideModel(); + + mockDerivRudderstack = MockDerivRudderStack(); + + AuthTrackingRepository.init( + 'test', + derivRudderstack: mockDerivRudderstack, + ); + + when(() => mockDerivRudderstack.track( + eventName: any(named: 'eventName'), + properties: any(named: 'properties'))).thenAnswer( + (_) => Future.value(true), + ); + + when(() => mockSlideModel.imagePath) + .thenReturn('assets/images/charts.svg'); + when(() => mockSlideModel.supportingText).thenReturn('Supporting text'); when(() => mockSlideModel.imagePath) .thenReturn('assets/images/charts.svg'); when(() => mockSlideModel.supportingText).thenReturn('Supporting text'); diff --git a/packages/deriv_auth/test/features/login/presentation/layouts/deriv_login_layout_test.dart b/packages/deriv_auth/test/features/login/presentation/layouts/deriv_login_layout_test.dart index 9d8ddba69..d1bedacdb 100644 --- a/packages/deriv_auth/test/features/login/presentation/layouts/deriv_login_layout_test.dart +++ b/packages/deriv_auth/test/features/login/presentation/layouts/deriv_login_layout_test.dart @@ -1,4 +1,6 @@ +import 'package:analytics/sdk/rudderstack/sdk/deriv_rudderstack_sdk.dart'; import 'package:bloc_test/bloc_test.dart'; +import 'package:deriv_auth/core/analytics/data/auth_tracking_repository.dart'; import 'package:deriv_auth/core/models/landig_comany_model.dart'; import 'package:deriv_auth/deriv_auth.dart'; import 'package:deriv_passkeys/deriv_passkeys.dart'; @@ -18,8 +20,11 @@ class MockDerivPasskeysBloc extends MockBloc implements DerivPasskeysBloc {} +class MockDerivRudderStackService extends Mock implements DerivRudderstack {} + void main() { group('DerivLoginLayout', () { + late MockDerivRudderStackService mockDerivRudderstack; late MockAuthCubit authCubit; late MockSocialAuthCubit socialAuthCubit; late MockDerivPasskeysBloc derivPasskeysBloc; @@ -27,10 +32,23 @@ void main() { const String welcomeLabel = 'Welcome Back'; setUpAll(() { + mockDerivRudderstack = MockDerivRudderStackService(); authCubit = MockAuthCubit(); socialAuthCubit = MockSocialAuthCubit(); derivPasskeysBloc = MockDerivPasskeysBloc(); + AuthTrackingRepository.init( + 'test', + derivRudderstack: mockDerivRudderstack, + ); + + when(() => mockDerivRudderstack.track( + eventName: any(named: 'eventName'), + properties: any(named: 'properties'), + )).thenAnswer( + (_) => Future.value(true), + ); + when(() => derivPasskeysBloc.state).thenReturn( DerivPasskeysInitializedState(), ); diff --git a/packages/deriv_auth/test/features/signup/presentation/layouts/deriv_signup_layout_test.dart b/packages/deriv_auth/test/features/signup/presentation/layouts/deriv_signup_layout_test.dart index e48555b03..bcd5aec8a 100644 --- a/packages/deriv_auth/test/features/signup/presentation/layouts/deriv_signup_layout_test.dart +++ b/packages/deriv_auth/test/features/signup/presentation/layouts/deriv_signup_layout_test.dart @@ -1,3 +1,5 @@ +import 'package:analytics/sdk/rudderstack/sdk/deriv_rudderstack_sdk.dart'; +import 'package:deriv_auth/core/analytics/data/auth_tracking_repository.dart'; import 'package:deriv_auth/deriv_auth.dart'; import 'package:deriv_ui/deriv_ui.dart'; import 'package:flutter/material.dart'; @@ -11,8 +13,11 @@ import '../../../../mocks.dart'; import '../../../../pump_app.dart'; import '../../../social_auth/mocks/mock_social_provider_model.dart'; +class MockDerivRudderStack extends Mock implements DerivRudderstack {} + void main() { group('DerivSignupLayout', () { + late final MockDerivRudderStack mockDerivRudderstack; late MockSignupCubit signupCubit; late MockAuthCubit authCubit; late MockSocialAuthCubit socialAuthCubit; @@ -25,6 +30,19 @@ void main() { authCubit = MockAuthCubit(); socialAuthCubit = MockSocialAuthCubit(); + mockDerivRudderstack = MockDerivRudderStack(); + + AuthTrackingRepository.init( + 'test', + derivRudderstack: mockDerivRudderstack, + ); + + when(() => mockDerivRudderstack.track( + eventName: any(named: 'eventName'), + properties: any(named: 'properties'))).thenAnswer( + (_) => Future.value(true), + ); + registerFallbackValue(SocialAuthProvider.google); when(() => signupCubit.state) From 11b46a9f7bd00482d3cac7820cf4cd5d61da0cad Mon Sep 17 00:00:00 2001 From: emad-deriv <134991873+emad-deriv@users.noreply.github.com> Date: Tue, 25 Jun 2024 13:10:47 +0800 Subject: [PATCH 110/162] fix(deriv_web_view): update deriv ui version in deriv auth (#639) --- packages/deriv_auth/example/pubspec.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/deriv_auth/example/pubspec.yaml b/packages/deriv_auth/example/pubspec.yaml index bd7100588..d2d0fcc46 100644 --- a/packages/deriv_auth/example/pubspec.yaml +++ b/packages/deriv_auth/example/pubspec.yaml @@ -23,13 +23,11 @@ dependencies: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_http_client ref: deriv_http_client-v2.0.1 - -dependency_overrides: deriv_ui: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.7+5 + ref: deriv_ui-v0.0.7+7 dev_dependencies: flutter_test: From b18609a00533aaab6d6962eb89f323e2f560df8b Mon Sep 17 00:00:00 2001 From: Osama Ghazal <124760982+osama-deriv@users.noreply.github.com> Date: Tue, 25 Jun 2024 14:55:01 +0800 Subject: [PATCH 111/162] feat(update_checker): add the ability to change the key from the app side (#628) --- .../lib/src/presentation/update_checker.dart | 14 ++++++++++++++ .../src/repositories/firebase_remote_config.dart | 6 ++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/packages/update_checker/lib/src/presentation/update_checker.dart b/packages/update_checker/lib/src/presentation/update_checker.dart index 88eeaa134..9f9514d6c 100644 --- a/packages/update_checker/lib/src/presentation/update_checker.dart +++ b/packages/update_checker/lib/src/presentation/update_checker.dart @@ -1,3 +1,4 @@ +import 'package:firebase_remote_config/firebase_remote_config.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:update_checker/src/repositories/base_firebase.dart'; @@ -43,6 +44,19 @@ class _UpdateCheckerState extends State { @override void initState() { super.initState(); + // Configure fetch settings + FirebaseRemoteConfig.instance.setConfigSettings(RemoteConfigSettings( + fetchTimeout: const Duration(seconds: 10), + // Default fetch timeout + + // As google set a limit of 5 call per hour for each device, + // we set the minimumFetchInterval to 15 minutes + // to avoid Throttling error, + // check: https://firebase.google.com/docs/remote-config/get-started?platform=ios#throttling + minimumFetchInterval: + const Duration(minutes: 15), // Minimum fetch interval set to 0 + )); + _updateBloc = UpdateBloc(firebaseRepository: widget.firebaseRepository); _updateBloc.add(UpdateFetchEvent()); } diff --git a/packages/update_checker/lib/src/repositories/firebase_remote_config.dart b/packages/update_checker/lib/src/repositories/firebase_remote_config.dart index 8fdd42e2d..58bbd165a 100644 --- a/packages/update_checker/lib/src/repositories/firebase_remote_config.dart +++ b/packages/update_checker/lib/src/repositories/firebase_remote_config.dart @@ -5,9 +5,11 @@ import 'package:update_checker/src/repositories/base_firebase.dart'; /// the firebase database. class FirebaseRemoteConfigRepository implements BaseFirebase { /// Initializes the Firebase Database repository - const FirebaseRemoteConfigRepository(); + FirebaseRemoteConfigRepository( + {String versionControlKey = 'app_version_control'}) + : _versionControlKey = versionControlKey; - static const String _versionControlKey = 'app_version_control'; + late final String _versionControlKey; /// Fetches the update information from the database. @override From c19c8423914489149de847673884a01715ef3ccb Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Tue, 25 Jun 2024 15:32:16 +0800 Subject: [PATCH 112/162] chore(version): bump version and update changelog (#638) --- CHANGELOG.md | 46 +++++++++++++++++++ README.md | 16 +++---- packages/deriv_auth/CHANGELOG.md | 5 ++ packages/deriv_auth/example/pubspec.yaml | 10 ---- packages/deriv_auth/pubspec.yaml | 12 ++--- packages/deriv_language_selector/CHANGELOG.md | 4 ++ packages/deriv_language_selector/pubspec.yaml | 4 +- packages/deriv_passkeys/CHANGELOG.md | 4 ++ packages/deriv_passkeys/pubspec.yaml | 4 +- packages/deriv_ui/CHANGELOG.md | 4 ++ packages/deriv_ui/pubspec.yaml | 4 +- packages/deriv_web_view/CHANGELOG.md | 5 ++ packages/deriv_web_view/pubspec.yaml | 2 +- packages/deriv_widgetbook/CHANGELOG.md | 4 ++ packages/deriv_widgetbook/pubspec.yaml | 4 +- packages/update_checker/CHANGELOG.md | 4 ++ packages/update_checker/pubspec.yaml | 2 +- 17 files changed, 100 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 648ca89cb..a60653cbf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,52 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-06-25 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_auth` - `v6.7.0`](#deriv_auth---v670) + - [`deriv_web_view` - `v0.2.2+2`](#deriv_web_view---v0222) + - [`update_checker` - `v1.4.0`](#update_checker---v140) + - [`deriv_ui` - `v0.0.7+8`](#deriv_ui---v0078) + - [`deriv_widgetbook` - `v0.0.2+8`](#deriv_widgetbook---v0028) + - [`deriv_passkeys` - `v0.0.2+2`](#deriv_passkeys---v0022) + - [`deriv_language_selector` - `v0.0.2+6`](#deriv_language_selector---v0026) + +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_ui` - `v0.0.7+8` + - `deriv_widgetbook` - `v0.0.2+8` + - `deriv_passkeys` - `v0.0.2+2` + - `deriv_language_selector` - `v0.0.2+6` + +--- + +#### `deriv_auth` - `v6.7.0` + + - **FIX**(deriv_web_view): update deriv ui version in deriv auth ([#639](https://github.com/regentmarkets/flutter-deriv-packages/issues/639)). ([11b46a9f](https://github.com/regentmarkets/flutter-deriv-packages/commit/11b46a9f7bd00482d3cac7820cf4cd5d61da0cad)) + - **FEAT**(deriv_auth): add log in user tracking events. ([#620](https://github.com/regentmarkets/flutter-deriv-packages/issues/620)). ([ae9556cf](https://github.com/regentmarkets/flutter-deriv-packages/commit/ae9556cf3af98196bb22e351d9a8eccbf534889c)) + +#### `deriv_web_view` - `v0.2.2+2` + + - **FIX**(deriv_web_view): update deriv web view readme file ([#637](https://github.com/regentmarkets/flutter-deriv-packages/issues/637)). ([b0b66dad](https://github.com/regentmarkets/flutter-deriv-packages/commit/b0b66dadb6cb1b30dc3ad759f2eee031673b6bbf)) + - **FIX**(deriv_webview): add language parameter to needed classes ([#600](https://github.com/regentmarkets/flutter-deriv-packages/issues/600)). ([9b857999](https://github.com/regentmarkets/flutter-deriv-packages/commit/9b857999f479486830671f8b8e8b7fc26dcd769b)) + +#### `update_checker` - `v1.4.0` + + - **FEAT**(update_checker): add the ability to change the key from the app side ([#628](https://github.com/regentmarkets/flutter-deriv-packages/issues/628)). ([b18609a0](https://github.com/regentmarkets/flutter-deriv-packages/commit/b18609a00533aaab6d6962eb89f323e2f560df8b)) + + ## 2024-06-24 ### Changes diff --git a/README.md b/README.md index 1d6a3ea04..f3c46b68e 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.6.9)`. 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.7.0)`. 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+7 #your prefered version + ref: deriv_ui-v0.0.7+8 #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'. | [v2.0.0](./packages/analytics/CHANGELOG.md) | -| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.6.9 ](./packages/deriv_auth/CHANGELOG.md) | +| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.0 ](./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,20 +31,20 @@ 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+2](./packages/deriv_live_chat/CHANGELOG.md) | -| [deriv_language_selector](./packages/deriv_language_selector) | A package to handle language change of the app. | [v0.0.2+5](./packages/deriv_language_selector/CHANGELOG.md) | +| [deriv_language_selector](./packages/deriv_language_selector) | A package to handle language change of the app. | [v0.0.2+6](./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.4.4](./packages/deriv_localizations/CHANGELOG.md) | | [deriv_numpad](./packages/deriv_numpad) | Number Pad Widget for number input. | [v1.1.5](./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+7](./packages/deriv_ui/CHANGELOG.md) | +| [deriv_ui](./packages/deriv_ui) | A package that contains the UI components used by Deriv products. | [v0.0.7+8](./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+1](./packages/deriv_web_view/CHANGELOG.md) | -| [deriv_widgetbook](./packages/deriv_widgetbook) |Storybook for Deriv UI Widgets and Components | [v0.0.2+7](./packages/deriv_widgetbook/CHANGELOG.md) | +| [deriv_web_view](./packages/deriv_web_view) | Deriv web view package. | [v0.2.2+2](./packages/deriv_web_view/CHANGELOG.md) | +| [deriv_widgetbook](./packages/deriv_widgetbook) |Storybook for Deriv UI Widgets and Components | [v0.0.2+8](./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.3.0](./packages/update_checker/CHANGELOG.md) | +| [update_checker](./packages/update_checker) | Check and retrieve update information from the server for the given package. | [v1.4.0](./packages/update_checker/CHANGELOG.md) | | [deriv_feature_flag](./packages/deriv_feature_flag) | A package to provide feature flag functionality for apps. | [v0.1.1](./packages/deriv_feature_flag/CHANGELOG.md) | ## Environment Setup diff --git a/packages/deriv_auth/CHANGELOG.md b/packages/deriv_auth/CHANGELOG.md index 4c1180287..98adbe202 100644 --- a/packages/deriv_auth/CHANGELOG.md +++ b/packages/deriv_auth/CHANGELOG.md @@ -1,3 +1,8 @@ +## 6.7.0 + + - **FIX**(deriv_web_view): update deriv ui version in deriv auth ([#639](https://github.com/regentmarkets/flutter-deriv-packages/issues/639)). ([11b46a9f](https://github.com/regentmarkets/flutter-deriv-packages/commit/11b46a9f7bd00482d3cac7820cf4cd5d61da0cad)) + - **FEAT**(deriv_auth): add log in user tracking events. ([#620](https://github.com/regentmarkets/flutter-deriv-packages/issues/620)). ([ae9556cf](https://github.com/regentmarkets/flutter-deriv-packages/commit/ae9556cf3af98196bb22e351d9a8eccbf534889c)) + ## 6.6.9 - Update a dependency to the latest release. diff --git a/packages/deriv_auth/example/pubspec.yaml b/packages/deriv_auth/example/pubspec.yaml index d2d0fcc46..ce0a6b59c 100644 --- a/packages/deriv_auth/example/pubspec.yaml +++ b/packages/deriv_auth/example/pubspec.yaml @@ -18,16 +18,6 @@ dependencies: flutter_bloc: ^8.1.3 http: ^0.13.6 device_preview: ^1.1.0 - deriv_http_client: - git: - url: git@github.com:regentmarkets/flutter-deriv-packages.git - path: packages/deriv_http_client - ref: deriv_http_client-v2.0.1 - deriv_ui: - git: - url: git@github.com:regentmarkets/flutter-deriv-packages.git - path: packages/deriv_ui - ref: deriv_ui-v0.0.7+7 dev_dependencies: flutter_test: diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index a9fc818da..3bc47c29f 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.6.9 +version: 6.7.0 environment: sdk: ">=3.0.0 <4.0.0" @@ -28,7 +28,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.7+7 + ref: deriv_ui-v0.0.7+8 deriv_http_client: git: @@ -45,7 +45,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_web_view - ref: deriv_web_view-v0.2.2+1 + ref: deriv_web_view-v0.2.2+2 deriv_localizations: git: @@ -57,13 +57,13 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: deriv_passkeys-v0.0.2+1 + ref: deriv_passkeys-v0.0.2+2 deriv_language_selector: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_language_selector - ref: deriv_language_selector-v0.0.2+5 + ref: deriv_language_selector-v0.0.2+6 flutter_bloc: ^8.1.3 flutter_svg: ^2.0.7 @@ -79,7 +79,7 @@ dependency_overrides: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.7+7 + ref: deriv_ui-v0.0.7+8 dev_dependencies: mocktail: ^1.0.3 diff --git a/packages/deriv_language_selector/CHANGELOG.md b/packages/deriv_language_selector/CHANGELOG.md index 527f6375f..f67193042 100644 --- a/packages/deriv_language_selector/CHANGELOG.md +++ b/packages/deriv_language_selector/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.2+6 + + - Update a dependency to the latest release. + ## 0.0.2+5 - Update a dependency to the latest release. diff --git a/packages/deriv_language_selector/pubspec.yaml b/packages/deriv_language_selector/pubspec.yaml index a1e11f930..9a504d4ed 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+5 +version: 0.0.2+6 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+7 + ref: deriv_ui-v0.0.7+8 shared_preferences: ^2.2.2 flutter_bloc: ^8.1.4 equatable: ^2.0.5 diff --git a/packages/deriv_passkeys/CHANGELOG.md b/packages/deriv_passkeys/CHANGELOG.md index 863c60366..74a01b41d 100644 --- a/packages/deriv_passkeys/CHANGELOG.md +++ b/packages/deriv_passkeys/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.2+2 + + - Update a dependency to the latest release. + ## 0.0.2+1 - Update a dependency to the latest release. diff --git a/packages/deriv_passkeys/pubspec.yaml b/packages/deriv_passkeys/pubspec.yaml index 353df4251..e5591d6c1 100644 --- a/packages/deriv_passkeys/pubspec.yaml +++ b/packages/deriv_passkeys/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_passkeys description: Deriv Passkeys Flutter Plugin -version: 0.0.2+1 +version: 0.0.2+2 publish_to: "none" environment: @@ -32,7 +32,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.7+7 + ref: deriv_ui-v0.0.7+8 deriv_http_client: git: diff --git a/packages/deriv_ui/CHANGELOG.md b/packages/deriv_ui/CHANGELOG.md index 567ab709b..49cb32b82 100644 --- a/packages/deriv_ui/CHANGELOG.md +++ b/packages/deriv_ui/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.7+8 + + - Update a dependency to the latest release. + ## 0.0.7+7 - **REFACTOR**(deriv_ui): [DERG-3500] return inputted amount based on the formatter in numpad ([#624](https://github.com/regentmarkets/flutter-deriv-packages/issues/624)). ([fdf4df19](https://github.com/regentmarkets/flutter-deriv-packages/commit/fdf4df1979ddb8710dba8925ef779cca25d60615)) diff --git a/packages/deriv_ui/pubspec.yaml b/packages/deriv_ui/pubspec.yaml index 39c84205d..2ae95f03b 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+7 +version: 0.0.7+8 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+1 + ref: deriv_web_view-v0.2.2+2 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 c90de8c2a..8a7b08cb7 100644 --- a/packages/deriv_web_view/CHANGELOG.md +++ b/packages/deriv_web_view/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.2.2+2 + + - **FIX**(deriv_web_view): update deriv web view readme file ([#637](https://github.com/regentmarkets/flutter-deriv-packages/issues/637)). ([b0b66dad](https://github.com/regentmarkets/flutter-deriv-packages/commit/b0b66dadb6cb1b30dc3ad759f2eee031673b6bbf)) + - **FIX**(deriv_webview): add language parameter to needed classes ([#600](https://github.com/regentmarkets/flutter-deriv-packages/issues/600)). ([9b857999](https://github.com/regentmarkets/flutter-deriv-packages/commit/9b857999f479486830671f8b8e8b7fc26dcd769b)) + ## 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)) diff --git a/packages/deriv_web_view/pubspec.yaml b/packages/deriv_web_view/pubspec.yaml index b2198fe66..5120b322f 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+1 +version: 0.2.2+2 homepage: https://deriv.com/ publish_to: "none" diff --git a/packages/deriv_widgetbook/CHANGELOG.md b/packages/deriv_widgetbook/CHANGELOG.md index 55de88fb6..14dfc819a 100644 --- a/packages/deriv_widgetbook/CHANGELOG.md +++ b/packages/deriv_widgetbook/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.2+8 + + - Update a dependency to the latest release. + ## 0.0.2+7 - Update a dependency to the latest release. diff --git a/packages/deriv_widgetbook/pubspec.yaml b/packages/deriv_widgetbook/pubspec.yaml index 8a08de817..9fc50e51e 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+7 +version: 0.0.2+8 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+7 + ref: deriv_ui-v0.0.7+8 deriv_theme: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git diff --git a/packages/update_checker/CHANGELOG.md b/packages/update_checker/CHANGELOG.md index 04eae25e0..caf0d3f95 100644 --- a/packages/update_checker/CHANGELOG.md +++ b/packages/update_checker/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.4.0 + + - **FEAT**(update_checker): add the ability to change the key from the app side ([#628](https://github.com/regentmarkets/flutter-deriv-packages/issues/628)). ([b18609a0](https://github.com/regentmarkets/flutter-deriv-packages/commit/b18609a00533aaab6d6962eb89f323e2f560df8b)) + ## 1.3.0 - **FEAT**(deriv_logger): add ability to print prettified logs in console and UI ([#608](https://github.com/regentmarkets/flutter-deriv-packages/issues/608)). ([5a91c24b](https://github.com/regentmarkets/flutter-deriv-packages/commit/5a91c24bde607ff37940edf18f8dfac67d3fc4fa)) diff --git a/packages/update_checker/pubspec.yaml b/packages/update_checker/pubspec.yaml index ea68d1f23..5d50c0fc9 100644 --- a/packages/update_checker/pubspec.yaml +++ b/packages/update_checker/pubspec.yaml @@ -1,6 +1,6 @@ name: update_checker description: Check and retrieve update information from the server for the given package. -version: 1.3.0 +version: 1.4.0 homepage: https://deriv.com/ publish_to: "none" From e41815416eb76b3724481f8a0b980e943311ebeb Mon Sep 17 00:00:00 2001 From: abedelaziz-deriv <135210555+abedelaziz-deriv@users.noreply.github.com> Date: Tue, 25 Jun 2024 21:10:15 +0800 Subject: [PATCH 113/162] fix(deriv_auth): Fix login provider null issue (#641) --- .../lib/core/analytics/data/auth_tracking_repository.dart | 1 + .../features/login/presentation/layouts/deriv_login_layout.dart | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/deriv_auth/lib/core/analytics/data/auth_tracking_repository.dart b/packages/deriv_auth/lib/core/analytics/data/auth_tracking_repository.dart index f5fbe2757..6e898f633 100644 --- a/packages/deriv_auth/lib/core/analytics/data/auth_tracking_repository.dart +++ b/packages/deriv_auth/lib/core/analytics/data/auth_tracking_repository.dart @@ -54,6 +54,7 @@ class AuthTrackingRepository implements AuthUserTrackingInterface { final Map data = getUserTrackingData( LoginAction.loginError, _appId, + provider: _loginProvider, errorMessage: errorMessage, ); 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 5ec252b9c..4c14f4800 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 @@ -133,7 +133,6 @@ class _DerivLoginLayoutState extends State centerTitle: false, ), body: BlocConsumer( - bloc: authCubit, listener: _onAuthState, builder: (BuildContext context, DerivAuthState state) => Form( key: _formKey, From fa17c409001a7444f7fe9c5437dd25b83b69988f Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Tue, 25 Jun 2024 21:25:59 +0800 Subject: [PATCH 114/162] chore(version): bump version and update changelog (#643) --- CHANGELOG.md | 40 +++++++++++++++++++ README.md | 14 +++---- packages/deriv_auth/CHANGELOG.md | 5 +++ packages/deriv_auth/pubspec.yaml | 12 +++--- packages/deriv_language_selector/CHANGELOG.md | 4 ++ packages/deriv_language_selector/pubspec.yaml | 4 +- packages/deriv_passkeys/CHANGELOG.md | 4 ++ packages/deriv_passkeys/pubspec.yaml | 4 +- packages/deriv_ui/CHANGELOG.md | 4 ++ packages/deriv_ui/pubspec.yaml | 4 +- packages/deriv_web_view/CHANGELOG.md | 4 ++ packages/deriv_web_view/pubspec.yaml | 2 +- packages/deriv_widgetbook/CHANGELOG.md | 4 ++ packages/deriv_widgetbook/pubspec.yaml | 4 +- 14 files changed, 87 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a60653cbf..30a69b7bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,46 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-06-25 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_auth` - `v6.7.1`](#deriv_auth---v671) + - [`deriv_web_view` - `v0.2.2+3`](#deriv_web_view---v0223) + - [`deriv_ui` - `v0.0.7+9`](#deriv_ui---v0079) + - [`deriv_widgetbook` - `v0.0.2+9`](#deriv_widgetbook---v0029) + - [`deriv_passkeys` - `v0.0.2+3`](#deriv_passkeys---v0023) + - [`deriv_language_selector` - `v0.0.2+7`](#deriv_language_selector---v0027) + +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_ui` - `v0.0.7+9` + - `deriv_widgetbook` - `v0.0.2+9` + - `deriv_passkeys` - `v0.0.2+3` + - `deriv_language_selector` - `v0.0.2+7` + +--- + +#### `deriv_auth` - `v6.7.1` + + - **FIX**(deriv_auth): Fix login provider null issue ([#641](https://github.com/regentmarkets/flutter-deriv-packages/issues/641)). ([e4181541](https://github.com/regentmarkets/flutter-deriv-packages/commit/e41815416eb76b3724481f8a0b980e943311ebeb)) + - **FIX**(deriv_web_view): update deriv ui version in deriv auth ([#639](https://github.com/regentmarkets/flutter-deriv-packages/issues/639)). ([11b46a9f](https://github.com/regentmarkets/flutter-deriv-packages/commit/11b46a9f7bd00482d3cac7820cf4cd5d61da0cad)) + +#### `deriv_web_view` - `v0.2.2+3` + + - **FIX**(deriv_web_view): update deriv web view readme file ([#637](https://github.com/regentmarkets/flutter-deriv-packages/issues/637)). ([b0b66dad](https://github.com/regentmarkets/flutter-deriv-packages/commit/b0b66dadb6cb1b30dc3ad759f2eee031673b6bbf)) + + ## 2024-06-25 ### Changes diff --git a/README.md b/README.md index f3c46b68e..d9e7ee691 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.7.0)`. 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.7.1)`. 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+8 #your prefered version + ref: deriv_ui-v0.0.7+9 #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'. | [v2.0.0](./packages/analytics/CHANGELOG.md) | -| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.0 ](./packages/deriv_auth/CHANGELOG.md) | +| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.1 ](./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+2](./packages/deriv_live_chat/CHANGELOG.md) | -| [deriv_language_selector](./packages/deriv_language_selector) | A package to handle language change of the app. | [v0.0.2+6](./packages/deriv_language_selector/CHANGELOG.md) | +| [deriv_language_selector](./packages/deriv_language_selector) | A package to handle language change of the app. | [v0.0.2+7](./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.4.4](./packages/deriv_localizations/CHANGELOG.md) | | [deriv_numpad](./packages/deriv_numpad) | Number Pad Widget for number input. | [v1.1.5](./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+8](./packages/deriv_ui/CHANGELOG.md) | +| [deriv_ui](./packages/deriv_ui) | A package that contains the UI components used by Deriv products. | [v0.0.7+9](./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+2](./packages/deriv_web_view/CHANGELOG.md) | -| [deriv_widgetbook](./packages/deriv_widgetbook) |Storybook for Deriv UI Widgets and Components | [v0.0.2+8](./packages/deriv_widgetbook/CHANGELOG.md) | +| [deriv_web_view](./packages/deriv_web_view) | Deriv web view package. | [v0.2.2+3](./packages/deriv_web_view/CHANGELOG.md) | +| [deriv_widgetbook](./packages/deriv_widgetbook) |Storybook for Deriv UI Widgets and Components | [v0.0.2+9](./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.4.0](./packages/update_checker/CHANGELOG.md) | | [deriv_feature_flag](./packages/deriv_feature_flag) | A package to provide feature flag functionality for apps. | [v0.1.1](./packages/deriv_feature_flag/CHANGELOG.md) | diff --git a/packages/deriv_auth/CHANGELOG.md b/packages/deriv_auth/CHANGELOG.md index 98adbe202..9c4cc3686 100644 --- a/packages/deriv_auth/CHANGELOG.md +++ b/packages/deriv_auth/CHANGELOG.md @@ -1,3 +1,8 @@ +## 6.7.1 + + - **FIX**(deriv_auth): Fix login provider null issue ([#641](https://github.com/regentmarkets/flutter-deriv-packages/issues/641)). ([e4181541](https://github.com/regentmarkets/flutter-deriv-packages/commit/e41815416eb76b3724481f8a0b980e943311ebeb)) + - **FIX**(deriv_web_view): update deriv ui version in deriv auth ([#639](https://github.com/regentmarkets/flutter-deriv-packages/issues/639)). ([11b46a9f](https://github.com/regentmarkets/flutter-deriv-packages/commit/11b46a9f7bd00482d3cac7820cf4cd5d61da0cad)) + ## 6.7.0 - **FIX**(deriv_web_view): update deriv ui version in deriv auth ([#639](https://github.com/regentmarkets/flutter-deriv-packages/issues/639)). ([11b46a9f](https://github.com/regentmarkets/flutter-deriv-packages/commit/11b46a9f7bd00482d3cac7820cf4cd5d61da0cad)) diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index 3bc47c29f..a63fa69f9 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.7.0 +version: 6.7.1 environment: sdk: ">=3.0.0 <4.0.0" @@ -28,7 +28,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.7+8 + ref: deriv_ui-v0.0.7+9 deriv_http_client: git: @@ -45,7 +45,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_web_view - ref: deriv_web_view-v0.2.2+2 + ref: deriv_web_view-v0.2.2+3 deriv_localizations: git: @@ -57,13 +57,13 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: deriv_passkeys-v0.0.2+2 + ref: deriv_passkeys-v0.0.2+3 deriv_language_selector: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_language_selector - ref: deriv_language_selector-v0.0.2+6 + ref: deriv_language_selector-v0.0.2+7 flutter_bloc: ^8.1.3 flutter_svg: ^2.0.7 @@ -79,7 +79,7 @@ dependency_overrides: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.7+8 + ref: deriv_ui-v0.0.7+9 dev_dependencies: mocktail: ^1.0.3 diff --git a/packages/deriv_language_selector/CHANGELOG.md b/packages/deriv_language_selector/CHANGELOG.md index f67193042..042e415f2 100644 --- a/packages/deriv_language_selector/CHANGELOG.md +++ b/packages/deriv_language_selector/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.2+7 + + - Update a dependency to the latest release. + ## 0.0.2+6 - Update a dependency to the latest release. diff --git a/packages/deriv_language_selector/pubspec.yaml b/packages/deriv_language_selector/pubspec.yaml index 9a504d4ed..65dbe3b48 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+6 +version: 0.0.2+7 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+8 + ref: deriv_ui-v0.0.7+9 shared_preferences: ^2.2.2 flutter_bloc: ^8.1.4 equatable: ^2.0.5 diff --git a/packages/deriv_passkeys/CHANGELOG.md b/packages/deriv_passkeys/CHANGELOG.md index 74a01b41d..45d557892 100644 --- a/packages/deriv_passkeys/CHANGELOG.md +++ b/packages/deriv_passkeys/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_passkeys/pubspec.yaml b/packages/deriv_passkeys/pubspec.yaml index e5591d6c1..d97350d14 100644 --- a/packages/deriv_passkeys/pubspec.yaml +++ b/packages/deriv_passkeys/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_passkeys description: Deriv Passkeys Flutter Plugin -version: 0.0.2+2 +version: 0.0.2+3 publish_to: "none" environment: @@ -32,7 +32,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.7+8 + ref: deriv_ui-v0.0.7+9 deriv_http_client: git: diff --git a/packages/deriv_ui/CHANGELOG.md b/packages/deriv_ui/CHANGELOG.md index 49cb32b82..84203b2c2 100644 --- a/packages/deriv_ui/CHANGELOG.md +++ b/packages/deriv_ui/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.7+9 + + - Update a dependency to the latest release. + ## 0.0.7+8 - Update a dependency to the latest release. diff --git a/packages/deriv_ui/pubspec.yaml b/packages/deriv_ui/pubspec.yaml index 2ae95f03b..08fa0368b 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+8 +version: 0.0.7+9 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+2 + ref: deriv_web_view-v0.2.2+3 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 8a7b08cb7..caf42b7ba 100644 --- a/packages/deriv_web_view/CHANGELOG.md +++ b/packages/deriv_web_view/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.2.2+3 + + - **FIX**(deriv_web_view): update deriv web view readme file ([#637](https://github.com/regentmarkets/flutter-deriv-packages/issues/637)). ([b0b66dad](https://github.com/regentmarkets/flutter-deriv-packages/commit/b0b66dadb6cb1b30dc3ad759f2eee031673b6bbf)) + ## 0.2.2+2 - **FIX**(deriv_web_view): update deriv web view readme file ([#637](https://github.com/regentmarkets/flutter-deriv-packages/issues/637)). ([b0b66dad](https://github.com/regentmarkets/flutter-deriv-packages/commit/b0b66dadb6cb1b30dc3ad759f2eee031673b6bbf)) diff --git a/packages/deriv_web_view/pubspec.yaml b/packages/deriv_web_view/pubspec.yaml index 5120b322f..919b4f04a 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+2 +version: 0.2.2+3 homepage: https://deriv.com/ publish_to: "none" diff --git a/packages/deriv_widgetbook/CHANGELOG.md b/packages/deriv_widgetbook/CHANGELOG.md index 14dfc819a..5163095e0 100644 --- a/packages/deriv_widgetbook/CHANGELOG.md +++ b/packages/deriv_widgetbook/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.2+9 + + - Update a dependency to the latest release. + ## 0.0.2+8 - Update a dependency to the latest release. diff --git a/packages/deriv_widgetbook/pubspec.yaml b/packages/deriv_widgetbook/pubspec.yaml index 9fc50e51e..79424c1a1 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+8 +version: 0.0.2+9 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+8 + ref: deriv_ui-v0.0.7+9 deriv_theme: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git From d1fb8590eb5eb55f9bd9db3a255f33cf152f364d Mon Sep 17 00:00:00 2001 From: emad-deriv <134991873+emad-deriv@users.noreply.github.com> Date: Wed, 26 Jun 2024 12:16:43 +0800 Subject: [PATCH 115/162] fix(deriv_passkeys): fix passkeys success button styles (#629) --- .../passkey_created_call_to_action.dart | 31 +++++++++---------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/packages/deriv_passkeys/lib/src/presentation/widgets/passkey_created_call_to_action.dart b/packages/deriv_passkeys/lib/src/presentation/widgets/passkey_created_call_to_action.dart index 2555e0bf1..919aaaaa5 100644 --- a/packages/deriv_passkeys/lib/src/presentation/widgets/passkey_created_call_to_action.dart +++ b/packages/deriv_passkeys/lib/src/presentation/widgets/passkey_created_call_to_action.dart @@ -21,28 +21,25 @@ class PasskeysCreatedCallToAction extends StatelessWidget { @override Widget build(BuildContext context) => Padding( padding: const EdgeInsets.all(16), - child: Row( + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - Expanded( - child: SecondaryButton( - onPressed: () => addMorePasskeysNavigationCallback(context), - child: Text( - context.derivPasskeysLocalizations.addMorePasskeysButtonText, - style: TextStyle( - color: context.theme.colors.prominent, - ), + SecondaryButton( + onPressed: () => addMorePasskeysNavigationCallback(context), + child: Text( + context.derivPasskeysLocalizations.addMorePasskeysButtonText, + style: TextStyle( + color: context.theme.colors.prominent, ), ), ), const SizedBox(width: 16), - Expanded( - child: PrimaryButton( - onPressed: () => continueTradingNavigationCallback(context), - child: Text( - context.derivPasskeysLocalizations.continueTradingButtonText, - style: TextStyle( - color: context.theme.colors.prominent, - ), + PrimaryButton( + onPressed: () => continueTradingNavigationCallback(context), + child: Text( + context.derivPasskeysLocalizations.continueTradingButtonText, + style: TextStyle( + color: context.theme.colors.prominent, ), ), ), From d45e7f733d8d04527c97fd66675e87ce80fd7b16 Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Wed, 26 Jun 2024 13:05:02 +0800 Subject: [PATCH 116/162] chore(version): bump version and update changelog (#644) --- CHANGELOG.md | 28 ++++++++++++++++++++++++++++ README.md | 4 ++-- packages/deriv_auth/CHANGELOG.md | 4 ++++ packages/deriv_auth/pubspec.yaml | 4 ++-- packages/deriv_passkeys/CHANGELOG.md | 4 ++++ packages/deriv_passkeys/pubspec.yaml | 2 +- 6 files changed, 41 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30a69b7bf..05f53d782 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,34 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-06-26 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_passkeys` - `v0.0.2+4`](#deriv_passkeys---v0024) + - [`deriv_auth` - `v6.7.2`](#deriv_auth---v672) + +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.7.2` + +--- + +#### `deriv_passkeys` - `v0.0.2+4` + + - **FIX**(deriv_passkeys): fix passkeys success button styles ([#629](https://github.com/regentmarkets/flutter-deriv-packages/issues/629)). ([d1fb8590](https://github.com/regentmarkets/flutter-deriv-packages/commit/d1fb8590eb5eb55f9bd9db3a255f33cf152f364d)) + + ## 2024-06-25 ### Changes diff --git a/README.md b/README.md index d9e7ee691..65409f884 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.7.1)`. 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.7.2)`. To use the package, add the following to your pubspec.yaml file: ```yaml @@ -20,7 +20,7 @@ deriv_ui: | Name | Description | Version | | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | | [analytics](./packages/analytics) | Used to collect and send analytical information to 'Firebase' and 'Segment'. | [v2.0.0](./packages/analytics/CHANGELOG.md) | -| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.1 ](./packages/deriv_auth/CHANGELOG.md) | +| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.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) | diff --git a/packages/deriv_auth/CHANGELOG.md b/packages/deriv_auth/CHANGELOG.md index 9c4cc3686..ced45ad6e 100644 --- a/packages/deriv_auth/CHANGELOG.md +++ b/packages/deriv_auth/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.7.2 + + - Update a dependency to the latest release. + ## 6.7.1 - **FIX**(deriv_auth): Fix login provider null issue ([#641](https://github.com/regentmarkets/flutter-deriv-packages/issues/641)). ([e4181541](https://github.com/regentmarkets/flutter-deriv-packages/commit/e41815416eb76b3724481f8a0b980e943311ebeb)) diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index a63fa69f9..8b18d7ab1 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.7.1 +version: 6.7.2 environment: sdk: ">=3.0.0 <4.0.0" @@ -57,7 +57,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: deriv_passkeys-v0.0.2+3 + ref: deriv_passkeys-v0.0.2+4 deriv_language_selector: git: diff --git a/packages/deriv_passkeys/CHANGELOG.md b/packages/deriv_passkeys/CHANGELOG.md index 45d557892..a5e322660 100644 --- a/packages/deriv_passkeys/CHANGELOG.md +++ b/packages/deriv_passkeys/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.2+4 + + - **FIX**(deriv_passkeys): fix passkeys success button styles ([#629](https://github.com/regentmarkets/flutter-deriv-packages/issues/629)). ([d1fb8590](https://github.com/regentmarkets/flutter-deriv-packages/commit/d1fb8590eb5eb55f9bd9db3a255f33cf152f364d)) + ## 0.0.2+3 - Update a dependency to the latest release. diff --git a/packages/deriv_passkeys/pubspec.yaml b/packages/deriv_passkeys/pubspec.yaml index d97350d14..14982d764 100644 --- a/packages/deriv_passkeys/pubspec.yaml +++ b/packages/deriv_passkeys/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_passkeys description: Deriv Passkeys Flutter Plugin -version: 0.0.2+3 +version: 0.0.2+4 publish_to: "none" environment: From 33f5e3a1bc0765cb8559b5a39e300b8c088aa705 Mon Sep 17 00:00:00 2001 From: ramin-deriv <55975218+ramin-deriv@users.noreply.github.com> Date: Wed, 26 Jun 2024 14:41:01 +0800 Subject: [PATCH 117/162] feat(deriv_localizations): add localization for deriv mobile chart wrapper package (#627) --- packages/deriv_localizations/l10n.sh | 19 ++++++++++++++----- .../deriv_mobile_chart_wrapper/app_en.arb | 3 +++ 2 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_en.arb diff --git a/packages/deriv_localizations/l10n.sh b/packages/deriv_localizations/l10n.sh index b825291b8..bf2e9fe61 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" "deriv_mobile_chart_wrapper") # Base localization directory base_l10n_dir="lib/l10n" @@ -29,14 +29,23 @@ done ls $base_l10n_dir/generated -echo "Localization generation complete." - - # Add the generated localization files to Git git add "$base_l10n_dir/generated" +# Create deriv_localizations.dart barrel file under lib folder. +localizations_file="lib/deriv_localizations.dart" +echo "// Generated file for exporting localization classes" > $localizations_file + +for dir in "${feature_dirs[@]}"; do + echo "export 'l10n/generated/$dir/${dir}_localizations.dart';" >> $localizations_file +done + +echo "Created deriv_localizations.dart barrel file with exports." + +# Add and commit the deriv_localizations.dart barrel file to Git +git add $localizations_file + # Commit the changes git commit -m "Update localizations" - echo "Localization generation complete." diff --git a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_en.arb b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_en.arb new file mode 100644 index 000000000..d3fba5184 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_en.arb @@ -0,0 +1,3 @@ +{ + "labelIndicators": "Indicators" +} From 554793ec0ee090375492cb50c418cf5bfba10aec Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Wed, 26 Jun 2024 14:57:58 +0800 Subject: [PATCH 118/162] chore(version): bump version and update changelog (#646) Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: ramin-deriv --- CHANGELOG.md | 30 +++++++++++++++++++++++ README.md | 6 ++--- packages/deriv_auth/CHANGELOG.md | 4 +++ packages/deriv_auth/pubspec.yaml | 6 ++--- packages/deriv_localizations/CHANGELOG.md | 4 +++ packages/deriv_localizations/pubspec.yaml | 2 +- packages/deriv_passkeys/CHANGELOG.md | 4 +++ packages/deriv_passkeys/pubspec.yaml | 4 +-- 8 files changed, 51 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05f53d782..658f811ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,36 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-06-26 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_localizations` - `v1.5.0`](#deriv_localizations---v150) + - [`deriv_auth` - `v6.7.3`](#deriv_auth---v673) + - [`deriv_passkeys` - `v0.0.2+5`](#deriv_passkeys---v0025) + +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.7.3` + - `deriv_passkeys` - `v0.0.2+5` + +--- + +#### `deriv_localizations` - `v1.5.0` + + - **FEAT**(deriv_localizations): add localization for deriv mobile chart wrapper package ([#627](https://github.com/regentmarkets/flutter-deriv-packages/issues/627)). ([33f5e3a1](https://github.com/regentmarkets/flutter-deriv-packages/commit/33f5e3a1bc0765cb8559b5a39e300b8c088aa705)) + + ## 2024-06-26 ### Changes diff --git a/README.md b/README.md index 65409f884..b639e0b13 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.7.2)`. 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.7.3)`. To use the package, add the following to your pubspec.yaml file: ```yaml @@ -20,7 +20,7 @@ deriv_ui: | Name | Description | Version | | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | | [analytics](./packages/analytics) | Used to collect and send analytical information to 'Firebase' and 'Segment'. | [v2.0.0](./packages/analytics/CHANGELOG.md) | -| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.2 ](./packages/deriv_auth/CHANGELOG.md) | +| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.3 ](./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) | @@ -32,7 +32,7 @@ deriv_ui: | [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+2](./packages/deriv_live_chat/CHANGELOG.md) | | [deriv_language_selector](./packages/deriv_language_selector) | A package to handle language change of the app. | [v0.0.2+7](./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.4.4](./packages/deriv_localizations/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.5.0](./packages/deriv_localizations/CHANGELOG.md) | | [deriv_numpad](./packages/deriv_numpad) | Number Pad Widget for number input. | [v1.1.5](./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) | diff --git a/packages/deriv_auth/CHANGELOG.md b/packages/deriv_auth/CHANGELOG.md index ced45ad6e..e4ad2fdb3 100644 --- a/packages/deriv_auth/CHANGELOG.md +++ b/packages/deriv_auth/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.7.3 + + - Update a dependency to the latest release. + ## 6.7.2 - Update a dependency to the latest release. diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index 8b18d7ab1..73cbc2826 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.7.2 +version: 6.7.3 environment: sdk: ">=3.0.0 <4.0.0" @@ -51,13 +51,13 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_localizations - ref: deriv_localizations-v1.4.4 + ref: deriv_localizations-v1.5.0 deriv_passkeys: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: deriv_passkeys-v0.0.2+4 + ref: deriv_passkeys-v0.0.2+5 deriv_language_selector: git: diff --git a/packages/deriv_localizations/CHANGELOG.md b/packages/deriv_localizations/CHANGELOG.md index d162f2858..19f7c5d8c 100644 --- a/packages/deriv_localizations/CHANGELOG.md +++ b/packages/deriv_localizations/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.5.0 + + - **FEAT**(deriv_localizations): add localization for deriv mobile chart wrapper package ([#627](https://github.com/regentmarkets/flutter-deriv-packages/issues/627)). ([33f5e3a1](https://github.com/regentmarkets/flutter-deriv-packages/commit/33f5e3a1bc0765cb8559b5a39e300b8c088aa705)) + ## 1.4.4 - **REFACTOR**(deriv_localizations): Crowdin Localization Generated ([#617](https://github.com/regentmarkets/flutter-deriv-packages/issues/617)). ([1d5e5f14](https://github.com/regentmarkets/flutter-deriv-packages/commit/1d5e5f141640aa00546dcbb31d2db8eb9a994452)) diff --git a/packages/deriv_localizations/pubspec.yaml b/packages/deriv_localizations/pubspec.yaml index aa2b18e4f..cf5416a7f 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.4.4 +version: 1.5.0 environment: sdk: '>=3.0.2 <4.0.0' diff --git a/packages/deriv_passkeys/CHANGELOG.md b/packages/deriv_passkeys/CHANGELOG.md index a5e322660..1a3ce4d6c 100644 --- a/packages/deriv_passkeys/CHANGELOG.md +++ b/packages/deriv_passkeys/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.2+5 + + - Update a dependency to the latest release. + ## 0.0.2+4 - **FIX**(deriv_passkeys): fix passkeys success button styles ([#629](https://github.com/regentmarkets/flutter-deriv-packages/issues/629)). ([d1fb8590](https://github.com/regentmarkets/flutter-deriv-packages/commit/d1fb8590eb5eb55f9bd9db3a255f33cf152f364d)) diff --git a/packages/deriv_passkeys/pubspec.yaml b/packages/deriv_passkeys/pubspec.yaml index 14982d764..1dd116c70 100644 --- a/packages/deriv_passkeys/pubspec.yaml +++ b/packages/deriv_passkeys/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_passkeys description: Deriv Passkeys Flutter Plugin -version: 0.0.2+4 +version: 0.0.2+5 publish_to: "none" environment: @@ -26,7 +26,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_localizations - ref: deriv_localizations-v1.4.4 + ref: deriv_localizations-v1.5.0 deriv_ui: git: From 004236796cbf52cd5aa09eb4f78e53de0dda3518 Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Wed, 26 Jun 2024 15:47:48 +0800 Subject: [PATCH 119/162] chore(deriv_localizations): Crowdin Localization Updated (#647) --- .../lib/l10n/deriv_mobile_chart_wrapper/app_ar.arb | 3 +++ .../lib/l10n/deriv_mobile_chart_wrapper/app_bn.arb | 3 +++ .../lib/l10n/deriv_mobile_chart_wrapper/app_de.arb | 3 +++ .../lib/l10n/deriv_mobile_chart_wrapper/app_es.arb | 3 +++ .../lib/l10n/deriv_mobile_chart_wrapper/app_fr.arb | 3 +++ .../lib/l10n/deriv_mobile_chart_wrapper/app_it.arb | 3 +++ .../lib/l10n/deriv_mobile_chart_wrapper/app_ko.arb | 3 +++ .../lib/l10n/deriv_mobile_chart_wrapper/app_pl.arb | 3 +++ .../lib/l10n/deriv_mobile_chart_wrapper/app_pt.arb | 3 +++ .../lib/l10n/deriv_mobile_chart_wrapper/app_ru.arb | 3 +++ .../lib/l10n/deriv_mobile_chart_wrapper/app_si.arb | 3 +++ .../lib/l10n/deriv_mobile_chart_wrapper/app_sw.arb | 3 +++ .../lib/l10n/deriv_mobile_chart_wrapper/app_th.arb | 3 +++ .../lib/l10n/deriv_mobile_chart_wrapper/app_tr.arb | 3 +++ .../lib/l10n/deriv_mobile_chart_wrapper/app_vi.arb | 3 +++ .../lib/l10n/deriv_mobile_chart_wrapper/app_zh.arb | 3 +++ 16 files changed, 48 insertions(+) create mode 100644 packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_ar.arb create mode 100644 packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_bn.arb create mode 100644 packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_de.arb create mode 100644 packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_es.arb create mode 100644 packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_fr.arb create mode 100644 packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_it.arb create mode 100644 packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_ko.arb create mode 100644 packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_pl.arb create mode 100644 packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_pt.arb create mode 100644 packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_ru.arb create mode 100644 packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_si.arb create mode 100644 packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_sw.arb create mode 100644 packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_th.arb create mode 100644 packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_tr.arb create mode 100644 packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_vi.arb create mode 100644 packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_zh.arb diff --git a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_ar.arb b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_ar.arb new file mode 100644 index 000000000..1941c81f8 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_ar.arb @@ -0,0 +1,3 @@ +{ + "labelIndicators": "المؤشرات" +} \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_bn.arb b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_bn.arb new file mode 100644 index 000000000..c406ace5d --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_bn.arb @@ -0,0 +1,3 @@ +{ + "labelIndicators": "সূচক" +} \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_de.arb b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_de.arb new file mode 100644 index 000000000..ca7b35187 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_de.arb @@ -0,0 +1,3 @@ +{ + "labelIndicators": "Indikatoren" +} \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_es.arb b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_es.arb new file mode 100644 index 000000000..9503f6aab --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_es.arb @@ -0,0 +1,3 @@ +{ + "labelIndicators": "Indicadores" +} \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_fr.arb b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_fr.arb new file mode 100644 index 000000000..9a78c8fb2 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_fr.arb @@ -0,0 +1,3 @@ +{ + "labelIndicators": "Indicateurs" +} \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_it.arb b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_it.arb new file mode 100644 index 000000000..7dae053d1 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_it.arb @@ -0,0 +1,3 @@ +{ + "labelIndicators": "Indicatori" +} \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_ko.arb b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_ko.arb new file mode 100644 index 000000000..1df3fd1b7 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_ko.arb @@ -0,0 +1,3 @@ +{ + "labelIndicators": "지표" +} \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_pl.arb b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_pl.arb new file mode 100644 index 000000000..91d1d83c1 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_pl.arb @@ -0,0 +1,3 @@ +{ + "labelIndicators": "Wskaźniki" +} \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_pt.arb b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_pt.arb new file mode 100644 index 000000000..9503f6aab --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_pt.arb @@ -0,0 +1,3 @@ +{ + "labelIndicators": "Indicadores" +} \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_ru.arb b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_ru.arb new file mode 100644 index 000000000..4164941a3 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_ru.arb @@ -0,0 +1,3 @@ +{ + "labelIndicators": "Индикаторы" +} \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_si.arb b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_si.arb new file mode 100644 index 000000000..2571da265 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_si.arb @@ -0,0 +1,3 @@ +{ + "labelIndicators": "දර්ශක" +} \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_sw.arb b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_sw.arb new file mode 100644 index 000000000..c047b5c14 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_sw.arb @@ -0,0 +1,3 @@ +{ + "labelIndicators": "Viashiria" +} \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_th.arb b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_th.arb new file mode 100644 index 000000000..dd7623f15 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_th.arb @@ -0,0 +1,3 @@ +{ + "labelIndicators": "ตัวบ่งชี้" +} \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_tr.arb b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_tr.arb new file mode 100644 index 000000000..0dc2ae764 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_tr.arb @@ -0,0 +1,3 @@ +{ + "labelIndicators": "Göstergeler" +} \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_vi.arb b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_vi.arb new file mode 100644 index 000000000..f6ce868bf --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_vi.arb @@ -0,0 +1,3 @@ +{ + "labelIndicators": "Các chỉ số" +} \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_zh.arb b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_zh.arb new file mode 100644 index 000000000..4704206cc --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_zh.arb @@ -0,0 +1,3 @@ +{ + "labelIndicators": "指標" +} \ No newline at end of file From c925c22a97e6e13568fefa0d86d993985093617c Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Wed, 26 Jun 2024 17:06:18 +0800 Subject: [PATCH 120/162] refactor(deriv_localizations): Crowdin Localization Generated (#648) --- .../lib/deriv_localizations.dart | 4 + ...iv_mobile_chart_wrapper_localizations.dart | 178 ++++++++++++++++++ ...mobile_chart_wrapper_localizations_ar.dart | 9 + ...mobile_chart_wrapper_localizations_bn.dart | 9 + ...mobile_chart_wrapper_localizations_de.dart | 9 + ...mobile_chart_wrapper_localizations_en.dart | 9 + ...mobile_chart_wrapper_localizations_es.dart | 9 + ...mobile_chart_wrapper_localizations_fr.dart | 9 + ...mobile_chart_wrapper_localizations_it.dart | 9 + ...mobile_chart_wrapper_localizations_ko.dart | 9 + ...mobile_chart_wrapper_localizations_pl.dart | 9 + ...mobile_chart_wrapper_localizations_pt.dart | 9 + ...mobile_chart_wrapper_localizations_ru.dart | 9 + ...mobile_chart_wrapper_localizations_si.dart | 9 + ...mobile_chart_wrapper_localizations_sw.dart | 9 + ...mobile_chart_wrapper_localizations_th.dart | 9 + ...mobile_chart_wrapper_localizations_tr.dart | 9 + ...mobile_chart_wrapper_localizations_vi.dart | 9 + ...mobile_chart_wrapper_localizations_zh.dart | 9 + .../deriv_passkeys_localizations_pt.dart | 6 +- .../deriv_passkeys_localizations_th.dart | 4 +- .../deriv_passkeys_localizations_tr.dart | 6 +- .../deriv_passkeys_localizations_zh.dart | 6 +- 23 files changed, 346 insertions(+), 11 deletions(-) create mode 100644 packages/deriv_localizations/lib/deriv_localizations.dart create mode 100644 packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations.dart create mode 100644 packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_ar.dart create mode 100644 packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_bn.dart create mode 100644 packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_de.dart create mode 100644 packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_en.dart create mode 100644 packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_es.dart create mode 100644 packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_fr.dart create mode 100644 packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_it.dart create mode 100644 packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_ko.dart create mode 100644 packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_pl.dart create mode 100644 packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_pt.dart create mode 100644 packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_ru.dart create mode 100644 packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_si.dart create mode 100644 packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_sw.dart create mode 100644 packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_th.dart create mode 100644 packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_tr.dart create mode 100644 packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_vi.dart create mode 100644 packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_zh.dart diff --git a/packages/deriv_localizations/lib/deriv_localizations.dart b/packages/deriv_localizations/lib/deriv_localizations.dart new file mode 100644 index 000000000..72b4f56fb --- /dev/null +++ b/packages/deriv_localizations/lib/deriv_localizations.dart @@ -0,0 +1,4 @@ +// Generated file for exporting localization classes +export 'l10n/generated/deriv_auth/deriv_auth_localizations.dart'; +export 'l10n/generated/deriv_passkeys/deriv_passkeys_localizations.dart'; +export 'l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations.dart'; diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations.dart new file mode 100644 index 000000000..7140049d1 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations.dart @@ -0,0 +1,178 @@ +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 'deriv_mobile_chart_wrapper_localizations_ar.dart'; +import 'deriv_mobile_chart_wrapper_localizations_bn.dart'; +import 'deriv_mobile_chart_wrapper_localizations_de.dart'; +import 'deriv_mobile_chart_wrapper_localizations_en.dart'; +import 'deriv_mobile_chart_wrapper_localizations_es.dart'; +import 'deriv_mobile_chart_wrapper_localizations_fr.dart'; +import 'deriv_mobile_chart_wrapper_localizations_it.dart'; +import 'deriv_mobile_chart_wrapper_localizations_ko.dart'; +import 'deriv_mobile_chart_wrapper_localizations_pl.dart'; +import 'deriv_mobile_chart_wrapper_localizations_pt.dart'; +import 'deriv_mobile_chart_wrapper_localizations_ru.dart'; +import 'deriv_mobile_chart_wrapper_localizations_si.dart'; +import 'deriv_mobile_chart_wrapper_localizations_sw.dart'; +import 'deriv_mobile_chart_wrapper_localizations_th.dart'; +import 'deriv_mobile_chart_wrapper_localizations_tr.dart'; +import 'deriv_mobile_chart_wrapper_localizations_vi.dart'; +import 'deriv_mobile_chart_wrapper_localizations_zh.dart'; + +/// Callers can lookup localized strings with an instance of DerivMobileChartWrapperLocalizations +/// returned by `DerivMobileChartWrapperLocalizations.of(context)`. +/// +/// Applications need to include `DerivMobileChartWrapperLocalizations.delegate()` in their app's +/// `localizationDelegates` list, and the locales they support in the app's +/// `supportedLocales` list. For example: +/// +/// ```dart +/// import 'deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations.dart'; +/// +/// return MaterialApp( +/// localizationsDelegates: DerivMobileChartWrapperLocalizations.localizationsDelegates, +/// supportedLocales: DerivMobileChartWrapperLocalizations.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 DerivMobileChartWrapperLocalizations.supportedLocales +/// property. +abstract class DerivMobileChartWrapperLocalizations { + DerivMobileChartWrapperLocalizations(String locale) : localeName = intl.Intl.canonicalizedLocale(locale.toString()); + + final String localeName; + + static DerivMobileChartWrapperLocalizations of(BuildContext context) { + return Localizations.of(context, DerivMobileChartWrapperLocalizations)!; + } + + static const LocalizationsDelegate delegate = _DerivMobileChartWrapperLocalizationsDelegate(); + + /// 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> localizationsDelegates = >[ + delegate, + GlobalMaterialLocalizations.delegate, + GlobalCupertinoLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + ]; + + /// A list of this localizations delegate's supported locales. + static const List supportedLocales = [ + Locale('ar'), + Locale('bn'), + Locale('de'), + Locale('en'), + Locale('es'), + Locale('fr'), + Locale('it'), + Locale('ko'), + Locale('pl'), + Locale('pt'), + Locale('ru'), + Locale('si'), + Locale('sw'), + Locale('th'), + Locale('tr'), + Locale('vi'), + Locale('zh') + ]; + + /// No description provided for @labelIndicators. + /// + /// In en, this message translates to: + /// **'Indicators'** + String get labelIndicators; +} + +class _DerivMobileChartWrapperLocalizationsDelegate extends LocalizationsDelegate { + const _DerivMobileChartWrapperLocalizationsDelegate(); + + @override + Future load(Locale locale) { + return SynchronousFuture(lookupDerivMobileChartWrapperLocalizations(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); + + @override + bool shouldReload(_DerivMobileChartWrapperLocalizationsDelegate old) => false; +} + +DerivMobileChartWrapperLocalizations lookupDerivMobileChartWrapperLocalizations(Locale locale) { + + + // Lookup logic when only language code is specified. + switch (locale.languageCode) { + case 'ar': return DerivMobileChartWrapperLocalizationsAr(); + case 'bn': return DerivMobileChartWrapperLocalizationsBn(); + case 'de': return DerivMobileChartWrapperLocalizationsDe(); + case 'en': return DerivMobileChartWrapperLocalizationsEn(); + case 'es': return DerivMobileChartWrapperLocalizationsEs(); + case 'fr': return DerivMobileChartWrapperLocalizationsFr(); + case 'it': return DerivMobileChartWrapperLocalizationsIt(); + case 'ko': return DerivMobileChartWrapperLocalizationsKo(); + case 'pl': return DerivMobileChartWrapperLocalizationsPl(); + case 'pt': return DerivMobileChartWrapperLocalizationsPt(); + case 'ru': return DerivMobileChartWrapperLocalizationsRu(); + case 'si': return DerivMobileChartWrapperLocalizationsSi(); + case 'sw': return DerivMobileChartWrapperLocalizationsSw(); + case 'th': return DerivMobileChartWrapperLocalizationsTh(); + case 'tr': return DerivMobileChartWrapperLocalizationsTr(); + case 'vi': return DerivMobileChartWrapperLocalizationsVi(); + case 'zh': return DerivMobileChartWrapperLocalizationsZh(); + } + + throw FlutterError( + 'DerivMobileChartWrapperLocalizations.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_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_ar.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_ar.dart new file mode 100644 index 000000000..8b345e8b6 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_ar.dart @@ -0,0 +1,9 @@ +import 'deriv_mobile_chart_wrapper_localizations.dart'; + +/// The translations for Arabic (`ar`). +class DerivMobileChartWrapperLocalizationsAr extends DerivMobileChartWrapperLocalizations { + DerivMobileChartWrapperLocalizationsAr([String locale = 'ar']) : super(locale); + + @override + String get labelIndicators => 'المؤشرات'; +} diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_bn.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_bn.dart new file mode 100644 index 000000000..648ddc85f --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_bn.dart @@ -0,0 +1,9 @@ +import 'deriv_mobile_chart_wrapper_localizations.dart'; + +/// The translations for Bengali Bangla (`bn`). +class DerivMobileChartWrapperLocalizationsBn extends DerivMobileChartWrapperLocalizations { + DerivMobileChartWrapperLocalizationsBn([String locale = 'bn']) : super(locale); + + @override + String get labelIndicators => 'সূচক'; +} diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_de.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_de.dart new file mode 100644 index 000000000..c3aadd6f9 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_de.dart @@ -0,0 +1,9 @@ +import 'deriv_mobile_chart_wrapper_localizations.dart'; + +/// The translations for German (`de`). +class DerivMobileChartWrapperLocalizationsDe extends DerivMobileChartWrapperLocalizations { + DerivMobileChartWrapperLocalizationsDe([String locale = 'de']) : super(locale); + + @override + String get labelIndicators => 'Indikatoren'; +} diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_en.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_en.dart new file mode 100644 index 000000000..4cb6f2961 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_en.dart @@ -0,0 +1,9 @@ +import 'deriv_mobile_chart_wrapper_localizations.dart'; + +/// The translations for English (`en`). +class DerivMobileChartWrapperLocalizationsEn extends DerivMobileChartWrapperLocalizations { + DerivMobileChartWrapperLocalizationsEn([String locale = 'en']) : super(locale); + + @override + String get labelIndicators => 'Indicators'; +} diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_es.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_es.dart new file mode 100644 index 000000000..728fbda31 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_es.dart @@ -0,0 +1,9 @@ +import 'deriv_mobile_chart_wrapper_localizations.dart'; + +/// The translations for Spanish Castilian (`es`). +class DerivMobileChartWrapperLocalizationsEs extends DerivMobileChartWrapperLocalizations { + DerivMobileChartWrapperLocalizationsEs([String locale = 'es']) : super(locale); + + @override + String get labelIndicators => 'Indicadores'; +} diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_fr.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_fr.dart new file mode 100644 index 000000000..ca6942d0b --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_fr.dart @@ -0,0 +1,9 @@ +import 'deriv_mobile_chart_wrapper_localizations.dart'; + +/// The translations for French (`fr`). +class DerivMobileChartWrapperLocalizationsFr extends DerivMobileChartWrapperLocalizations { + DerivMobileChartWrapperLocalizationsFr([String locale = 'fr']) : super(locale); + + @override + String get labelIndicators => 'Indicateurs'; +} diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_it.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_it.dart new file mode 100644 index 000000000..a971c59fe --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_it.dart @@ -0,0 +1,9 @@ +import 'deriv_mobile_chart_wrapper_localizations.dart'; + +/// The translations for Italian (`it`). +class DerivMobileChartWrapperLocalizationsIt extends DerivMobileChartWrapperLocalizations { + DerivMobileChartWrapperLocalizationsIt([String locale = 'it']) : super(locale); + + @override + String get labelIndicators => 'Indicatori'; +} diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_ko.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_ko.dart new file mode 100644 index 000000000..367cb3365 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_ko.dart @@ -0,0 +1,9 @@ +import 'deriv_mobile_chart_wrapper_localizations.dart'; + +/// The translations for Korean (`ko`). +class DerivMobileChartWrapperLocalizationsKo extends DerivMobileChartWrapperLocalizations { + DerivMobileChartWrapperLocalizationsKo([String locale = 'ko']) : super(locale); + + @override + String get labelIndicators => '지표'; +} diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_pl.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_pl.dart new file mode 100644 index 000000000..6c1d04203 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_pl.dart @@ -0,0 +1,9 @@ +import 'deriv_mobile_chart_wrapper_localizations.dart'; + +/// The translations for Polish (`pl`). +class DerivMobileChartWrapperLocalizationsPl extends DerivMobileChartWrapperLocalizations { + DerivMobileChartWrapperLocalizationsPl([String locale = 'pl']) : super(locale); + + @override + String get labelIndicators => 'Wskaźniki'; +} diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_pt.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_pt.dart new file mode 100644 index 000000000..ccdb68863 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_pt.dart @@ -0,0 +1,9 @@ +import 'deriv_mobile_chart_wrapper_localizations.dart'; + +/// The translations for Portuguese (`pt`). +class DerivMobileChartWrapperLocalizationsPt extends DerivMobileChartWrapperLocalizations { + DerivMobileChartWrapperLocalizationsPt([String locale = 'pt']) : super(locale); + + @override + String get labelIndicators => 'Indicadores'; +} diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_ru.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_ru.dart new file mode 100644 index 000000000..38471e29b --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_ru.dart @@ -0,0 +1,9 @@ +import 'deriv_mobile_chart_wrapper_localizations.dart'; + +/// The translations for Russian (`ru`). +class DerivMobileChartWrapperLocalizationsRu extends DerivMobileChartWrapperLocalizations { + DerivMobileChartWrapperLocalizationsRu([String locale = 'ru']) : super(locale); + + @override + String get labelIndicators => 'Индикаторы'; +} diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_si.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_si.dart new file mode 100644 index 000000000..a536c05cb --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_si.dart @@ -0,0 +1,9 @@ +import 'deriv_mobile_chart_wrapper_localizations.dart'; + +/// The translations for Sinhala Sinhalese (`si`). +class DerivMobileChartWrapperLocalizationsSi extends DerivMobileChartWrapperLocalizations { + DerivMobileChartWrapperLocalizationsSi([String locale = 'si']) : super(locale); + + @override + String get labelIndicators => 'දර්ශක'; +} diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_sw.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_sw.dart new file mode 100644 index 000000000..8f0aebce6 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_sw.dart @@ -0,0 +1,9 @@ +import 'deriv_mobile_chart_wrapper_localizations.dart'; + +/// The translations for Swahili (`sw`). +class DerivMobileChartWrapperLocalizationsSw extends DerivMobileChartWrapperLocalizations { + DerivMobileChartWrapperLocalizationsSw([String locale = 'sw']) : super(locale); + + @override + String get labelIndicators => 'Viashiria'; +} diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_th.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_th.dart new file mode 100644 index 000000000..e7ff1cf14 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_th.dart @@ -0,0 +1,9 @@ +import 'deriv_mobile_chart_wrapper_localizations.dart'; + +/// The translations for Thai (`th`). +class DerivMobileChartWrapperLocalizationsTh extends DerivMobileChartWrapperLocalizations { + DerivMobileChartWrapperLocalizationsTh([String locale = 'th']) : super(locale); + + @override + String get labelIndicators => 'ตัวบ่งชี้'; +} diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_tr.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_tr.dart new file mode 100644 index 000000000..fdb1cf932 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_tr.dart @@ -0,0 +1,9 @@ +import 'deriv_mobile_chart_wrapper_localizations.dart'; + +/// The translations for Turkish (`tr`). +class DerivMobileChartWrapperLocalizationsTr extends DerivMobileChartWrapperLocalizations { + DerivMobileChartWrapperLocalizationsTr([String locale = 'tr']) : super(locale); + + @override + String get labelIndicators => 'Göstergeler'; +} diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_vi.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_vi.dart new file mode 100644 index 000000000..d15440fb2 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_vi.dart @@ -0,0 +1,9 @@ +import 'deriv_mobile_chart_wrapper_localizations.dart'; + +/// The translations for Vietnamese (`vi`). +class DerivMobileChartWrapperLocalizationsVi extends DerivMobileChartWrapperLocalizations { + DerivMobileChartWrapperLocalizationsVi([String locale = 'vi']) : super(locale); + + @override + String get labelIndicators => 'Các chỉ số'; +} diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_zh.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_zh.dart new file mode 100644 index 000000000..ce16903a5 --- /dev/null +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations_zh.dart @@ -0,0 +1,9 @@ +import 'deriv_mobile_chart_wrapper_localizations.dart'; + +/// The translations for Chinese (`zh`). +class DerivMobileChartWrapperLocalizationsZh extends DerivMobileChartWrapperLocalizations { + DerivMobileChartWrapperLocalizationsZh([String locale = 'zh']) : super(locale); + + @override + String get labelIndicators => '指標'; +} diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_pt.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_pt.dart index 962bf194d..e8d959a8c 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_pt.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_pt.dart @@ -64,13 +64,13 @@ class DerivPasskeysLocalizationsPt extends DerivPasskeysLocalizations { String get howToCreatePasskeyDescription2 => 'Pode criar uma passkey por dispositivo.'; @override - String get p2pHowToCreatePasskey => 'Como criar uma chave de acesso?'; + String get p2pHowToCreatePasskey => 'Como pode criar uma passkey?'; @override - String get p2pHowToCreatePasskeyDescription1 => 'Vá para \'Perfil\' em seu aplicativo Deriv P2P.'; + String get p2pHowToCreatePasskeyDescription1 => 'Aceda à secção \"Perfil\" na sua aplicação Deriv P2P.'; @override - String get p2pHowToCreatePasskeyDescription2 => 'Toque em “Chaves de acesso” para criar sua chave de acesso.'; + String get p2pHowToCreatePasskeyDescription2 => 'Selecione \"Passkeys\" para criar a sua chave de acesso.'; @override String get whereArePasskeysSaved => 'Onde são guardadas as chaves de acesso?'; diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_th.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_th.dart index 283e39200..b48f49d11 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_th.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_th.dart @@ -64,13 +64,13 @@ class DerivPasskeysLocalizationsTh extends DerivPasskeysLocalizations { String get howToCreatePasskeyDescription2 => 'คุณสามารถสร้างหนึ่ง Passkey ต่ออุปกรณ์'; @override - String get p2pHowToCreatePasskey => 'วิธีการสร้างรหัสผ่าน'; + String get p2pHowToCreatePasskey => 'จะสร้าง Passkey ได้อย่างไร?'; @override String get p2pHowToCreatePasskeyDescription1 => 'ไปที่ \'โปรไฟล์\' ในแอป Deriv P2P ของคุณ'; @override - String get p2pHowToCreatePasskeyDescription2 => 'แตะ \'รหัสผ่าน\' เพื่อสร้างรหัสผ่านของคุณ'; + String get p2pHowToCreatePasskeyDescription2 => 'แตะ \'Passkeys\' เพื่อสร้าง Passkey ของคุณ'; @override String get whereArePasskeysSaved => 'Passkey จะถูกบันทึกไว้ที่ไหน?'; diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_tr.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_tr.dart index 00d289dbc..ee9c2d250 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_tr.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_tr.dart @@ -64,13 +64,13 @@ class DerivPasskeysLocalizationsTr extends DerivPasskeysLocalizations { String get howToCreatePasskeyDescription2 => 'Cihaz başına bir passkey oluşturabilirsiniz.'; @override - String get p2pHowToCreatePasskey => 'Parola nasıl oluşturulur?'; + String get p2pHowToCreatePasskey => 'Passkey nasıl oluşturulur?'; @override String get p2pHowToCreatePasskeyDescription1 => 'Deriv P2P uygulamanızdaki \'Profil\' bölümüne gidin.'; @override - String get p2pHowToCreatePasskeyDescription2 => 'Parola anahtarınızı oluşturmak için \'Parola Tuşları\'na dokunun.'; + String get p2pHowToCreatePasskeyDescription2 => 'Passkey\'inizi oluşturmak için \"Passkeys\" ögesine dokunun.'; @override String get whereArePasskeysSaved => 'Passkeys nereye kaydedilir?'; @@ -151,7 +151,7 @@ class DerivPasskeysLocalizationsTr extends DerivPasskeysLocalizations { String get continueTradingButtonText => 'Alım satıma devam'; @override - String get addMorePasskeysButtonText => 'Daha fazla passkeys'; + String get addMorePasskeysButtonText => 'Daha fazla passkeys ekle'; @override String get unableToSetupPasskey => 'Passkey ayarlanamıyor'; diff --git a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_zh.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_zh.dart index 6fd607651..8684b4fc8 100644 --- a/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_zh.dart +++ b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_zh.dart @@ -64,13 +64,13 @@ class DerivPasskeysLocalizationsZh extends DerivPasskeysLocalizations { String get howToCreatePasskeyDescription2 => '可以為每個裝置建立一個金鑰。'; @override - String get p2pHowToCreatePasskey => '如何建立密碼?'; + String get p2pHowToCreatePasskey => '如何建立金鑰?'; @override - String get p2pHowToCreatePasskeyDescription1 => '在您的 Deriv P2P 應用程序中轉到「個人資料」。'; + String get p2pHowToCreatePasskeyDescription1 => '在 Deriv P2P 應用程式中轉到‘個人資料‘。'; @override - String get p2pHowToCreatePasskeyDescription2 => '點擊「密碼」以建立您的密碼。'; + String get p2pHowToCreatePasskeyDescription2 => '點選‘密鑰‘以建立密鑰。'; @override String get whereArePasskeysSaved => '金鑰儲存在哪裡?'; From 4894c60b4d15ea386cef472155653309206cfd35 Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Wed, 26 Jun 2024 17:47:14 +0800 Subject: [PATCH 121/162] chore(version): bump version and update changelog (#650) Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: ramin-deriv --- CHANGELOG.md | 30 +++++++++++++++++++++++ README.md | 6 ++--- packages/deriv_auth/CHANGELOG.md | 4 +++ packages/deriv_auth/pubspec.yaml | 6 ++--- packages/deriv_localizations/CHANGELOG.md | 4 +++ packages/deriv_localizations/pubspec.yaml | 2 +- packages/deriv_passkeys/CHANGELOG.md | 4 +++ packages/deriv_passkeys/pubspec.yaml | 4 +-- 8 files changed, 51 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 658f811ac..6e4c8ba88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,36 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-06-26 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_localizations` - `v1.5.1`](#deriv_localizations---v151) + - [`deriv_auth` - `v6.7.4`](#deriv_auth---v674) + - [`deriv_passkeys` - `v0.0.2+6`](#deriv_passkeys---v0026) + +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.7.4` + - `deriv_passkeys` - `v0.0.2+6` + +--- + +#### `deriv_localizations` - `v1.5.1` + + - **REFACTOR**(deriv_localizations): Crowdin Localization Generated ([#648](https://github.com/regentmarkets/flutter-deriv-packages/issues/648)). ([c925c22a](https://github.com/regentmarkets/flutter-deriv-packages/commit/c925c22a97e6e13568fefa0d86d993985093617c)) + + ## 2024-06-26 ### Changes diff --git a/README.md b/README.md index b639e0b13..9ddb07b09 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.7.3)`. 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.7.4)`. To use the package, add the following to your pubspec.yaml file: ```yaml @@ -20,7 +20,7 @@ deriv_ui: | Name | Description | Version | | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | | [analytics](./packages/analytics) | Used to collect and send analytical information to 'Firebase' and 'Segment'. | [v2.0.0](./packages/analytics/CHANGELOG.md) | -| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.3 ](./packages/deriv_auth/CHANGELOG.md) | +| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.4 ](./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) | @@ -32,7 +32,7 @@ deriv_ui: | [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+2](./packages/deriv_live_chat/CHANGELOG.md) | | [deriv_language_selector](./packages/deriv_language_selector) | A package to handle language change of the app. | [v0.0.2+7](./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.5.0](./packages/deriv_localizations/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.5.1](./packages/deriv_localizations/CHANGELOG.md) | | [deriv_numpad](./packages/deriv_numpad) | Number Pad Widget for number input. | [v1.1.5](./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) | diff --git a/packages/deriv_auth/CHANGELOG.md b/packages/deriv_auth/CHANGELOG.md index e4ad2fdb3..4a25283bc 100644 --- a/packages/deriv_auth/CHANGELOG.md +++ b/packages/deriv_auth/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.7.4 + + - Update a dependency to the latest release. + ## 6.7.3 - Update a dependency to the latest release. diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index 73cbc2826..e3761df56 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.7.3 +version: 6.7.4 environment: sdk: ">=3.0.0 <4.0.0" @@ -51,13 +51,13 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_localizations - ref: deriv_localizations-v1.5.0 + ref: deriv_localizations-v1.5.1 deriv_passkeys: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: deriv_passkeys-v0.0.2+5 + ref: deriv_passkeys-v0.0.2+6 deriv_language_selector: git: diff --git a/packages/deriv_localizations/CHANGELOG.md b/packages/deriv_localizations/CHANGELOG.md index 19f7c5d8c..302a624c8 100644 --- a/packages/deriv_localizations/CHANGELOG.md +++ b/packages/deriv_localizations/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.5.1 + + - **REFACTOR**(deriv_localizations): Crowdin Localization Generated ([#648](https://github.com/regentmarkets/flutter-deriv-packages/issues/648)). ([c925c22a](https://github.com/regentmarkets/flutter-deriv-packages/commit/c925c22a97e6e13568fefa0d86d993985093617c)) + ## 1.5.0 - **FEAT**(deriv_localizations): add localization for deriv mobile chart wrapper package ([#627](https://github.com/regentmarkets/flutter-deriv-packages/issues/627)). ([33f5e3a1](https://github.com/regentmarkets/flutter-deriv-packages/commit/33f5e3a1bc0765cb8559b5a39e300b8c088aa705)) diff --git a/packages/deriv_localizations/pubspec.yaml b/packages/deriv_localizations/pubspec.yaml index cf5416a7f..f9fc08a0e 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.5.0 +version: 1.5.1 environment: sdk: '>=3.0.2 <4.0.0' diff --git a/packages/deriv_passkeys/CHANGELOG.md b/packages/deriv_passkeys/CHANGELOG.md index 1a3ce4d6c..b079e02df 100644 --- a/packages/deriv_passkeys/CHANGELOG.md +++ b/packages/deriv_passkeys/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.2+6 + + - Update a dependency to the latest release. + ## 0.0.2+5 - Update a dependency to the latest release. diff --git a/packages/deriv_passkeys/pubspec.yaml b/packages/deriv_passkeys/pubspec.yaml index 1dd116c70..a9dbcf176 100644 --- a/packages/deriv_passkeys/pubspec.yaml +++ b/packages/deriv_passkeys/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_passkeys description: Deriv Passkeys Flutter Plugin -version: 0.0.2+5 +version: 0.0.2+6 publish_to: "none" environment: @@ -26,7 +26,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_localizations - ref: deriv_localizations-v1.5.0 + ref: deriv_localizations-v1.5.1 deriv_ui: git: From 282278aeb27256eaa37660f58eff704d27e92c93 Mon Sep 17 00:00:00 2001 From: Ilya <106583608+ilya-deriv@users.noreply.github.com> Date: Thu, 27 Jun 2024 10:53:29 +0300 Subject: [PATCH 122/162] fix(deriv_passkeys): Fix_logout_issue_by_fetching_refresh_token (#630) --- .../lib/src/data/mappers/deriv_passkeys_mapper.dart | 1 + ..._passkeys_verify_credentials_response_entity.dart | 8 ++++++-- .../states/bloc/deriv_passkeys_bloc.dart | 2 ++ .../states/bloc/deriv_passkeys_state.dart | 12 +++++++++--- .../data/deriv_passkeys_data_source_mock_setup.dart | 3 ++- .../test/data/deriv_passkeys_mapper_test.dart | 3 ++- .../states/bloc/deriv_passkeys_bloc_setup.dart | 5 ++++- .../states/bloc/deriv_passkeys_state_test.dart | 7 +++++-- 8 files changed, 31 insertions(+), 10 deletions(-) diff --git a/packages/deriv_passkeys/lib/src/data/mappers/deriv_passkeys_mapper.dart b/packages/deriv_passkeys/lib/src/data/mappers/deriv_passkeys_mapper.dart index 9404c3987..468a647cf 100644 --- a/packages/deriv_passkeys/lib/src/data/mappers/deriv_passkeys_mapper.dart +++ b/packages/deriv_passkeys/lib/src/data/mappers/deriv_passkeys_mapper.dart @@ -51,6 +51,7 @@ class DerivPasskeysMapper { DerivPasskeysVerifyCredentialsResponseModel model) => DerivPasskeysVerifyCredentialsResponseEntity( token: (model.response['tokens'] as List).first['token'], + refreshToken: model.response['refresh_token'] as String, ); /// Maps [ConnectionInfoEntity] to [PasskeysConnectionInfoModel]. diff --git a/packages/deriv_passkeys/lib/src/domain/entities/deriv_passkeys_verify_credentials_response_entity.dart b/packages/deriv_passkeys/lib/src/domain/entities/deriv_passkeys_verify_credentials_response_entity.dart index 1e249d40a..aeeca7d38 100644 --- a/packages/deriv_passkeys/lib/src/domain/entities/deriv_passkeys_verify_credentials_response_entity.dart +++ b/packages/deriv_passkeys/lib/src/domain/entities/deriv_passkeys_verify_credentials_response_entity.dart @@ -5,11 +5,15 @@ final class DerivPasskeysVerifyCredentialsResponseEntity extends Equatable { /// Creates a [DerivPasskeysVerifyCredentialsResponseEntity]. const DerivPasskeysVerifyCredentialsResponseEntity({ required this.token, + required this.refreshToken, }); - /// contains the token from the REST API to verify credentials. + /// App token from the REST API to verify credentials. final String token; + /// Refresh token from the REST API to verify credentials. + final String refreshToken; + @override - List get props => [token]; + List get props => [token, refreshToken]; } diff --git a/packages/deriv_passkeys/lib/src/presentation/states/bloc/deriv_passkeys_bloc.dart b/packages/deriv_passkeys/lib/src/presentation/states/bloc/deriv_passkeys_bloc.dart index ea167db91..1a8285e7f 100644 --- a/packages/deriv_passkeys/lib/src/presentation/states/bloc/deriv_passkeys_bloc.dart +++ b/packages/deriv_passkeys/lib/src/presentation/states/bloc/deriv_passkeys_bloc.dart @@ -57,6 +57,8 @@ class DerivPasskeysBloc extends Bloc { emit( DerivPasskeysCredentialVerifiedState( token: derivPasskeysVerifyCredentialsResponseEntity.token, + refreshToken: + derivPasskeysVerifyCredentialsResponseEntity.refreshToken, ), ); }).catchError((Object error) { diff --git a/packages/deriv_passkeys/lib/src/presentation/states/bloc/deriv_passkeys_state.dart b/packages/deriv_passkeys/lib/src/presentation/states/bloc/deriv_passkeys_state.dart index e50ae555c..72f3c115e 100644 --- a/packages/deriv_passkeys/lib/src/presentation/states/bloc/deriv_passkeys_state.dart +++ b/packages/deriv_passkeys/lib/src/presentation/states/bloc/deriv_passkeys_state.dart @@ -33,13 +33,19 @@ class DerivPasskeysCreatedSuccessfullyState extends DerivPasskeysState {} /// [DerivPasskeysCredentialVerifiedState] represents the credential verified state within the DerivPasskeys flow. class DerivPasskeysCredentialVerifiedState extends DerivPasskeysState { /// Creates a [DerivPasskeysCredentialVerifiedState]. - const DerivPasskeysCredentialVerifiedState({required this.token}); + const DerivPasskeysCredentialVerifiedState({ + required this.token, + required this.refreshToken, + }); - /// The response. + /// App token from the response. final String token; + /// Refresh token from the response. + final String refreshToken; + @override - List get props => [token]; + List get props => [token, refreshToken]; } /// [DerivPasskeysNotSupportedState] represents the not supported state within the DerivPasskeys flow. diff --git a/packages/deriv_passkeys/test/data/deriv_passkeys_data_source_mock_setup.dart b/packages/deriv_passkeys/test/data/deriv_passkeys_data_source_mock_setup.dart index 221657dae..4fa40b0d0 100644 --- a/packages/deriv_passkeys/test/data/deriv_passkeys_data_source_mock_setup.dart +++ b/packages/deriv_passkeys/test/data/deriv_passkeys_data_source_mock_setup.dart @@ -99,7 +99,8 @@ const DerivPasskeysVerifyCredentialsResponseModel { 'token': 'token', }, - ] + ], + 'refresh_token': 'refresh_token', }, ); diff --git a/packages/deriv_passkeys/test/data/deriv_passkeys_mapper_test.dart b/packages/deriv_passkeys/test/data/deriv_passkeys_mapper_test.dart index 76968b9ea..8d3684c2b 100644 --- a/packages/deriv_passkeys/test/data/deriv_passkeys_mapper_test.dart +++ b/packages/deriv_passkeys/test/data/deriv_passkeys_mapper_test.dart @@ -106,7 +106,8 @@ void main() { { 'token': '', } - ] + ], + 'refresh_token': 'refresh_token', }, ); diff --git a/packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_bloc_setup.dart b/packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_bloc_setup.dart index 0c8e906c7..b293053b5 100644 --- a/packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_bloc_setup.dart +++ b/packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_bloc_setup.dart @@ -31,7 +31,10 @@ void setupDerivPasskeysBloc() { void setupSuccessDerivPasskeysVerifyCredentialEvent() { const DerivPasskeysVerifyCredentialsResponseEntity mockResponseEntity = - DerivPasskeysVerifyCredentialsResponseEntity(token: 'token'); + DerivPasskeysVerifyCredentialsResponseEntity( + token: 'token', + refreshToken: 'refresh_token', + ); when(() => mockDerivPasskeysService.verifyCredential( jwtToken: any(named: 'jwtToken'), diff --git a/packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_state_test.dart b/packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_state_test.dart index cba709665..785c6a623 100644 --- a/packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_state_test.dart +++ b/packages/deriv_passkeys/test/presentation/states/bloc/deriv_passkeys_state_test.dart @@ -34,8 +34,11 @@ void main() { group('DerivPasskeysCredentialVerifiedState', () { test('props should contain token', () { const String token = 'example_token'; - const DerivPasskeysState state = - DerivPasskeysCredentialVerifiedState(token: token); + const String refreshToken = 'example_refresh_token'; + const DerivPasskeysState state = DerivPasskeysCredentialVerifiedState( + token: token, + refreshToken: refreshToken, + ); expect(state.props, contains(token)); }); }); From f616dfca2e9d160876d408e9d9056d918449b665 Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Fri, 28 Jun 2024 10:08:54 +0800 Subject: [PATCH 123/162] chore(version): bump version and update changelog (#652) Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: emad-deriv --- CHANGELOG.md | 28 ++++++++++++++++++++++++++++ README.md | 4 ++-- packages/deriv_auth/CHANGELOG.md | 4 ++++ packages/deriv_auth/pubspec.yaml | 4 ++-- packages/deriv_passkeys/CHANGELOG.md | 4 ++++ packages/deriv_passkeys/pubspec.yaml | 2 +- 6 files changed, 41 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e4c8ba88..deeefbc5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,34 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-06-27 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_passkeys` - `v0.0.2+7`](#deriv_passkeys---v0027) + - [`deriv_auth` - `v6.7.5`](#deriv_auth---v675) + +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.7.5` + +--- + +#### `deriv_passkeys` - `v0.0.2+7` + + - **FIX**(deriv_passkeys): Fix_logout_issue_by_fetching_refresh_token ([#630](https://github.com/regentmarkets/flutter-deriv-packages/issues/630)). ([282278ae](https://github.com/regentmarkets/flutter-deriv-packages/commit/282278aeb27256eaa37660f58eff704d27e92c93)) + + ## 2024-06-26 ### Changes diff --git a/README.md b/README.md index 9ddb07b09..b4d1ebbae 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.7.4)`. 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.7.5)`. To use the package, add the following to your pubspec.yaml file: ```yaml @@ -20,7 +20,7 @@ deriv_ui: | Name | Description | Version | | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | | [analytics](./packages/analytics) | Used to collect and send analytical information to 'Firebase' and 'Segment'. | [v2.0.0](./packages/analytics/CHANGELOG.md) | -| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.4 ](./packages/deriv_auth/CHANGELOG.md) | +| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.5 ](./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) | diff --git a/packages/deriv_auth/CHANGELOG.md b/packages/deriv_auth/CHANGELOG.md index 4a25283bc..2eca701bc 100644 --- a/packages/deriv_auth/CHANGELOG.md +++ b/packages/deriv_auth/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.7.5 + + - Update a dependency to the latest release. + ## 6.7.4 - Update a dependency to the latest release. diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index e3761df56..69d668e27 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.7.4 +version: 6.7.5 environment: sdk: ">=3.0.0 <4.0.0" @@ -57,7 +57,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: deriv_passkeys-v0.0.2+6 + ref: deriv_passkeys-v0.0.2+7 deriv_language_selector: git: diff --git a/packages/deriv_passkeys/CHANGELOG.md b/packages/deriv_passkeys/CHANGELOG.md index b079e02df..d156b3fc3 100644 --- a/packages/deriv_passkeys/CHANGELOG.md +++ b/packages/deriv_passkeys/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.2+7 + + - **FIX**(deriv_passkeys): Fix_logout_issue_by_fetching_refresh_token ([#630](https://github.com/regentmarkets/flutter-deriv-packages/issues/630)). ([282278ae](https://github.com/regentmarkets/flutter-deriv-packages/commit/282278aeb27256eaa37660f58eff704d27e92c93)) + ## 0.0.2+6 - Update a dependency to the latest release. diff --git a/packages/deriv_passkeys/pubspec.yaml b/packages/deriv_passkeys/pubspec.yaml index a9dbcf176..db7aed071 100644 --- a/packages/deriv_passkeys/pubspec.yaml +++ b/packages/deriv_passkeys/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_passkeys description: Deriv Passkeys Flutter Plugin -version: 0.0.2+6 +version: 0.0.2+7 publish_to: "none" environment: From 7707c889aa051c9551cf0aa3e05e4fbddd62a45d Mon Sep 17 00:00:00 2001 From: sahani-deriv <125638269+sahani-deriv@users.noreply.github.com> Date: Fri, 28 Jun 2024 11:13:31 +0800 Subject: [PATCH 124/162] ci: add workflow to check if versioning pr exists (#645) Co-authored-by: Ahrar <98078754+ahrar-deriv@users.noreply.github.com> --- .github/workflows/check_versioning_pr.yml | 61 +++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/check_versioning_pr.yml diff --git a/.github/workflows/check_versioning_pr.yml b/.github/workflows/check_versioning_pr.yml new file mode 100644 index 000000000..78871d2b7 --- /dev/null +++ b/.github/workflows/check_versioning_pr.yml @@ -0,0 +1,61 @@ +name: versioning_pr_exists + +on: + pull_request: + types: [opened, edited, reopened, synchronize] + +jobs: + check-version-pr: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + + - name: Set up Node.js + uses: actions/setup-node@eff380dfbcf941bf8832e4acb788cebe13dfd758 + with: + node-version: "14" + + - name: Check if PR with title chore(version) exists + id: check-pr + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea + with: + github-token: ${{ secrets.PAT }} + script: | + const { data: pullRequests } = await github.rest.pulls.list({ + owner: context.repo.owner, + repo: context.repo.repo, + state: 'open', + per_page: 100 + }); + + const existingPR = pullRequests.find(pr => pr.title === 'chore(version): bump version and update changelog'); + + if (existingPR) { + core.setOutput("VERSIONING_PR_EXISTS", true); + console.log("Version bump pull request exists. Please merge that pr first to pass the check.: #${existingPR.number}"); + } else { + core.setOutput("VERSIONING_PR_EXISTS", false); + console.log("No version bump pull request found."); + } + + - name: Delete comment if exists + uses: izhangzhihao/delete-comment@d075704468e1cf74e60944d9f335351213c34d85 + with: + github_token: ${{ secrets.PAT }} + delete_user_name: mobile-apps-deriv + issue_number: ${{ github.event.number }} + + - name: Comment if versioning PR exists + if: ${{ contains(steps.check-pr.outputs.VERSIONING_PR_EXISTS, 'true') }} + uses: marocchino/sticky-pull-request-comment@4b7290acd5c5b99ef9995db30e52150e705d2475 + with: + GITHUB_TOKEN: ${{ secrets.PAT }} + message: | + **Merge Is BLOCKED : we still have a chore(version) pr open, please merge that pr first ** + + - name: Fail if versioning PR exists + if: ${{ contains(steps.check-pr.outputs.VERSIONING_PR_EXISTS, 'true') }} + run: | + echo "A PR with the title 'chore(version)' already exists. Exiting." + exit 1 From 9ada725ded271e2b94cffed622eff2e75539cb55 Mon Sep 17 00:00:00 2001 From: Ilya <106583608+ilya-deriv@users.noreply.github.com> Date: Fri, 28 Jun 2024 09:43:00 +0300 Subject: [PATCH 125/162] feat(analytics): ilya/DERG-2409/Add_tracking_to_real_account_sign_up_on_Deriv_Go (#603) Co-authored-by: Illya Tsai Co-authored-by: Illya Tsai Co-authored-by: Osama Ghazal <124760982+osama-deriv@users.noreply.github.com> --- .../events/rudderstack_events.dart | 98 ++++++++++++++++++- 1 file changed, 96 insertions(+), 2 deletions(-) diff --git a/packages/analytics/lib/sdk/rudderstack/events/rudderstack_events.dart b/packages/analytics/lib/sdk/rudderstack/events/rudderstack_events.dart index 425373151..1b2692f5b 100644 --- a/packages/analytics/lib/sdk/rudderstack/events/rudderstack_events.dart +++ b/packages/analytics/lib/sdk/rudderstack/events/rudderstack_events.dart @@ -20,7 +20,7 @@ class DerivRudderstackEvents { properties: { 'action': 'open', 'form_source': 'mobile_derivgo', - 'form_name': 'virtual_signup_derivgo' + 'form_name': 'common_events_derivgo' }, ); } @@ -56,7 +56,7 @@ class DerivRudderstackEvents { DerivRudderstack().track( eventName: 'ce_virtual_signup_form', properties: { - 'action': 'tab_referral_toggle', + 'action': 'tap_referral_toggle', 'form_source': 'mobile_derivgo', 'form_name': 'virtual_signup_derivgo' }, @@ -182,4 +182,98 @@ class DerivRudderstackEvents { }, ); } + + /// Tracks when the real signup form opened. + void logOpenRealSignUp() { + DerivRudderstack().track( + eventName: 'ce_real_account_signup_form', + properties: { + 'action': 'open_real_sign_up', + 'form_source': 'mobile_derivgo', + 'form_name': 'real_signup_derivgo' + }, + ); + } + + /// Tracks when the user presses the next button + /// and the step is successfully passed. + void logStepPassedRealSignUp( + [String? stepNum, + String? stepCodename, + Map? userChoice]) { + DerivRudderstack().track( + eventName: 'ce_real_account_signup_form', + properties: { + 'action': 'step_passed', + 'step_codename': stepCodename, + 'step_num': stepNum, + 'user_choice': userChoice, + 'form_source': 'mobile_derivgo', + 'form_name': 'real_signup_derivgo' + }, + ); + } + + /// Tracks when user tap the 'previous' button and go to previous screen. + void logStepBackRealSignUp(String stepCodeName) { + DerivRudderstack().track( + eventName: 'ce_real_account_signup_form', + properties: { + 'action': 'step_back', + 'form_source': 'mobile_derivgo', + 'form_name': 'real_signup_derivgo' + }, + ); + } + + /// Tracks if the user presses the close button on the signup form. + void logCloseRealSignUp() { + DerivRudderstack().track( + eventName: 'ce_real_account_signup_form', + properties: { + 'action': 'close', + 'form_source': 'mobile_derivgo', + 'form_name': 'real_signup_derivgo' + }, + ); + } + + /// Tracks if any logical error has happened on the form, + /// validation error for instance. + void logValidationErrorDuringRealSignUp() { + DerivRudderstack().track( + eventName: 'ce_real_account_signup_form', + properties: { + 'action': 'real_signup_error', + 'form_source': 'mobile_derivgo', + 'form_name': 'real_signup_derivgo' + }, + ); + } + + /// Tracks system error has happened, + /// like no connection to the server and etc. + void logError(String error) { + DerivRudderstack().track( + eventName: 'ce_real_account_signup_form', + properties: { + 'action': 'other_error', + 'error_message': error, + 'form_source': 'mobile_derivgo', + 'form_name': 'common_events_derivgo' + }, + ); + } + + /// Tracks when the signup flow is finished. + void logRealSignUpFinished() { + DerivRudderstack().track( + eventName: 'ce_real_account_signup_form', + properties: { + 'action': 'real_signup_finished', + 'form_source': 'mobile_derivgo', + 'form_name': 'real_signup_derivgo' + }, + ); + } } From 0ee339b8b7bafef4f2a57ed57bf38cd698933ab5 Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Fri, 28 Jun 2024 15:26:38 +0800 Subject: [PATCH 126/162] chore(version): bump version and update changelog (#654) Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: osama-deriv --- CHANGELOG.md | 30 ++++++++++++++++++++++++++++ README.md | 6 +++--- packages/analytics/CHANGELOG.md | 4 ++++ packages/analytics/pubspec.yaml | 2 +- packages/deriv_auth/CHANGELOG.md | 4 ++++ packages/deriv_auth/pubspec.yaml | 6 +++--- packages/deriv_passkeys/CHANGELOG.md | 4 ++++ packages/deriv_passkeys/pubspec.yaml | 4 ++-- 8 files changed, 51 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index deeefbc5d..9e4c688a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,36 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-06-28 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`analytics` - `v2.1.0`](#analytics---v210) + - [`deriv_auth` - `v6.7.6`](#deriv_auth---v676) + - [`deriv_passkeys` - `v0.0.2+8`](#deriv_passkeys---v0028) + +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.7.6` + - `deriv_passkeys` - `v0.0.2+8` + +--- + +#### `analytics` - `v2.1.0` + + - **FEAT**(analytics): ilya/DERG-2409/Add_tracking_to_real_account_sign_up_on_Deriv_Go ([#603](https://github.com/regentmarkets/flutter-deriv-packages/issues/603)). ([9ada725d](https://github.com/regentmarkets/flutter-deriv-packages/commit/9ada725ded271e2b94cffed622eff2e75539cb55)) + + ## 2024-06-27 ### Changes diff --git a/README.md b/README.md index b4d1ebbae..ca0f1cd5a 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.7.5)`. 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.7.6)`. To use the package, add the following to your pubspec.yaml file: ```yaml @@ -19,8 +19,8 @@ deriv_ui: | Name | Description | Version | | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | -| [analytics](./packages/analytics) | Used to collect and send analytical information to 'Firebase' and 'Segment'. | [v2.0.0](./packages/analytics/CHANGELOG.md) | -| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.5 ](./packages/deriv_auth/CHANGELOG.md) | +| [analytics](./packages/analytics) | Used to collect and send analytical information to 'Firebase' and 'Segment'. | [v2.1.0](./packages/analytics/CHANGELOG.md) | +| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.6 ](./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) | diff --git a/packages/analytics/CHANGELOG.md b/packages/analytics/CHANGELOG.md index 37d435e42..d638d6943 100644 --- a/packages/analytics/CHANGELOG.md +++ b/packages/analytics/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.1.0 + + - **FEAT**(analytics): ilya/DERG-2409/Add_tracking_to_real_account_sign_up_on_Deriv_Go ([#603](https://github.com/regentmarkets/flutter-deriv-packages/issues/603)). ([9ada725d](https://github.com/regentmarkets/flutter-deriv-packages/commit/9ada725ded271e2b94cffed622eff2e75539cb55)) + ## 2.0.0 > Note: This release has breaking changes. diff --git a/packages/analytics/pubspec.yaml b/packages/analytics/pubspec.yaml index c49dcbcb8..8376e99b0 100644 --- a/packages/analytics/pubspec.yaml +++ b/packages/analytics/pubspec.yaml @@ -1,6 +1,6 @@ name: analytics description: A new Flutter package for collecting and sending analytical information from the app. -version: 2.0.0 +version: 2.1.0 homepage: https://deriv.com/ publish_to: "none" diff --git a/packages/deriv_auth/CHANGELOG.md b/packages/deriv_auth/CHANGELOG.md index 2eca701bc..3f8b7612d 100644 --- a/packages/deriv_auth/CHANGELOG.md +++ b/packages/deriv_auth/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.7.6 + + - Update a dependency to the latest release. + ## 6.7.5 - Update a dependency to the latest release. diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index 69d668e27..911956f83 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.7.5 +version: 6.7.6 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/analytics - ref: analytics-v2.0.0 + ref: analytics-v2.1.0 deriv_theme: git: @@ -57,7 +57,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: deriv_passkeys-v0.0.2+7 + ref: deriv_passkeys-v0.0.2+8 deriv_language_selector: git: diff --git a/packages/deriv_passkeys/CHANGELOG.md b/packages/deriv_passkeys/CHANGELOG.md index d156b3fc3..ce5e2df3e 100644 --- a/packages/deriv_passkeys/CHANGELOG.md +++ b/packages/deriv_passkeys/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.2+8 + + - Update a dependency to the latest release. + ## 0.0.2+7 - **FIX**(deriv_passkeys): Fix_logout_issue_by_fetching_refresh_token ([#630](https://github.com/regentmarkets/flutter-deriv-packages/issues/630)). ([282278ae](https://github.com/regentmarkets/flutter-deriv-packages/commit/282278aeb27256eaa37660f58eff704d27e92c93)) diff --git a/packages/deriv_passkeys/pubspec.yaml b/packages/deriv_passkeys/pubspec.yaml index db7aed071..821ab4ac7 100644 --- a/packages/deriv_passkeys/pubspec.yaml +++ b/packages/deriv_passkeys/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_passkeys description: Deriv Passkeys Flutter Plugin -version: 0.0.2+7 +version: 0.0.2+8 publish_to: "none" environment: @@ -14,7 +14,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/analytics - ref: analytics-v2.0.0 + ref: analytics-v2.1.0 deriv_theme: git: From 01aec1edbd8f02e21951918ec86f00fb28ef2c58 Mon Sep 17 00:00:00 2001 From: ramin-deriv <55975218+ramin-deriv@users.noreply.github.com> Date: Fri, 28 Jun 2024 15:43:55 +0800 Subject: [PATCH 127/162] feat(deriv_mobile_chart_wrapper): [DERG-2498] create deriv_mobile_chart_wrapper package (#626) --- .github/workflows/all_packages.yaml | 4 +- .../deriv_mobile_chart_wrapper/.gitignore | 30 ++ packages/deriv_mobile_chart_wrapper/.metadata | 10 + .../deriv_mobile_chart_wrapper/CHANGELOG.md | 3 + packages/deriv_mobile_chart_wrapper/LICENSE | 1 + packages/deriv_mobile_chart_wrapper/README.md | 21 ++ .../analysis_options.yaml | 4 + .../assets/icons/ic_bollinger_bands.svg | 5 + .../assets/icons/ic_indicators_menu.svg | 3 + .../assets/icons/ic_macd.svg | 4 + .../assets/icons/ic_moving_average.svg | 3 + .../assets/icons/ic_rsi.svg | 5 + .../lib/deriv_mobile_chart_wrapper.dart | 6 + .../lib/src/assets.dart | 7 + .../lib/src/extensions.dart | 12 + .../lib/src/mobile_chart_wrapper.dart | 280 ++++++++++++++++++ .../mobile_tools_ui/chart_bottom_sheet.dart | 76 +++++ .../chart_setting_button_with_background.dart | 40 +++ .../custom_draggable_sheet.dart | 145 +++++++++ .../mobile_tools_ui/indicator_list_item.dart | 65 ++++ .../indicator_menu_button.dart | 29 ++ .../mobile_tools_bottom_sheet_content.dart | 79 +++++ .../src/mobile_tools_ui/tools_controller.dart | 21 ++ .../lib/src/models/indicator_item_model.dart | 14 + .../deriv_mobile_chart_wrapper/pubspec.yaml | 84 ++++++ .../test/mobile_chart_wrapper_test.dart | 77 +++++ 26 files changed, 1027 insertions(+), 1 deletion(-) create mode 100644 packages/deriv_mobile_chart_wrapper/.gitignore create mode 100644 packages/deriv_mobile_chart_wrapper/.metadata create mode 100644 packages/deriv_mobile_chart_wrapper/CHANGELOG.md create mode 100644 packages/deriv_mobile_chart_wrapper/LICENSE create mode 100644 packages/deriv_mobile_chart_wrapper/README.md create mode 100644 packages/deriv_mobile_chart_wrapper/analysis_options.yaml create mode 100644 packages/deriv_mobile_chart_wrapper/assets/icons/ic_bollinger_bands.svg create mode 100644 packages/deriv_mobile_chart_wrapper/assets/icons/ic_indicators_menu.svg create mode 100644 packages/deriv_mobile_chart_wrapper/assets/icons/ic_macd.svg create mode 100644 packages/deriv_mobile_chart_wrapper/assets/icons/ic_moving_average.svg create mode 100644 packages/deriv_mobile_chart_wrapper/assets/icons/ic_rsi.svg create mode 100644 packages/deriv_mobile_chart_wrapper/lib/deriv_mobile_chart_wrapper.dart create mode 100644 packages/deriv_mobile_chart_wrapper/lib/src/assets.dart create mode 100644 packages/deriv_mobile_chart_wrapper/lib/src/extensions.dart create mode 100644 packages/deriv_mobile_chart_wrapper/lib/src/mobile_chart_wrapper.dart create mode 100644 packages/deriv_mobile_chart_wrapper/lib/src/mobile_tools_ui/chart_bottom_sheet.dart create mode 100644 packages/deriv_mobile_chart_wrapper/lib/src/mobile_tools_ui/chart_setting_button_with_background.dart create mode 100644 packages/deriv_mobile_chart_wrapper/lib/src/mobile_tools_ui/custom_draggable_sheet.dart create mode 100644 packages/deriv_mobile_chart_wrapper/lib/src/mobile_tools_ui/indicator_list_item.dart create mode 100644 packages/deriv_mobile_chart_wrapper/lib/src/mobile_tools_ui/indicator_menu_button.dart create mode 100644 packages/deriv_mobile_chart_wrapper/lib/src/mobile_tools_ui/mobile_tools_bottom_sheet_content.dart create mode 100644 packages/deriv_mobile_chart_wrapper/lib/src/mobile_tools_ui/tools_controller.dart create mode 100644 packages/deriv_mobile_chart_wrapper/lib/src/models/indicator_item_model.dart create mode 100644 packages/deriv_mobile_chart_wrapper/pubspec.yaml create mode 100644 packages/deriv_mobile_chart_wrapper/test/mobile_chart_wrapper_test.dart diff --git a/.github/workflows/all_packages.yaml b/.github/workflows/all_packages.yaml index fb3c00d1d..038db27dd 100644 --- a/.github/workflows/all_packages.yaml +++ b/.github/workflows/all_packages.yaml @@ -30,7 +30,9 @@ jobs: - name: Set SSH Key uses: webfactory/ssh-agent@fd34b8dee206fe74b288a5e61bc95fba2f1911eb with: - ssh-private-key: ${{secrets.SSH_PRIVATE_KEY}} + ssh-private-key: | + ${{ secrets.SSH_PRIVATE_KEY }} + ${{ secrets.SSH_CHART_PRIVATE_KEY }} - name: Install Melos and run pub get uses: bluefireteam/melos-action@dd3c344d731938d2ab2567a261f54a19a68b5f6a diff --git a/packages/deriv_mobile_chart_wrapper/.gitignore b/packages/deriv_mobile_chart_wrapper/.gitignore new file mode 100644 index 000000000..96486fd93 --- /dev/null +++ b/packages/deriv_mobile_chart_wrapper/.gitignore @@ -0,0 +1,30 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. +/pubspec.lock +**/doc/api/ +.dart_tool/ +.packages +build/ diff --git a/packages/deriv_mobile_chart_wrapper/.metadata b/packages/deriv_mobile_chart_wrapper/.metadata new file mode 100644 index 000000000..fa347fc6a --- /dev/null +++ b/packages/deriv_mobile_chart_wrapper/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 + channel: stable + +project_type: package diff --git a/packages/deriv_mobile_chart_wrapper/CHANGELOG.md b/packages/deriv_mobile_chart_wrapper/CHANGELOG.md new file mode 100644 index 000000000..b4504b44c --- /dev/null +++ b/packages/deriv_mobile_chart_wrapper/CHANGELOG.md @@ -0,0 +1,3 @@ +## 0.0.1 + +* Setup the package. diff --git a/packages/deriv_mobile_chart_wrapper/LICENSE b/packages/deriv_mobile_chart_wrapper/LICENSE new file mode 100644 index 000000000..ba75c69f7 --- /dev/null +++ b/packages/deriv_mobile_chart_wrapper/LICENSE @@ -0,0 +1 @@ +TODO: Add your license here. diff --git a/packages/deriv_mobile_chart_wrapper/README.md b/packages/deriv_mobile_chart_wrapper/README.md new file mode 100644 index 000000000..da82d0a64 --- /dev/null +++ b/packages/deriv_mobile_chart_wrapper/README.md @@ -0,0 +1,21 @@ +A wrapper package around package _**deriv_chart**_ to implement any functionality specific to mobile and can be wrapped around the main chart package. +Since the main [chart package](https://github.com/regentmarkets/flutter-chart) is used in both mobile app and the web platform, for any feature that is specific to mobile, to keep the size of the main chart package small, we implement it in this package. + +## Features +Menu and interfaces to add/remove indicators and drawing tools. + +## Dependencies +- [deriv_chart](https://github.com/regentmarkets/flutter-chart) +- [deriv_theme](https://github.com/regentmarkets/flutter-deriv-packages/tree/master/packages/deriv_theme) +- [deriv_localizations](https://github.com/regentmarkets/flutter-deriv-packages/tree/master/packages/deriv_localizations) +- [deriv_ui](https://github.com/regentmarkets/flutter-deriv-packages/tree/master/packages/deriv_ui) + +## Get started +``` +dependencies: + deriv_mobile_chart_wrapper: + git: + url: git@github.com:regentmarkets/flutter-deriv-packages.git + path: packages/deriv_mobile_chart_wrapper + ref: [latest_version] +``` diff --git a/packages/deriv_mobile_chart_wrapper/analysis_options.yaml b/packages/deriv_mobile_chart_wrapper/analysis_options.yaml new file mode 100644 index 000000000..a5744c1cf --- /dev/null +++ b/packages/deriv_mobile_chart_wrapper/analysis_options.yaml @@ -0,0 +1,4 @@ +include: package:flutter_lints/flutter.yaml + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/packages/deriv_mobile_chart_wrapper/assets/icons/ic_bollinger_bands.svg b/packages/deriv_mobile_chart_wrapper/assets/icons/ic_bollinger_bands.svg new file mode 100644 index 000000000..2abf85f5d --- /dev/null +++ b/packages/deriv_mobile_chart_wrapper/assets/icons/ic_bollinger_bands.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/packages/deriv_mobile_chart_wrapper/assets/icons/ic_indicators_menu.svg b/packages/deriv_mobile_chart_wrapper/assets/icons/ic_indicators_menu.svg new file mode 100644 index 000000000..58ad8a51c --- /dev/null +++ b/packages/deriv_mobile_chart_wrapper/assets/icons/ic_indicators_menu.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/deriv_mobile_chart_wrapper/assets/icons/ic_macd.svg b/packages/deriv_mobile_chart_wrapper/assets/icons/ic_macd.svg new file mode 100644 index 000000000..b4da2a46a --- /dev/null +++ b/packages/deriv_mobile_chart_wrapper/assets/icons/ic_macd.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/deriv_mobile_chart_wrapper/assets/icons/ic_moving_average.svg b/packages/deriv_mobile_chart_wrapper/assets/icons/ic_moving_average.svg new file mode 100644 index 000000000..f15853309 --- /dev/null +++ b/packages/deriv_mobile_chart_wrapper/assets/icons/ic_moving_average.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/deriv_mobile_chart_wrapper/assets/icons/ic_rsi.svg b/packages/deriv_mobile_chart_wrapper/assets/icons/ic_rsi.svg new file mode 100644 index 000000000..b602ca188 --- /dev/null +++ b/packages/deriv_mobile_chart_wrapper/assets/icons/ic_rsi.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/packages/deriv_mobile_chart_wrapper/lib/deriv_mobile_chart_wrapper.dart b/packages/deriv_mobile_chart_wrapper/lib/deriv_mobile_chart_wrapper.dart new file mode 100644 index 000000000..d9d336d92 --- /dev/null +++ b/packages/deriv_mobile_chart_wrapper/lib/deriv_mobile_chart_wrapper.dart @@ -0,0 +1,6 @@ +library deriv_mobile_chart_wrapper; + +export 'src/mobile_chart_wrapper.dart'; +export 'src/mobile_tools_ui/tools_controller.dart'; +export 'src/mobile_tools_ui/indicator_menu_button.dart'; +export 'package:deriv_chart/deriv_chart.dart'; diff --git a/packages/deriv_mobile_chart_wrapper/lib/src/assets.dart b/packages/deriv_mobile_chart_wrapper/lib/src/assets.dart new file mode 100644 index 000000000..95253e2e1 --- /dev/null +++ b/packages/deriv_mobile_chart_wrapper/lib/src/assets.dart @@ -0,0 +1,7 @@ +const String iconAssetsFolder = 'assets/icons/'; + +const String macdIcon = '${iconAssetsFolder}ic_macd.svg'; +const String rsiIcon = '${iconAssetsFolder}ic_rsi.svg'; +const String bollingerBandsIcon = '${iconAssetsFolder}ic_bollinger_bands.svg'; +const String movingAverageIcon = '${iconAssetsFolder}ic_moving_average.svg'; +const String indicatorsMenuIcon = '${iconAssetsFolder}ic_indicators_menu.svg'; diff --git a/packages/deriv_mobile_chart_wrapper/lib/src/extensions.dart b/packages/deriv_mobile_chart_wrapper/lib/src/extensions.dart new file mode 100644 index 000000000..35b539e12 --- /dev/null +++ b/packages/deriv_mobile_chart_wrapper/lib/src/extensions.dart @@ -0,0 +1,12 @@ +import 'package:deriv_localizations/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations.dart'; +import 'package:deriv_theme/deriv_theme.dart'; +import 'package:flutter/material.dart'; + +/// Extension for [BuildContext]. +extension ContextExtension on BuildContext { + /// Get DerivMobileChartWrapperLocalizations. + DerivMobileChartWrapperLocalizations get mobileChartWrapperLocalizations => + DerivMobileChartWrapperLocalizations.of(this); + + ThemeProvider get themeProvider => DerivThemeProvider.getTheme(this); +} diff --git a/packages/deriv_mobile_chart_wrapper/lib/src/mobile_chart_wrapper.dart b/packages/deriv_mobile_chart_wrapper/lib/src/mobile_chart_wrapper.dart new file mode 100644 index 000000000..bdf01b22b --- /dev/null +++ b/packages/deriv_mobile_chart_wrapper/lib/src/mobile_chart_wrapper.dart @@ -0,0 +1,280 @@ +import 'package:deriv_chart/deriv_chart.dart'; +import 'package:deriv_ui/components/components.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +import 'mobile_tools_ui/chart_bottom_sheet.dart'; +import 'mobile_tools_ui/mobile_tools_bottom_sheet_content.dart'; +import 'mobile_tools_ui/tools_controller.dart'; + +/// The mobile version wrapper around the [Chart] which handles adding/removing +/// indicators and drawing tools to the chart. +class MobileChartWrapper extends StatefulWidget { + /// Initializes [MobileChartWrapper]. + const MobileChartWrapper({ + required this.mainSeries, + required this.granularity, + this.toolsStoreKey = 'default', + this.toolsController, + this.markerSeries, + this.controller, + this.onCrosshairAppeared, + this.onCrosshairDisappeared, + this.onCrosshairHover, + this.onVisibleAreaChanged, + this.onQuoteAreaChanged, + this.theme, + this.isLive = false, + this.dataFitEnabled = false, + this.showCrosshair = true, + this.annotations, + this.opacity = 1.0, + this.pipSize = 4, + this.chartAxisConfig = const ChartAxisConfig(), + this.maxCurrentTickOffset, + this.msPerPx, + this.minIntervalWidth, + this.maxIntervalWidth, + this.dataFitPadding, + this.currentTickAnimationDuration, + this.quoteBoundsAnimationDuration, + this.showCurrentTickBlinkAnimation, + this.verticalPaddingFraction, + this.bottomChartTitleMargin, + this.showDataFitButton, + this.showScrollToLastTickButton, + this.loadingAnimationColor, + Key? key, + }) : super(key: key); + + /// Chart's main data series + final DataSeries mainSeries; + + /// Open position marker series. + final MarkerSeries? markerSeries; + + /// The key which is used to store selected indicators/tools. + /// + /// When you pass the same key that was passed before when user selected some + /// tools, by passing the same key, the tools will be restored. + final String toolsStoreKey; + + /// Chart's controller + final ChartController? controller; + + /// Chart's tools controller. + final ToolsController? toolsController; + + /// Number of digits after decimal point in price. + final int pipSize; + + /// For candles: Duration of one candle in ms. + /// For ticks: Average ms difference between two consecutive ticks. + final int granularity; + + /// Called when crosshair details appear after long press. + final VoidCallback? onCrosshairAppeared; + + /// Called when the crosshair is dismissed. + final VoidCallback? onCrosshairDisappeared; + + /// Called when the crosshair cursor is hovered/moved. + final OnCrosshairHoverCallback? onCrosshairHover; + + /// Called when chart is scrolled or zoomed. + final VisibleAreaChangedCallback? onVisibleAreaChanged; + + /// Callback provided by library user. + final VisibleQuoteAreaChangedCallback? onQuoteAreaChanged; + + /// Chart's theme. + final ChartTheme? theme; + + /// Chart's annotations + final List>? annotations; + + /// Configurations for chart's axes. + final ChartAxisConfig chartAxisConfig; + + /// Whether the chart should be showing live data or not. + /// In case of being true the chart will keep auto-scrolling when its visible + /// area is on the newest ticks/candles. + final bool isLive; + + /// Starts in data fit mode and adds a data-fit button. + final bool dataFitEnabled; + + /// Chart's opacity, Will be applied on the [mainSeries]. + final double opacity; + + /// Whether the crosshair should be shown or not. + final bool showCrosshair; + + /// Max distance between rightBoundEpoch and nowEpoch in pixels. + final double? maxCurrentTickOffset; + + /// Specifies the zoom level of the chart. + final double? msPerPx; + + /// Specifies the minimum interval width + /// that is used for calculating the maximum msPerPx. + final double? minIntervalWidth; + + /// Specifies the maximum interval width + /// that is used for calculating the maximum msPerPx. + final double? maxIntervalWidth; + + /// Padding around data used in data-fit mode. + final EdgeInsets? dataFitPadding; + + /// Duration of the current tick animated transition. + final Duration? currentTickAnimationDuration; + + /// Duration of quote bounds animated transition. + final Duration? quoteBoundsAnimationDuration; + + /// Whether to show current tick blink animation or not. + final bool? showCurrentTickBlinkAnimation; + + /// Fraction of the chart's height taken by top or bottom padding. + /// Quote scaling (drag on quote area) is controlled by this variable. + final double? verticalPaddingFraction; + + /// Specifies the margin to prevent overlap. + final EdgeInsets? bottomChartTitleMargin; + + /// Whether the data fit button is shown or not. + final bool? showDataFitButton; + + /// Whether to show the scroll to last tick button or not. + final bool? showScrollToLastTickButton; + + /// The color of the loading animation. + final Color? loadingAnimationColor; + + @override + MobileChartWrapperState createState() => MobileChartWrapperState(); +} + +/// The state of the [MobileChartWrapper]. +class MobileChartWrapperState extends State { + AddOnsRepository? _indicatorsRepo; + + // TODO(Ramin): Add AddOnsRepository? and DrawingTools + // for drawing tools. + + @override + void initState() { + super.initState(); + + _initRepos(); + _setupController(); + } + + @override + void didUpdateWidget(covariant MobileChartWrapper oldWidget) { + super.didUpdateWidget(oldWidget); + + if (widget.toolsStoreKey != oldWidget.toolsStoreKey) { + loadSavedIndicatorsAndDrawingTools(); + } + } + + void _setupController() { + widget.toolsController?.onShowIndicatorsToolsMenu = () { + if (_indicatorsRepo != null) { + _showIndicatorsSheet(_indicatorsRepo!); + } + }; + } + + void _initRepos() { + if (widget.toolsController?.indicatorsEnabled ?? false) { + _indicatorsRepo = AddOnsRepository( + createAddOn: (Map map) => + IndicatorConfig.fromJson(map), + onEditCallback: (_) => _showIndicatorsSheet(_indicatorsRepo!), + sharedPrefKey: widget.toolsStoreKey, + ); + } + + loadSavedIndicatorsAndDrawingTools(); + } + + Future loadSavedIndicatorsAndDrawingTools() async { + final SharedPreferences prefs = await SharedPreferences.getInstance(); + final List> stateRepos = + >[ + if (_indicatorsRepo != null) _indicatorsRepo!, + // TODO(Ramin): add drawing tools repo here. + ]; + + stateRepos + .asMap() + .forEach((int index, AddOnsRepository element) { + try { + element.loadFromPrefs(prefs, widget.toolsStoreKey); + } on Exception { + // ignore: unawaited_futures + showDialog( + context: context, + builder: (BuildContext context) => AnimatedPopupDialog( + child: Center( + child: element is Repository + // TODO(Ramin): use localization. + ? const Text('Failed loading indicators') + : const Text('Failed loading drawing tools'), + ), + ), + ); + } + }); + } + + void _showIndicatorsSheet(AddOnsRepository indicatorsRepo) { + // Show indicators menu as modal bottom sheet so it's dismissible by tapping + // outside. + showModalBottomSheet( + context: context, + builder: (_) => ChangeNotifierProvider>.value( + value: indicatorsRepo, + child: ChartBottomSheet( + child: SizedBox( + height: MediaQuery.of(context).size.height * 0.5, + child: const MobileToolsBottomSheetContent(), + ), + ), + ), + ); + } + + @override + Widget build(BuildContext context) => + // TODO(Ramin): Check if we can consider using Chart widget directly. + DerivChart( + indicatorsRepo: _indicatorsRepo ?? + AddOnsRepository( + createAddOn: (Map map) => + IndicatorConfig.fromJson(map), + sharedPrefKey: widget.toolsStoreKey, + ), + drawingToolsRepo: AddOnsRepository( + createAddOn: (Map map) => + DrawingToolConfig.fromJson(map), + sharedPrefKey: widget.toolsStoreKey, + ), + controller: widget.controller, + mainSeries: widget.mainSeries, + markerSeries: widget.markerSeries, + pipSize: widget.pipSize, + granularity: widget.granularity, + onVisibleAreaChanged: widget.onVisibleAreaChanged, + isLive: widget.isLive, + dataFitEnabled: widget.dataFitEnabled, + opacity: widget.opacity, + chartAxisConfig: widget.chartAxisConfig, + annotations: widget.annotations, + activeSymbol: widget.toolsStoreKey, + ); +} diff --git a/packages/deriv_mobile_chart_wrapper/lib/src/mobile_tools_ui/chart_bottom_sheet.dart b/packages/deriv_mobile_chart_wrapper/lib/src/mobile_tools_ui/chart_bottom_sheet.dart new file mode 100644 index 000000000..9cdb48942 --- /dev/null +++ b/packages/deriv_mobile_chart_wrapper/lib/src/mobile_tools_ui/chart_bottom_sheet.dart @@ -0,0 +1,76 @@ +import 'package:deriv_chart/deriv_chart.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +import 'custom_draggable_sheet.dart'; + +/// Bottom sheet container used in chart library. +class ChartBottomSheet extends StatefulWidget { + /// Creates a bottom sheet container for [child]. + const ChartBottomSheet({ + required this.child, + this.theme, + Key? key, + }) : super(key: key); + + /// Body of bottom sheet container. + final Widget child; + + /// The theme of the chart which the bottom sheet is being placed inside. + final ChartTheme? theme; + + @override + _ChartBottomSheetState createState() => _ChartBottomSheetState(); +} + +class _ChartBottomSheetState extends State { + late ChartTheme _theme; + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + + _theme = widget.theme ?? + (Theme.of(context).brightness == Brightness.dark + ? ChartDefaultDarkTheme() + : ChartDefaultLightTheme()); + } + + @override + Widget build(BuildContext context) => CustomDraggableSheet( + child: Provider.value( + value: _theme, + child: ClipRRect( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(_theme.borderRadius24Chart), + topRight: Radius.circular(_theme.borderRadius24Chart), + ), + child: Material( + elevation: 8, + color: _theme.base07Color, + child: Column( + children: [ + _buildTopHandle(), + Expanded(child: widget.child), + ], + ), + ), + ), + ), + ); + + Widget _buildTopHandle() => Container( + padding: EdgeInsets.symmetric(vertical: _theme.margin08Chart), + width: double.infinity, + child: Center( + child: Container( + width: 40, + height: 4, + decoration: BoxDecoration( + color: _theme.base05Color, + borderRadius: BorderRadius.circular(_theme.borderRadius04Chart), + ), + ), + ), + ); +} diff --git a/packages/deriv_mobile_chart_wrapper/lib/src/mobile_tools_ui/chart_setting_button_with_background.dart b/packages/deriv_mobile_chart_wrapper/lib/src/mobile_tools_ui/chart_setting_button_with_background.dart new file mode 100644 index 000000000..ae7afce7f --- /dev/null +++ b/packages/deriv_mobile_chart_wrapper/lib/src/mobile_tools_ui/chart_setting_button_with_background.dart @@ -0,0 +1,40 @@ +import 'package:deriv_theme/deriv_theme.dart'; +import 'package:flutter/material.dart'; + +/// A button with a background. +class ChartSettingButtonWithBackground extends StatelessWidget { + /// Creates a button with a background. + const ChartSettingButtonWithBackground({ + required this.child, + required this.onTap, + super.key, + }); + + /// The button content. + final Widget child; + + /// The callback function to be called when the button is tapped. + final VoidCallback onTap; + + @override + Widget build(BuildContext context) => Container( + width: ThemeProvider.margin32, + height: ThemeProvider.margin32, + decoration: BoxDecoration( + color: context.theme.colors.secondary, + borderRadius: BorderRadius.circular(ThemeProvider.borderRadius04), + ), + child: Material( + color: Colors.transparent, + borderRadius: BorderRadius.circular(ThemeProvider.borderRadius04), + child: InkWell( + borderRadius: BorderRadius.circular(ThemeProvider.borderRadius04), + child: Padding( + padding: const EdgeInsets.all(ThemeProvider.margin08), + child: child, + ), + onTap: onTap, + ), + ), + ); +} diff --git a/packages/deriv_mobile_chart_wrapper/lib/src/mobile_tools_ui/custom_draggable_sheet.dart b/packages/deriv_mobile_chart_wrapper/lib/src/mobile_tools_ui/custom_draggable_sheet.dart new file mode 100644 index 000000000..3128b3486 --- /dev/null +++ b/packages/deriv_mobile_chart_wrapper/lib/src/mobile_tools_ui/custom_draggable_sheet.dart @@ -0,0 +1,145 @@ +import 'package:flutter/material.dart'; + +/// A widget to manage the over-scroll to dismiss for a scrollable inside its +/// [child] that being shown by calling [showBottomSheet()]. +/// +/// This widget will listen to [OverscrollNotification] inside its [child] to +/// detect that it has reached its top scroll limit. when user is closing the +/// [child] by over-scrolling, it will call [Navigator.pop()], to fully dismiss +/// the [BottomSheet]. +class CustomDraggableSheet extends StatefulWidget { + /// Initializes a widget to manage the over-scroll to dismiss for a scrollable + /// inside its [child]. + const CustomDraggableSheet({ + required this.child, + Key? key, + this.animationDuration = const Duration(milliseconds: 100), + this.introAnimationDuration = const Duration(milliseconds: 300), + }) : super(key: key); + + /// The sheet that was popped-up inside a [BottomSheet] throw calling + /// [showBottomSheet]. + final Widget child; + + /// The duration of animation whether sheet will fling back to top or dismiss. + final Duration animationDuration; + + /// The duration of the starting animation. + final Duration introAnimationDuration; + + @override + _CustomDraggableSheetState createState() => _CustomDraggableSheetState(); +} + +class _CustomDraggableSheetState extends State + with SingleTickerProviderStateMixin { + late AnimationController _animationController; + + final GlobalKey> _sheetKey = GlobalKey(); + + Size? _sheetSize; + + bool _overScrolled = false; + + @override + void initState() { + super.initState(); + + _animationController = AnimationController.unbounded(vsync: this, value: 1) + ..addStatusListener((AnimationStatus status) { + if (status == AnimationStatus.completed && + _animationController.value > 0.9) { + Navigator.of(context).pop(); + } + }); + + WidgetsFlutterBinding.ensureInitialized().addPostFrameCallback((_) { + _sheetSize = _initSizes(); + _animationController.animateTo( + 0, + duration: widget.introAnimationDuration, + curve: Curves.easeOut, + ); + }); + } + + Size _initSizes() { + final RenderBox chartBox = + _sheetKey.currentContext!.findRenderObject() as RenderBox; + return chartBox.size; + } + + @override + Widget build(BuildContext context) => AnimatedBuilder( + key: _sheetKey, + animation: _animationController, + builder: (BuildContext context, Widget? child) => FractionalTranslation( + translation: Offset(0, _animationController.value), + child: child, + ), + child: NotificationListener( + onNotification: _handleScrollNotification, + child: widget.child, + ), + ); + + @override + void dispose() { + _animationController.dispose(); + super.dispose(); + } + + bool _handleScrollNotification(Notification notification) { + if (_sheetSize != null && notification is OverscrollNotification) { + _overScrolled = true; + _panToBottom(notification); + } else if (notification is ScrollUpdateNotification && _overScrolled) { + _panToTop(notification); + } else if (!_animationController.isAnimating && + notification is ScrollEndNotification && + _overScrolled) { + _overScrolled = false; + _flingToTopOrBottom(); + } + + return false; + } + + void _panToTop(ScrollUpdateNotification notification) { + final double deltaPercent = notification.scrollDelta! / _sheetSize!.height; + + if (deltaPercent > 0) { + _updateSheetHeightBy(deltaPercent); + } + } + + void _panToBottom(OverscrollNotification notification) { + final double deltaPercent = notification.overscroll / _sheetSize!.height; + + if (deltaPercent < 0) { + _updateSheetHeightBy(deltaPercent); + } + } + + void _updateSheetHeightBy(double deltaPercent) { + _animationController.value -= deltaPercent; + final double value = _animationController.value.clamp(0.0, 1.0); + _animationController.value = value; + } + + void _flingToTopOrBottom() { + if (_animationController.value > 0.5) { + _animationController.animateTo( + 1, + duration: widget.animationDuration, + curve: Curves.easeOut, + ); + } else { + _animationController.animateTo( + 0, + duration: widget.animationDuration, + curve: Curves.easeOut, + ); + } + } +} diff --git a/packages/deriv_mobile_chart_wrapper/lib/src/mobile_tools_ui/indicator_list_item.dart b/packages/deriv_mobile_chart_wrapper/lib/src/mobile_tools_ui/indicator_list_item.dart new file mode 100644 index 000000000..8bb00ec7f --- /dev/null +++ b/packages/deriv_mobile_chart_wrapper/lib/src/mobile_tools_ui/indicator_list_item.dart @@ -0,0 +1,65 @@ +import 'package:deriv_mobile_chart_wrapper/src/extensions.dart'; +import 'package:deriv_theme/deriv_theme.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + +/// List item widget to show an indicator. +class IndicatorListItem extends StatelessWidget { + /// Constructor of the widget + const IndicatorListItem({ + required this.iconAssetPath, + required this.title, + required this.onInfoIconTapped, + this.count = 0, + super.key, + }); + + /// The path to the SVG icon asset. + final String iconAssetPath; + + /// The title of the indicator. + final String title; + + /// The callback which will be called when the info icon is tapped. + final VoidCallback onInfoIconTapped; + + /// Number of added indicators of this type. + /// + /// It will show in the item if it's greater than 0. + final int count; + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.all(ThemeProvider.margin16), + child: Row( + children: [ + _buildIndicatorIcon(), + const SizedBox(width: Dimens.margin08), + _buildIndicatorTitle(context), + const Spacer(), + IconButton( + icon: const Icon(Icons.info_outline), + color: context.themeProvider.colors.prominent, + onPressed: onInfoIconTapped, + ), + ], + ), + ); + } + + Widget _buildIndicatorIcon() => SvgPicture.asset( + iconAssetPath, + width: ThemeProvider.margin24, + height: ThemeProvider.margin24, + package: 'deriv_mobile_chart_wrapper', + ); + + Widget _buildIndicatorTitle(BuildContext context) => Text( + title, + style: context.themeProvider.textStyle( + textStyle: TextStyles.body1, + color: context.themeProvider.colors.general, + ), + ); +} diff --git a/packages/deriv_mobile_chart_wrapper/lib/src/mobile_tools_ui/indicator_menu_button.dart b/packages/deriv_mobile_chart_wrapper/lib/src/mobile_tools_ui/indicator_menu_button.dart new file mode 100644 index 000000000..42c293168 --- /dev/null +++ b/packages/deriv_mobile_chart_wrapper/lib/src/mobile_tools_ui/indicator_menu_button.dart @@ -0,0 +1,29 @@ +import 'package:deriv_mobile_chart_wrapper/src/assets.dart'; +import 'package:deriv_theme/deriv_theme.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + +import 'chart_setting_button_with_background.dart'; + +/// A button that opens the indicator menu. +class IndicatorMenuButton extends StatelessWidget { + /// Initializes the indicator menu button. + const IndicatorMenuButton({ + required this.onTap, + super.key, + }); + + /// The callback function to be called when the button is tapped. + final VoidCallback onTap; + + @override + Widget build(BuildContext context) => ChartSettingButtonWithBackground( + onTap: onTap, + child: SvgPicture.asset( + indicatorsMenuIcon, + width: ThemeProvider.margin18, + height: ThemeProvider.margin18, + package: 'deriv_mobile_chart_wrapper', + ), + ); +} diff --git a/packages/deriv_mobile_chart_wrapper/lib/src/mobile_tools_ui/mobile_tools_bottom_sheet_content.dart b/packages/deriv_mobile_chart_wrapper/lib/src/mobile_tools_ui/mobile_tools_bottom_sheet_content.dart new file mode 100644 index 000000000..cbbb7caa0 --- /dev/null +++ b/packages/deriv_mobile_chart_wrapper/lib/src/mobile_tools_ui/mobile_tools_bottom_sheet_content.dart @@ -0,0 +1,79 @@ +import 'package:deriv_mobile_chart_wrapper/src/assets.dart'; +import 'package:deriv_mobile_chart_wrapper/src/mobile_tools_ui/indicator_list_item.dart'; +import 'package:deriv_mobile_chart_wrapper/src/models/indicator_item_model.dart'; +import 'package:deriv_theme/deriv_theme.dart'; +import 'package:deriv_mobile_chart_wrapper/src/extensions.dart'; +import 'package:flutter/material.dart'; + +/// Bottom sheet content to show the list of support tools (indicators/ drawing +/// tools) for the mobile version. +class MobileToolsBottomSheetContent extends StatelessWidget { + /// Initializes the bottom sheet content. + const MobileToolsBottomSheetContent({super.key}); + + static const List indicators = [ + IndicatorItemModel(title: 'MACD', icon: macdIcon), + IndicatorItemModel(title: 'Relative Strength Index (RSI)', icon: rsiIcon), + IndicatorItemModel(title: 'Bollinger Bands', icon: bollingerBandsIcon), + IndicatorItemModel(title: 'Moving Average', icon: movingAverageIcon), + ]; + + @override + Widget build(BuildContext context) => Column( + children: [ + _buildHeader(context), + Expanded( + child: Ink( + color: context.theme.colors.primary, + child: Column( + children: [ + const SizedBox(height: ThemeProvider.margin16), + _buildChipsList(), + Expanded(child: _buildIndicatorsList()), + ], + ), + ), + ), + ], + ); + + Widget _buildIndicatorsList() { + return ListView.builder( + itemCount: indicators.length, + itemBuilder: (_, index) { + final IndicatorItemModel indicator = indicators[index]; + + return IndicatorListItem( + iconAssetPath: indicator.icon, + title: indicator.title, + onInfoIconTapped: () {}, + ); + }, + ); + } + + Widget _buildChipsList() { + // Overscroll behaviour of horizontal chips list sometimes triggers + // BottomSheet top <-> bottom dragging. That's why we're capturing the + // overscroll here so it doesn't propagate up to the BottomSheet. + return NotificationListener( + onNotification: (OverscrollNotification notification) { + return true; + }, + // TODO(Ramin): add chips list. + child: const SizedBox.shrink(), + ); + } + + Widget _buildHeader(BuildContext context) => Container( + padding: const EdgeInsets.symmetric(vertical: Dimens.margin16), + alignment: Alignment.center, + child: Text( + context.mobileChartWrapperLocalizations.labelIndicators, + style: DerivThemeProvider.getTheme(context).textStyle( + textStyle: TextStyles.subheading, + color: DerivThemeProvider.getTheme(context).colors.prominent, + ), + ), + ); +} diff --git a/packages/deriv_mobile_chart_wrapper/lib/src/mobile_tools_ui/tools_controller.dart b/packages/deriv_mobile_chart_wrapper/lib/src/mobile_tools_ui/tools_controller.dart new file mode 100644 index 000000000..a207eca9c --- /dev/null +++ b/packages/deriv_mobile_chart_wrapper/lib/src/mobile_tools_ui/tools_controller.dart @@ -0,0 +1,21 @@ +import 'dart:ui'; + +/// Controller class to show tools menu. +class ToolsController { + /// Initializes the tools controller. + ToolsController({this.indicatorsEnabled = true}); + + /// Whether indicators are enabled or not. + final bool indicatorsEnabled; + + /// Called to show indicators tools menu. + VoidCallback? onShowIndicatorsToolsMenu; + + /// Shows indicators tools menu. + void showIndicatorsToolsMenu() => onShowIndicatorsToolsMenu?.call(); + + /// Shows drawing tools menu. + void showDrawingToolsMenu() { + // TODO(Ramin): Call the callback for drawing tools. + } +} diff --git a/packages/deriv_mobile_chart_wrapper/lib/src/models/indicator_item_model.dart b/packages/deriv_mobile_chart_wrapper/lib/src/models/indicator_item_model.dart new file mode 100644 index 000000000..fc155c903 --- /dev/null +++ b/packages/deriv_mobile_chart_wrapper/lib/src/models/indicator_item_model.dart @@ -0,0 +1,14 @@ +/// Model class to keep the information of an indicator item. +class IndicatorItemModel { + /// Initializes an indicator item model. + const IndicatorItemModel({ + required this.title, + required this.icon, + }); + + /// The title. + final String title; + + /// The path to the SVG icon. + final String icon; +} diff --git a/packages/deriv_mobile_chart_wrapper/pubspec.yaml b/packages/deriv_mobile_chart_wrapper/pubspec.yaml new file mode 100644 index 000000000..a162e8bfe --- /dev/null +++ b/packages/deriv_mobile_chart_wrapper/pubspec.yaml @@ -0,0 +1,84 @@ +name: deriv_mobile_chart_wrapper +description: A new Flutter package project. +version: 0.0.1 +homepage: + +environment: + sdk: ">=3.0.0 <4.0.0" + +dependencies: + flutter: + sdk: flutter + + deriv_chart: + git: + url: git@github.com:regentmarkets/flutter-chart.git + ref: dev + + deriv_theme: + git: + url: git@github.com:regentmarkets/flutter-deriv-packages.git + path: packages/deriv_theme + ref: deriv_theme-v2.5.0 + + deriv_localizations: + git: + url: git@github.com:regentmarkets/flutter-deriv-packages.git + path: packages/deriv_localizations + ref: deriv_localizations-v1.5.1 + + deriv_ui: + git: + url: git@github.com:regentmarkets/flutter-deriv-packages.git + path: packages/deriv_ui + ref: deriv_ui-v0.0.7+6 + + provider: ^6.0.5 + flutter_svg: ^2.0.9 + shared_preferences: ^2.1.0 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^2.0.0 + mockito: ^5.4.2 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter packages. +flutter: + uses-material-design: true + + assets: + - assets/icons/ic_macd.svg + - assets/icons/ic_rsi.svg + - assets/icons/ic_bollinger_bands.svg + - assets/icons/ic_moving_average.svg + - assets/icons/ic_indicators_menu.svg +# +# For details regarding assets in packages, see +# https://flutter.dev/assets-and-images/#from-packages +# +# An image asset can refer to one or more resolution-specific "variants", see +# https://flutter.dev/assets-and-images/#resolution-aware + +# To add custom fonts to your package, add a fonts section here, +# in this "flutter" section. Each entry in this list should have a +# "family" key with the font family name, and a "fonts" key with a +# list giving the asset and other descriptors for the font. For +# example: +# fonts: +# - family: Schyler +# fonts: +# - asset: fonts/Schyler-Regular.ttf +# - asset: fonts/Schyler-Italic.ttf +# style: italic +# - family: Trajan Pro +# fonts: +# - asset: fonts/TrajanPro.ttf +# - asset: fonts/TrajanPro_Bold.ttf +# weight: 700 +# +# For details regarding fonts in packages, see +# https://flutter.dev/custom-fonts/#from-packages diff --git a/packages/deriv_mobile_chart_wrapper/test/mobile_chart_wrapper_test.dart b/packages/deriv_mobile_chart_wrapper/test/mobile_chart_wrapper_test.dart new file mode 100644 index 000000000..3fc7efb0b --- /dev/null +++ b/packages/deriv_mobile_chart_wrapper/test/mobile_chart_wrapper_test.dart @@ -0,0 +1,77 @@ +import 'package:deriv_localizations/l10n/generated/deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper_localizations.dart'; +import 'package:deriv_mobile_chart_wrapper/src/mobile_tools_ui/mobile_tools_bottom_sheet_content.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mockito/mockito.dart'; +import 'package:flutter/material.dart'; +import 'package:deriv_mobile_chart_wrapper/deriv_mobile_chart_wrapper.dart'; + +class MockToolsController extends Mock implements ToolsController { + @override + bool get indicatorsEnabled => true; +} + +class MockAddOnsRepository extends Mock + implements AddOnsRepository {} + +void main() { + group('MobileChartWrapper Tests', () { + testWidgets('MobileChartWrapper initializes correctly', + (WidgetTester tester) async { + await tester.pumpWidget(_TestWidget(toolsController: ToolsController())); + + // Verify initial state + expect(find.byType(DerivChart), findsOneWidget); + }); + + testWidgets('ToolsController showIndicatorsToolsMenu callback is set', + (WidgetTester tester) async { + final mockToolsController = MockToolsController(); + await tester.pumpWidget( + _TestWidget(toolsController: mockToolsController), + ); + + // Verify callback is set + verify(mockToolsController.onShowIndicatorsToolsMenu = any).called(1); + }); + + testWidgets('MobileChartWrapper shows indicators sheet', + (WidgetTester tester) async { + final toolsController = ToolsController(); + + await tester.pumpWidget( + _TestWidget( + toolsController: toolsController, + ), + ); + + // Trigger the callback to show the sheet + toolsController.showIndicatorsToolsMenu(); + await tester.pump(); + + // Verify the bottom sheet is displayed + expect(find.byType(MobileToolsBottomSheetContent), findsOneWidget); + }); + }); +} + +class _TestWidget extends StatelessWidget { + const _TestWidget({required this.toolsController}); + + final ToolsController toolsController; + + @override + Widget build(BuildContext context) { + return MaterialApp( + localizationsDelegates: const >[ + DerivMobileChartWrapperLocalizations.delegate, + ], + home: Material( + child: MobileChartWrapper( + mainSeries: LineSeries([]), + granularity: 60, + toolsController: toolsController, + ), + ), + ); + } +} From 7e42e19f5aa1f8aca9d529aa27ede554d1a18f5c Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Fri, 28 Jun 2024 17:31:38 +0800 Subject: [PATCH 128/162] chore(version): bump version and update changelog (#655) Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 21 +++++++++++++++++++ .../deriv_mobile_chart_wrapper/CHANGELOG.md | 4 ++++ .../deriv_mobile_chart_wrapper/pubspec.yaml | 2 +- 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e4c688a6..3f10163ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,27 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-06-28 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_mobile_chart_wrapper` - `v0.0.2`](#deriv_mobile_chart_wrapper---v002) + +--- + +#### `deriv_mobile_chart_wrapper` - `v0.0.2` + + - **FEAT**(deriv_mobile_chart_wrapper): [DERG-2498] create deriv_mobile_chart_wrapper package ([#626](https://github.com/regentmarkets/flutter-deriv-packages/issues/626)). ([01aec1ed](https://github.com/regentmarkets/flutter-deriv-packages/commit/01aec1edbd8f02e21951918ec86f00fb28ef2c58)) + + ## 2024-06-28 ### Changes diff --git a/packages/deriv_mobile_chart_wrapper/CHANGELOG.md b/packages/deriv_mobile_chart_wrapper/CHANGELOG.md index b4504b44c..82aecd4d3 100644 --- a/packages/deriv_mobile_chart_wrapper/CHANGELOG.md +++ b/packages/deriv_mobile_chart_wrapper/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.2 + + - **FEAT**(deriv_mobile_chart_wrapper): [DERG-2498] create deriv_mobile_chart_wrapper package ([#626](https://github.com/regentmarkets/flutter-deriv-packages/issues/626)). ([01aec1ed](https://github.com/regentmarkets/flutter-deriv-packages/commit/01aec1edbd8f02e21951918ec86f00fb28ef2c58)) + ## 0.0.1 * Setup the package. diff --git a/packages/deriv_mobile_chart_wrapper/pubspec.yaml b/packages/deriv_mobile_chart_wrapper/pubspec.yaml index a162e8bfe..df9f78a83 100644 --- a/packages/deriv_mobile_chart_wrapper/pubspec.yaml +++ b/packages/deriv_mobile_chart_wrapper/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_mobile_chart_wrapper description: A new Flutter package project. -version: 0.0.1 +version: 0.0.2 homepage: environment: From 190c7edd657325cf511071204c47104ecc1575b1 Mon Sep 17 00:00:00 2001 From: ramin-deriv <55975218+ramin-deriv@users.noreply.github.com> Date: Fri, 28 Jun 2024 21:50:04 +0800 Subject: [PATCH 129/162] chore(deriv_mobile_chart_wrapper): update deriv_ui depdendency (#657) --- packages/deriv_mobile_chart_wrapper/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/deriv_mobile_chart_wrapper/pubspec.yaml b/packages/deriv_mobile_chart_wrapper/pubspec.yaml index df9f78a83..a66cdbb1b 100644 --- a/packages/deriv_mobile_chart_wrapper/pubspec.yaml +++ b/packages/deriv_mobile_chart_wrapper/pubspec.yaml @@ -31,7 +31,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.7+6 + ref: deriv_ui-v0.0.7+9 provider: ^6.0.5 flutter_svg: ^2.0.9 From 3425078b52baac4f387504c9d41063bda1dba249 Mon Sep 17 00:00:00 2001 From: abedelaziz-deriv <135210555+abedelaziz-deriv@users.noreply.github.com> Date: Mon, 1 Jul 2024 10:20:29 +0800 Subject: [PATCH 130/162] refactor(deriv_passkeys): update deriv api dependency (#656) --- packages/deriv_auth/example/pubspec.yaml | 6 ++++++ packages/deriv_auth/pubspec.yaml | 2 +- packages/deriv_passkeys/pubspec.yaml | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/deriv_auth/example/pubspec.yaml b/packages/deriv_auth/example/pubspec.yaml index ce0a6b59c..a2b58d10e 100644 --- a/packages/deriv_auth/example/pubspec.yaml +++ b/packages/deriv_auth/example/pubspec.yaml @@ -19,6 +19,12 @@ dependencies: http: ^0.13.6 device_preview: ^1.1.0 +dependency_overrides: + flutter_deriv_api: + git: + url: git@github.com:deriv-com/flutter-deriv-api.git + ref: v1.0.0 + dev_dependencies: flutter_test: sdk: flutter diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index 911956f83..94c844b96 100644 --- a/packages/deriv_auth/pubspec.yaml +++ b/packages/deriv_auth/pubspec.yaml @@ -39,7 +39,7 @@ dependencies: flutter_deriv_api: git: url: git@github.com:deriv-com/flutter-deriv-api.git - ref: dev + ref: v1.0.0 deriv_web_view: git: diff --git a/packages/deriv_passkeys/pubspec.yaml b/packages/deriv_passkeys/pubspec.yaml index 821ab4ac7..5e2a7cb96 100644 --- a/packages/deriv_passkeys/pubspec.yaml +++ b/packages/deriv_passkeys/pubspec.yaml @@ -43,7 +43,7 @@ dependencies: flutter_deriv_api: git: url: git@github.com:deriv-com/flutter-deriv-api.git - ref: dev + ref: v1.0.0 flutter_svg: ^2.0.9 plugin_platform_interface: ^2.0.2 From 701f45319ef823d17e052e2f9ffaefd173007819 Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Mon, 1 Jul 2024 10:37:17 +0800 Subject: [PATCH 131/162] chore(version): bump version and update changelog (#658) --- CHANGELOG.md | 26 ++++++++++++++++++++++++++ README.md | 4 ++-- packages/deriv_auth/CHANGELOG.md | 4 ++++ packages/deriv_auth/pubspec.yaml | 4 ++-- packages/deriv_passkeys/CHANGELOG.md | 4 ++++ packages/deriv_passkeys/pubspec.yaml | 2 +- 6 files changed, 39 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f10163ce..d667a49c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,32 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-07-01 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_auth` - `v6.7.7`](#deriv_auth---v677) + - [`deriv_passkeys` - `v0.0.2+9`](#deriv_passkeys---v0029) + +--- + +#### `deriv_auth` - `v6.7.7` + + - **REFACTOR**(deriv_passkeys): update deriv api dependency ([#656](https://github.com/regentmarkets/flutter-deriv-packages/issues/656)). ([3425078b](https://github.com/regentmarkets/flutter-deriv-packages/commit/3425078b52baac4f387504c9d41063bda1dba249)) + +#### `deriv_passkeys` - `v0.0.2+9` + + - **REFACTOR**(deriv_passkeys): update deriv api dependency ([#656](https://github.com/regentmarkets/flutter-deriv-packages/issues/656)). ([3425078b](https://github.com/regentmarkets/flutter-deriv-packages/commit/3425078b52baac4f387504c9d41063bda1dba249)) + + ## 2024-06-28 ### Changes diff --git a/README.md b/README.md index ca0f1cd5a..54909d92e 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.7.6)`. 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.7.7)`. To use the package, add the following to your pubspec.yaml file: ```yaml @@ -20,7 +20,7 @@ deriv_ui: | Name | Description | Version | | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | | [analytics](./packages/analytics) | Used to collect and send analytical information to 'Firebase' and 'Segment'. | [v2.1.0](./packages/analytics/CHANGELOG.md) | -| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.6 ](./packages/deriv_auth/CHANGELOG.md) | +| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.7 ](./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) | diff --git a/packages/deriv_auth/CHANGELOG.md b/packages/deriv_auth/CHANGELOG.md index 3f8b7612d..ff5a82ea8 100644 --- a/packages/deriv_auth/CHANGELOG.md +++ b/packages/deriv_auth/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.7.7 + + - **REFACTOR**(deriv_passkeys): update deriv api dependency ([#656](https://github.com/regentmarkets/flutter-deriv-packages/issues/656)). ([3425078b](https://github.com/regentmarkets/flutter-deriv-packages/commit/3425078b52baac4f387504c9d41063bda1dba249)) + ## 6.7.6 - Update a dependency to the latest release. diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index 94c844b96..74084673e 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.7.6 +version: 6.7.7 environment: sdk: ">=3.0.0 <4.0.0" @@ -57,7 +57,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: deriv_passkeys-v0.0.2+8 + ref: deriv_passkeys-v0.0.2+9 deriv_language_selector: git: diff --git a/packages/deriv_passkeys/CHANGELOG.md b/packages/deriv_passkeys/CHANGELOG.md index ce5e2df3e..ff47fd72f 100644 --- a/packages/deriv_passkeys/CHANGELOG.md +++ b/packages/deriv_passkeys/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.2+9 + + - **REFACTOR**(deriv_passkeys): update deriv api dependency ([#656](https://github.com/regentmarkets/flutter-deriv-packages/issues/656)). ([3425078b](https://github.com/regentmarkets/flutter-deriv-packages/commit/3425078b52baac4f387504c9d41063bda1dba249)) + ## 0.0.2+8 - Update a dependency to the latest release. diff --git a/packages/deriv_passkeys/pubspec.yaml b/packages/deriv_passkeys/pubspec.yaml index 5e2a7cb96..b8c734770 100644 --- a/packages/deriv_passkeys/pubspec.yaml +++ b/packages/deriv_passkeys/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_passkeys description: Deriv Passkeys Flutter Plugin -version: 0.0.2+8 +version: 0.0.2+9 publish_to: "none" environment: From 75e5c6c4bc011582d2aba529dcd50e7dfcd60e65 Mon Sep 17 00:00:00 2001 From: Ahrar <98078754+ahrar-deriv@users.noreply.github.com> Date: Mon, 1 Jul 2024 17:27:27 +0800 Subject: [PATCH 132/162] ci: pre commit semantic commit msg check (#659) --- README.md | 10 ++++++++++ githooks/commit-msg | 28 ++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100755 githooks/commit-msg diff --git a/README.md b/README.md index 54909d92e..264e735e6 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,16 @@ This repository contains private packages & plugins that are used by the company's products built in Flutter. +###
GIT HOOK + +Please run the below command to have the git hook installed.
+This Hook will check for Semantic versioning commit convention
+ +```BASH +curl --fail -o $HOME/.git/hooks/commit-msg https://raw.githubusercontent.com/regentmarkets/flutter-deriv-packages/master/githooks/commit-msg \ + && chmod +x $HOME/.git/hooks/commit-msg +``` + ## Using the packages Each package has been released as git tag with convention as **packageName-vVersionNumber**`(Example: deriv_auth-v6.7.7)`. To use the package, add the following to your pubspec.yaml file: diff --git a/githooks/commit-msg b/githooks/commit-msg new file mode 100755 index 000000000..096e4d223 --- /dev/null +++ b/githooks/commit-msg @@ -0,0 +1,28 @@ +#!/bin/sh + +if [ -z "$1" ]; then + echo "Missing argument (commit message). Did you try to run this manually?" + exit 1 +fi + +commitTitle="$(cat $1 | head -n1)" + +# ignore merge requests +if echo "$commitTitle" | grep -qE "Merge branch"; then + echo "Commit hook: ignoring branch merge" + exit 0 +fi +# check semantic versioning scheme +if ! echo "$commitTitle" | grep -qE '^(feat|fix|docs|style|refactor|perf|test|chore|build|ci|revert)(\([a-z0-9\s\-\_\,]+\))?!?:\s\w'; then + echo "Your commit message did not follow semantic versioning: $commitTitle" + echo "" + echo "Format: (): " + echo "Example: feat(deriv-auth): single entry" + echo "" + echo "Valid types: build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test" + echo "" + echo "Please see" + echo "- https://github.com/regentmarkets/flutter-deriv-packages/blob/master/.github/GIT_RULES.md" + echo "- https://www.conventionalcommits.org/en/v1.0.0/#summary" + exit 1 +fi From 30aa969f7ed3f083ab1610518eded103d0aa2eb7 Mon Sep 17 00:00:00 2001 From: naif-deriv <112558231+naif-deriv@users.noreply.github.com> Date: Tue, 2 Jul 2024 07:38:36 +0400 Subject: [PATCH 133/162] fix(deriv_auth): fix_error_when_initializing_mock_auth_service (#660) --- .../example_login_repository.dart | 14 +++++++---- .../login/services/example_login_service.dart | 15 +++++------ packages/deriv_auth/example/lib/main.dart | 9 +++++++ .../features/auth/cubit/deriv_auth_cubit.dart | 5 +--- .../auth/services/base_auth_service.dart | 23 ++++++++++++++++- .../auth/services/deriv_auth_service.dart | 25 +++---------------- 6 files changed, 53 insertions(+), 38 deletions(-) diff --git a/packages/deriv_auth/example/lib/features/login/repositories/example_login_repository.dart b/packages/deriv_auth/example/lib/features/login/repositories/example_login_repository.dart index 2e7f72a29..bd2ad58bc 100644 --- a/packages/deriv_auth/example/lib/features/login/repositories/example_login_repository.dart +++ b/packages/deriv_auth/example/lib/features/login/repositories/example_login_repository.dart @@ -7,15 +7,17 @@ class ExampleLoginRepository implements BaseAuthRepository { Future.value(const AuthorizeResponseEntity()); @override - Future getDefaultAccount() => Future.value(AccountModel( - accountId: "accountId", - )); + Future getDefaultAccount() => Future.value( + AccountModel( + accountId: "accountId", + ), + ); @override Future> getLatestAccounts() => Future.value([ AccountModel( accountId: "accountId", - ) + ), ]); @override @@ -32,5 +34,7 @@ class ExampleLoginRepository implements BaseAuthRepository { @override Future getLandingCompany(String? countryCode) => - Future.value(const LandingCompanyEntity()); + Future.value( + const LandingCompanyEntity(), + ); } diff --git a/packages/deriv_auth/example/lib/features/login/services/example_login_service.dart b/packages/deriv_auth/example/lib/features/login/services/example_login_service.dart index 63c832a4f..8fdc880e9 100644 --- a/packages/deriv_auth/example/lib/features/login/services/example_login_service.dart +++ b/packages/deriv_auth/example/lib/features/login/services/example_login_service.dart @@ -2,22 +2,23 @@ import 'package:deriv_auth/core/models/account_model.dart'; import 'package:deriv_auth/core/models/authorize_model.dart'; import 'package:deriv_auth/core/models/landig_comany_model.dart'; import 'package:deriv_auth/core/services/token/models/login_request.dart'; -import 'package:deriv_auth/features/auth/repository/base_auth_repository.dart'; import 'package:deriv_auth/features/auth/services/base_auth_service.dart'; /// `DerivGO` implementation of [BaseAuthService]. class ExampleLoginService extends BaseAuthService { /// Initializes a [ExampleLoginService] class. ExampleLoginService({ - required this.authRepository, + required super.authRepository, + required super.jwtService, + required super.connectionInfo, + required super.tokenService, }); - /// Interface of all client related functions. - final BaseAuthRepository authRepository; - @override - Future onLoginRequest( - {required GetTokensRequestModel request, String? userAgent}) async => + Future onLoginRequest({ + required GetTokensRequestModel request, + String? userAgent, + }) async => const AuthorizeEntity(); @override diff --git a/packages/deriv_auth/example/lib/main.dart b/packages/deriv_auth/example/lib/main.dart index f16ee0fa0..c329c062c 100644 --- a/packages/deriv_auth/example/lib/main.dart +++ b/packages/deriv_auth/example/lib/main.dart @@ -36,6 +36,15 @@ class MyApp extends StatelessWidget { create: (context) => DerivAuthCubit( authService: ExampleLoginService( authRepository: ExampleLoginRepository(), + jwtService: DerivJwtService( + repository: DerivJwtRepository( + client: HttpClient(), + connectionInfo: DerivAuthConnectionInfo(), + appToken: 'test_app_token', + ), + ), + connectionInfo: DerivAuthConnectionInfo(), + tokenService: DerivTokenService(), ), ), ), diff --git a/packages/deriv_auth/lib/features/auth/cubit/deriv_auth_cubit.dart b/packages/deriv_auth/lib/features/auth/cubit/deriv_auth_cubit.dart index 53eb7fb2a..6b7db78de 100644 --- a/packages/deriv_auth/lib/features/auth/cubit/deriv_auth_cubit.dart +++ b/packages/deriv_auth/lib/features/auth/cubit/deriv_auth_cubit.dart @@ -12,7 +12,6 @@ import 'package:deriv_auth/core/services/token/models/enums.dart'; import 'package:deriv_auth/core/services/token/models/login_request.dart'; import 'package:deriv_auth/features/auth/deriv_auth_io.dart'; import 'package:deriv_auth/features/auth/services/base_auth_service.dart'; -import 'package:deriv_auth/features/auth/services/deriv_auth_service.dart'; import 'package:deriv_auth/features/social_auth/models/social_auth_dto.dart'; part 'deriv_auth_state.dart'; @@ -27,9 +26,7 @@ class DerivAuthCubit extends Cubit required this.authService, }) : super(DerivAuthLoadingState()) { AuthTrackingRepository.init( - authService is DerivAuthService - ? (authService as DerivAuthService).connectionInfo.appId - : (throw Exception('Connection Info is not provided.')), + authService.connectionInfo.appId, derivRudderstack: DerivRudderstack(), ); } diff --git a/packages/deriv_auth/lib/features/auth/services/base_auth_service.dart b/packages/deriv_auth/lib/features/auth/services/base_auth_service.dart index 184acc869..2c07aca21 100644 --- a/packages/deriv_auth/lib/features/auth/services/base_auth_service.dart +++ b/packages/deriv_auth/lib/features/auth/services/base_auth_service.dart @@ -1,12 +1,33 @@ +import 'package:deriv_auth/core/connection_info.dart'; import 'package:deriv_auth/core/models/account_model.dart'; import 'package:deriv_auth/core/models/authorize_model.dart'; import 'package:deriv_auth/core/models/landig_comany_model.dart'; +import 'package:deriv_auth/core/services/jwt/services/base_jwt_service.dart'; import 'package:deriv_auth/core/services/token/models/login_request.dart'; +import 'package:deriv_auth/core/services/token/services/base_token_service.dart'; +import 'package:deriv_auth/features/auth/repository/base_auth_repository.dart'; /// Interface to define all authentication-related functionality. abstract class BaseAuthService { /// Constructor for [BaseAuthService]. - BaseAuthService(); + BaseAuthService({ + required this.connectionInfo, + required this.jwtService, + required this.authRepository, + required this.tokenService, + }); + + /// Client connection info. + final AuthConnectionInfo connectionInfo; + + /// Interface for all jwtRelated functions. + final BaseJwtService jwtService; + + /// Interface of all client related functions. + final BaseAuthRepository authRepository; + + /// Token service. + final BaseTokenService tokenService; /// Function before logging user in. Future onLoginRequest({ diff --git a/packages/deriv_auth/lib/features/auth/services/deriv_auth_service.dart b/packages/deriv_auth/lib/features/auth/services/deriv_auth_service.dart index 1a0d6c697..fe64da79c 100644 --- a/packages/deriv_auth/lib/features/auth/services/deriv_auth_service.dart +++ b/packages/deriv_auth/lib/features/auth/services/deriv_auth_service.dart @@ -1,6 +1,4 @@ import 'package:collection/collection.dart'; -import 'package:deriv_auth/core/connection_info.dart'; - import 'package:deriv_auth/core/constants/constants.dart'; import 'package:deriv_auth/core/exceptions/deriv_auth_exception.dart'; import 'package:deriv_auth/core/extensions/extensions.dart'; @@ -8,11 +6,8 @@ import 'package:deriv_auth/core/models/account_model.dart'; import 'package:deriv_auth/core/models/auth_error/auth_error.dart'; import 'package:deriv_auth/core/models/authorize_model.dart'; import 'package:deriv_auth/core/models/landig_comany_model.dart'; -import 'package:deriv_auth/core/services/jwt/services/base_jwt_service.dart'; import 'package:deriv_auth/core/services/token/models/login_request.dart'; import 'package:deriv_auth/core/services/token/models/login_response.dart'; -import 'package:deriv_auth/core/services/token/services/base_token_service.dart'; -import 'package:deriv_auth/features/auth/repository/base_auth_repository.dart'; import 'package:deriv_http_client/deriv_http_client.dart'; import 'base_auth_service.dart'; @@ -21,24 +16,12 @@ import 'base_auth_service.dart'; class DerivAuthService extends BaseAuthService { /// Initializes a [DerivAuthService] class. DerivAuthService({ - required this.authRepository, - required this.jwtService, - required this.connectionInfo, - required this.tokenService, + required super.authRepository, + required super.jwtService, + required super.connectionInfo, + required super.tokenService, }); - /// Client connection info. - final AuthConnectionInfo connectionInfo; - - /// Interface for all jwtRelated functions. - final BaseJwtService jwtService; - - /// Interface of all client related functions. - final BaseAuthRepository authRepository; - - /// Token service. - final BaseTokenService tokenService; - @override Future onLoginRequest({ required GetTokensRequestModel request, From 7fc55dd3adfa55f2eaf43499e7456edfb221be39 Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Tue, 2 Jul 2024 12:22:32 +0800 Subject: [PATCH 134/162] chore(version): bump version and update changelog (#661) --- CHANGELOG.md | 21 +++++++++++++++++++++ README.md | 4 ++-- packages/deriv_auth/CHANGELOG.md | 4 ++++ packages/deriv_auth/pubspec.yaml | 2 +- 4 files changed, 28 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d667a49c7..d83b1e55e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,27 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-07-02 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_auth` - `v6.7.8`](#deriv_auth---v678) + +--- + +#### `deriv_auth` - `v6.7.8` + + - **FIX**(deriv_auth): fix_error_when_initializing_mock_auth_service ([#660](https://github.com/regentmarkets/flutter-deriv-packages/issues/660)). ([30aa969f](https://github.com/regentmarkets/flutter-deriv-packages/commit/30aa969f7ed3f083ab1610518eded103d0aa2eb7)) + + ## 2024-07-01 ### Changes diff --git a/README.md b/README.md index 264e735e6..cd2c6f6ec 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ curl --fail -o $HOME/.git/hooks/commit-msg https://raw.githubusercontent.com/reg ## Using the packages -Each package has been released as git tag with convention as **packageName-vVersionNumber**`(Example: deriv_auth-v6.7.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.7.8)`. To use the package, add the following to your pubspec.yaml file: ```yaml @@ -30,7 +30,7 @@ deriv_ui: | Name | Description | Version | | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | | [analytics](./packages/analytics) | Used to collect and send analytical information to 'Firebase' and 'Segment'. | [v2.1.0](./packages/analytics/CHANGELOG.md) | -| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.7 ](./packages/deriv_auth/CHANGELOG.md) | +| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.8 ](./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) | diff --git a/packages/deriv_auth/CHANGELOG.md b/packages/deriv_auth/CHANGELOG.md index ff5a82ea8..2f5e43778 100644 --- a/packages/deriv_auth/CHANGELOG.md +++ b/packages/deriv_auth/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.7.8 + + - **FIX**(deriv_auth): fix_error_when_initializing_mock_auth_service ([#660](https://github.com/regentmarkets/flutter-deriv-packages/issues/660)). ([30aa969f](https://github.com/regentmarkets/flutter-deriv-packages/commit/30aa969f7ed3f083ab1610518eded103d0aa2eb7)) + ## 6.7.7 - **REFACTOR**(deriv_passkeys): update deriv api dependency ([#656](https://github.com/regentmarkets/flutter-deriv-packages/issues/656)). ([3425078b](https://github.com/regentmarkets/flutter-deriv-packages/commit/3425078b52baac4f387504c9d41063bda1dba249)) diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index 74084673e..1f6dfa9a3 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.7.7 +version: 6.7.8 environment: sdk: ">=3.0.0 <4.0.0" From f99554bc134b7fe7fe0b3f5bf7555728868176c9 Mon Sep 17 00:00:00 2001 From: abedelaziz-deriv <135210555+abedelaziz-deriv@users.noreply.github.com> Date: Tue, 2 Jul 2024 15:50:32 +0800 Subject: [PATCH 135/162] refactor(deriv_auth): Replace uni_links2 with app_links (#664) --- .../social_auth/services/social_web_view_service.dart | 4 ++-- packages/deriv_auth/pubspec.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/deriv_auth/lib/features/social_auth/services/social_web_view_service.dart b/packages/deriv_auth/lib/features/social_auth/services/social_web_view_service.dart index e76cdc0b3..c4353f8af 100644 --- a/packages/deriv_auth/lib/features/social_auth/services/social_web_view_service.dart +++ b/packages/deriv_auth/lib/features/social_auth/services/social_web_view_service.dart @@ -1,9 +1,9 @@ import 'dart:async'; +import 'package:app_links/app_links.dart'; import 'package:deriv_auth/deriv_auth.dart'; import 'package:deriv_web_view/web_view.dart'; import 'package:flutter_deriv_api/helpers/miscellaneous_helper.dart'; -import 'package:uni_links2/uni_links.dart'; /// Service to handle social auth web view. final class SocialAuthWebViewService implements BaseSocialWebViewService { @@ -36,7 +36,7 @@ final class SocialAuthWebViewService implements BaseSocialWebViewService { } void _setupLinkStream(SocialAuthUriHandler uriHandler) { - _uriLinkStream = uriLinkStream.listen( + _uriLinkStream = AppLinks().uriLinkStream.listen( (Uri? uri) { _uriLinkStream?.cancel(); diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index 1f6dfa9a3..d0e221993 100644 --- a/packages/deriv_auth/pubspec.yaml +++ b/packages/deriv_auth/pubspec.yaml @@ -72,7 +72,7 @@ dependencies: package_info_plus: ^4.2.0 crypto: ^3.0.2 http: ^0.13.5 - uni_links2: ^0.6.0+2 + app_links: ^3.4.5 dependency_overrides: deriv_ui: From e4441a68c7a39d773aacedc07279d1f58a400f23 Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Tue, 2 Jul 2024 16:11:04 +0800 Subject: [PATCH 136/162] chore(version): bump version and update changelog (#665) --- CHANGELOG.md | 21 +++++++++++++++++++++ README.md | 4 ++-- packages/deriv_auth/CHANGELOG.md | 4 ++++ packages/deriv_auth/pubspec.yaml | 2 +- 4 files changed, 28 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d83b1e55e..3c1331475 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,27 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-07-02 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_auth` - `v6.7.9`](#deriv_auth---v679) + +--- + +#### `deriv_auth` - `v6.7.9` + + - **REFACTOR**(deriv_auth): Replace uni_links2 with app_links ([#664](https://github.com/regentmarkets/flutter-deriv-packages/issues/664)). ([f99554bc](https://github.com/regentmarkets/flutter-deriv-packages/commit/f99554bc134b7fe7fe0b3f5bf7555728868176c9)) + + ## 2024-07-02 ### Changes diff --git a/README.md b/README.md index cd2c6f6ec..80f722c4a 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ curl --fail -o $HOME/.git/hooks/commit-msg https://raw.githubusercontent.com/reg ## Using the packages -Each package has been released as git tag with convention as **packageName-vVersionNumber**`(Example: deriv_auth-v6.7.8)`. 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.7.9)`. To use the package, add the following to your pubspec.yaml file: ```yaml @@ -30,7 +30,7 @@ deriv_ui: | Name | Description | Version | | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | | [analytics](./packages/analytics) | Used to collect and send analytical information to 'Firebase' and 'Segment'. | [v2.1.0](./packages/analytics/CHANGELOG.md) | -| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.8 ](./packages/deriv_auth/CHANGELOG.md) | +| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.9 ](./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) | diff --git a/packages/deriv_auth/CHANGELOG.md b/packages/deriv_auth/CHANGELOG.md index 2f5e43778..f92c60916 100644 --- a/packages/deriv_auth/CHANGELOG.md +++ b/packages/deriv_auth/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.7.9 + + - **REFACTOR**(deriv_auth): Replace uni_links2 with app_links ([#664](https://github.com/regentmarkets/flutter-deriv-packages/issues/664)). ([f99554bc](https://github.com/regentmarkets/flutter-deriv-packages/commit/f99554bc134b7fe7fe0b3f5bf7555728868176c9)) + ## 6.7.8 - **FIX**(deriv_auth): fix_error_when_initializing_mock_auth_service ([#660](https://github.com/regentmarkets/flutter-deriv-packages/issues/660)). ([30aa969f](https://github.com/regentmarkets/flutter-deriv-packages/commit/30aa969f7ed3f083ab1610518eded103d0aa2eb7)) diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index d0e221993..a3ae9e2b9 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.7.8 +version: 6.7.9 environment: sdk: ">=3.0.0 <4.0.0" From 93dc49a55aeade6c0555afe2c3489eb717dc561b Mon Sep 17 00:00:00 2001 From: Ahrar <98078754+ahrar-deriv@users.noreply.github.com> Date: Tue, 2 Jul 2024 18:37:26 +0800 Subject: [PATCH 137/162] ci: fix action blocking chore(version) (#663) Co-authored-by: abedelaziz-deriv <135210555+abedelaziz-deriv@users.noreply.github.com> --- .github/workflows/check_versioning_pr.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check_versioning_pr.yml b/.github/workflows/check_versioning_pr.yml index 78871d2b7..d75d7d500 100644 --- a/.github/workflows/check_versioning_pr.yml +++ b/.github/workflows/check_versioning_pr.yml @@ -7,6 +7,7 @@ on: jobs: check-version-pr: runs-on: ubuntu-latest + if: ${{ ! startsWith(github.event.pull_request.title , 'chore(version)') }} steps: - name: Checkout repository uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 From e3272bc4c202993b9d2d85181fcddff9ebf59169 Mon Sep 17 00:00:00 2001 From: Ahrar <98078754+ahrar-deriv@users.noreply.github.com> Date: Wed, 3 Jul 2024 08:52:23 +0800 Subject: [PATCH 138/162] docs: update readme for commit-msg (#662) --- README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 80f722c4a..a603d910d 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,12 @@ This repository contains private packages & plugins that are used by the company ### GIT HOOK -Please run the below command to have the git hook installed.
This Hook will check for Semantic versioning commit convention
+1- Please download commit-msg file from githooks/commit-msg.
+2- Run the command below.
```BASH -curl --fail -o $HOME/.git/hooks/commit-msg https://raw.githubusercontent.com/regentmarkets/flutter-deriv-packages/master/githooks/commit-msg \ +curl --fail -o $HOME/.git/hooks/commit-msg $HOME/Downloads/commit-msg \ && chmod +x $HOME/.git/hooks/commit-msg ``` @@ -16,7 +17,6 @@ curl --fail -o $HOME/.git/hooks/commit-msg https://raw.githubusercontent.com/reg Each package has been released as git tag with convention as **packageName-vVersionNumber**`(Example: deriv_auth-v6.7.9)`. To use the package, add the following to your pubspec.yaml file: - ```yaml deriv_ui: git: @@ -41,8 +41,8 @@ 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+2](./packages/deriv_live_chat/CHANGELOG.md) | -| [deriv_language_selector](./packages/deriv_language_selector) | A package to handle language change of the app. | [v0.0.2+7](./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.5.1](./packages/deriv_localizations/CHANGELOG.md) | +| [deriv_language_selector](./packages/deriv_language_selector) | A package to handle language change of the app. | [v0.0.2+7](./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) | | [deriv_numpad](./packages/deriv_numpad) | Number Pad Widget for number input. | [v1.1.5](./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) | @@ -51,24 +51,24 @@ deriv_ui: | [deriv_ui](./packages/deriv_ui) | A package that contains the UI components used by Deriv products. | [v0.0.7+9](./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+3](./packages/deriv_web_view/CHANGELOG.md) | -| [deriv_widgetbook](./packages/deriv_widgetbook) |Storybook for Deriv UI Widgets and Components | [v0.0.2+9](./packages/deriv_widgetbook/CHANGELOG.md) | +| [deriv_web_view](./packages/deriv_web_view) | Deriv web view package. | [v0.2.2+3](./packages/deriv_web_view/CHANGELOG.md) | +| [deriv_widgetbook](./packages/deriv_widgetbook) | Storybook for Deriv UI Widgets and Components | [v0.0.2+9](./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.4.0](./packages/update_checker/CHANGELOG.md) | -| [deriv_feature_flag](./packages/deriv_feature_flag) | A package to provide feature flag functionality for apps. | [v0.1.1](./packages/deriv_feature_flag/CHANGELOG.md) | +| [deriv_feature_flag](./packages/deriv_feature_flag) | A package to provide feature flag functionality for apps. | [v0.1.1](./packages/deriv_feature_flag/CHANGELOG.md) | ## Environment Setup We use [Melos](https://pub.dev/packages/melos) to manage the multiple packages in this repository. To get started, install Melos globally: ```bash -$ dart pub global activate melos +dart pub global activate melos ``` Running `pub get` on all packages, run: ```bash -$ melos bootstrap +melos bootstrap ``` `Analyze` and `Test` has already been configured in `melos.yaml` so you can do the following: @@ -76,13 +76,13 @@ $ melos bootstrap Running `flutter analyze` on all packages: ```bash -$ melos run analyze +melos run analyze ``` Running `flutter test` on all packages: ```bash -$ melos run test --no-select +melos run test --no-select ``` If you'd like to run any other command on all packages, you can configure it in `melos.yaml` or run it directly with melos: From 7a58c741554ffc356d03152874dd4243650897ab Mon Sep 17 00:00:00 2001 From: Ahrar <98078754+ahrar-deriv@users.noreply.github.com> Date: Wed, 3 Jul 2024 08:57:08 +0800 Subject: [PATCH 139/162] docs: remove curl command (#666) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a603d910d..505cbee6d 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ This repository contains private packages & plugins that are used by the company 2- Run the command below.
```BASH -curl --fail -o $HOME/.git/hooks/commit-msg $HOME/Downloads/commit-msg \ +cp $HOME/Downloads/commit-msg $HOME/.git/hooks/commit-msg \ && chmod +x $HOME/.git/hooks/commit-msg ``` From 7de916e64729c9456c2e058c2051cfa0daaa04ea Mon Sep 17 00:00:00 2001 From: ramin-deriv Date: Wed, 3 Jul 2024 10:16:15 +0800 Subject: [PATCH 140/162] check if LoginProvider is null --- .../analytics/data/auth_tracking_data.dart | 2 +- .../data/auth_tracking_repository.dart | 20 +++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/packages/deriv_auth/lib/core/analytics/data/auth_tracking_data.dart b/packages/deriv_auth/lib/core/analytics/data/auth_tracking_data.dart index 9ce8e5491..9ac3b2559 100644 --- a/packages/deriv_auth/lib/core/analytics/data/auth_tracking_data.dart +++ b/packages/deriv_auth/lib/core/analytics/data/auth_tracking_data.dart @@ -4,7 +4,7 @@ import 'package:deriv_auth/core/analytics/enums.dart'; Map getUserTrackingData( LoginAction action, String appId, { - LoginProvider? provider, + required LoginProvider provider, String? errorMessage, }) => switch (action) { diff --git a/packages/deriv_auth/lib/core/analytics/data/auth_tracking_repository.dart b/packages/deriv_auth/lib/core/analytics/data/auth_tracking_repository.dart index 6e898f633..b10449b1c 100644 --- a/packages/deriv_auth/lib/core/analytics/data/auth_tracking_repository.dart +++ b/packages/deriv_auth/lib/core/analytics/data/auth_tracking_repository.dart @@ -38,11 +38,15 @@ class AuthTrackingRepository implements AuthUserTrackingInterface { @override void trackUserOpenedLoginForm() { + if (_loginProvider == null) { + return; + } + final Map data = getUserTrackingData( LoginAction.openLoginForm, _appId, + provider: _loginProvider!, ); - _derivRudderstack.track( eventName: data['event'] as String, properties: data['properties'] as Map, @@ -51,10 +55,14 @@ class AuthTrackingRepository implements AuthUserTrackingInterface { @override void trackError(String errorMessage) { + if (_loginProvider == null) { + return; + } + final Map data = getUserTrackingData( LoginAction.loginError, _appId, - provider: _loginProvider, + provider: _loginProvider!, errorMessage: errorMessage, ); @@ -107,7 +115,7 @@ class AuthTrackingRepository implements AuthUserTrackingInterface { final Map data = getUserTrackingData( LoginAction.startLogin, _appId, - provider: _loginProvider, + provider: _loginProvider!, ); _derivRudderstack.track( @@ -118,10 +126,14 @@ class AuthTrackingRepository implements AuthUserTrackingInterface { @override void trackLoginFinished() { + if (_loginProvider == null) { + return; + } + final Map data = getUserTrackingData( LoginAction.finishLogin, _appId, - provider: _loginProvider, + provider: _loginProvider!, ); _derivRudderstack.track( From b29d222ce219d0664e3cafb6c302cd1041749905 Mon Sep 17 00:00:00 2001 From: ramin-deriv <55975218+ramin-deriv@users.noreply.github.com> Date: Wed, 3 Jul 2024 12:03:57 +0800 Subject: [PATCH 141/162] fix(deriv_auth): minor change in readme file (#669) --- packages/deriv_auth/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/deriv_auth/README.md b/packages/deriv_auth/README.md index dfe5a5535..6ec48dc2a 100644 --- a/packages/deriv_auth/README.md +++ b/packages/deriv_auth/README.md @@ -99,6 +99,7 @@ DerivAuthCubit( Some usage examples: + - First, start by getting the `DerivAuthCubit` instance. ```dart @@ -341,4 +342,4 @@ Some usage examples: ```dart /// Call the [getSocialAuthProviders] method. _cubit.getSocialAuthProviders(); - ``` \ No newline at end of file + ``` From 49439ef77633dbc5d7be410b092c41c968b50591 Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Wed, 3 Jul 2024 20:35:39 +0800 Subject: [PATCH 142/162] chore(version): bump version and update changelog (#670) Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: ahrar-deriv --- CHANGELOG.md | 21 +++++++++++++++++++++ README.md | 6 +++--- packages/deriv_auth/CHANGELOG.md | 4 ++++ packages/deriv_auth/pubspec.yaml | 2 +- 4 files changed, 29 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c1331475..34c9b2d05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,27 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-07-03 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_auth` - `v6.7.10`](#deriv_auth---v6710) + +--- + +#### `deriv_auth` - `v6.7.10` + + - **FIX**(deriv_auth): minor change in readme file ([#669](https://github.com/regentmarkets/flutter-deriv-packages/issues/669)). ([b29d222c](https://github.com/regentmarkets/flutter-deriv-packages/commit/b29d222ce219d0664e3cafb6c302cd1041749905)) + + ## 2024-07-02 ### Changes diff --git a/README.md b/README.md index 505cbee6d..c466af883 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ cp $HOME/Downloads/commit-msg $HOME/.git/hooks/commit-msg \ ## Using the packages -Each package has been released as git tag with convention as **packageName-vVersionNumber**`(Example: deriv_auth-v6.7.9)`. 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.7.10)`. To use the package, add the following to your pubspec.yaml file: ```yaml deriv_ui: @@ -30,7 +30,7 @@ deriv_ui: | Name | Description | Version | | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | | [analytics](./packages/analytics) | Used to collect and send analytical information to 'Firebase' and 'Segment'. | [v2.1.0](./packages/analytics/CHANGELOG.md) | -| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.9 ](./packages/deriv_auth/CHANGELOG.md) | +| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.10 ](./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) | @@ -42,7 +42,7 @@ deriv_ui: | [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+2](./packages/deriv_live_chat/CHANGELOG.md) | | [deriv_language_selector](./packages/deriv_language_selector) | A package to handle language change of the app. | [v0.0.2+7](./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) | +| [deriv_localizations](./packages/deriv_localizations) | A Package that contains the localization arb(coming from Crowdin) and dart generated files for flutter_deriv_packages. | [v1.5.1](./packages/deriv_localizations/CHANGELOG.md) | | [deriv_numpad](./packages/deriv_numpad) | Number Pad Widget for number input. | [v1.1.5](./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) | diff --git a/packages/deriv_auth/CHANGELOG.md b/packages/deriv_auth/CHANGELOG.md index f92c60916..5d864bd33 100644 --- a/packages/deriv_auth/CHANGELOG.md +++ b/packages/deriv_auth/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.7.10 + + - **FIX**(deriv_auth): minor change in readme file ([#669](https://github.com/regentmarkets/flutter-deriv-packages/issues/669)). ([b29d222c](https://github.com/regentmarkets/flutter-deriv-packages/commit/b29d222ce219d0664e3cafb6c302cd1041749905)) + ## 6.7.9 - **REFACTOR**(deriv_auth): Replace uni_links2 with app_links ([#664](https://github.com/regentmarkets/flutter-deriv-packages/issues/664)). ([f99554bc](https://github.com/regentmarkets/flutter-deriv-packages/commit/f99554bc134b7fe7fe0b3f5bf7555728868176c9)) diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index a3ae9e2b9..39349b3b2 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.7.9 +version: 6.7.10 environment: sdk: ">=3.0.0 <4.0.0" From 97c7b6fe0a7c139df11bdabbc9af17ad3059244c Mon Sep 17 00:00:00 2001 From: ramin-deriv <55975218+ramin-deriv@users.noreply.github.com> Date: Thu, 4 Jul 2024 09:18:58 +0800 Subject: [PATCH 143/162] chore(deriv_mobile_chart_wrapper): update deriv_chart dep (#668) --- packages/deriv_mobile_chart_wrapper/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/deriv_mobile_chart_wrapper/pubspec.yaml b/packages/deriv_mobile_chart_wrapper/pubspec.yaml index a66cdbb1b..60531062a 100644 --- a/packages/deriv_mobile_chart_wrapper/pubspec.yaml +++ b/packages/deriv_mobile_chart_wrapper/pubspec.yaml @@ -13,7 +13,7 @@ dependencies: deriv_chart: git: url: git@github.com:regentmarkets/flutter-chart.git - ref: dev + ref: v0.1.0 deriv_theme: git: From 13e6b3f35ba863098fd9785daaa8ccc7cb23b388 Mon Sep 17 00:00:00 2001 From: ramin-deriv <55975218+ramin-deriv@users.noreply.github.com> Date: Thu, 4 Jul 2024 10:18:46 +0800 Subject: [PATCH 144/162] fix(deriv_mobile_chart_wrapper): update readme file (#672) --- packages/deriv_mobile_chart_wrapper/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/deriv_mobile_chart_wrapper/README.md b/packages/deriv_mobile_chart_wrapper/README.md index da82d0a64..b70e54f27 100644 --- a/packages/deriv_mobile_chart_wrapper/README.md +++ b/packages/deriv_mobile_chart_wrapper/README.md @@ -11,6 +11,7 @@ Menu and interfaces to add/remove indicators and drawing tools. - [deriv_ui](https://github.com/regentmarkets/flutter-deriv-packages/tree/master/packages/deriv_ui) ## Get started +Adding the depedency: ``` dependencies: deriv_mobile_chart_wrapper: From 1c6277dc00420bc35907180c074e6b8e7df9e67c Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Thu, 4 Jul 2024 10:45:46 +0800 Subject: [PATCH 145/162] chore(version): bump version and update changelog (#673) Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 21 +++++++++++++++++++ .../deriv_mobile_chart_wrapper/CHANGELOG.md | 4 ++++ .../deriv_mobile_chart_wrapper/pubspec.yaml | 2 +- 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34c9b2d05..387a99d3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,27 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-07-04 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_mobile_chart_wrapper` - `v0.0.2+1`](#deriv_mobile_chart_wrapper---v0021) + +--- + +#### `deriv_mobile_chart_wrapper` - `v0.0.2+1` + + - **FIX**(deriv_mobile_chart_wrapper): update readme file ([#672](https://github.com/regentmarkets/flutter-deriv-packages/issues/672)). ([13e6b3f3](https://github.com/regentmarkets/flutter-deriv-packages/commit/13e6b3f35ba863098fd9785daaa8ccc7cb23b388)) + + ## 2024-07-03 ### Changes diff --git a/packages/deriv_mobile_chart_wrapper/CHANGELOG.md b/packages/deriv_mobile_chart_wrapper/CHANGELOG.md index 82aecd4d3..021636ca8 100644 --- a/packages/deriv_mobile_chart_wrapper/CHANGELOG.md +++ b/packages/deriv_mobile_chart_wrapper/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.2+1 + + - **FIX**(deriv_mobile_chart_wrapper): update readme file ([#672](https://github.com/regentmarkets/flutter-deriv-packages/issues/672)). ([13e6b3f3](https://github.com/regentmarkets/flutter-deriv-packages/commit/13e6b3f35ba863098fd9785daaa8ccc7cb23b388)) + ## 0.0.2 - **FEAT**(deriv_mobile_chart_wrapper): [DERG-2498] create deriv_mobile_chart_wrapper package ([#626](https://github.com/regentmarkets/flutter-deriv-packages/issues/626)). ([01aec1ed](https://github.com/regentmarkets/flutter-deriv-packages/commit/01aec1edbd8f02e21951918ec86f00fb28ef2c58)) diff --git a/packages/deriv_mobile_chart_wrapper/pubspec.yaml b/packages/deriv_mobile_chart_wrapper/pubspec.yaml index 60531062a..081c65add 100644 --- a/packages/deriv_mobile_chart_wrapper/pubspec.yaml +++ b/packages/deriv_mobile_chart_wrapper/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_mobile_chart_wrapper description: A new Flutter package project. -version: 0.0.2 +version: 0.0.2+1 homepage: environment: From ae7663a08ddeffbf9b08f13119a003ef3fb5800b Mon Sep 17 00:00:00 2001 From: WAQAS YOUNAS Date: Thu, 4 Jul 2024 12:53:13 +0800 Subject: [PATCH 146/162] waqas/fix_forced_logout_if_no_token_found_for_a_logidId --- .../auth/services/deriv_auth_service.dart | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/packages/deriv_auth/lib/features/auth/services/deriv_auth_service.dart b/packages/deriv_auth/lib/features/auth/services/deriv_auth_service.dart index fe64da79c..5730982a0 100644 --- a/packages/deriv_auth/lib/features/auth/services/deriv_auth_service.dart +++ b/packages/deriv_auth/lib/features/auth/services/deriv_auth_service.dart @@ -86,20 +86,23 @@ class DerivAuthService extends BaseAuthService { responseAuthorizeEntity!.copyWith( signupProvider: signupProvider, refreshToken: refreshToken, - accountList: responseAuthorizeEntity.accountList - ?.map( - (AccountListItem accountListItem) => accountListItem.copyWith( - token: accounts - .where( - (AccountModel element) => - element.accountId == accountListItem.loginid, - ) - .firstOrNull - ?.token ?? - token, - ), - ) - .toList(), + accountList: responseAuthorizeEntity.accountList?.map( + (AccountListItem accountListItem) { + final AccountModel? account = accounts.firstWhereOrNull( + (AccountModel element) => + element.accountId == accountListItem.loginid, + ); + + if (account?.token == null) { + throw DerivAuthException( + message: 'Login is Expired', + type: AuthErrorType.expiredAccount, + ); + } + + return accountListItem.copyWith(token: account!.token); + }, + ).toList(), ); await authRepository.onLogin(_enhancedAuthorizeEntity); From 415640731299fd07ffafeae74520f318df7cc56a Mon Sep 17 00:00:00 2001 From: sahani-deriv <125638269+sahani-deriv@users.noreply.github.com> Date: Fri, 5 Jul 2024 10:53:07 +0800 Subject: [PATCH 147/162] chore(version): bump version and update changelog (#675) --- CHANGELOG.md | 1 + README.md | 2 +- packages/deriv_auth/pubspec.yaml | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 387a99d3a..317a9c53e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ Packages with breaking changes: Packages with other changes: - [`deriv_mobile_chart_wrapper` - `v0.0.2+1`](#deriv_mobile_chart_wrapper---v0021) + - deriv_auth-v6.7.11 --- diff --git a/README.md b/README.md index c466af883..2bec6cfc3 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ deriv_ui: | Name | Description | Version | | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | | [analytics](./packages/analytics) | Used to collect and send analytical information to 'Firebase' and 'Segment'. | [v2.1.0](./packages/analytics/CHANGELOG.md) | -| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.10 ](./packages/deriv_auth/CHANGELOG.md) | +| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.11 ](./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) | diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index 39349b3b2..97e32bf1e 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.7.10 +version: 6.7.11 environment: sdk: ">=3.0.0 <4.0.0" From 39472704a3d264bc5f64ba2ae75e29134f890590 Mon Sep 17 00:00:00 2001 From: Weng Lok <103249398+weng-deriv@users.noreply.github.com> Date: Wed, 10 Jul 2024 14:54:41 +0800 Subject: [PATCH 148/162] feat(deriv_passkeys): [P2PS-3072] add keys to deriv passkey package effortless passkeys login page (#677) --- .../pages/effortless_passkeys_login_page.dart | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/packages/deriv_passkeys/lib/src/presentation/pages/effortless_passkeys_login_page.dart b/packages/deriv_passkeys/lib/src/presentation/pages/effortless_passkeys_login_page.dart index 7fd1f0f51..b0b9e3483 100644 --- a/packages/deriv_passkeys/lib/src/presentation/pages/effortless_passkeys_login_page.dart +++ b/packages/deriv_passkeys/lib/src/presentation/pages/effortless_passkeys_login_page.dart @@ -21,6 +21,7 @@ class EffortlessPasskeysPage extends StatelessWidget required this.onPageClosed, required this.addMorePasskeysNavigationCallback, required this.continueTradingNavigationCallback, + this.effortlessPasskeysPageKeys, super.key, }) { trackOpenEffortlessLoginPage(); @@ -38,6 +39,9 @@ class EffortlessPasskeysPage extends StatelessWidget /// Callback to be called when the flow is complete. final void Function(BuildContext context) onPageClosed; + /// Pass an object of keys to assign to specific widget in this page. + final EffortlessPasskeysPageKeys? effortlessPasskeysPageKeys; + @override Widget build(BuildContext context) => WillPopScope( onWillPop: () async { @@ -91,6 +95,8 @@ class EffortlessPasskeysPage extends StatelessWidget child: Padding( padding: const EdgeInsets.all(16), child: TextButton( + key: effortlessPasskeysPageKeys + ?.maybeLaterTextButtonKey, onPressed: () { trackMaybeLater(); onPageClosed(context); @@ -170,6 +176,8 @@ class EffortlessPasskeysPage extends StatelessWidget PlaceholderAlignment .middle, child: InkWell( + key: effortlessPasskeysPageKeys + ?.hyperlinkInkWellKey, onTap: () { Navigator.push( context, @@ -218,6 +226,8 @@ class EffortlessPasskeysPage extends StatelessWidget child: Padding( padding: const EdgeInsets.all(16), child: PrimaryButton( + key: effortlessPasskeysPageKeys + ?.createPasskeyButtonKey, onPressed: () { trackCreatePasskey(); context.read().add( @@ -243,3 +253,22 @@ class EffortlessPasskeysPage extends StatelessWidget ), ); } + +/// A class that allows users to pass keys to [EffortlessPasskeysPage]. +class EffortlessPasskeysPageKeys { + /// Constructs [EffortlessPasskeysPageKeys]. + EffortlessPasskeysPageKeys({ + this.createPasskeyButtonKey, + this.hyperlinkInkWellKey, + this.maybeLaterTextButtonKey, + }); + + /// Key for create passkey button widget. + final Key? createPasskeyButtonKey; + + /// Key for hyper link ink well widget. + final Key? hyperlinkInkWellKey; + + /// Key for maybe later text button widget. + final Key? maybeLaterTextButtonKey; +} From 66d50d579665c631b5c4c3353a0a05106c5698aa Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Wed, 10 Jul 2024 15:10:28 +0800 Subject: [PATCH 149/162] chore(version): bump version and update changelog (#681) Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: sahani-deriv --- CHANGELOG.md | 28 ++++++++++++++++++++++++++++ README.md | 4 ++-- packages/deriv_auth/CHANGELOG.md | 4 ++++ packages/deriv_auth/pubspec.yaml | 4 ++-- packages/deriv_passkeys/CHANGELOG.md | 4 ++++ packages/deriv_passkeys/pubspec.yaml | 2 +- 6 files changed, 41 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 317a9c53e..80cb49935 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,34 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-07-10 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_passkeys` - `v0.0.3`](#deriv_passkeys---v003) + - [`deriv_auth` - `v6.7.12`](#deriv_auth---v6712) + +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.7.12` + +--- + +#### `deriv_passkeys` - `v0.0.3` + + - **FEAT**(deriv_passkeys): [P2PS-3072] add keys to deriv passkey package effortless passkeys login page ([#677](https://github.com/regentmarkets/flutter-deriv-packages/issues/677)). ([39472704](https://github.com/regentmarkets/flutter-deriv-packages/commit/39472704a3d264bc5f64ba2ae75e29134f890590)) + + ## 2024-07-04 ### Changes diff --git a/README.md b/README.md index 2bec6cfc3..044392feb 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ cp $HOME/Downloads/commit-msg $HOME/.git/hooks/commit-msg \ ## Using the packages -Each package has been released as git tag with convention as **packageName-vVersionNumber**`(Example: deriv_auth-v6.7.10)`. 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.7.12)`. To use the package, add the following to your pubspec.yaml file: ```yaml deriv_ui: @@ -30,7 +30,7 @@ deriv_ui: | Name | Description | Version | | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | | [analytics](./packages/analytics) | Used to collect and send analytical information to 'Firebase' and 'Segment'. | [v2.1.0](./packages/analytics/CHANGELOG.md) | -| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.11 ](./packages/deriv_auth/CHANGELOG.md) | +| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.12 ](./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) | diff --git a/packages/deriv_auth/CHANGELOG.md b/packages/deriv_auth/CHANGELOG.md index 5d864bd33..ee82587bf 100644 --- a/packages/deriv_auth/CHANGELOG.md +++ b/packages/deriv_auth/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.7.12 + + - Update a dependency to the latest release. + ## 6.7.10 - **FIX**(deriv_auth): minor change in readme file ([#669](https://github.com/regentmarkets/flutter-deriv-packages/issues/669)). ([b29d222c](https://github.com/regentmarkets/flutter-deriv-packages/commit/b29d222ce219d0664e3cafb6c302cd1041749905)) diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index 97e32bf1e..edbd672b0 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.7.11 +version: 6.7.12 environment: sdk: ">=3.0.0 <4.0.0" @@ -57,7 +57,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: deriv_passkeys-v0.0.2+9 + ref: deriv_passkeys-v0.0.3 deriv_language_selector: git: diff --git a/packages/deriv_passkeys/CHANGELOG.md b/packages/deriv_passkeys/CHANGELOG.md index ff47fd72f..6220cbed3 100644 --- a/packages/deriv_passkeys/CHANGELOG.md +++ b/packages/deriv_passkeys/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.3 + + - **FEAT**(deriv_passkeys): [P2PS-3072] add keys to deriv passkey package effortless passkeys login page ([#677](https://github.com/regentmarkets/flutter-deriv-packages/issues/677)). ([39472704](https://github.com/regentmarkets/flutter-deriv-packages/commit/39472704a3d264bc5f64ba2ae75e29134f890590)) + ## 0.0.2+9 - **REFACTOR**(deriv_passkeys): update deriv api dependency ([#656](https://github.com/regentmarkets/flutter-deriv-packages/issues/656)). ([3425078b](https://github.com/regentmarkets/flutter-deriv-packages/commit/3425078b52baac4f387504c9d41063bda1dba249)) diff --git a/packages/deriv_passkeys/pubspec.yaml b/packages/deriv_passkeys/pubspec.yaml index b8c734770..e17e0f4b9 100644 --- a/packages/deriv_passkeys/pubspec.yaml +++ b/packages/deriv_passkeys/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_passkeys description: Deriv Passkeys Flutter Plugin -version: 0.0.2+9 +version: 0.0.3 publish_to: "none" environment: From aa84a46dfb9cd22a335276c1ae0063ffee7852ef Mon Sep 17 00:00:00 2001 From: emad-deriv <134991873+emad-deriv@users.noreply.github.com> Date: Thu, 11 Jul 2024 15:41:09 +0800 Subject: [PATCH 150/162] fix(deriv_passkeys): add keys to passkey login page (#676) --- .../pages/effortless_passkeys_login_page.dart | 31 +++++++++++++++++++ .../widgets/icon_text_row_widget.dart | 6 +++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/packages/deriv_passkeys/lib/src/presentation/pages/effortless_passkeys_login_page.dart b/packages/deriv_passkeys/lib/src/presentation/pages/effortless_passkeys_login_page.dart index b0b9e3483..6906c94cc 100644 --- a/packages/deriv_passkeys/lib/src/presentation/pages/effortless_passkeys_login_page.dart +++ b/packages/deriv_passkeys/lib/src/presentation/pages/effortless_passkeys_login_page.dart @@ -127,6 +127,8 @@ class EffortlessPasskeysPage extends StatelessWidget Text( context.derivPasskeysLocalizations .effortlessLoginWithPasskeys, + key: effortlessPasskeysPageKeys + ?.loginWithPasskeyTextKey, style: const TextStyle(fontSize: 20), ), const SizedBox( @@ -137,6 +139,8 @@ class EffortlessPasskeysPage extends StatelessWidget text: context .derivPasskeysLocalizations .noNeedToRememberPassword, + textKey: effortlessPasskeysPageKeys + ?.noNeedToRememberPasswordRowKey, ), Divider( color: context.theme.colors.hover, @@ -146,6 +150,8 @@ class EffortlessPasskeysPage extends StatelessWidget text: context .derivPasskeysLocalizations .syncAcrossDevices, + textKey: effortlessPasskeysPageKeys + ?.syncAcrossDevicesRowKey, ), Divider( color: context.theme.colors.hover, @@ -155,6 +161,8 @@ class EffortlessPasskeysPage extends StatelessWidget text: context .derivPasskeysLocalizations .useYourBiometrics, + textKey: effortlessPasskeysPageKeys + ?.useBiometricsRowKey, ), Divider( color: context.theme.colors.hover, @@ -210,6 +218,9 @@ class EffortlessPasskeysPage extends StatelessWidget style: TextStyle( color: context.theme .colors.coral), + key: + effortlessPasskeysPageKeys + ?.hereRichTextKey, ), ), ), @@ -261,6 +272,11 @@ class EffortlessPasskeysPageKeys { this.createPasskeyButtonKey, this.hyperlinkInkWellKey, this.maybeLaterTextButtonKey, + this.loginWithPasskeyTextKey, + this.noNeedToRememberPasswordRowKey, + this.syncAcrossDevicesRowKey, + this.useBiometricsRowKey, + this.hereRichTextKey, }); /// Key for create passkey button widget. @@ -271,4 +287,19 @@ class EffortlessPasskeysPageKeys { /// Key for maybe later text button widget. final Key? maybeLaterTextButtonKey; + + /// Key for login with passkey text widget. + final Key? loginWithPasskeyTextKey; + + /// Key for no need to remember password row widget. + final Key? noNeedToRememberPasswordRowKey; + + /// Key for sync across devices row widget. + final Key? syncAcrossDevicesRowKey; + + /// Key for use biometrics row widget. + final Key? useBiometricsRowKey; + + /// Key for here rich text widget. + final Key? hereRichTextKey; } diff --git a/packages/deriv_passkeys/lib/src/presentation/widgets/icon_text_row_widget.dart b/packages/deriv_passkeys/lib/src/presentation/widgets/icon_text_row_widget.dart index b412b7d23..595290de8 100644 --- a/packages/deriv_passkeys/lib/src/presentation/widgets/icon_text_row_widget.dart +++ b/packages/deriv_passkeys/lib/src/presentation/widgets/icon_text_row_widget.dart @@ -7,6 +7,7 @@ class IconTextRowWidget extends StatelessWidget { const IconTextRowWidget({ required this.assetName, required this.text, + this.textKey, }); /// The name of the asset to display. @@ -15,6 +16,9 @@ class IconTextRowWidget extends StatelessWidget { /// The text to display. final String text; + /// Key for text value + final Key? textKey; + @override Widget build(BuildContext context) => Row( children: [ @@ -23,7 +27,7 @@ class IconTextRowWidget extends StatelessWidget { package: 'deriv_passkeys', ), const SizedBox(width: 8), - Expanded(child: Text(text)), + Expanded(child: Text(text, key: textKey)), ], ); } From 2a0cb5b60d49de477e6cbddffd7dea37c378e555 Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Fri, 12 Jul 2024 11:23:34 +0800 Subject: [PATCH 151/162] chore(version): bump version and update changelog (#682) Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: emad-deriv --- CHANGELOG.md | 28 ++++++++++++++++++++++++++++ README.md | 4 ++-- packages/deriv_auth/CHANGELOG.md | 4 ++++ packages/deriv_auth/pubspec.yaml | 4 ++-- packages/deriv_passkeys/CHANGELOG.md | 4 ++++ packages/deriv_passkeys/pubspec.yaml | 2 +- 6 files changed, 41 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80cb49935..14e05be1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,34 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-07-11 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_passkeys` - `v0.0.3+1`](#deriv_passkeys---v0031) + - [`deriv_auth` - `v6.7.13`](#deriv_auth---v6713) + +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.7.13` + +--- + +#### `deriv_passkeys` - `v0.0.3+1` + + - **FIX**(deriv_passkeys): add keys to passkey login page ([#676](https://github.com/regentmarkets/flutter-deriv-packages/issues/676)). ([aa84a46d](https://github.com/regentmarkets/flutter-deriv-packages/commit/aa84a46dfb9cd22a335276c1ae0063ffee7852ef)) + + ## 2024-07-10 ### Changes diff --git a/README.md b/README.md index 044392feb..b3274b283 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ cp $HOME/Downloads/commit-msg $HOME/.git/hooks/commit-msg \ ## Using the packages -Each package has been released as git tag with convention as **packageName-vVersionNumber**`(Example: deriv_auth-v6.7.12)`. 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.7.13)`. To use the package, add the following to your pubspec.yaml file: ```yaml deriv_ui: @@ -30,7 +30,7 @@ deriv_ui: | Name | Description | Version | | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | | [analytics](./packages/analytics) | Used to collect and send analytical information to 'Firebase' and 'Segment'. | [v2.1.0](./packages/analytics/CHANGELOG.md) | -| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.12 ](./packages/deriv_auth/CHANGELOG.md) | +| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.13 ](./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) | diff --git a/packages/deriv_auth/CHANGELOG.md b/packages/deriv_auth/CHANGELOG.md index ee82587bf..4e7128bcd 100644 --- a/packages/deriv_auth/CHANGELOG.md +++ b/packages/deriv_auth/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.7.13 + + - Update a dependency to the latest release. + ## 6.7.12 - Update a dependency to the latest release. diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index edbd672b0..8431f7db8 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.7.12 +version: 6.7.13 environment: sdk: ">=3.0.0 <4.0.0" @@ -57,7 +57,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: deriv_passkeys-v0.0.3 + ref: deriv_passkeys-v0.0.3+1 deriv_language_selector: git: diff --git a/packages/deriv_passkeys/CHANGELOG.md b/packages/deriv_passkeys/CHANGELOG.md index 6220cbed3..1a9902631 100644 --- a/packages/deriv_passkeys/CHANGELOG.md +++ b/packages/deriv_passkeys/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.3+1 + + - **FIX**(deriv_passkeys): add keys to passkey login page ([#676](https://github.com/regentmarkets/flutter-deriv-packages/issues/676)). ([aa84a46d](https://github.com/regentmarkets/flutter-deriv-packages/commit/aa84a46dfb9cd22a335276c1ae0063ffee7852ef)) + ## 0.0.3 - **FEAT**(deriv_passkeys): [P2PS-3072] add keys to deriv passkey package effortless passkeys login page ([#677](https://github.com/regentmarkets/flutter-deriv-packages/issues/677)). ([39472704](https://github.com/regentmarkets/flutter-deriv-packages/commit/39472704a3d264bc5f64ba2ae75e29134f890590)) diff --git a/packages/deriv_passkeys/pubspec.yaml b/packages/deriv_passkeys/pubspec.yaml index e17e0f4b9..1a2a3ccbb 100644 --- a/packages/deriv_passkeys/pubspec.yaml +++ b/packages/deriv_passkeys/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_passkeys description: Deriv Passkeys Flutter Plugin -version: 0.0.3 +version: 0.0.3+1 publish_to: "none" environment: From 76e75cffb7f4632d8920d67fcc272f08e4aadcf2 Mon Sep 17 00:00:00 2001 From: sahani-deriv <125638269+sahani-deriv@users.noreply.github.com> Date: Fri, 12 Jul 2024 14:43:52 +0800 Subject: [PATCH 152/162] chore(deriv_localizations): add indicator strings (#679) Co-authored-by: ramin-deriv <55975218+ramin-deriv@users.noreply.github.com> --- .../deriv_mobile_chart_wrapper/app_en.arb | 82 ++++++++++++++++++- 1 file changed, 81 insertions(+), 1 deletion(-) diff --git a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_en.arb b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_en.arb index d3fba5184..84d54e299 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_en.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_en.arb @@ -1,3 +1,83 @@ { - "labelIndicators": "Indicators" + "labelIndicators": "Indicators", + "labelActive": "Active", + "labelAll": "All", + "labelMomentum": "Momentum", + "labelVolatility": "Volatility", + "labelMovingAverages": "Moving averages", + "labelMACD": "MACD", + "labelRelativeStrengthIndex": "Relative Strength Index (RSI)", + "labelRSI": "RSI", + "labelBollingerBands": "Bollinger Bands (BB)", + "labelBB": "BB", + "labelMovingAverage": "Moving Average (MA)", + "labelMA": "MA", + "infoMACD": "MACD is a trading indicator used in technical analysis of stock prices. It is supposed to reveal changes in the strength, direction, momentum, and duration of a trend in a stock's price.", + "infoRSI": "The Relative Strength Index (RSI) was published by J. Welles Wilder. The current price is normalized as a percentage between 0 and 100. The flutter_chart_id of this oscillator is misleading because it does not compare the instrument relative to another instrument or set of instruments, but rather represents the current price relative to other recent pieces within the selected lookback window length.", + "infoBB": "Bollinger Bands (BB) can be used to measure the highness or lowness of the price relative to previous trades.", + "infoMA": "The Moving Average (MA) helps to identify the overall market trend by filtering out short-term price fluctuations. Using historical data, it calculates the average price over a specific period and plots a line on the chart. If the MA line moves upwards, it’s an indicator of an uptrend, a downtrend if it moves downwards. A buy signal occurs when the price moves above the MA line.", + "infoMaximumActiveIndicatorsAdded": "You've added the maximum number of active indicators.", + "infoAddSelectedIndicator": "Add {indicator}", + "infoAddIndicator": "Add indicator", + "labelDeleteAllIndicators": "Delete all indicators", + "infoDeleteAllIndicators": "This will delete all active indicators.", + "labelDeleteIndicator": "Delete {indicator} indicator", + "infoDeleteIndicator": "Are you sure you want to delete this indicator?", + "labelCancel": "Cancel", + "labelDelete": "Delete", + "labelDeleteAll": "Delete All", + "infoUpto3indicatorsAllowed": "Up to 3 active indicators allowed.", + "infoNoActiveIndicators": "You have no active indicators yet.", + "labelReset": "Reset", + "labelApply": "Apply", + "labelOK": "OK", + "labelRSILine": "RSI line", + "labelPeriod": "Period", + "labelMinRange": "Min range", + "labelMaxRange": "Max range", + "labelSource": "Source", + "labelClose": "Close", + "labelOpen": "Open", + "labelHigh": "High", + "labelLow": "Low", + "labelHl/2": "Hl/2", + "labelHlc/3": "Hlc/3", + "labelHlcc/4": "Hlcc/4", + "labelOhlc/4": "Ohlc/4", + "labelShowZones": "Show Zones", + "labelOverbought": "Overbought", + "labelOversold": "Oversold", + "labelMinSize": "Min size", + "labelMaxSize": "Max size", + "labelRange": "Range", + "labelOverboughtLine": "Overbought line", + "labelOversoldLine": "Oversold line", + "labelMACDLine": "MACD line", + "labelFastMAPeriod": "Fast MA period", + "labelSlowMAPeriod": "Slow MA period", + "labelSignalLine": "Signal line", + "labelSignalPeriod": "Signal period", + "labelIncreasingBar": "Increasing bar", + "labelDecreasingBar": "Decreasing bar", + "labelBollingerBandsTop": "Bollinger Bands top", + "labelBollingerBandsMedian": "Bollinger Bands median", + "labelBollingerBandsBottom": "Bollinger Bands bottom", + "labelChannelFill": "Channel fill", + "labelFillColor": "Fill color", + "labelStandardDeviations": "Standard deviations", + "labelMovingAverageType": "Moving Average Type", + "labelMALine": "MA line", + "labelOffset": "Offset", + "labelType": "Type", + "labelSimple": "Simple", + "labelExponential": "Exponential", + "labelWeighted": "Weighted", + "labelHull": "Hull", + "labelZeroLag": "Zero Lag", + "labelTimeSeries": "Time Series", + "labelWellesWilder": "Welles Wilder", + "labelVariable": "Variable", + "labelTriangular": "Triangular", + "label2Exponential": "2-Exponential", + "label3Exponential": "3-Exponential" } From ddda9b91017ad73e77832c4c50ac879287f751b4 Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Sat, 13 Jul 2024 16:29:56 +0800 Subject: [PATCH 153/162] chore(deriv_localizations): Crowdin Localization Updated (#649) Co-authored-by: ramin-deriv <55975218+ramin-deriv@users.noreply.github.com> --- .../lib/l10n/deriv_auth/app_fr.arb | 4 +- .../deriv_mobile_chart_wrapper/app_ar.arb | 82 ++++++++++++++++++- .../deriv_mobile_chart_wrapper/app_bn.arb | 82 ++++++++++++++++++- .../deriv_mobile_chart_wrapper/app_de.arb | 82 ++++++++++++++++++- .../deriv_mobile_chart_wrapper/app_es.arb | 82 ++++++++++++++++++- .../deriv_mobile_chart_wrapper/app_fr.arb | 82 ++++++++++++++++++- .../deriv_mobile_chart_wrapper/app_it.arb | 82 ++++++++++++++++++- .../deriv_mobile_chart_wrapper/app_ko.arb | 82 ++++++++++++++++++- .../deriv_mobile_chart_wrapper/app_pl.arb | 82 ++++++++++++++++++- .../deriv_mobile_chart_wrapper/app_pt.arb | 82 ++++++++++++++++++- .../deriv_mobile_chart_wrapper/app_ru.arb | 82 ++++++++++++++++++- .../deriv_mobile_chart_wrapper/app_si.arb | 82 ++++++++++++++++++- .../deriv_mobile_chart_wrapper/app_sw.arb | 82 ++++++++++++++++++- .../deriv_mobile_chart_wrapper/app_th.arb | 82 ++++++++++++++++++- .../deriv_mobile_chart_wrapper/app_tr.arb | 82 ++++++++++++++++++- .../deriv_mobile_chart_wrapper/app_vi.arb | 82 ++++++++++++++++++- .../deriv_mobile_chart_wrapper/app_zh.arb | 82 ++++++++++++++++++- .../lib/l10n/deriv_passkeys/app_de.arb | 2 +- 18 files changed, 1299 insertions(+), 19 deletions(-) diff --git a/packages/deriv_localizations/lib/l10n/deriv_auth/app_fr.arb b/packages/deriv_localizations/lib/l10n/deriv_auth/app_fr.arb index 6b10d558b..be90562c9 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_auth/app_fr.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_auth/app_fr.arb @@ -14,12 +14,12 @@ "warnNotAvailableCountries": "Si vous avez des questions, contactez-nous par ", "labelLiveChat": "Chat en direct", "actionSignUpForFree": "Inscrivez-vous gratuitement", - "actionLogin": "Connexion", + "actionLogin": "Se connecter", "labelTwoFactorAuth": "Authentification à deux facteurs", "informEnterTwoFactorAuthCode": "Saisissez le code à 6 chiffres qui s'affiche sur l'application d'authentification de votre téléphone.", "labelTwoFactorAuthenticationCode": "code 2FA", "actionProceed": "Continuer", - "labelLogIn": "Connexion", + "labelLogIn": "Se connecter", "informLoginOptions": "Ou connectez-vous avec", "labelEmail": "E-mail", "labelPassword": "Mot de passe", diff --git a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_ar.arb b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_ar.arb index 1941c81f8..92bcec46f 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_ar.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_ar.arb @@ -1,3 +1,83 @@ { - "labelIndicators": "المؤشرات" + "labelIndicators": "المؤشرات", + "labelActive": "نشط", + "labelAll": "الكل", + "labelMomentum": "الزخم", + "labelVolatility": "التقلبات", + "labelMovingAverages": "المتوسطات المتحركة", + "labelMACD": "MACD", + "labelRelativeStrengthIndex": "مؤشر القوة النسبية (RSI)", + "labelRSI": "مؤشر القوة النسبية", + "labelBollingerBands": "البولنجر باند (BB)", + "labelBB": "ب ب", + "labelMovingAverage": "المتوسط المتحرك (MA)", + "labelMA": "ماجستير", + "infoMACD": "مؤشر MACD هو مؤشر تداول يستخدم في التحليل الفني لأسعار الأسهم. ومن المفترض أن يكشف عن التغيرات في قوة واتجاه وزخم ومدة الاتجاه في سعر السهم.", + "infoRSI": "تم نشر مؤشر القوة النسبية (RSI) بواسطة J. Welles Wilder. يتم تطبيع السعر الحالي كنسبة مئوية بين 0 و 100. إن معرف flutter_chart_id لهذا المذبذب مضلل لأنه لا يقارن الأداة بالنسبة إلى أداة أخرى أو مجموعة من الأدوات، بل يمثل السعر الحالي بالنسبة إلى القطع الحديثة الأخرى ضمن طول نافذة الاسترجاع المحددة.", + "infoBB": "يمكن استخدام مؤشر بولينجر باند (BB) لقياس مدى ارتفاع أو انخفاض السعر بالنسبة للصفقات السابقة.", + "infoMA": "يساعد المتوسط المتحرك (MA) على تحديد الاتجاه العام للسوق من خلال تصفية تقلبات الأسعار على المدى القصير. وباستخدام البيانات التاريخية، يحسب المتوسط المتحرك متوسط السعر خلال فترة محددة ويرسم خطًا على الرسم البياني. إذا تحرك خط المتوسط المتحرك المتحرك لأعلى، فهذا مؤشر على وجود اتجاه صعودي، ويكون مؤشرًا على اتجاه هبوطي إذا تحرك لأسفل. وتحدث إشارة الشراء عندما يتحرك السعر فوق خط المتوسط المتحرك.", + "infoMaximumActiveIndicatorsAdded": "لقد أضفت الحد الأقصى لعدد المؤشرات النشطة.", + "infoAddSelectedIndicator": "إضافة {indicator}", + "infoAddIndicator": "إضافة مؤشر", + "labelDeleteAllIndicators": "حذف جميع المؤشرات", + "infoDeleteAllIndicators": "سيؤدي ذلك إلى حذف جميع المؤشرات النشطة.", + "labelDeleteIndicator": "حذف المؤشر {indicator}", + "infoDeleteIndicator": "هل أنت متأكد من رغبتك في حذف هذا المؤشر؟", + "labelCancel": "إلغاء", + "labelDelete": "حذف", + "labelDeleteAll": "حذف الكل", + "infoUpto3indicatorsAllowed": "يُسمح بحد أقصى 3 مؤشرات نشطة.", + "infoNoActiveIndicators": "ليس لديك مؤشرات نشطة حتى الآن.", + "labelReset": "إعادة تعيين", + "labelApply": "قدم طلبك", + "labelOK": "حسناً", + "labelRSILine": "خط مؤشر القوة النسبية RSI", + "labelPeriod": "الفترة", + "labelMinRange": "الحد الأدنى للنطاق", + "labelMaxRange": "الحد الأقصى للنطاق", + "labelSource": "المصدر", + "labelClose": "إغلاق", + "labelOpen": "افتح", + "labelHigh": "عالية", + "labelLow": "منخفضة", + "labelHl/2": "هـ / 2", + "labelHlc/3": "Hlc/3", + "labelHlcc/4": "Hlcc/4", + "labelOhlc/4": "أولك/4", + "labelShowZones": "مناطق العرض", + "labelOverbought": "الإفراط في الشراء", + "labelOversold": "المبالغة في البيع", + "labelMinSize": "الحد الأدنى للحجم", + "labelMaxSize": "الحد الأقصى للحجم", + "labelRange": "النطاق", + "labelOverboughtLine": "خط ذروة الشراء", + "labelOversoldLine": "خط المبيع الزائد", + "labelMACDLine": "خط MACD", + "labelFastMAPeriod": "فترة المتوسط المتحرك السريع", + "labelSlowMAPeriod": "فترة بطء المتوسط المتحرك البطيء", + "labelSignalLine": "خط الإشارة", + "labelSignalPeriod": "فترة الإشارة", + "labelIncreasingBar": "زيادة الشريط", + "labelDecreasingBar": "شريط تنازلي", + "labelBollingerBandsTop": "قمة بولينجر باندز", + "labelBollingerBandsMedian": "متوسط بولينجر باندز", + "labelBollingerBandsBottom": "قاع بولينجر باندز", + "labelChannelFill": "تعبئة القناة", + "labelFillColor": "لون التعبئة", + "labelStandardDeviations": "الانحرافات المعيارية", + "labelMovingAverageType": "نوع المتوسط المتحرك", + "labelMALine": "خط MA", + "labelOffset": "الأوفست", + "labelType": "النوع", + "labelSimple": "بسيطة", + "labelExponential": "الأسي", + "labelWeighted": "مرجح", + "labelHull": "هال", + "labelZeroLag": "التأخر الصفري", + "labelTimeSeries": "السلاسل الزمنية", + "labelWellesWilder": "ويلز وايلدر", + "labelVariable": "متغير", + "labelTriangular": "مثلث الشكل", + "label2Exponential": "2-الأسي", + "label3Exponential": "3-الإكسبونسي" } \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_bn.arb b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_bn.arb index c406ace5d..b259eb03d 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_bn.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_bn.arb @@ -1,3 +1,83 @@ { - "labelIndicators": "সূচক" + "labelIndicators": "সূচক", + "labelActive": "সক্রিয়", + "labelAll": "সব", + "labelMomentum": "মোমেন্টাম", + "labelVolatility": "অস্থিরতা", + "labelMovingAverages": "মুভিং গড়", + "labelMACD": "ম্যাকডি", + "labelRelativeStrengthIndex": "আপেক্ষিক শক্তি সূচক (আরএসআই)", + "labelRSI": "আরএসআই", + "labelBollingerBands": "বোলিঙ্গার ব্যান্ড (বিবি)", + "labelBB": "বিবি", + "labelMovingAverage": "মুভিং এভারেজ (এমএ)", + "labelMA": "মা", + "infoMACD": "এমএসিডি স্টকের দামের প্রযুক্তিগত বিশ্লেষণে ব্যবহৃত একটি ট্রেডিং সূচক। এটি কোনও স্টকের দামের প্রবণতার শক্তি, দিক, গতি এবং সময়কালের পরিবর্তনগুলি প্রকাশ করবে বলে মনে করা হয়।", + "infoRSI": "আপেক্ষিক শক্তি সূচক (আরএসআই) প্রকাশ করেছিলেন জে ওয়েলস ওয়াইল্ডার। বর্তমান মূল্য 0 থেকে 100 এর মধ্যে শতাংশ হিসাবে স্বাভাবিক করা হয়। এই অসিলেটরের ফ্লুটার_চার্ট_আইডি বিভ্রান্তিকর কারণ এটি অন্য যন্ত্র বা যন্ত্রের সেটের সাথে তুলনা করে না, বরং নির্বাচিত লুকব্যাক উইন্ডো দৈর্ঘ্যের মধ্যে অন্যান্য সাম্প্রতিক টুকরোগুলির তুলনায় বর্তমান দামের প্রতিনিধিত্ব করে।", + "infoBB": "পূর্ববর্তী ট্রেডগুলির তুলনায় মূল্যের উচ্চতা বা নিম্নতা পরিমাপ করতে বোলিঙ্গার ব্যান্ড (বিবি) ব্যবহার করা যেতে পারে।", + "infoMA": "মুভিং এভারেজ (এমএ) স্বল্পমেয়াদী মূল্যের ওঠানামা ফিল্টার করে সামগ্রিক বাজারের প্রবণতা সনাক্ত করতে ঐতিহাসিক ডেটা ব্যবহার করে, এটি একটি নির্দিষ্ট সময়কালে গড় মূল্য গণনা করে এবং চার্টে একটি লাইন প্লট করে। এমএ লাইন যদি উপরের দিকে চলে যায় তবে এটি একটি আপট্রেন্ডের সূচক, নীচের দিকে চলে গেলে একটি ডাউনট্রেন্ড। মূল্য এমএ লাইনের উপরে চলে গেলে একটি ক্রয় সংকেত ঘটে।", + "infoMaximumActiveIndicatorsAdded": "আপনি সর্বাধিক সংখ্যক সক্রিয় সূচক যুক্ত করেছেন।", + "infoAddSelectedIndicator": "যোগ করুন {indicator}", + "infoAddIndicator": "সূচক যোগ করুন", + "labelDeleteAllIndicators": "সমস্ত সূচক মুছুন", + "infoDeleteAllIndicators": "এটি সমস্ত সক্রিয় সূচক মুছে ফেলবে।", + "labelDeleteIndicator": "{indicator} সূচক মুছুন", + "infoDeleteIndicator": "আপনি কি নিশ্চিত যে আপনি এই সূচকটি মুছে ফেলতে চান?", + "labelCancel": "বাতিল করুন", + "labelDelete": "মুছে ফেলুন", + "labelDeleteAll": "সব মুছে ফেলুন", + "infoUpto3indicatorsAllowed": "3 টি পর্যন্ত সক্রিয় সূচক অনুমোদিত।", + "infoNoActiveIndicators": "আপনার এখনও কোনও সক্রিয় সূচক নেই।", + "labelReset": "রিসেট করুন", + "labelApply": "আবেদন করুন", + "labelOK": "ঠিক আছে", + "labelRSILine": "আরএসআই লাইন", + "labelPeriod": "সময়কাল", + "labelMinRange": "নিম্ন পরিসীমা", + "labelMaxRange": "সর্বোচ্চ ব্যাপ্তি", + "labelSource": "উৎস", + "labelClose": "বন্ধ করুন", + "labelOpen": "খোলা", + "labelHigh": "উচ্চ", + "labelLow": "নিম্ন", + "labelHl/2": "এইচএল/2", + "labelHlc/3": "এইচএলসি/3", + "labelHlcc/4": "এইচএলসিসি/4", + "labelOhlc/4": "ওএইচএলসি/4", + "labelShowZones": "অঞ্চল দেখান", + "labelOverbought": "অতিরিক্ত খরচ", + "labelOversold": "অতিরিক্ত বিক্রি", + "labelMinSize": "ন্যূনতম আকার", + "labelMaxSize": "সর্বোচ্চ আকার", + "labelRange": "পরিসীমা", + "labelOverboughtLine": "ওভারবাউট লাইন", + "labelOversoldLine": "ওভারসোল্ড লাইন", + "labelMACDLine": "এমএসিডি লাইন", + "labelFastMAPeriod": "দ্রুত এমএ পিরিয়ড", + "labelSlowMAPeriod": "ধীর এমএ পিরিয়ড", + "labelSignalLine": "সিগন্যাল লাইন", + "labelSignalPeriod": "সংকেত সময়কাল", + "labelIncreasingBar": "বর্ধমান বার", + "labelDecreasingBar": "হ্রাস করা বার", + "labelBollingerBandsTop": "বোলিংগার ব্যান্ড শীর্ষ", + "labelBollingerBandsMedian": "বোলিঙ্গার ব্যান্ডের মাঝারি", + "labelBollingerBandsBottom": "বোলিঙ্গার ব্যান্ড নীচে", + "labelChannelFill": "চ্যানেল পূরণ", + "labelFillColor": "রঙ পূরণ করুন", + "labelStandardDeviations": "মান বিচ্যুতি", + "labelMovingAverageType": "মুভিং এভারেজ প্রকার", + "labelMALine": "এমএ লাইন", + "labelOffset": "অফসেট", + "labelType": "টাইপ", + "labelSimple": "সহজ", + "labelExponential": "এক্সপোনেন্সিয়াল", + "labelWeighted": "ওজনযুক্ত", + "labelHull": "হাল", + "labelZeroLag": "জিরো ল্যাগ", + "labelTimeSeries": "টাইম সিরিজ", + "labelWellesWilder": "ওয়েলস ওয়াইল্ডার", + "labelVariable": "পরিবর্তনশীল", + "labelTriangular": "ত্রিভুজ", + "label2Exponential": "2-এক্সপোনেন্সিয়াল", + "label3Exponential": "3-এক্সপোনেন্সিয়াল" } \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_de.arb b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_de.arb index ca7b35187..96ae85b04 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_de.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_de.arb @@ -1,3 +1,83 @@ { - "labelIndicators": "Indikatoren" + "labelIndicators": "Indikatoren", + "labelActive": "Aktiv", + "labelAll": "Alle", + "labelMomentum": "Momentum", + "labelVolatility": "Volatilität", + "labelMovingAverages": "Gleitende Durchschnitte", + "labelMACD": "MACD", + "labelRelativeStrengthIndex": "Relative Stärke Index (RSI)", + "labelRSI": "RSI", + "labelBollingerBands": "Bollinger Bands (BB)", + "labelBB": "BB", + "labelMovingAverage": "Gleitender Durchschnitt (MA)", + "labelMA": "MA", + "infoMACD": "Der MACD ist ein Handelsindikator, der bei der technischen Analyse von Aktienkursen verwendet wird. Er soll Veränderungen in der Stärke, Richtung, Dynamik und Dauer eines Trends bei einem Aktienkurs aufzeigen.", + "infoRSI": "Der Relative Strength Index (RSI) wurde von J. Welles Wilder veröffentlicht. Der aktuelle Kurs wird als Prozentsatz zwischen 0 und 100 normalisiert. Die flutter_chart_id dieses Oszillators ist irreführend, da sie das Instrument nicht im Verhältnis zu einem anderen Instrument oder einer Reihe von Instrumenten vergleicht, sondern den aktuellen Kurs im Verhältnis zu anderen jüngsten Stücken innerhalb des gewählten Rückblickfensters darstellt.", + "infoBB": "Bollinger Bänder (BB) können verwendet werden, um die Höhe oder Tiefe des Kurses im Vergleich zu früheren Trades zu messen.", + "infoMA": "Der gleitende Durchschnitt (MA) hilft dabei, den allgemeinen Markttrend zu erkennen, indem er kurzfristige Kursschwankungen herausfiltert. Anhand historischer Daten berechnet er den Durchschnittspreis über einen bestimmten Zeitraum und zeichnet eine Linie in den Chart ein. Bewegt sich die MA-Linie nach oben, ist dies ein Indikator für einen Aufwärtstrend, bewegt sie sich nach unten, ist dies ein Abwärtstrend. Ein Kaufsignal entsteht, wenn sich der Kurs über die MA-Linie bewegt.", + "infoMaximumActiveIndicatorsAdded": "Sie haben die maximale Anzahl von aktiven Indikatoren hinzugefügt.", + "infoAddSelectedIndicator": "{indicator}hinzufügen", + "infoAddIndicator": "Indikator hinzufügen", + "labelDeleteAllIndicators": "Alle Indikatoren löschen", + "infoDeleteAllIndicators": "Dadurch werden alle aktiven Indikatoren gelöscht.", + "labelDeleteIndicator": "Löschen {indicator} Indikator", + "infoDeleteIndicator": "Sind Sie sicher, dass Sie diesen Indikator löschen möchten?", + "labelCancel": "Abbrechen", + "labelDelete": "Löschen", + "labelDeleteAll": "Alle löschen", + "infoUpto3indicatorsAllowed": "Bis zu 3 aktive Indikatoren erlaubt.", + "infoNoActiveIndicators": "Sie haben noch keine aktiven Indikatoren.", + "labelReset": "Zurücksetzen", + "labelApply": "Anwenden", + "labelOK": "OK", + "labelRSILine": "RSI-Linie", + "labelPeriod": "Zeitraum", + "labelMinRange": "Min. Reichweite", + "labelMaxRange": "Maximale Reichweite", + "labelSource": "Quelle", + "labelClose": "Schließen Sie", + "labelOpen": "Öffnen Sie", + "labelHigh": "Hoch", + "labelLow": "Niedrig", + "labelHl/2": "Hl/2", + "labelHlc/3": "Hlc/3", + "labelHlcc/4": "Hlcc/4", + "labelOhlc/4": "Ohlc/4", + "labelShowZones": "Zonen anzeigen", + "labelOverbought": "Überkauft", + "labelOversold": "Überverkauft", + "labelMinSize": "Minimale Größe", + "labelMaxSize": "Maximale Größe", + "labelRange": "Reichweite", + "labelOverboughtLine": "Überkaufte Linie", + "labelOversoldLine": "Überverkaufte Linie", + "labelMACDLine": "MACD-Linie", + "labelFastMAPeriod": "Schnelle MA-Periode", + "labelSlowMAPeriod": "Langsame MA-Periode", + "labelSignalLine": "Signalleitung", + "labelSignalPeriod": "Signalperiode", + "labelIncreasingBar": "Steigende Bar", + "labelDecreasingBar": "Abnehmender Balken", + "labelBollingerBandsTop": "Bollinger Bands oben", + "labelBollingerBandsMedian": "Bollinger Bands Median", + "labelBollingerBandsBottom": "Bollinger Bands unten", + "labelChannelFill": "Kanal füllen", + "labelFillColor": "Farbe ausfüllen", + "labelStandardDeviations": "Standardabweichungen", + "labelMovingAverageType": "Gleitender Durchschnitt Typ", + "labelMALine": "MA-Linie", + "labelOffset": "Versetzt", + "labelType": "Typ", + "labelSimple": "Einfach", + "labelExponential": "Exponential", + "labelWeighted": "Gewichtet", + "labelHull": "Rumpf", + "labelZeroLag": "Null Verzögerung", + "labelTimeSeries": "Zeitreihen", + "labelWellesWilder": "Welles Wilder", + "labelVariable": "Variabel", + "labelTriangular": "Dreieckig", + "label2Exponential": "2-Exponential", + "label3Exponential": "3-Exponential" } \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_es.arb b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_es.arb index 9503f6aab..3fa4544ab 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_es.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_es.arb @@ -1,3 +1,83 @@ { - "labelIndicators": "Indicadores" + "labelIndicators": "Indicadores", + "labelActive": "Activo", + "labelAll": "Todos", + "labelMomentum": "Impulso", + "labelVolatility": "Volatilidad", + "labelMovingAverages": "Medias móviles", + "labelMACD": "MACD", + "labelRelativeStrengthIndex": "Índice de fuerza relativa (RSI)", + "labelRSI": "RSI", + "labelBollingerBands": "Bandas de Bollinger (BB)", + "labelBB": "BB", + "labelMovingAverage": "Media móvil (MA)", + "labelMA": "MA", + "infoMACD": "El MACD es un indicador utilizado en el análisis técnico de las cotizaciones bursátiles. Se supone que revela los cambios en la fuerza, la dirección, el impulso y la duración de una tendencia en el precio de una acción.", + "infoRSI": "El índice de fuerza relativa (RSI) fue publicado por J. Welles Wilder. El precio actual se normaliza como un porcentaje entre 0 y 100. El flutter_chart_id de este oscilador es engañoso porque no compara el instrumento en relación con otro instrumento o conjunto de instrumentos, sino que representa el precio actual en relación con otras piezas recientes dentro de la longitud de la ventana de retroceso seleccionada.", + "infoBB": "Las Bandas de Bollinger (BB) pueden utilizarse para medir la altitud o la caída del precio en relación con operaciones anteriores.", + "infoMA": "La media móvil (MA) ayuda a identificar la tendencia general del mercado filtrando las fluctuaciones de precios a corto plazo. Utilizando datos históricos, calcula el precio medio durante un periodo específico y traza una línea en el gráfico. Si la línea MA se mueve hacia arriba, es un indicador de una tendencia alcista, una tendencia bajista si se mueve hacia abajo. Una señal de compra se produce cuando el precio se mueve por encima de la línea MA.", + "infoMaximumActiveIndicatorsAdded": "Ha añadido el número máximo de indicadores activos.", + "infoAddSelectedIndicator": "Añada {indicator}", + "infoAddIndicator": "Añadir indicador", + "labelDeleteAllIndicators": "Borrar todos los indicadores", + "infoDeleteAllIndicators": "Esto borrará todos los indicadores activos.", + "labelDeleteIndicator": "Borrar el indicador {indicator}", + "infoDeleteIndicator": "¿Está seguro de que desea eliminar este indicador?", + "labelCancel": "Cancelar", + "labelDelete": "Borrar", + "labelDeleteAll": "Borrar todo", + "infoUpto3indicatorsAllowed": "Se permiten hasta 3 indicadores activos.", + "infoNoActiveIndicators": "Aún no tiene indicadores activos.", + "labelReset": "Reinicie", + "labelApply": "Aplique", + "labelOK": "OK", + "labelRSILine": "Línea RSI", + "labelPeriod": "Periodo", + "labelMinRange": "Alcance mínimo", + "labelMaxRange": "Alcance máximo", + "labelSource": "Fuente", + "labelClose": "Cerrar", + "labelOpen": "Abra", + "labelHigh": "Alta", + "labelLow": "Bajo", + "labelHl/2": "Hl/2", + "labelHlc/3": "Hlc/3", + "labelHlcc/4": "Hlcc/4", + "labelOhlc/4": "Ohlc/4", + "labelShowZones": "Mostrar zonas", + "labelOverbought": "Sobrecompra", + "labelOversold": "Sobreventa", + "labelMinSize": "Tamaño mínimo", + "labelMaxSize": "Tamaño máximo", + "labelRange": "Gama", + "labelOverboughtLine": "Línea de sobrecompra", + "labelOversoldLine": "Línea de sobreventa", + "labelMACDLine": "Línea MACD", + "labelFastMAPeriod": "Periodo MA rápido", + "labelSlowMAPeriod": "Periodo MA lento", + "labelSignalLine": "Línea de señales", + "labelSignalPeriod": "Periodo de señalización", + "labelIncreasingBar": "Barra creciente", + "labelDecreasingBar": "Barra decreciente", + "labelBollingerBandsTop": "Parte superior de las bandas de Bollinger", + "labelBollingerBandsMedian": "Mediana de las bandas de Bollinger", + "labelBollingerBandsBottom": "Fondo de las Bandas de Bollinger", + "labelChannelFill": "Relleno del canal", + "labelFillColor": "Color de relleno", + "labelStandardDeviations": "Desviaciones estándar", + "labelMovingAverageType": "Tipo de media móvil", + "labelMALine": "Línea MA", + "labelOffset": "Desplazamiento", + "labelType": "Tipo", + "labelSimple": "Simple", + "labelExponential": "Exponencial", + "labelWeighted": "Ponderado", + "labelHull": "Casco", + "labelZeroLag": "Retraso cero", + "labelTimeSeries": "Series temporales", + "labelWellesWilder": "Welles Wilder", + "labelVariable": "Variable", + "labelTriangular": "Triangular", + "label2Exponential": "2-Exponencial", + "label3Exponential": "3-Exponencial" } \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_fr.arb b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_fr.arb index 9a78c8fb2..bfbe9c750 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_fr.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_fr.arb @@ -1,3 +1,83 @@ { - "labelIndicators": "Indicateurs" + "labelIndicators": "Indicateurs", + "labelActive": "Actif", + "labelAll": "Tous", + "labelMomentum": "L'élan", + "labelVolatility": "Volatilité", + "labelMovingAverages": "Moyennes mobiles", + "labelMACD": "MACD", + "labelRelativeStrengthIndex": "Indice de force relative (IFR)", + "labelRSI": "RSI", + "labelBollingerBands": "Bandes de Bollinger (BB)", + "labelBB": "BB", + "labelMovingAverage": "Moyenne mobile (MA)", + "labelMA": "MA", + "infoMACD": "Le MACD est un indicateur de trading utilisé dans l'analyse technique des cours boursiers. Il est censé révéler les changements dans la force, la direction, l'élan et la durée d'une tendance dans le prix d'une action.", + "infoRSI": "L'indice de force relative (RSI) a été publié par J. Welles Wilder. Le prix actuel est normalisé en pourcentage entre 0 et 100. Le flutter_chart_id de cet oscillateur est trompeur car il ne compare pas l'instrument par rapport à un autre instrument ou à un ensemble d'instruments, mais représente plutôt le prix actuel par rapport à d'autres pièces récentes dans la longueur de la fenêtre d'observation sélectionnée.", + "infoBB": "Les bandes de Bollinger (BB) peuvent être utilisées pour mesurer la hausse ou la baisse du prix par rapport aux transactions précédentes.", + "infoMA": "La moyenne mobile (MA) permet d'identifier la tendance générale du marché en filtrant les fluctuations de prix à court terme. À l'aide de données historiques, elle calcule le prix moyen sur une période donnée et trace une ligne sur le graphique. Si la ligne de la MA se déplace vers le haut, il s'agit d'un indicateur de tendance haussière, et si elle se déplace vers le bas, il s'agit d'un indicateur de tendance baissière. Un signal d'achat se produit lorsque le prix passe au-dessus de la ligne MA.", + "infoMaximumActiveIndicatorsAdded": "Vous avez ajouté le nombre maximum d'indicateurs actifs.", + "infoAddSelectedIndicator": "Ajoutez {indicator}", + "infoAddIndicator": "Ajouter un indicateur", + "labelDeleteAllIndicators": "Supprimer tous les indicateurs", + "infoDeleteAllIndicators": "Cette opération supprime tous les indicateurs actifs.", + "labelDeleteIndicator": "Indicateur de suppression {indicator}", + "infoDeleteIndicator": "Êtes-vous sûr de vouloir supprimer cet indicateur ?", + "labelCancel": "Annuler", + "labelDelete": "Supprimer", + "labelDeleteAll": "Supprimer tout", + "infoUpto3indicatorsAllowed": "Jusqu'à 3 indicateurs actifs sont autorisés.", + "infoNoActiveIndicators": "Vous n'avez pas encore d'indicateurs actifs.", + "labelReset": "Remise à zéro", + "labelApply": "Appliquer", + "labelOK": "OK", + "labelRSILine": "Ligne RSI", + "labelPeriod": "Période", + "labelMinRange": "Plage minimale", + "labelMaxRange": "Portée maximale", + "labelSource": "Source", + "labelClose": "Fermer", + "labelOpen": "Ouvrir", + "labelHigh": "Haut", + "labelLow": "Faible", + "labelHl/2": "Hl/2", + "labelHlc/3": "Hlc/3", + "labelHlcc/4": "Hlcc/4", + "labelOhlc/4": "Ohlc/4", + "labelShowZones": "Afficher les zones", + "labelOverbought": "Surachat", + "labelOversold": "Survente", + "labelMinSize": "Taille minimale", + "labelMaxSize": "Taille maximale", + "labelRange": "Gamme", + "labelOverboughtLine": "Ligne de surachat", + "labelOversoldLine": "Ligne de survente", + "labelMACDLine": "Ligne MACD", + "labelFastMAPeriod": "Période d'AM rapide", + "labelSlowMAPeriod": "Période d'AM lente", + "labelSignalLine": "Ligne de signal", + "labelSignalPeriod": "Période du signal", + "labelIncreasingBar": "Augmentation de la barre", + "labelDecreasingBar": "Barre décroissante", + "labelBollingerBandsTop": "Sommet des bandes de Bollinger", + "labelBollingerBandsMedian": "Bandes de Bollinger médianes", + "labelBollingerBandsBottom": "Fond des bandes de Bollinger", + "labelChannelFill": "Remplissage du canal", + "labelFillColor": "Couleur de remplissage", + "labelStandardDeviations": "Écarts types", + "labelMovingAverageType": "Type de moyenne mobile", + "labelMALine": "Ligne MA", + "labelOffset": "Décalage", + "labelType": "Type", + "labelSimple": "Simple", + "labelExponential": "Exponentiel", + "labelWeighted": "Pondéré", + "labelHull": "Coque", + "labelZeroLag": "Zéro lag", + "labelTimeSeries": "Séries chronologiques", + "labelWellesWilder": "Welles Wilder", + "labelVariable": "Variable", + "labelTriangular": "Triangulaire", + "label2Exponential": "2-Exponentiel", + "label3Exponential": "3-Exponentiel" } \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_it.arb b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_it.arb index 7dae053d1..dde338132 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_it.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_it.arb @@ -1,3 +1,83 @@ { - "labelIndicators": "Indicatori" + "labelIndicators": "Indicatori", + "labelActive": "Attivo", + "labelAll": "Tutti", + "labelMomentum": "Momento", + "labelVolatility": "Volatilità", + "labelMovingAverages": "Medie mobili", + "labelMACD": "MACD", + "labelRelativeStrengthIndex": "Indice di forza relativa (RSI)", + "labelRSI": "RSI", + "labelBollingerBands": "Bande di Bollinger (BB)", + "labelBB": "BB", + "labelMovingAverage": "Media mobile (MA)", + "labelMA": "MA", + "infoMACD": "Il MACD è un indicatore di trading utilizzato nell'analisi tecnica dei prezzi delle azioni. Si suppone che riveli i cambiamenti nella forza, nella direzione, nello slancio e nella durata di una tendenza nel prezzo di un'azione.", + "infoRSI": "L'Indice di Forza Relativa (RSI) è stato pubblicato da J. Welles Wilder. Il prezzo corrente viene normalizzato come percentuale tra 0 e 100. Il flutter_chart_id di questo oscillatore è fuorviante perché non confronta lo strumento rispetto ad un altro strumento o ad un insieme di strumenti, ma rappresenta piuttosto il prezzo corrente rispetto ad altri pezzi recenti all'interno della lunghezza della finestra di lookback selezionata.", + "infoBB": "Le Bande di Bollinger (BB) possono essere utilizzate per misurare l'altezza o la debolezza del prezzo rispetto alle contrattazioni precedenti.", + "infoMA": "La media mobile (MA) aiuta a identificare la tendenza generale del mercato, filtrando le fluttuazioni di prezzo a breve termine. Utilizzando i dati storici, calcola il prezzo medio in un periodo specifico e traccia una linea sul grafico. Se la linea MA si muove verso l'alto, è un indicatore di una tendenza al rialzo, di una tendenza al ribasso se si muove verso il basso. Un segnale di acquisto si verifica quando il prezzo si muove al di sopra della linea MA.", + "infoMaximumActiveIndicatorsAdded": "Ha aggiunto il numero massimo di indicatori attivi.", + "infoAddSelectedIndicator": "Aggiungi {indicator}", + "infoAddIndicator": "Aggiungi indicatore", + "labelDeleteAllIndicators": "Cancellare tutti gli indicatori", + "infoDeleteAllIndicators": "Questo eliminerà tutti gli indicatori attivi.", + "labelDeleteIndicator": "Cancellare l'indicatore {indicator}", + "infoDeleteIndicator": "È sicuro di voler eliminare questo indicatore?", + "labelCancel": "Annullamento", + "labelDelete": "Cancellare", + "labelDeleteAll": "Cancella tutto", + "infoUpto3indicatorsAllowed": "Sono consentiti fino a 3 indicatori attivi.", + "infoNoActiveIndicators": "Non ha ancora indicatori attivi.", + "labelReset": "Azzeramento", + "labelApply": "Applicare", + "labelOK": "OK", + "labelRSILine": "Linea RSI", + "labelPeriod": "Periodo", + "labelMinRange": "Intervallo minimo", + "labelMaxRange": "Gamma massima", + "labelSource": "Fonte", + "labelClose": "Chiudere", + "labelOpen": "Aperto", + "labelHigh": "Alto", + "labelLow": "Basso", + "labelHl/2": "Hl/2", + "labelHlc/3": "Hlc/3", + "labelHlcc/4": "Hlcc/4", + "labelOhlc/4": "Ohlc/4", + "labelShowZones": "Mostra le zone", + "labelOverbought": "Sovracomprato", + "labelOversold": "In ipervenduto", + "labelMinSize": "Dimensione minima", + "labelMaxSize": "Dimensione massima", + "labelRange": "Gamma", + "labelOverboughtLine": "Linea di ipercomprato", + "labelOversoldLine": "Linea di ipervenduto", + "labelMACDLine": "Linea MACD", + "labelFastMAPeriod": "Periodo di MA veloce", + "labelSlowMAPeriod": "Periodo di MA lento", + "labelSignalLine": "Linea di segnale", + "labelSignalPeriod": "Periodo del segnale", + "labelIncreasingBar": "Barra di aumento", + "labelDecreasingBar": "Barra decrescente", + "labelBollingerBandsTop": "Bande di Bollinger top", + "labelBollingerBandsMedian": "Bande di Bollinger mediane", + "labelBollingerBandsBottom": "Fondo delle Bande di Bollinger", + "labelChannelFill": "Riempimento del canale", + "labelFillColor": "Colore di riempimento", + "labelStandardDeviations": "Deviazioni standard", + "labelMovingAverageType": "Tipo di media mobile", + "labelMALine": "Linea MA", + "labelOffset": "Offset", + "labelType": "Tipo", + "labelSimple": "Semplice", + "labelExponential": "Esponenziale", + "labelWeighted": "Ponderato", + "labelHull": "Scafo", + "labelZeroLag": "Zero Lag", + "labelTimeSeries": "Serie temporale", + "labelWellesWilder": "Welles Wilder", + "labelVariable": "Variabile", + "labelTriangular": "Triangolare", + "label2Exponential": "2-Esponenziale", + "label3Exponential": "3-Esponenziale" } \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_ko.arb b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_ko.arb index 1df3fd1b7..3590876b7 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_ko.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_ko.arb @@ -1,3 +1,83 @@ { - "labelIndicators": "지표" + "labelIndicators": "지표", + "labelActive": "활성", + "labelAll": "모두", + "labelMomentum": "모멘텀", + "labelVolatility": "변동성", + "labelMovingAverages": "이동 평균", + "labelMACD": "MACD", + "labelRelativeStrengthIndex": "상대 강도 지수(RSI)", + "labelRSI": "RSI", + "labelBollingerBands": "볼린저 밴드(BB)", + "labelBB": "BB", + "labelMovingAverage": "이동 평균(MA)", + "labelMA": "MA", + "infoMACD": "MACD는 주가의 기술적 분석에 사용되는 트레이딩 지표입니다. 이는 주식 가격 추세의 강도, 방향, 모멘텀, 지속 기간의 변화를 나타내는 지표입니다.", + "infoRSI": "상대강도지수(RSI)는 J. 웰즈 와일더가 발표했습니다. 현재 가격은 0에서 100 사이의 백분율로 정규화됩니다. 이 오실레이터의 flutter_chart_id는 다른 상품 또는 상품 세트와 비교하는 것이 아니라 선택한 룩백 윈도우 길이 내의 다른 최근 상품과 비교한 현재 가격을 나타내므로 오해의 소지가 있습니다.", + "infoBB": "볼린저 밴드(BB)는 이전 거래 대비 가격의 고점 또는 저점을 측정하는 데 사용할 수 있습니다.", + "infoMA": "이동평균(MA)은 단기적인 가격 변동을 걸러내어 전체 시장 추세를 파악하는 데 도움이 됩니다. 과거 데이터를 사용하여 특정 기간 동안의 평균 가격을 계산하고 차트에 선을 표시합니다. MA 선이 위로 이동하면 상승 추세, 아래로 이동하면 하락 추세의 지표입니다. 가격이 MA 선 위로 이동하면 매수 신호가 발생합니다.", + "infoMaximumActiveIndicatorsAdded": "활성 지표의 최대 개수를 추가했습니다.", + "infoAddSelectedIndicator": "{indicator}추가", + "infoAddIndicator": "표시기 추가", + "labelDeleteAllIndicators": "모든 지표 삭제", + "infoDeleteAllIndicators": "이렇게 하면 모든 활성 표시기가 삭제됩니다.", + "labelDeleteIndicator": "{indicator} 표시기 삭제", + "infoDeleteIndicator": "이 표시기를 삭제하시겠습니까?", + "labelCancel": "취소", + "labelDelete": "삭제", + "labelDeleteAll": "모두 삭제", + "infoUpto3indicatorsAllowed": "활성 표시기는 최대 3개까지 허용됩니다.", + "infoNoActiveIndicators": "아직 활성화된 지표가 없습니다.", + "labelReset": "초기화", + "labelApply": "신청하기", + "labelOK": "확인", + "labelRSILine": "RSI 라인", + "labelPeriod": "기간", + "labelMinRange": "최소 범위", + "labelMaxRange": "최대 범위", + "labelSource": "출처", + "labelClose": "닫기", + "labelOpen": "열기", + "labelHigh": "높음", + "labelLow": "낮음", + "labelHl/2": "Hl/2", + "labelHlc/3": "Hlc/3", + "labelHlcc/4": "Hlcc/4", + "labelOhlc/4": "Ohlc/4", + "labelShowZones": "영역 표시", + "labelOverbought": "과매수", + "labelOversold": "과매도", + "labelMinSize": "최소 크기", + "labelMaxSize": "최대 크기", + "labelRange": "범위", + "labelOverboughtLine": "과매수 라인", + "labelOversoldLine": "과매도 라인", + "labelMACDLine": "MACD 라인", + "labelFastMAPeriod": "빠른 MA 기간", + "labelSlowMAPeriod": "느린 MA 기간", + "labelSignalLine": "신호 라인", + "labelSignalPeriod": "신호 기간", + "labelIncreasingBar": "바 증가", + "labelDecreasingBar": "바 감소", + "labelBollingerBandsTop": "볼린저 밴드 상단", + "labelBollingerBandsMedian": "볼린저 밴드 중앙값", + "labelBollingerBandsBottom": "볼린저 밴드 하단", + "labelChannelFill": "채널 채우기", + "labelFillColor": "채우기 색상", + "labelStandardDeviations": "표준 편차", + "labelMovingAverageType": "이동 평균 유형", + "labelMALine": "MA 라인", + "labelOffset": "오프셋", + "labelType": "유형", + "labelSimple": "Simple", + "labelExponential": "지수", + "labelWeighted": "가중치", + "labelHull": "Hull", + "labelZeroLag": "제로 랙", + "labelTimeSeries": "시계열", + "labelWellesWilder": "웰즈 와일더", + "labelVariable": "변수", + "labelTriangular": "삼각형", + "label2Exponential": "2-지수", + "label3Exponential": "3-지수" } \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_pl.arb b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_pl.arb index 91d1d83c1..a839f9a3d 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_pl.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_pl.arb @@ -1,3 +1,83 @@ { - "labelIndicators": "Wskaźniki" + "labelIndicators": "Wskaźniki", + "labelActive": "Aktywny", + "labelAll": "Wszystko", + "labelMomentum": "Pęd", + "labelVolatility": "Zmienność", + "labelMovingAverages": "Średnie kroczące", + "labelMACD": "MACD", + "labelRelativeStrengthIndex": "Względny wskaźnik siły (RSI)", + "labelRSI": "RSI", + "labelBollingerBands": "Zespoły Bollingera (BB)", + "labelBB": "BB", + "labelMovingAverage": "Średnia ruchoma (MA)", + "labelMA": "MA", + "infoMACD": "MACD jest wskaźnikiem handlowym wykorzystywanym w technicznej analizie cen akcji. Ma ujawniać zmiany w sile, kierunku, pędzie i czasie trwania trendu w cenie akcji.", + "infoRSI": "Relative Strength Index (RSI) został opublikowany przez J. Wellesa Wildera. Aktualna cena jest znormalizowana jako procent od 0 do 100. Flutter_chart_id tego oscylatora jest mylący, ponieważ nie porównuje instrumentu względem innego instrumentu lub zestawu instrumentów, ale reprezentuje aktualną cenę w stosunku do innych ostatnich elementów w wybranej długości okna przeglądającego.", + "infoBB": "Pasma Bollingera (BB) można wykorzystać do pomiaru wysokości lub niskiej ceny w stosunku do poprzednich transakcji.", + "infoMA": "Średnia krocząca (MA) pomaga zidentyfikować ogólny trend rynkowy poprzez filtrowanie krótkoterminowych wahań cen. Korzystając z danych historycznych, oblicza średnią cenę w określonym okresie i wykreśla linię na wykresie. Jeśli linia MA porusza się w górę, jest to wskaźnik trendu wzrostowego, trendu spadkowego, jeśli porusza się w dół. Sygnał zakupu pojawia się, gdy cena przesuwa się powyżej linii MA.", + "infoMaximumActiveIndicatorsAdded": "Dodano maksymalną liczbę aktywnych wskaźników.", + "infoAddSelectedIndicator": "Dodaj {indicator}", + "infoAddIndicator": "Dodaj wskaźnik", + "labelDeleteAllIndicators": "Usuń wszystkie wskaźniki", + "infoDeleteAllIndicators": "Spowoduje to usunięcie wszystkich aktywnych wskaźników.", + "labelDeleteIndicator": "Usuń wskaźnik {indicator}", + "infoDeleteIndicator": "Czy na pewno chcesz usunąć ten wskaźnik?", + "labelCancel": "Anuluj", + "labelDelete": "Usuń", + "labelDeleteAll": "Usuń wszystko", + "infoUpto3indicatorsAllowed": "Dozwolone jest do 3 aktywnych wskaźników.", + "infoNoActiveIndicators": "Nie masz jeszcze aktywnych wskaźników.", + "labelReset": "Resetuj", + "labelApply": "Zastosuj", + "labelOK": "DOBRZE", + "labelRSILine": "Linia RSI", + "labelPeriod": "Kropka", + "labelMinRange": "Minimalny zasięg", + "labelMaxRange": "Maksymalny zasięg", + "labelSource": "Źródło", + "labelClose": "Zamknij", + "labelOpen": "Otwórz", + "labelHigh": "Wysoki", + "labelLow": "Niski", + "labelHl/2": "Hl/2", + "labelHlc/3": "HLC/3", + "labelHlcc/4": "Hlcc/4", + "labelOhlc/4": "Ohlc/4", + "labelShowZones": "Pokaż strefy", + "labelOverbought": "Wykupione", + "labelOversold": "Wyprzedane", + "labelMinSize": "Minimalny rozmiar", + "labelMaxSize": "Maksymalny rozmiar", + "labelRange": "Zasięg", + "labelOverboughtLine": "Linia wykupiona", + "labelOversoldLine": "Linia wyprzedana", + "labelMACDLine": "Linia MACD", + "labelFastMAPeriod": "Szybki okres MA", + "labelSlowMAPeriod": "Powolny okres MA", + "labelSignalLine": "Linia sygnałowa", + "labelSignalPeriod": "Okres sygnału", + "labelIncreasingBar": "Zwiększanie paska", + "labelDecreasingBar": "Malejący pasek", + "labelBollingerBandsTop": "Bollinger Bands Top", + "labelBollingerBandsMedian": "Mediana pasm Bollingera", + "labelBollingerBandsBottom": "Dolne paski Bollingera", + "labelChannelFill": "Wypełnienie kanału", + "labelFillColor": "Kolor wypełnienia", + "labelStandardDeviations": "Odchylenia standardowe", + "labelMovingAverageType": "Typ średniej ruchomej", + "labelMALine": "Linia MA", + "labelOffset": "Przesunięcie", + "labelType": "Typ", + "labelSimple": "Prosty", + "labelExponential": "wykładniczy", + "labelWeighted": "ważony", + "labelHull": "Kadłub", + "labelZeroLag": "Zero opóźnienia", + "labelTimeSeries": "Szereg czasowy", + "labelWellesWilder": "Welles Wilder", + "labelVariable": "Zmienna", + "labelTriangular": "Trójkątne", + "label2Exponential": "2-wykładniczy", + "label3Exponential": "3-wykładniczy" } \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_pt.arb b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_pt.arb index 9503f6aab..97883fce3 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_pt.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_pt.arb @@ -1,3 +1,83 @@ { - "labelIndicators": "Indicadores" + "labelIndicators": "Indicadores", + "labelActive": "Ativo", + "labelAll": "Todos", + "labelMomentum": "Momento", + "labelVolatility": "Volatilidade", + "labelMovingAverages": "Médias móveis", + "labelMACD": "MACD", + "labelRelativeStrengthIndex": "Índice de Força Relativa (RSI)", + "labelRSI": "RSI", + "labelBollingerBands": "Bandas de Bollinger (BB)", + "labelBB": "BB", + "labelMovingAverage": "Média móvel (MA)", + "labelMA": "MA", + "infoMACD": "O MACD é um indicador de negociação utilizado na análise técnica dos preços das acções. É suposto revelar alterações na força, direção, impulso e duração de uma tendência no preço de uma ação.", + "infoRSI": "O Índice de Força Relativa (RSI) foi publicado por J. Welles Wilder. O preço atual é normalizado como uma percentagem entre 0 e 100. O flutter_chart_id deste oscilador é enganador porque não compara o instrumento em relação a outro instrumento ou conjunto de instrumentos, mas sim representa o preço atual em relação a outras peças recentes dentro do comprimento da janela de lookback selecionada.", + "infoBB": "As Bandas de Bollinger (BB) podem ser utilizadas para medir a alta ou a baixa do preço relativamente a transacções anteriores.", + "infoMA": "A média móvel (MA) ajuda a identificar a tendência geral do mercado, filtrando as flutuações de preços a curto prazo. Utilizando dados históricos, calcula o preço médio durante um período específico e traça uma linha no gráfico. Se a linha MA se mover para cima, é um indicador de uma tendência de subida, uma tendência de descida se se mover para baixo. Um sinal de compra ocorre quando o preço se move acima da linha MA.", + "infoMaximumActiveIndicatorsAdded": "Adicionou o número máximo de indicadores activos.", + "infoAddSelectedIndicator": "Adicione {indicator}", + "infoAddIndicator": "Adicionar indicador", + "labelDeleteAllIndicators": "Eliminar todos os indicadores", + "infoDeleteAllIndicators": "Esta ação elimina todos os indicadores activos.", + "labelDeleteIndicator": "Apague o indicador {indicator}", + "infoDeleteIndicator": "Tem a certeza de que pretende eliminar este indicador?", + "labelCancel": "Cancelar", + "labelDelete": "Eliminar", + "labelDeleteAll": "Eliminar tudo", + "infoUpto3indicatorsAllowed": "São permitidos até 3 indicadores activos.", + "infoNoActiveIndicators": "Ainda não tem indicadores activos.", + "labelReset": "Repor", + "labelApply": "Aplicar", + "labelOK": "OK", + "labelRSILine": "Linha RSI", + "labelPeriod": "Período", + "labelMinRange": "Intervalo mínimo", + "labelMaxRange": "Alcance máximo", + "labelSource": "Fonte", + "labelClose": "Fechar", + "labelOpen": "Aberto", + "labelHigh": "Elevado", + "labelLow": "Baixo", + "labelHl/2": "Hl/2", + "labelHlc/3": "Hlc/3", + "labelHlcc/4": "Hlcc/4", + "labelOhlc/4": "Ohlc/4", + "labelShowZones": "Mostrar zonas", + "labelOverbought": "Sobrecomprado", + "labelOversold": "Sobrevenda", + "labelMinSize": "Tamanho mínimo", + "labelMaxSize": "Tamanho máximo", + "labelRange": "Alcance", + "labelOverboughtLine": "Linha de sobrecompra", + "labelOversoldLine": "Linha de sobrevenda", + "labelMACDLine": "Linha MACD", + "labelFastMAPeriod": "Período MA rápido", + "labelSlowMAPeriod": "Período MA lento", + "labelSignalLine": "Linha de sinal", + "labelSignalPeriod": "Período do sinal", + "labelIncreasingBar": "Aumentar a barra", + "labelDecreasingBar": "Barra decrescente", + "labelBollingerBandsTop": "Topo das Bandas de Bollinger", + "labelBollingerBandsMedian": "Mediana das bandas de Bollinger", + "labelBollingerBandsBottom": "Fundo do Bollinger Bands", + "labelChannelFill": "Enchimento do canal", + "labelFillColor": "Cor de preenchimento", + "labelStandardDeviations": "Desvios-padrão", + "labelMovingAverageType": "Tipo de média móvel", + "labelMALine": "Linha MA", + "labelOffset": "Desvio", + "labelType": "Tipo", + "labelSimple": "Simples", + "labelExponential": "Exponencial", + "labelWeighted": "Ponderado", + "labelHull": "Casco", + "labelZeroLag": "Desfasamento zero", + "labelTimeSeries": "Séries temporais", + "labelWellesWilder": "Welles Wilder", + "labelVariable": "Variável", + "labelTriangular": "Triangular", + "label2Exponential": "2-Exponencial", + "label3Exponential": "3-Exponencial" } \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_ru.arb b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_ru.arb index 4164941a3..f6c858122 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_ru.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_ru.arb @@ -1,3 +1,83 @@ { - "labelIndicators": "Индикаторы" + "labelIndicators": "Индикаторы", + "labelActive": "Активный", + "labelAll": "Все", + "labelMomentum": "Momentum", + "labelVolatility": "Волатильность", + "labelMovingAverages": "Скользящие средние", + "labelMACD": "MACD", + "labelRelativeStrengthIndex": "Индекс относительной силы (RSI)", + "labelRSI": "RSI", + "labelBollingerBands": "Полосы Боллинджера (BB)", + "labelBB": "BB", + "labelMovingAverage": "Скользящая средняя (MA)", + "labelMA": "MA", + "infoMACD": "MACD - это торговый индикатор, используемый в техническом анализе цен на акции. Он призван выявлять изменения в силе, направлении, импульсе и продолжительности тренда в цене акции.", + "infoRSI": "Индекс относительной силы (RSI) был опубликован Дж. Уэллсом Уайлдером. Текущая цена нормируется в процентах от 0 до 100. Flutter_chart_id этого осциллятора вводит в заблуждение, поскольку он не сравнивает инструмент относительно другого инструмента или набора инструментов, а скорее представляет текущую цену относительно других недавних фигур в пределах выбранной длины окна обратного просмотра.", + "infoBB": "Полосы Боллинджера (Bollinger Bands, BB) можно использовать для измерения высоты или низкости цены по отношению к предыдущим сделкам.", + "infoMA": "Скользящая средняя (MA) помогает определить общую тенденцию рынка, отсеивая краткосрочные колебания цен. Используя исторические данные, она рассчитывает среднюю цену за определенный период и наносит линию на график. Если линия MA движется вверх, это индикатор восходящего тренда, если вниз - нисходящего. Сигнал к покупке возникает, когда цена движется выше линии MA.", + "infoMaximumActiveIndicatorsAdded": "Вы добавили максимальное количество активных индикаторов.", + "infoAddSelectedIndicator": "Добавить {indicator}", + "infoAddIndicator": "Добавьте индикатор", + "labelDeleteAllIndicators": "Удалите все индикаторы", + "infoDeleteAllIndicators": "Это удалит все активные индикаторы.", + "labelDeleteIndicator": "Индикатор удаления {indicator}", + "infoDeleteIndicator": "Вы уверены, что хотите удалить этот индикатор?", + "labelCancel": "Отмена", + "labelDelete": "Удалить", + "labelDeleteAll": "Удалить все", + "infoUpto3indicatorsAllowed": "Допускается до 3 активных индикаторов.", + "infoNoActiveIndicators": "У Вас пока нет активных индикаторов.", + "labelReset": "Сброс", + "labelApply": "Применить", + "labelOK": "OK", + "labelRSILine": "Линия RSI", + "labelPeriod": "Период", + "labelMinRange": "Минимальный диапазон", + "labelMaxRange": "Максимальный диапазон", + "labelSource": "Источник", + "labelClose": "Закрыть", + "labelOpen": "Открыть", + "labelHigh": "Высокий", + "labelLow": "Низкий", + "labelHl/2": "Hl/2", + "labelHlc/3": "Hlc/3", + "labelHlcc/4": "Hlcc/4", + "labelOhlc/4": "Ohlc/4", + "labelShowZones": "Показать зоны", + "labelOverbought": "Перекупленность", + "labelOversold": "Перепроданность", + "labelMinSize": "Минимальный размер", + "labelMaxSize": "Максимальный размер", + "labelRange": "Диапазон", + "labelOverboughtLine": "Линия перекупленности", + "labelOversoldLine": "Линия перепроданности", + "labelMACDLine": "Линия MACD", + "labelFastMAPeriod": "Быстрый период MA", + "labelSlowMAPeriod": "Медленный период MA", + "labelSignalLine": "Сигнальная линия", + "labelSignalPeriod": "Период сигнала", + "labelIncreasingBar": "Увеличивающаяся планка", + "labelDecreasingBar": "Уменьшающаяся планка", + "labelBollingerBandsTop": "Вершина Bollinger Bands", + "labelBollingerBandsMedian": "Медиана полос Боллинджера", + "labelBollingerBandsBottom": "Дно полос Боллинджера", + "labelChannelFill": "Заполнение канала", + "labelFillColor": "Цвет заливки", + "labelStandardDeviations": "Стандартные отклонения", + "labelMovingAverageType": "Тип скользящей средней", + "labelMALine": "Линия MA", + "labelOffset": "Смещение", + "labelType": "Тип", + "labelSimple": "Простой", + "labelExponential": "Экспоненциальный", + "labelWeighted": "Взвешенный", + "labelHull": "Корпус", + "labelZeroLag": "Нулевая задержка", + "labelTimeSeries": "Временные ряды", + "labelWellesWilder": "Уэллс Уайлдер", + "labelVariable": "Переменная", + "labelTriangular": "Треугольный", + "label2Exponential": "2-Экспоненциальный", + "label3Exponential": "3-экспоненциальный" } \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_si.arb b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_si.arb index 2571da265..f9a39fea1 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_si.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_si.arb @@ -1,3 +1,83 @@ { - "labelIndicators": "දර්ශක" + "labelIndicators": "දර්ශක", + "labelActive": "ක්රියාකාරී", + "labelAll": "සියල්ලම", + "labelMomentum": "ගම්යතාව", + "labelVolatility": "අස්ථාවරත්වය", + "labelMovingAverages": "චලනය වන සාමාන්යයන්", + "labelMACD": "මැක්ඩී", + "labelRelativeStrengthIndex": "සාපේක්ෂ ශක්ති දර්ශකය (RSI)", + "labelRSI": "ආර්එස්අයි", + "labelBollingerBands": "බොලින්ගර් බෑන්ඩ් (බීබී)", + "labelBB": "BB", + "labelMovingAverage": "චලනය වන සාමාන්යය (MA)", + "labelMA": "මා", + "infoMACD": "MACD යනු කොටස් මිල ගණන් පිළිබඳ තාක්ෂණික විශ්ලේෂණයේදී භාවිතා කරන වෙළඳ දර්ශකයකි. එය කොටස් මිලෙහි ප්රවණතාවයේ ශක්තිය, දිශාව, ගම්යතාව සහ කාලසීමාවේ වෙනස්කම් හෙළි කිරීමට නියමිතය.", + "infoRSI": "සාපේක්ෂ ශක්ති දර්ශකය (RSI) ප්රකාශයට පත් කරන ලද්දේ ජේ වෙල්ස් වයිල්ඩර් විසිනි. වර්තමාන මිල 0 සහ 100 අතර ප්රතිශතයක් ලෙස සාමාන්යකරණය කර ඇත. මෙම ඔස්කිලේටරයේ flutter_chart_id නොමඟ යන්නේ එය වෙනත් උපකරණයක් හෝ උපකරණ කට්ටලයකට සාපේක්ෂව උපකරණය සංසන්දනය නොකරන නිසා, ඒ වෙනුවට තෝරාගත් lookback කවුළුව දිග තුළ අනෙකුත් මෑත කෑලිවලට සාපේක්ෂව වත්මන් මිල නියෝජනය කරයි.", + "infoBB": "පෙර වෙළඳාම් වලට සාපේක්ෂව මිලෙහි උසස්කම හෝ පහත් බව මැනීම සඳහා බොලින්ගර් බෑන්ඩ් (බීබී) භාවිතා කළ හැකිය.", + "infoMA": "චලනය වන සාමාන්යය (MA) කෙටි කාලීන මිල උච්චාවචනයන් පෙරීම මගින් සමස්ත වෙළඳපල ප්රවණතාව හඳුනා ගැනීමට උපකාරී වේ. ඓතිහාසික දත්ත භාවිතා කරමින්, එය නිශ්චිත කාල පරිච්ඡේදයක් පුරා සාමාන්ය මිල ගණනය කර ප්රස්ථාරයේ රේඛාවක් සකස් කරයි. MA රේඛාව ඉහළට ගමන් කරන්නේ නම් එය uptrend ක දර්ශකයක්, පහළට ගමන් කරන්නේ නම් downtrend එකක්. මිල MA රේඛාවට ඉහළින් ගමන් කරන විට මිලදී ගැනීමේ සංඥාවක් සිදු වේ.", + "infoMaximumActiveIndicatorsAdded": "ඔබ උපරිම ක්රියාකාරී දර්ශක සංඛ්යාව එකතු කර ඇත.", + "infoAddSelectedIndicator": "{indicator}එකතු කරන්න", + "infoAddIndicator": "දර්ශකය එක් කරන්න", + "labelDeleteAllIndicators": "සියලුම දර්ශක මකා දමන්න", + "infoDeleteAllIndicators": "මෙය සියලුම ක්රියාකාරී දර්ශක මකා දමනු ඇත.", + "labelDeleteIndicator": "{indicator} දර්ශකය මකන්න", + "infoDeleteIndicator": "ඔබට මෙම දර්ශකය මකා දැමීමට අවශ්ය බව ඔබට විශ්වාසද?", + "labelCancel": "අවලංගු කරන්න", + "labelDelete": "මකන්න", + "labelDeleteAll": "සියල්ල මකා දමන්න", + "infoUpto3indicatorsAllowed": "ක්රියාකාරී දර්ශක 3 ක් දක්වා අවසර ඇත.", + "infoNoActiveIndicators": "ඔබට තවමත් ක්රියාකාරී දර්ශක නොමැත.", + "labelReset": "යළි පිහිටුවන්න", + "labelApply": "අයදුම් කරන්න", + "labelOK": "හරි", + "labelRSILine": "ආර්එස්අයි රේඛාව", + "labelPeriod": "කාල සීමාව", + "labelMinRange": "අවම පරාසය", + "labelMaxRange": "උපරිම පරාසය", + "labelSource": "මූලාශ්රය", + "labelClose": "වසා දමන්න", + "labelOpen": "විවෘත කරන්න", + "labelHigh": "ඉහළ", + "labelLow": "අඩුයි", + "labelHl/2": "එච්එල්/2", + "labelHlc/3": "එච්එල්සී/3", + "labelHlcc/4": "එච්එල්සී/4", + "labelOhlc/4": "ඕඑච්එල්සී/4", + "labelShowZones": "කලාප පෙන්වන්න", + "labelOverbought": "අධික ලෙස මිල දී ගනු ලැබේ", + "labelOversold": "අධික ලෙස විකුණා ඇත", + "labelMinSize": "අවම ප්රමාණය", + "labelMaxSize": "උපරිම ප්රමාණය", + "labelRange": "පරාසය", + "labelOverboughtLine": "අධික ලෙස මිලදී ගත් රේඛාව", + "labelOversoldLine": "අධි විකුණුම් රේඛාව", + "labelMACDLine": "MACD රේඛාව", + "labelFastMAPeriod": "වේගවත් MA කාල පරිච්ඡේදය", + "labelSlowMAPeriod": "මන්දගාමී MA කාලය", + "labelSignalLine": "සංඥා රේඛාව", + "labelSignalPeriod": "සංඥා කාලය", + "labelIncreasingBar": "තීරුව වැඩි කිරීම", + "labelDecreasingBar": "බාර් අඩුවීම", + "labelBollingerBandsTop": "බොලින්ගර් බෑන්ඩ් ටොප්", + "labelBollingerBandsMedian": "බොලින්ගර් බෑන්ඩ් මධ්යන්ය", + "labelBollingerBandsBottom": "බොලින්ගර් බෑන්ඩ්ස් පහළ", + "labelChannelFill": "නාලිකා පිරවීම", + "labelFillColor": "වර්ණය පුරවන්න", + "labelStandardDeviations": "සම්මත අපගමනය", + "labelMovingAverageType": "චලනය වන සාමාන්ය වර්ගය", + "labelMALine": "එම්ඒ රේඛාව", + "labelOffset": "ඕෆ්සෙට්", + "labelType": "වර්ගය", + "labelSimple": "සරල", + "labelExponential": "එක්ස්පේන්ෂල්", + "labelWeighted": "බර බර", + "labelHull": "හල්", + "labelZeroLag": "ශුරෝ ලැග්", + "labelTimeSeries": "කාල මාලාව", + "labelWellesWilder": "වෙල්ස් වයිල්ඩර්", + "labelVariable": "විචල්ය", + "labelTriangular": "ත්රිකෝණාකාර", + "label2Exponential": "2-එක්ස්පෙන්ෂනල්", + "label3Exponential": "3-එක්ස්පෙන්ෂනල්" } \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_sw.arb b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_sw.arb index c047b5c14..91f0f5f7e 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_sw.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_sw.arb @@ -1,3 +1,83 @@ { - "labelIndicators": "Viashiria" + "labelIndicators": "Viashiria", + "labelActive": "Inafanya kazi", + "labelAll": "Wote", + "labelMomentum": "Mwendo", + "labelVolatility": "Ubadilishaji", + "labelMovingAverages": "Wastani wa kusonga", + "labelMACD": "MACD", + "labelRelativeStrengthIndex": "Kielelezo cha Nguvu ya Uhusiano (RSI)", + "labelRSI": "RSI", + "labelBollingerBands": "Bendi za Bollinger (BB)", + "labelBB": "BB", + "labelMovingAverage": "Wastani wa kusonga (MA)", + "labelMA": "MA", + "infoMACD": "MACD ni kiashiria cha biashara kinachotumiwa katika uchambuzi wa kiufundi wa bei za hisa. Inapaswa kufichua mabadiliko katika nguvu, mwelekeo, kasi, na muda wa mwenendo wa bei ya hisa.", + "infoRSI": "Fahirisi ya Nguvu ya Relay (RSI) ilichapishwa na J. Welles Wilder. Bei ya sasa imeorodheshwa kama asilimia kati ya 0 na 100. Flutter_chart_id ya oscillator hii inatoa kwa sababu hailinganishi chombo kinachohusiana na chombo kingine au seti ya vyombo, lakini badala yake inawakilisha bei ya sasa ikilinganishwa na vipande vingine vya hivi karibuni ndani ya urefu wa dirisha lililochaguliwa.", + "infoBB": "Bendi za Bollinger (BB) zinaweza kutumika kupima juu au chini wa bei kulinganishwa na biashara zilizopita.", + "infoMA": "Wastani wa Kusonga (MA) husaidia kutambua mwenendo wa jumla wa soko kwa kuchuja mabadiliko ya bei ya muda mfupi. Kutumia data ya kihistoria, inahesabu bei ya wastani kwa kipindi maalum na inapanga mstari kwenye chati. Ikiwa mstari wa MA unasonga juu, ni kiashiria cha kuongezeka, mwenendo wa kushuka ikiwa unasonga chini. Ishara ya ununuzi hutokea wakati bei inapohamia juu ya mstari wa MA.", + "infoMaximumActiveIndicatorsAdded": "Umeongeza idadi kubwa ya viashiria vya kazi.", + "infoAddSelectedIndicator": "Ongeza {indicator}", + "infoAddIndicator": "Ongeza kiashiria", + "labelDeleteAllIndicators": "Futa viashiria vyote", + "infoDeleteAllIndicators": "Hii itafuta viashiria vyote vya kazi.", + "labelDeleteIndicator": "Futa kiashiria cha {indicator}", + "infoDeleteIndicator": "Je! Una hakika unataka kufuta kiashiria hiki?", + "labelCancel": "Ghairi", + "labelDelete": "Futa", + "labelDeleteAll": "Futa Yote", + "infoUpto3indicatorsAllowed": "Hadi viashiria 3 vya kazi zinaruhusiwa.", + "infoNoActiveIndicators": "Huna viashiria vya kazi bado.", + "labelReset": "Weka upya", + "labelApply": "Tumia", + "labelOK": "SAWA", + "labelRSILine": "Mstari wa RSI", + "labelPeriod": "Kipindi", + "labelMinRange": "Kiwango cha chini", + "labelMaxRange": "Kiwango cha juu", + "labelSource": "chanzo", + "labelClose": "Kufunga", + "labelOpen": "Fungua", + "labelHigh": "Juu", + "labelLow": "Ndogo", + "labelHl/2": "Hl/2", + "labelHlc/3": "HLC/3", + "labelHlcc/4": "Hlcc/4", + "labelOhlc/4": "Ohlc/4", + "labelShowZones": "Onyesha Maeneo", + "labelOverbought": "Kununua kupita kiasi", + "labelOversold": "Uuzwa kupita kiasi", + "labelMinSize": "Ukubwa wa chini", + "labelMaxSize": "Ukubwa wa juu", + "labelRange": "Mbalimbali", + "labelOverboughtLine": "Mstari wa kununuliwa kupita", + "labelOversoldLine": "Mstari uliouzwa zaidi", + "labelMACDLine": "Mstari wa MACD", + "labelFastMAPeriod": "Kipindi cha haraka cha MA", + "labelSlowMAPeriod": "Kipindi cha polepole cha MA", + "labelSignalLine": "Mstari wa ishara", + "labelSignalPeriod": "Kipindi cha ishara", + "labelIncreasingBar": "Kuongezeka kwa bar", + "labelDecreasingBar": "Baa ya kupungua", + "labelBollingerBandsTop": "Bollinger Bands juu", + "labelBollingerBandsMedian": "Bollinger Bands wastani", + "labelBollingerBandsBottom": "Bandi za Bollinger chini", + "labelChannelFill": "Kujaza kituo", + "labelFillColor": "Jaza rangi", + "labelStandardDeviations": "Upungufu wa kawaida", + "labelMovingAverageType": "Aina ya wastani ya kusonga", + "labelMALine": "Mstari wa MA", + "labelOffset": "Kidhibiti", + "labelType": "Aina", + "labelSimple": "Rahisi", + "labelExponential": "Mwanganyiko", + "labelWeighted": "Uzito", + "labelHull": "Hull", + "labelZeroLag": "Zero Lag", + "labelTimeSeries": "Mfululizo wa Wakati", + "labelWellesWilder": "Welles Wilder", + "labelVariable": "Tofauti", + "labelTriangular": "Pembetatu", + "label2Exponential": "2-Exponential", + "label3Exponential": "3-Mfanyiko" } \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_th.arb b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_th.arb index dd7623f15..bb7761cd2 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_th.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_th.arb @@ -1,3 +1,83 @@ { - "labelIndicators": "ตัวบ่งชี้" + "labelIndicators": "ตัวบ่งชี้", + "labelActive": "แอคทีฟ", + "labelAll": "ทั้งหมด", + "labelMomentum": "โมเมนตัม", + "labelVolatility": "ความผันผัน", + "labelMovingAverages": "ค่าเฉลี่ยเคลื่อนที่", + "labelMACD": "MACD", + "labelRelativeStrengthIndex": "ดัชนีความแข็งแรงสัมพัทธ์ (RSI)", + "labelRSI": "อาร์เอสไอ", + "labelBollingerBands": "โบลลิงเกอร์แบนด์ (BB)", + "labelBB": "บีบี", + "labelMovingAverage": "ค่าเฉลี่ยเคลื่อนที่ (MA)", + "labelMA": "แม่", + "infoMACD": "MACD เป็นตัวบ่งชี้การซื้อขายที่ใช้ในการวิเคราะห์ทางเทคนิคของราคาหุ้นมันควรจะเปิดเผยการเปลี่ยนแปลงในความแข็งแกร่งทิศทางโมเมนตัมและระยะเวลาของแนวโน้มในราคาหุ้น", + "infoRSI": "ดัชนีความแข็งแกร่งสัมพัทธ์ (RSI) เผยแพร่โดย เจ เวลเลส ไวลดอร์ราคาปัจจุบันเป็นปกติเป็นเปอร์เซ็นต์ระหว่าง 0 ถึง 100flutter_chart_id ของออสซิลเลเตอร์นี้ทำให้เข้าใจผิดเพราะไม่ได้เปรียบเทียบตราสารที่เกี่ยวข้องกับตราสารอื่น หรือชุดตราสารหนึ่ง แต่เป็นตัวแทนของราคาปัจจุบันเมื่อเทียบกับชิ้นส่วนล่าสุดอื่น ๆ ภายในความยาวหน้าต่างมองย้อนกลับที่เลือก", + "infoBB": "Bollinger Bands (BB) สามารถใช้เพื่อวัดความสูงหรือต่ำของราคาเมื่อเทียบกับการซื้อขายครั้งก่อน", + "infoMA": "ค่าเฉลี่ยเคลื่อนที่ (MA) ช่วยระบุแนวโน้มของตลาดโดยรวมโดยการกรองความผันผวนของราคาระยะสั้นการใช้ข้อมูลในอดีตจะคำนวณราคาเฉลี่ยในช่วงเวลาที่เฉพาะเจาะจงและแสดงเส้นบนแผนภูมิหากเส้น MA เคลื่อนไปขึ้นมันเป็นตัวบ่งชี้ของแนวโน้มขาขึ้น เทรนด์ขาลงหากเคลื่อนที่ลงลงสัญญาณการซื้อเกิดขึ้นเมื่อราคาเคลื่อนที่เหนือบรรทัด MA", + "infoMaximumActiveIndicatorsAdded": "คุณได้เพิ่มจำนวนตัวบ่งชี้ที่ใช้งานได้สูงสุดแล้ว", + "infoAddSelectedIndicator": "เพิ่ม {indicator}", + "infoAddIndicator": "เพิ่มตัวบ่งชี้", + "labelDeleteAllIndicators": "ลบตัวบ่งชี้ทั้งหมด", + "infoDeleteAllIndicators": "สิ่งนี้จะลบตัวบ่งชี้ที่ใช้งานอยู่ทั้งหมด", + "labelDeleteIndicator": "ลบตัวบ่งชี้ {indicator}", + "infoDeleteIndicator": "คุณแน่ใจหรือไม่ว่าต้องการลบตัวบ่งชี้นี้?", + "labelCancel": "ยกเลิก", + "labelDelete": "ลบ", + "labelDeleteAll": "ลบทั้งหมด", + "infoUpto3indicatorsAllowed": "อนุญาตให้ใช้ตัวบ่งชี้ที่ใช้งานได้สูงสุด 3 ตัว", + "infoNoActiveIndicators": "คุณยังไม่มีตัวบ่งชี้ที่ใช้งานอยู่", + "labelReset": "รีเซ็ต", + "labelApply": "สมัคร", + "labelOK": "โอเค", + "labelRSILine": "สาย RSI", + "labelPeriod": "ระยะเวลา", + "labelMinRange": "ช่วงขั้นต่ำ", + "labelMaxRange": "ช่วงสูงสุด", + "labelSource": "แหล่งที่มา", + "labelClose": "ปิด", + "labelOpen": "เปิด", + "labelHigh": "สูง", + "labelLow": "ต่ำ", + "labelHl/2": "เอชเอล/2", + "labelHlc/3": "เอชแอลซี/3", + "labelHlcc/4": "เอชลซีซี/4", + "labelOhlc/4": "โอเอลซี/4", + "labelShowZones": "แสดงโซน", + "labelOverbought": "ซื้อมากเกินไป", + "labelOversold": "ขายมากเกินไป", + "labelMinSize": "ขนาดขั้นต่ำ", + "labelMaxSize": "ขนาดสูงสุด", + "labelRange": "เรนจ์", + "labelOverboughtLine": "สายซื้อมากเกินไป", + "labelOversoldLine": "สายขายมากเกินไป", + "labelMACDLine": "สาย MACD", + "labelFastMAPeriod": "ระยะเวลา MA ที่รวดเร็ว", + "labelSlowMAPeriod": "ระยะเวลา MA ช้า", + "labelSignalLine": "สายสัญญาณ", + "labelSignalPeriod": "ระยะเวลาสัญญาณ", + "labelIncreasingBar": "แถบเพิ่มขึ้น", + "labelDecreasingBar": "แถบลดลง", + "labelBollingerBandsTop": "เสื้อแถบโบลลิงเจอร์", + "labelBollingerBandsMedian": "แถบโบลลิงเกอร์เฉลี่ย", + "labelBollingerBandsBottom": "แถบโบลลิงเกอร์ด้านล่าง", + "labelChannelFill": "เติมช่อง", + "labelFillColor": "เติมสี", + "labelStandardDeviations": "เบี่ยงเบนมาตรฐาน", + "labelMovingAverageType": "ประเภทค่าเฉลี่ยเคลื่อนที่", + "labelMALine": "สาย MA", + "labelOffset": "ออฟเซต", + "labelType": "ประเภท", + "labelSimple": "เรียบง่าย", + "labelExponential": "เลขชี้กำลัง", + "labelWeighted": "ถ่วงน้ำหนัก", + "labelHull": "ฮัลล์", + "labelZeroLag": "ความล่าช้าเป็นศูนย์", + "labelTimeSeries": "ซีรี่ส์เวลา", + "labelWellesWilder": "เวลเลส ไวล์เดอร์", + "labelVariable": "ตัวแปร", + "labelTriangular": "สามเหลี่ยม", + "label2Exponential": "2-เลขชี้กำลัง", + "label3Exponential": "3- เลขชี้กำลัง" } \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_tr.arb b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_tr.arb index 0dc2ae764..2fac4eff4 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_tr.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_tr.arb @@ -1,3 +1,83 @@ { - "labelIndicators": "Göstergeler" + "labelIndicators": "Göstergeler", + "labelActive": "Aktif", + "labelAll": "Tümü", + "labelMomentum": "Momentum", + "labelVolatility": "Volatilite", + "labelMovingAverages": "Hareketli ortalamalar", + "labelMACD": "MACD", + "labelRelativeStrengthIndex": "Göreceli Güç Endeksi (RSI)", + "labelRSI": "RSI", + "labelBollingerBands": "Bollinger Bantları (BB)", + "labelBB": "BB", + "labelMovingAverage": "Hareketli Ortalama (MA)", + "labelMA": "MA", + "infoMACD": "MACD, hisse senedi fiyatlarının teknik analizinde kullanılan bir alım satım göstergesidir. Bir hisse senedinin fiyatındaki bir trendin gücü, yönü, momentumu ve süresindeki değişiklikleri ortaya çıkarması beklenir.", + "infoRSI": "Göreceli Güç Endeksi (RSI) J. Welles Wilder tarafından yayınlanmıştır. Mevcut fiyat 0 ile 100 arasında bir yüzde olarak normalleştirilir. Bu osilatörün flutter_chart_id'si yanıltıcıdır çünkü enstrümanı başka bir enstrümanla veya enstrüman setiyle karşılaştırmaz, bunun yerine seçilen geriye dönük pencere uzunluğu içindeki diğer son parçalara göre mevcut fiyatı temsil eder.", + "infoBB": "Bollinger Bantları (BB), önceki işlemlere göre fiyatın yüksekliğini veya düşüklüğünü ölçmek için kullanılabilir.", + "infoMA": "Hareketli Ortalama (MA), kısa vadeli fiyat dalgalanmalarını filtreleyerek genel piyasa trendini belirlemeye yardımcı olur. Geçmiş verileri kullanarak belirli bir dönemdeki ortalama fiyatı hesaplar ve grafik üzerinde bir çizgi çizer. MA çizgisi yukarı doğru hareket ederse, bu bir yükseliş trendinin, aşağı doğru hareket ederse bir düşüş trendinin göstergesidir. Fiyat MA çizgisinin üzerine çıktığında bir alım sinyali oluşur.", + "infoMaximumActiveIndicatorsAdded": "Maksimum sayıda aktif gösterge eklediniz.", + "infoAddSelectedIndicator": "{indicator}adresini ekleyin", + "infoAddIndicator": "Gösterge ekleyin", + "labelDeleteAllIndicators": "Tüm göstergeleri sil", + "infoDeleteAllIndicators": "Bu işlem tüm aktif göstergeleri silecektir.", + "labelDeleteIndicator": "Sil {indicator} göstergesi", + "infoDeleteIndicator": "Bu göstergeyi silmek istediğinizden emin misiniz?", + "labelCancel": "İptal", + "labelDelete": "Silme", + "labelDeleteAll": "Tümünü Sil", + "infoUpto3indicatorsAllowed": "En fazla 3 aktif göstergeye izin verilir.", + "infoNoActiveIndicators": "Henüz aktif göstergeniz yok.", + "labelReset": "Sıfırla", + "labelApply": "Başvurmak", + "labelOK": "TAMAM.", + "labelRSILine": "RSI çizgisi", + "labelPeriod": "Dönem", + "labelMinRange": "Min aralık", + "labelMaxRange": "Maksimum aralık", + "labelSource": "Kaynak", + "labelClose": "Kapat", + "labelOpen": "Açık", + "labelHigh": "Yüksek", + "labelLow": "Düşük", + "labelHl/2": "Hl/2", + "labelHlc/3": "Hlc/3", + "labelHlcc/4": "Hlcc/4", + "labelOhlc/4": "Ohlc/4", + "labelShowZones": "Bölgeleri Göster", + "labelOverbought": "Aşırı alım", + "labelOversold": "Aşırı satım", + "labelMinSize": "Min boyut", + "labelMaxSize": "Maksimum boyut", + "labelRange": "Menzil", + "labelOverboughtLine": "Aşırı alım çizgisi", + "labelOversoldLine": "Aşırı satım çizgisi", + "labelMACDLine": "MACD çizgisi", + "labelFastMAPeriod": "Hızlı MA dönemi", + "labelSlowMAPeriod": "Yavaş MA dönemi", + "labelSignalLine": "Sinyal hattı", + "labelSignalPeriod": "Sinyal süresi", + "labelIncreasingBar": "Artan çubuk", + "labelDecreasingBar": "Azalan çubuk", + "labelBollingerBandsTop": "Bollinger Bantları üst", + "labelBollingerBandsMedian": "Bollinger Bantları medyan", + "labelBollingerBandsBottom": "Bollinger Bantları alt", + "labelChannelFill": "Kanal dolgusu", + "labelFillColor": "Dolgu rengi", + "labelStandardDeviations": "Standart sapmalar", + "labelMovingAverageType": "Hareketli Ortalama Türü", + "labelMALine": "Ana hat", + "labelOffset": "Ofset", + "labelType": "Tip", + "labelSimple": "Basit", + "labelExponential": "Üstel", + "labelWeighted": "Ağırlıklı", + "labelHull": "Gövde", + "labelZeroLag": "Sıfır Gecikme", + "labelTimeSeries": "Zaman Serisi", + "labelWellesWilder": "Welles Wilder", + "labelVariable": "Değişken", + "labelTriangular": "Üçgen", + "label2Exponential": "2-Eksponansiyel", + "label3Exponential": "3-Eksponansiyel" } \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_vi.arb b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_vi.arb index f6ce868bf..558ae33ba 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_vi.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_vi.arb @@ -1,3 +1,83 @@ { - "labelIndicators": "Các chỉ số" + "labelIndicators": "Các chỉ số", + "labelActive": "Hoạt động", + "labelAll": "Tất cả", + "labelMomentum": "Đà", + "labelVolatility": "Có trọng lượng", + "labelMovingAverages": "Đường trung bình động", + "labelMACD": "MACD", + "labelRelativeStrengthIndex": "Chỉ số sức mạnh tương đối (RSI)", + "labelRSI": "RSI", + "labelBollingerBands": "Dải Bollinger (BB)", + "labelBB": "BB", + "labelMovingAverage": "Đường trung bình động (MA)", + "labelMA": "MA", + "infoMACD": "MACD là một chỉ báo giao dịch được sử dụng trong phân tích kỹ thuật giá cổ phiếu. Nó được cho là tiết lộ những thay đổi về sức mạnh, hướng, đà và thời gian của xu hướng trong giá cổ phiếu.", + "infoRSI": "Chỉ số sức mạnh tương đối (RSI) được công bố bởi J. Welles Wilder. Giá hiện tại được chuẩn hóa theo tỷ lệ phần trăm từ 0 đến 100. Flutter_chart_id của bộ dao động này gây hiểu nhầm vì nó không so sánh công cụ so với một công cụ hoặc bộ công cụ khác, mà đại diện cho giá hiện tại so với các phần gần đây khác trong độ dài cửa sổ nhìn lại đã chọn.", + "infoBB": "Dải Bollinger (BB) có thể được sử dụng để đo mức cao hoặc thấp của giá so với các giao dịch trước đó.", + "infoMA": "Đường trung bình động (MA) giúp xác định xu hướng thị trường tổng thể bằng cách lọc ra các biến động giá ngắn hạn. Sử dụng dữ liệu lịch sử, nó tính toán giá trung bình trong một khoảng thời gian cụ thể và vẽ một đường trên biểu đồ. Nếu đường MA di chuyển lên, đó là một chỉ báo của xu hướng tăng, xu hướng giảm nếu nó di chuyển xuống. Tín hiệu mua xảy ra khi giá di chuyển trên đường MA.", + "infoMaximumActiveIndicatorsAdded": "Bạn đã thêm số lượng chỉ báo hoạt động tối đa.", + "infoAddSelectedIndicator": "Thêm {indicator}", + "infoAddIndicator": "Thêm chỉ báo", + "labelDeleteAllIndicators": "Xóa tất cả các chỉ số", + "infoDeleteAllIndicators": "Điều này sẽ xóa tất cả các chỉ số hoạt động.", + "labelDeleteIndicator": "Xóa chỉ báo {indicator}", + "infoDeleteIndicator": "Bạn có chắc chắn muốn xóa chỉ báo này không?", + "labelCancel": "Hủy", + "labelDelete": "Xóa", + "labelDeleteAll": "Xóa tất cả", + "infoUpto3indicatorsAllowed": "Cho phép tối đa 3 chỉ số hoạt động.", + "infoNoActiveIndicators": "Bạn chưa có chỉ số hoạt động.", + "labelReset": "Đặt lại", + "labelApply": "Áp dụng", + "labelOK": "ĐƯỢC", + "labelRSILine": "Dòng RSI", + "labelPeriod": "Thời kỳ", + "labelMinRange": "Phạm vi tối thiểu", + "labelMaxRange": "Phạm vi tối đa", + "labelSource": "Nguồn", + "labelClose": "Đóng", + "labelOpen": "Mở", + "labelHigh": "Cao", + "labelLow": "Thấp", + "labelHl/2": "Hl/2", + "labelHlc/3": "Hlc/3", + "labelHlcc/4": "Hlcc/4", + "labelOhlc/4": "Ohlc/4", + "labelShowZones": "Hiển thị khu vực", + "labelOverbought": "Mua quá mức", + "labelOversold": "Bán quá mức", + "labelMinSize": "Kích thước tối thiểu", + "labelMaxSize": "Kích thước tối đa", + "labelRange": "Phạm vi", + "labelOverboughtLine": "Dòng quá mua", + "labelOversoldLine": "Dòng bán quá mức", + "labelMACDLine": "Dòng MACD", + "labelFastMAPeriod": "Thời gian MA nhanh", + "labelSlowMAPeriod": "Thời gian MA chậm", + "labelSignalLine": "Đường tín hiệu", + "labelSignalPeriod": "Thời gian tín hiệu", + "labelIncreasingBar": "Tăng thanh", + "labelDecreasingBar": "Thanh giảm", + "labelBollingerBandsTop": "Bollinger Bands hàng đầu", + "labelBollingerBandsMedian": "Dải Bollinger trung bình", + "labelBollingerBandsBottom": "Dải Bollinger phía dưới", + "labelChannelFill": "Điền kênh", + "labelFillColor": "Tô màu", + "labelStandardDeviations": "Độ lệch chuẩn", + "labelMovingAverageType": "Loại trung bình di chuyển", + "labelMALine": "Dòng MA", + "labelOffset": "Bù đắp", + "labelType": "Kiểu", + "labelSimple": "Đơn giản", + "labelExponential": "Theo cấp số nhân", + "labelWeighted": "Có trọng số", + "labelHull": "Thân tàu", + "labelZeroLag": "Không có độ trễ", + "labelTimeSeries": "Chuỗi thời gian", + "labelWellesWilder": "Welles Wilder", + "labelVariable": "Biến", + "labelTriangular": "Tam giác", + "label2Exponential": "2-cấp số nhân", + "label3Exponential": "3-cấp số nhân" } \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_zh.arb b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_zh.arb index 4704206cc..e99048b37 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_zh.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_mobile_chart_wrapper/app_zh.arb @@ -1,3 +1,83 @@ { - "labelIndicators": "指標" + "labelIndicators": "指標", + "labelActive": "活躍", + "labelAll": "全部", + "labelMomentum": "動量", + "labelVolatility": "波動性", + "labelMovingAverages": "移動平均線", + "labelMACD": "MACD", + "labelRelativeStrengthIndex": "相對強度指數(RSI)", + "labelRSI": "RSI", + "labelBollingerBands": "布林格帶(BB)", + "labelBB": "BB", + "labelMovingAverage": "移動平均值 (MA)", + "labelMA": "MA", + "infoMACD": "MACD 是交易指標,用於股票價格的技術分析。可顯示股票價格中趨勢的強度、方向、動量和持續時間的變化。", + "infoRSI": "相對強度指數(RSI)由 J. Welles Wilder 發布。將目前價格以 0 到 100 之間的百分比標準化。此振盪器的 flutter_chart_id 具有誤導性,因為它不與其他工具或一組工具相比較,而是代表所選回顧窗口長度內與其他最近的股票相對的目前價格。", + "infoBB": "布林格帶(BB)可用於測量與之前交易相對於價格的高度或低度。", + "infoMA": "移動平均線(MA)通過過濾短期價格波動來幫助識別整體市場趨勢。它使用歷史資料,計算特定期間的平均價格,並在圖表繪線。如果 MA 線向上移動,則是上升趨勢的指標,如果向下移動則是下降趨勢的指標。當價格走在 MA 線上方時,就會出現買入信號。", + "infoMaximumActiveIndicatorsAdded": "已新增使用中指標數目上限。", + "infoAddSelectedIndicator": "新增 {indicator}", + "infoAddIndicator": "新增指標", + "labelDeleteAllIndicators": "刪除所有指標", + "infoDeleteAllIndicators": "這將刪除所有活躍指標。", + "labelDeleteIndicator": "刪除 {indicator} 指標", + "infoDeleteIndicator": "確定要刪除此指標嗎?", + "labelCancel": "取消", + "labelDelete": "刪除", + "labelDeleteAll": "刪除全部", + "infoUpto3indicatorsAllowed": "最多允許 3 個活躍指標。", + "infoNoActiveIndicators": "尚未有活躍指標。", + "labelReset": "重設", + "labelApply": "申請", + "labelOK": "好", + "labelRSILine": "RSI 線", + "labelPeriod": "週期", + "labelMinRange": "最小範圍", + "labelMaxRange": "最大範圍", + "labelSource": "來源", + "labelClose": "關閉", + "labelOpen": "開啟", + "labelHigh": "High", + "labelLow": "Low", + "labelHl/2": "Hl/2", + "labelHlc/3": "Hlc/3", + "labelHlcc/4": "Hlcc/4", + "labelOhlc/4": "Ohlc/4", + "labelShowZones": "顯示區域", + "labelOverbought": "超買", + "labelOversold": "超賣", + "labelMinSize": "最小尺寸", + "labelMaxSize": "最大尺寸", + "labelRange": "範圍", + "labelOverboughtLine": "超買線", + "labelOversoldLine": "超賣線", + "labelMACDLine": "MACD 線", + "labelFastMAPeriod": "快速 MA 週期", + "labelSlowMAPeriod": "慢速 MA 週期", + "labelSignalLine": "信號線", + "labelSignalPeriod": "信號週期", + "labelIncreasingBar": "增加條型線", + "labelDecreasingBar": "減少條型線", + "labelBollingerBandsTop": "布林格帶頂部", + "labelBollingerBandsMedian": "布林格帶中位數", + "labelBollingerBandsBottom": "布林格帶底部", + "labelChannelFill": "通道填充", + "labelFillColor": "填色", + "labelStandardDeviations": "標準偏差", + "labelMovingAverageType": "移動平均線類型", + "labelMALine": "MA 線", + "labelOffset": "偏移", + "labelType": "類型", + "labelSimple": "簡單", + "labelExponential": "指數式", + "labelWeighted": "加權", + "labelHull": "Hull", + "labelZeroLag": "零延遲", + "labelTimeSeries": "時間序列", + "labelWellesWilder": "Welles Wilder", + "labelVariable": "變量", + "labelTriangular": "三角形", + "label2Exponential": "2-指數式", + "label3Exponential": "3-指數式" } \ No newline at end of file diff --git a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_de.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_de.arb index 089fdada3..8531e26ed 100644 --- a/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_de.arb +++ b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_de.arb @@ -28,7 +28,7 @@ "howToCreatePasskeyDescription2": "Sie können einen Passkey pro Gerät erstellen.", "p2pHowToCreatePasskey": "Wie erstelle ich einen Passkey?", "p2pHowToCreatePasskeyDescription1": "Gehen Sie in Ihrer Deriv P2P-App zu „Profil“.", - "p2pHowToCreatePasskeyDescription2": "Tippen Sie auf „Hauptschlüssel“, um Ihren Hauptschlüssel zu erstellen.", + "p2pHowToCreatePasskeyDescription2": "Tippen Sie auf „Passkeys“, um Ihren Passkey zu erstellen.", "whereArePasskeysSaved": "Wo werden die Passkeys gespeichert?", "whereArePasskeysSavedDescriptionAndroid": "Android: Google Passwort-Manager.", "whereArePasskeysSavedDescriptionIOS": "iOS: iCloud-Schlüsselbund.", From e34d78b303358cb5f91abab14a2a042ce3650b0f Mon Sep 17 00:00:00 2001 From: John <139219226+akhil-deriv@users.noreply.github.com> Date: Mon, 15 Jul 2024 14:49:46 +0400 Subject: [PATCH 154/162] feat(deriv_ui): [DERG 2450] Added Timeline Widget to Deriv UI (#631) Co-authored-by: ayaan-deriv <142789997+ayaan-deriv@users.noreply.github.com> --- .../timeline/src/connector_theme.dart | 203 +++++++ .../components/timeline/src/connectors.dart | 445 ++++++++++++++ .../timeline/src/indicator_theme.dart | 178 ++++++ .../components/timeline/src/indicators.dart | 262 +++++++++ .../components/timeline/src/line_painter.dart | 206 +++++++ .../timeline/src/timeline_node.dart | 216 +++++++ .../timeline/src/timeline_theme.dart | 373 ++++++++++++ .../timeline/src/timeline_tile.dart | 215 +++++++ .../timeline/src/timeline_tile_builder.dart | 545 ++++++++++++++++++ .../components/timeline/src/timelines.dart | 483 ++++++++++++++++ .../lib/components/timeline/src/util.dart | 2 + .../lib/components/timeline/timelines.dart | 12 + .../example/lib/update_bloc_page.dart | 2 +- .../example/lib/update_checker_page.dart | 2 +- 14 files changed, 3142 insertions(+), 2 deletions(-) create mode 100644 packages/deriv_ui/lib/components/timeline/src/connector_theme.dart create mode 100644 packages/deriv_ui/lib/components/timeline/src/connectors.dart create mode 100644 packages/deriv_ui/lib/components/timeline/src/indicator_theme.dart create mode 100644 packages/deriv_ui/lib/components/timeline/src/indicators.dart create mode 100644 packages/deriv_ui/lib/components/timeline/src/line_painter.dart create mode 100644 packages/deriv_ui/lib/components/timeline/src/timeline_node.dart create mode 100644 packages/deriv_ui/lib/components/timeline/src/timeline_theme.dart create mode 100644 packages/deriv_ui/lib/components/timeline/src/timeline_tile.dart create mode 100644 packages/deriv_ui/lib/components/timeline/src/timeline_tile_builder.dart create mode 100644 packages/deriv_ui/lib/components/timeline/src/timelines.dart create mode 100644 packages/deriv_ui/lib/components/timeline/src/util.dart create mode 100644 packages/deriv_ui/lib/components/timeline/timelines.dart diff --git a/packages/deriv_ui/lib/components/timeline/src/connector_theme.dart b/packages/deriv_ui/lib/components/timeline/src/connector_theme.dart new file mode 100644 index 000000000..2209db96a --- /dev/null +++ b/packages/deriv_ui/lib/components/timeline/src/connector_theme.dart @@ -0,0 +1,203 @@ +import 'dart:ui' show lerpDouble; +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; +import 'connectors.dart'; +import 'timeline_node.dart'; +import 'timeline_theme.dart'; + +/// Defines the visual properties of [SolidLineConnector], connectors inside +/// [TimelineNode]. +/// +/// Descendant widgets obtain the current [ConnectorThemeData] object using +/// `ConnectorTheme.of(context)`. Instances of [ConnectorThemeData] can be +/// customized with [ConnectorThemeData.copyWith]. +/// +/// Typically a [ConnectorThemeData] is specified as part of the overall +/// [TimelineTheme] with [TimelineThemeData.connectorTheme]. +/// +/// All [ConnectorThemeData] properties are `null` by default. When null, the +/// widgets will provide their own defaults. +/// +/// See also: +/// +/// * [TimelineThemeData], which describes the overall theme information for +/// the timeline. +@immutable +class ConnectorThemeData with Diagnosticable { + /// Creates a theme that can be used for [ConnectorTheme] or + /// [TimelineThemeData.connectorTheme]. + const ConnectorThemeData({ + this.color, + this.space, + this.thickness, + this.indent, + }); + + /// The color of [SolidLineConnector]s and connectors inside [TimelineNode]s, + /// and so forth. + final Color? color; + + /// This represents the amount of horizontal or vertical space the connector + /// takes up. + final double? space; + + /// The thickness of the line drawn within the connector. + final double? thickness; + + /// The amount of empty space at the edge of [SolidLineConnector]. + final double? indent; + + /// Creates a copy of this object with the given fields replaced with the new + /// values. + ConnectorThemeData copyWith({ + Color? color, + double? space, + double? thickness, + double? indent, + }) => + ConnectorThemeData( + color: color ?? this.color, + space: space ?? this.space, + thickness: thickness ?? this.thickness, + indent: indent ?? this.indent, + ); + + /// Linearly interpolate between two Connector themes. + /// + /// The argument `t` must not be null. + /// + /// {@macro dart.ui.shadow.lerp} + static ConnectorThemeData lerp( + ConnectorThemeData? a, ConnectorThemeData? b, double t) => + ConnectorThemeData( + color: Color.lerp(a?.color, b?.color, t), + space: lerpDouble(a?.space, b?.space, t), + thickness: lerpDouble(a?.thickness, b?.thickness, t), + indent: lerpDouble(a?.indent, b?.indent, t), + ); + + @override + int get hashCode => Object.hash( + color, + space, + thickness, + indent, + ); + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (other.runtimeType != runtimeType) { + return false; + } + return other is ConnectorThemeData && + other.color == color && + other.space == space && + other.thickness == thickness && + other.indent == indent; + } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties + ..add(ColorProperty('color', color, defaultValue: null)) + ..add(DoubleProperty('space', space, defaultValue: null)) + ..add(DoubleProperty('thickness', thickness, defaultValue: null)) + ..add(DoubleProperty('indent', indent, defaultValue: null)); + } +} + +/// An inherited widget that defines the configuration for +/// [SolidLineConnector]s, connectors inside [TimelineNode]s. +class ConnectorTheme extends InheritedTheme { + /// Creates a connector theme that controls the configurations for + /// [SolidLineConnector]s, connectors inside [TimelineNode]s. + const ConnectorTheme({ + required this.data, + required Widget child, + Key? key, + }) : super(key: key, child: child); + + /// The properties for descendant [SolidLineConnector]s, connectors inside + /// [TimelineNode]s. + final ConnectorThemeData data; + + /// The closest instance of this class's [data] value that encloses the given + /// context. + /// + /// If there is no ancestor, it returns [TimelineThemeData.connectorTheme]. + /// Applications can assume that the returned value will not be null. + /// + /// Typical usage is as follows: + /// + /// ```dart + /// ConnectorThemeData theme = ConnectorTheme.of(context); + /// ``` + static ConnectorThemeData of(BuildContext context) { + final ConnectorTheme? connectorTheme = + context.dependOnInheritedWidgetOfExactType(); + return connectorTheme?.data ?? TimelineTheme.of(context).connectorTheme; + } + + @override + Widget wrap(BuildContext context, Widget child) { + final ConnectorTheme? ancestorTheme = + context.findAncestorWidgetOfExactType(); + return identical(this, ancestorTheme) + ? child + : ConnectorTheme(data: data, child: child); + } + + @override + bool updateShouldNotify(ConnectorTheme oldWidget) => data != oldWidget.data; + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + data.debugFillProperties(properties); + } +} + +/// Connector component configured through [ConnectorTheme] +mixin ThemedConnectorComponent on Widget { + /// {@template timelines.connector.direction} + /// If this is null, then the [TimelineThemeData.direction] is used. + /// {@endtemplate} + Axis? get direction; + Axis getEffectiveDirection(BuildContext context) => + direction ?? TimelineTheme.of(context).direction; + + /// {@template timelines.connector.thickness} + /// If this is null, then the [ConnectorThemeData.thickness] is used which + /// defaults to 2.0. + /// {@endtemplate} + double? get thickness; + double getEffectiveThickness(BuildContext context) => + thickness ?? ConnectorTheme.of(context).thickness ?? 2.0; + + /// {@template timelines.connector.space} + /// If this is null, then the [ConnectorThemeData.space] is used. If that is + /// also null, then this defaults to double.infinity. + /// {@endtemplate} + double? get space; + double? getEffectiveSpace(BuildContext context) => + space ?? ConnectorTheme.of(context).space; + + double? get indent; + double getEffectiveIndent(BuildContext context) => + indent ?? ConnectorTheme.of(context).indent ?? 0.0; + + double? get endIndent; + double getEffectiveEndIndent(BuildContext context) => + endIndent ?? ConnectorTheme.of(context).indent ?? 0.0; + + Color? get color; + Color getEffectiveColor(BuildContext context) => + color ?? + ConnectorTheme.of(context).color ?? + TimelineTheme.of(context).color; +} diff --git a/packages/deriv_ui/lib/components/timeline/src/connectors.dart b/packages/deriv_ui/lib/components/timeline/src/connectors.dart new file mode 100644 index 000000000..809b7b1c5 --- /dev/null +++ b/packages/deriv_ui/lib/components/timeline/src/connectors.dart @@ -0,0 +1,445 @@ +import 'package:flutter/material.dart'; +import 'connector_theme.dart'; +import 'line_painter.dart'; +import 'timelines.dart'; +import 'timeline_node.dart'; +import 'timeline_theme.dart'; + +/// Abstract class for predefined connector widgets. +/// +/// See also: +/// +/// * [SolidLineConnector], which is a [Connector] that draws solid line. +/// * [DashedLineConnector], which is a [Connector] that draws outlined dot. +/// * [TransparentConnector], which is a [Connector] that only takes up space. +abstract class Connector extends StatelessWidget with ThemedConnectorComponent { + /// Creates an connector. + const Connector({ + Key? key, + this.direction, + this.space, + this.thickness, + this.indent, + this.endIndent, + this.color, + }) : assert(thickness == null || thickness >= 0.0), + assert(space == null || space >= 0.0), + assert(indent == null || indent >= 0.0), + assert(endIndent == null || endIndent >= 0.0), + super(key: key); + + /// Creates a solid line connector. + /// + /// See also: + /// + /// * [SolidLineConnector], exactly the same. + factory Connector.solidLine({ + Key? key, + Axis? direction, + double? thickness, + double? space, + double? indent, + double? endIndent, + Color? color, + }) => + SolidLineConnector( + key: key, + direction: direction, + thickness: thickness, + space: space, + indent: indent, + endIndent: endIndent, + color: color, + ); + + /// Creates a dashed line connector. + /// + /// See also: + /// + /// * [DashedLineConnector], exactly the same. + factory Connector.dashedLine({ + Key? key, + Axis? direction, + double? thickness, + double? dash, + double? gap, + double? space, + double? indent, + double? endIndent, + Color? color, + Color? gapColor, + }) => + DashedLineConnector( + key: key, + direction: direction, + thickness: thickness, + dash: dash, + gap: gap, + space: space, + indent: indent, + endIndent: endIndent, + color: color, + gapColor: gapColor, + ); + + /// Creates a dashed transparent connector. + /// + /// See also: + /// + /// * [TransparentConnector], exactly the same. + factory Connector.transparent({ + Key? key, + Axis? direction, + double? indent, + double? endIndent, + double? space, + }) => + TransparentConnector( + key: key, + direction: direction, + indent: indent, + endIndent: endIndent, + space: space, + ); + + /// {@macro timelines.direction} + /// + /// {@macro timelines.connector.direction} + @override + final Axis? direction; + + /// The connector's cross axis size extent. + /// + /// The connector itself is always drawn as a line that is centered within the + /// size specified by this value. + /// {@macro timelines.connector.space} + @override + final double? space; + + /// The thickness of the line drawn within the connector. + /// + /// {@macro timelines.connector.thickness} + @override + final double? thickness; + + /// The amount of empty space to the leading edge of the connector. + /// + /// If this is null, then the [ConnectorThemeData.indent] is used. If that is + /// also null, then this defaults to 0.0. + @override + final double? indent; + + /// The amount of empty space to the trailing edge of the connector. + /// + /// If this is null, then the [ConnectorThemeData.indent] is used. If that is + /// also null, then this defaults to 0.0. + @override + final double? endIndent; + + /// The color to use when painting the line. + /// + /// If this is null, then the [ConnectorThemeData.color] is used. If that is + /// also null, then [TimelineThemeData.color] is used. + @override + final Color? color; +} + +/// A thin line, with padding on either side. +/// +/// The box's total cross axis size(width or height, depend on [direction]) is +/// controlled by [space]. +/// +/// The appropriate padding is automatically computed from the cross axis size. +class SolidLineConnector extends Connector { + /// Creates a solid line connector. + /// + /// The [thickness], [space], [indent], and [endIndent] must be null or + /// non-negative. + const SolidLineConnector({ + Key? key, + Axis? direction, + double? thickness, + double? space, + double? indent, + double? endIndent, + Color? color, + }) : super( + key: key, + direction: direction, + thickness: thickness, + space: space, + indent: indent, + endIndent: endIndent, + color: color, + ); + + @override + Widget build(BuildContext context) { + final Axis direction = getEffectiveDirection(context); + final double thickness = getEffectiveThickness(context); + final Color color = getEffectiveColor(context); + final double? space = getEffectiveSpace(context); + final double indent = getEffectiveIndent(context); + final double endIndent = getEffectiveEndIndent(context); + + switch (direction) { + case Axis.vertical: + return _ConnectorIndent( + direction: direction, + indent: indent, + endIndent: endIndent, + space: space, + child: Container( + width: thickness, + color: color, + ), + ); + case Axis.horizontal: + return _ConnectorIndent( + direction: direction, + indent: indent, + endIndent: endIndent, + space: space, + child: Container( + height: thickness, + color: color, + ), + ); + } + } +} + +/// A decorated thin line, with padding on either side. +/// +/// The box's total cross axis size(width or height, depend on [direction]) is +/// controlled by [space]. +/// +/// The appropriate padding is automatically computed from the cross axis size. +class DecoratedLineConnector extends Connector { + /// Creates a decorated line connector. + /// + /// The [thickness], [space], [indent], and [endIndent] must be null or + /// non-negative. + const DecoratedLineConnector({ + Key? key, + Axis? direction, + double? thickness, + double? space, + double? indent, + double? endIndent, + this.decoration, + }) : super( + key: key, + direction: direction, + thickness: thickness, + space: space, + indent: indent, + endIndent: endIndent, + ); + + /// The decoration to paint line. + /// + /// Use the [SolidLineConnector] class to specify a simple solid color line. + final Decoration? decoration; + + @override + Widget build(BuildContext context) { + final Axis direction = getEffectiveDirection(context); + final double thickness = getEffectiveThickness(context); + final double? space = getEffectiveSpace(context); + final double indent = getEffectiveIndent(context); + final double endIndent = getEffectiveEndIndent(context); + final Color? color = decoration == null ? getEffectiveColor(context) : null; + + switch (direction) { + case Axis.vertical: + return _ConnectorIndent( + direction: direction, + indent: indent, + endIndent: endIndent, + space: space, + child: Container( + width: thickness, + color: color, + decoration: decoration, + ), + ); + case Axis.horizontal: + return _ConnectorIndent( + direction: direction, + indent: indent, + endIndent: endIndent, + space: space, + child: Container( + height: thickness, + color: color, + decoration: decoration, + ), + ); + } + } +} + +/// A thin dashed line, with padding on either side. +/// +/// The box's total cross axis size(width or height, depend on [direction]) is +/// controlled by [space]. +/// +/// The appropriate padding is automatically computed from the cross axis size. +/// +/// See also: +/// +/// * [DashedLinePainter], which is painter that draws this connector. +class DashedLineConnector extends Connector { + /// Creates a dashed line connector. + /// + /// The [thickness], [space], [indent], and [endIndent] must be null or + /// non-negative. + const DashedLineConnector({ + Key? key, + Axis? direction, + double? thickness, + this.dash, + this.gap, + double? space, + double? indent, + double? endIndent, + Color? color, + this.gapColor, + }) : super( + key: key, + direction: direction, + thickness: thickness, + space: space, + indent: indent, + endIndent: endIndent, + color: color, + ); + + /// The dash size of the line drawn within the connector. + /// + /// If this is null, then this defaults to 1.0. + final double? dash; + + /// The gap of the line drawn within the connector. + /// + /// If this is null, then this defaults to 1.0. + final double? gap; + + /// The color to use when painting the gap in the line. + /// + /// If this is null, then the [Colors.transparent] is used. + final Color? gapColor; + + @override + Widget build(BuildContext context) { + final Axis direction = getEffectiveDirection(context); + return _ConnectorIndent( + direction: direction, + indent: getEffectiveIndent(context), + endIndent: getEffectiveEndIndent(context), + space: getEffectiveSpace(context), + child: CustomPaint( + painter: DashedLinePainter( + direction: direction, + color: getEffectiveColor(context), + strokeWidth: getEffectiveThickness(context), + dashSize: dash ?? 1.0, + gapSize: gap ?? 1.0, + gapColor: gapColor ?? Colors.transparent, + ), + child: Container(), + ), + ); + } +} + +/// A transparent connector for start, end [TimelineNode] of the [Timeline]. +/// +/// This connector will be not displayed, it only occupies an area. +class TransparentConnector extends Connector { + /// Creates a transparent connector. + /// + /// The [space], [indent], and [endIndent] must be null or non-negative. + const TransparentConnector({ + Key? key, + Axis? direction, + double? indent, + double? endIndent, + double? space, + }) : super( + key: key, + direction: direction, + indent: indent, + endIndent: endIndent, + space: space, + ); + + @override + Widget build(BuildContext context) => _ConnectorIndent( + direction: getEffectiveDirection(context), + indent: getEffectiveIndent(context), + endIndent: getEffectiveEndIndent(context), + space: getEffectiveSpace(context), + child: Container(), + ); +} + +/// Apply indent to [child]. +class _ConnectorIndent extends StatelessWidget { + /// Creates a indent. + /// + /// The [direction]and [child] must be null. And [space], [indent] and + /// [endIndent] must be null or non-negative. + const _ConnectorIndent({ + required this.direction, + required this.space, + required this.child, + Key? key, + this.indent, + this.endIndent, + }) : assert(space == null || space >= 0), + assert(indent == null || indent >= 0), + assert(endIndent == null || endIndent >= 0), + super(key: key); + + /// {@macro timelines.direction} + final Axis direction; + + /// The connector's cross axis size extent. + /// + /// The connector itself is always drawn as a line that is centered within the + /// size specified by this value. + final double? space; + + /// The amount of empty space to the leading edge of the connector. + final double? indent; + + /// The amount of empty space to the trailing edge of the connector. + final double? endIndent; + + /// The widget below this widget in the tree. + /// + /// {@macro flutter.widgets.child} + final Widget child; + + @override + Widget build(BuildContext context) => SizedBox( + width: direction == Axis.vertical ? space : null, + height: direction == Axis.vertical ? null : space, + child: Center( + child: Padding( + padding: direction == Axis.vertical + ? EdgeInsetsDirectional.only( + top: indent ?? 0, + bottom: endIndent ?? 0, + ) + : EdgeInsetsDirectional.only( + start: indent ?? 0, + end: endIndent ?? 0, + ), + child: child, + ), + ), + ); +} diff --git a/packages/deriv_ui/lib/components/timeline/src/indicator_theme.dart b/packages/deriv_ui/lib/components/timeline/src/indicator_theme.dart new file mode 100644 index 000000000..734c1c983 --- /dev/null +++ b/packages/deriv_ui/lib/components/timeline/src/indicator_theme.dart @@ -0,0 +1,178 @@ +import 'dart:ui' show lerpDouble; +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; +import 'indicators.dart'; +import 'timeline_node.dart'; +import 'timeline_theme.dart'; + +/// Defines the visual properties of [DotIndicator], indicators inside +/// [TimelineNode]s. +/// +/// Descendant widgets obtain the current [IndicatorThemeData] object using +/// `IndicatorTheme.of(context)`. Instances of [IndicatorThemeData] can be +/// customized with [IndicatorThemeData.copyWith]. +/// +/// Typically a [IndicatorThemeData] is specified as part of the overall +/// [TimelineTheme] with [TimelineThemeData.indicatorTheme]. +/// +/// All [IndicatorThemeData] properties are `null` by default. When null, the +/// widgets will provide their own defaults. +/// +/// See also: +/// +/// * [TimelineThemeData], which describes the overall theme information for +/// the timeline. +@immutable +class IndicatorThemeData with Diagnosticable { + /// Creates a theme that can be used for [IndicatorTheme] or + /// [TimelineThemeData.indicatorTheme]. + const IndicatorThemeData({ + this.color, + this.size, + this.position, + }); + + /// The color of [DotIndicator]s and indicators inside [TimelineNode]s, and so + /// forth. + final Color? color; + + /// The size of [DotIndicator]s and indicators inside [TimelineNode]s, and so + /// forth in logical pixels. + /// + /// Indicators occupy a square with width and height equal to size. + final double? size; + + /// A position of indicator inside both two connectors. + final double? position; + + /// Creates a copy of this object with the given fields replaced with the new + /// values. + IndicatorThemeData copyWith({ + Color? color, + double? size, + double? position, + }) => + IndicatorThemeData( + color: color ?? this.color, + size: size ?? this.size, + position: position ?? this.position, + ); + + /// Linearly interpolate between two Indicator themes. + /// + /// The argument `t` must not be null. + /// + /// {@macro dart.ui.shadow.lerp} + static IndicatorThemeData lerp( + IndicatorThemeData? a, IndicatorThemeData? b, double t) => + IndicatorThemeData( + color: Color.lerp(a?.color, b?.color, t), + size: lerpDouble(a?.size, b?.size, t), + position: lerpDouble(a?.position, b?.position, t), + ); + + @override + int get hashCode => Object.hash(color, size, position); + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (other.runtimeType != runtimeType) { + return false; + } + return other is IndicatorThemeData && + other.color == color && + other.size == size && + other.position == position; + } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties + ..add(ColorProperty('color', color, defaultValue: null)) + ..add(DoubleProperty('size', size, defaultValue: null)) + ..add(DoubleProperty('position', size, defaultValue: null)); + } +} + +/// Controls the default color and size of indicators in a widget subtree. +/// +/// The indicator theme is honored by [TimelineNode], [DotIndicator] and +/// [OutlinedDotIndicator] widgets. +class IndicatorTheme extends InheritedTheme { + /// Creates an indicator theme that controls the color and size for + /// [DotIndicator]s, indicators inside [TimelineNode]s. + const IndicatorTheme({ + required this.data, + required Widget child, + Key? key, + }) : super(key: key, child: child); + + /// The properties for descendant [DotIndicator]s, indicators inside + /// [TimelineNode]s. + final IndicatorThemeData data; + + /// The data from the closest instance of this class that encloses the given + /// context. + /// + /// Defaults to the current [TimelineThemeData.indicatorTheme]. + /// + /// Typical usage is as follows: + /// + /// ```dart + /// IndicatorThemeData theme = IndicatorTheme.of(context); + /// ``` + static IndicatorThemeData of(BuildContext context) { + final IndicatorTheme? indicatorTheme = + context.dependOnInheritedWidgetOfExactType(); + return indicatorTheme?.data ?? TimelineTheme.of(context).indicatorTheme; + } + + @override + Widget wrap(BuildContext context, Widget child) { + final IndicatorTheme? ancestorTheme = + context.findAncestorWidgetOfExactType(); + return identical(this, ancestorTheme) + ? child + : IndicatorTheme(data: data, child: child); + } + + @override + bool updateShouldNotify(IndicatorTheme oldWidget) => data != oldWidget.data; + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + data.debugFillProperties(properties); + } +} + +/// Indicator component configured through [IndicatorTheme] +mixin ThemedIndicatorComponent on PositionedIndicator { + /// {@template timelines.indicator.color} + /// Defaults to the current [IndicatorTheme] color, if any. + /// + /// If no [IndicatorTheme] and no [TimelineTheme] is specified, indicators + /// will default to blue. + /// {@endtemplate} + Color? get color; + Color getEffectiveColor(BuildContext context) => + color ?? + IndicatorTheme.of(context).color ?? + TimelineTheme.of(context).color; + + /// {@template timelines.indicator.size} + /// Indicators occupy a square with width and height equal to size. + /// + /// Defaults to the current [IndicatorTheme] size, if any. If there is no + /// [IndicatorTheme], or it does not specify an explicit size, then it + /// defaults to own child size(0.0). + /// {@endtemplate} + double? get size; + double? getEffectiveSize(BuildContext context) => + size ?? IndicatorTheme.of(context).size; +} diff --git a/packages/deriv_ui/lib/components/timeline/src/indicators.dart b/packages/deriv_ui/lib/components/timeline/src/indicators.dart new file mode 100644 index 000000000..f58aa7c7a --- /dev/null +++ b/packages/deriv_ui/lib/components/timeline/src/indicators.dart @@ -0,0 +1,262 @@ +import 'package:flutter/material.dart'; +import 'indicator_theme.dart'; +import 'timeline_theme.dart'; + +/// [TimelineNode]'s indicator. +mixin PositionedIndicator on Widget { + /// {@template timelines.indicator.position} + /// If this is null, then the [IndicatorThemeData.position] is used. If that + /// is also null, then this defaults to [TimelineThemeData.indicatorPosition]. + /// {@endtemplate} + double? get position; + double getEffectivePosition(BuildContext context) => + position ?? + IndicatorTheme.of(context).position ?? + TimelineTheme.of(context).indicatorPosition; +} + +/// Abstract class for predefined indicator widgets. +/// +/// See also: +/// +/// * [DotIndicator], which is a [Indicator] that draws dot. +/// * [OutlinedDotIndicator], which is a [Indicator] that draws outlined dot. +/// * [ContainerIndicator], which is a [Indicator] that draws it's child. +abstract class Indicator extends StatelessWidget + with PositionedIndicator, ThemedIndicatorComponent { + /// Creates an indicator. + const Indicator({ + Key? key, + this.size, + this.color, + this.border, + this.position, + this.child, + }) : assert(size == null || size >= 0), + assert(position == null || 0 <= position && position <= 1), + super(key: key); + + /// Creates a dot indicator. + /// + /// See also: + /// + /// * [DotIndicator], exactly the same. + factory Indicator.dot({ + double? size, + Color? color, + double? position, + Border? border, + Widget? child, + }) => + DotIndicator( + size: size, + color: color, + position: position, + border: border, + child: child, + ); + + /// Creates a outlined dot indicator. + /// + /// See also: + /// + /// * [OutlinedDotIndicator], exactly the same. + factory Indicator.outlined({ + double? size, + Color? color, + Color? backgroundColor, + double? position, + double borderWidth = 2.0, + Widget? child, + }) => + OutlinedDotIndicator( + size: size, + color: color, + position: position, + backgroundColor: backgroundColor, + borderWidth: borderWidth, + child: child, + ); + + /// Creates a transparent indicator. + /// + /// See also: + /// + /// * [ContainerIndicator], this is created without child. + factory Indicator.transparent({ + double? size, + double? position, + }) => + ContainerIndicator( + size: size, + position: position, + ); + + /// Creates a widget indicator. + /// + /// See also: + /// + /// * [OutlinedDotIndicator], exactly the same. + factory Indicator.widget({ + double? size, + double? position, + Widget? child, + }) => + ContainerIndicator( + size: size, + position: position, + child: child, + ); + + /// The size of the dot in logical pixels. + /// + /// {@macro timelines.indicator.size} + @override + final double? size; + + /// The color to use when drawing the dot. + /// + /// {@macro timelines.indicator.color} + @override + final Color? color; + + /// The position of a indicator between the two connectors. + /// + /// {@macro timelines.indicator.position} + @override + final double? position; + + /// The border to use when drawing the dot's outline. + final BoxBorder? border; + + /// The widget below this widget in the tree. + /// + /// {@macro flutter.widgets.child} + final Widget? child; +} + +/// A widget that displays an [child]. The [child] if null, the indicator is not +/// visible. +class ContainerIndicator extends Indicator { + /// Creates a container indicator. + const ContainerIndicator({ + Key? key, + double? size, + double? position, + this.child, + }) : super( + key: key, + size: size, + position: position, + color: Colors.transparent, + ); + + /// The widget below this widget in the tree. + /// + /// {@macro flutter.widgets.child} + final Widget? child; + + @override + Widget build(BuildContext context) { + final double? size = getEffectiveSize(context); + return Container( + width: size, + height: size, + child: child, + ); + } +} + +/// A widget that displays an dot. +class DotIndicator extends Indicator { + /// Creates a dot indicator. + /// + /// The [size] must be null or non-negative. + const DotIndicator({ + Key? key, + double? size, + Color? color, + double? position, + this.border, + this.child, + }) : super( + key: key, + size: size, + color: color, + position: position, + ); + + /// The border to use when drawing the dot's outline. + final BoxBorder? border; + + /// The widget below this widget in the tree. + /// + /// {@macro flutter.widgets.child} + final Widget? child; + + @override + Widget build(BuildContext context) { + final double? effectiveSize = getEffectiveSize(context); + final Color effectiveColor = getEffectiveColor(context); + return Center( + child: Container( + width: effectiveSize ?? ((child == null) ? 15.0 : null), + height: effectiveSize ?? ((child == null) ? 15.0 : null), + child: child, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: effectiveColor, + border: border, + ), + ), + ); + } +} + +/// A widget that displays an outlined dot. +class OutlinedDotIndicator extends Indicator { + /// Creates a outlined dot indicator. + /// + /// The [size] must be null or non-negative. + const OutlinedDotIndicator({ + Key? key, + double? size, + Color? color, + double? position, + this.backgroundColor, + this.borderWidth = 2.0, + this.child, + }) : assert(size == null || size >= 0), + assert(position == null || 0 <= position && position <= 1), + super( + key: key, + size: size, + color: color, + position: position, + ); + + /// The color to use when drawing the dot in outline. + /// + /// {@macro timelines.indicator.color} + final Color? backgroundColor; + + /// The width of this outline, in logical pixels. + final double borderWidth; + + /// The widget below this widget in the tree. + /// + /// {@macro flutter.widgets.child} + final Widget? child; + + @override + Widget build(BuildContext context) => DotIndicator( + size: size, + color: backgroundColor ?? Colors.transparent, + position: position, + border: Border.all( + color: color ?? getEffectiveColor(context), + width: borderWidth, + ), + child: child, + ); +} diff --git a/packages/deriv_ui/lib/components/timeline/src/line_painter.dart b/packages/deriv_ui/lib/components/timeline/src/line_painter.dart new file mode 100644 index 000000000..7b7a2168e --- /dev/null +++ b/packages/deriv_ui/lib/components/timeline/src/line_painter.dart @@ -0,0 +1,206 @@ +import 'dart:math'; +import 'package:flutter/material.dart'; +import 'connectors.dart'; + +/// Paints a [DashedLineConnector]. +/// +/// Draw the line like this: +/// ``` +/// 0 > [dash][gap][dash][gap] < constraints size +/// ``` +/// +/// [dashSize] specifies the size of [dash]. and [gapSize] specifies the size of +/// [gap]. +/// +/// When using the default colors, this painter draws a dotted line or dashed +/// line that familiar. +/// If set other [gapColor], this painter draws a line that alternates between +/// two colors. +class DashedLinePainter extends CustomPainter { + /// Creates a dashed line painter. + /// + /// The [dashSize] argument must be 1 or more, and the [gapSize] and + /// [strokeWidth] arguments must be positive numbers. + /// + /// The [direction], [color], [gapColor] and [strokeCap] arguments must not be + /// null. + const DashedLinePainter({ + required this.direction, + required this.color, + this.gapColor = Colors.transparent, + this.dashSize = 1.0, + this.gapSize = 1.0, + this.strokeWidth = 1.0, + this.strokeCap = StrokeCap.square, + }) : assert(dashSize >= 1), + assert(gapSize >= 0), + assert(strokeWidth >= 0); + + /// {@macro timelines.direction} + final Axis direction; + + /// The color to paint dash of line. + final Color color; + + /// The color to paint gap(another dash) of line. + final Color gapColor; + + /// The size of dash + final double dashSize; + + /// The size of gap, it also draws [gapColor] + final double gapSize; + + /// The stroke width of dash and gap. + final double strokeWidth; + + /// Styles to use for line endings. + final StrokeCap strokeCap; + + @override + void paint(Canvas canvas, Size size) { + final Paint paint = Paint() + ..strokeWidth = strokeWidth + ..strokeCap = strokeCap + ..style = PaintingStyle.stroke; + + _DashOffset offset = _DashOffset( + containerSize: size, + strokeWidth: strokeWidth, + dashSize: dashSize, + gapSize: gapSize, + axis: direction, + ); + + while (offset.hasNext) { + // draw dash + paint.color = color; + canvas.drawLine( + offset, + offset.translateDashSize(), + paint, + ); + offset = offset.translateDashSize(); + + // draw gap + if (gapColor != Colors.transparent) { + paint.color = gapColor; + canvas.drawLine( + offset, + offset.translateGapSize(), + paint, + ); + } + offset = offset.translateGapSize(); + } + } + + @override + bool shouldRepaint(DashedLinePainter oldDelegate) => + direction != oldDelegate.direction || + color != oldDelegate.color || + gapColor != oldDelegate.gapColor || + dashSize != oldDelegate.dashSize || + gapSize != oldDelegate.gapSize || + strokeWidth != oldDelegate.strokeWidth || + strokeCap != oldDelegate.strokeCap; +} + +class _DashOffset extends Offset { + factory _DashOffset({ + required Size containerSize, + required double strokeWidth, + required double dashSize, + required double gapSize, + required Axis axis, + }) => + _DashOffset._( + dx: axis == Axis.vertical ? containerSize.width / 2 : 0, + dy: axis == Axis.vertical ? 0 : containerSize.height / 2, + strokeWidth: strokeWidth, + containerSize: containerSize, + dashSize: dashSize, + gapSize: gapSize, + axis: axis, + ); + + const _DashOffset._({ + required double dx, + required double dy, + required this.strokeWidth, + required this.containerSize, + required this.dashSize, + required this.gapSize, + required this.axis, + }) : super(dx, dy); + + final Size containerSize; + final double strokeWidth; + final double dashSize; + final double gapSize; + final Axis axis; + + double get offset { + if (axis == Axis.vertical) { + return dy; + } else { + return dx; + } + } + + bool get hasNext { + if (axis == Axis.vertical) { + return offset < containerSize.height; + } else { + return offset < containerSize.width; + } + } + + _DashOffset translateDashSize() => _translateDirectionally(dashSize); + + _DashOffset translateGapSize() => + _translateDirectionally(gapSize + strokeWidth); + + _DashOffset _translateDirectionally(double offset) { + if (axis == Axis.vertical) { + return translate(0, offset) as _DashOffset; + } else { + return translate(offset, 0) as _DashOffset; + } + } + + @override + Offset translate(double translateX, double translateY) { + double dx, dy; + if (axis == Axis.vertical) { + dx = this.dx; + dy = this.dy + translateY; + } else { + dx = this.dx + translateX; + dy = this.dy; + } + return copyWith( + dx: min(dx, containerSize.width), + dy: min(dy, containerSize.height), + ); + } + + _DashOffset copyWith({ + double? dx, + double? dy, + Size? containerSize, + double? strokeWidth, + double? dashSize, + double? gapSize, + Axis? axis, + }) => + _DashOffset._( + dx: dx ?? this.dx, + dy: dy ?? this.dy, + containerSize: containerSize ?? this.containerSize, + strokeWidth: strokeWidth ?? this.strokeWidth, + dashSize: dashSize ?? this.dashSize, + gapSize: gapSize ?? this.gapSize, + axis: axis ?? this.axis, + ); +} diff --git a/packages/deriv_ui/lib/components/timeline/src/timeline_node.dart b/packages/deriv_ui/lib/components/timeline/src/timeline_node.dart new file mode 100644 index 000000000..c1715f73d --- /dev/null +++ b/packages/deriv_ui/lib/components/timeline/src/timeline_node.dart @@ -0,0 +1,216 @@ +import 'package:flutter/material.dart'; +import 'connectors.dart'; +import 'indicators.dart'; +import 'timeline_theme.dart'; +import 'util.dart'; + +/// [TimelineTile]'s timeline node +mixin TimelineTileNode on Widget { + /// {@template timelines.node.position} + /// If this is null, then the [TimelineThemeData.nodePosition] is used. + /// {@endtemplate} + double? get position; + double getEffectivePosition(BuildContext context) => + position ?? TimelineTheme.of(context).nodePosition; +} + +/// A widget that displays indicator and two connectors. +/// +/// The [indicator] displayed between the [startConnector] and [endConnector] +class TimelineNode extends StatelessWidget with TimelineTileNode { + /// Creates a timeline node. + /// + /// The [indicatorPosition] must be null or a value between 0 and 1. + const TimelineNode({ + Key? key, + this.direction, + this.startConnector, + this.endConnector, + this.indicator = const ContainerIndicator(), + this.indicatorPosition, + this.position, + this.overlap, + }) : assert(indicatorPosition == null || + 0 <= indicatorPosition && indicatorPosition <= 1), + super(key: key); + + /// Creates a timeline node that connects the dot indicator in a solid line. + TimelineNode.simple({ + Key? key, + Axis? direction, + Color? color, + double? lineThickness, + double? nodePosition, + double? indicatorPosition, + double? indicatorSize, + Widget? indicatorChild, + double? indent, + double? endIndent, + bool drawStartConnector = true, + bool drawEndConnector = true, + bool? overlap, + }) : this( + key: key, + direction: direction, + startConnector: drawStartConnector + ? SolidLineConnector( + direction: direction, + color: color, + thickness: lineThickness, + indent: indent, + endIndent: endIndent, + ) + : null, + endConnector: drawEndConnector + ? SolidLineConnector( + direction: direction, + color: color, + thickness: lineThickness, + indent: indent, + endIndent: endIndent, + ) + : null, + indicator: DotIndicator( + child: indicatorChild, + position: indicatorPosition, + size: indicatorSize, + color: color, + ), + indicatorPosition: indicatorPosition, + position: nodePosition, + overlap: overlap, + ); + + /// {@macro timelines.direction} + final Axis? direction; + + /// The connector of the start edge of this node + final Widget? startConnector; + + /// The connector of the end edge of this node + final Widget? endConnector; + + /// The indicator of the node + final Widget indicator; + + /// The position of a indicator between the two connectors. + /// + /// {@macro timelines.indicator.position} + final double? indicatorPosition; + + /// A position of timeline node between both two contents. + /// + /// {@macro timelines.node.position} + @override + final double? position; + + /// Determine whether each connectors and indicator will overlap. + /// + /// When each connectors overlap, they are drawn from the center offset of the + /// indicator. + final bool? overlap; + + double _getEffectiveIndicatorPosition(BuildContext context) { + double? indicatorPosition = this.indicatorPosition; + return indicatorPosition ??= (indicator is PositionedIndicator) + ? (indicator as PositionedIndicator).getEffectivePosition(context) + : TimelineTheme.of(context).indicatorPosition; + } + + bool _getEffectiveOverlap(BuildContext context) { + final bool overlap = + this.overlap ?? TimelineTheme.of(context).nodeItemOverlap; + return overlap; + } + + @override + Widget build(BuildContext context) { + final Axis direction = + this.direction ?? TimelineTheme.of(context).direction; + final bool overlap = _getEffectiveOverlap(context); + //TODO: support both flex and logical pixel + final double indicatorFlex = _getEffectiveIndicatorPosition(context); + Widget line = indicator; + final List lineItems = [ + if (indicatorFlex > 0) + Flexible( + flex: (indicatorFlex * kFlexMultiplier).toInt(), + child: startConnector ?? const TransparentConnector(), + ), + if (!overlap) indicator, + if (indicatorFlex < 1) + Flexible( + flex: ((1 - indicatorFlex) * kFlexMultiplier).toInt(), + child: endConnector ?? const TransparentConnector(), + ), + ]; + + switch (direction) { + case Axis.vertical: + line = Column( + mainAxisSize: MainAxisSize.min, + children: lineItems, + ); + break; + case Axis.horizontal: + line = Row( + mainAxisSize: MainAxisSize.min, + children: lineItems, + ); + break; + } + + Widget result; + if (overlap) { + Widget positionedIndicator = indicator; + final List positionedIndicatorItems = [ + if (indicatorFlex > 0) + Flexible( + flex: (indicatorFlex * kFlexMultiplier).toInt(), + child: const TransparentConnector(), + ), + indicator, + Flexible( + flex: ((1 - indicatorFlex) * kFlexMultiplier).toInt(), + child: const TransparentConnector(), + ), + ]; + + switch (direction) { + case Axis.vertical: + positionedIndicator = Column( + mainAxisSize: MainAxisSize.min, + children: positionedIndicatorItems, + ); + break; + case Axis.horizontal: + positionedIndicator = Row( + mainAxisSize: MainAxisSize.min, + children: positionedIndicatorItems, + ); + break; + } + + result = Stack( + alignment: Alignment.center, + children: [ + line, + positionedIndicator, + ], + ); + } else { + result = line; + } + + if (TimelineTheme.of(context).direction != direction) { + result = TimelineTheme( + data: TimelineTheme.of(context).copyWith( + direction: direction, + ), + child: result, + ); + } + + return result; + } +} diff --git a/packages/deriv_ui/lib/components/timeline/src/timeline_theme.dart b/packages/deriv_ui/lib/components/timeline/src/timeline_theme.dart new file mode 100644 index 000000000..a1c116fd6 --- /dev/null +++ b/packages/deriv_ui/lib/components/timeline/src/timeline_theme.dart @@ -0,0 +1,373 @@ +import 'dart:ui'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; +import 'connector_theme.dart'; +import 'indicator_theme.dart'; +import 'timelines.dart'; + +/// Applies a theme to descendant timeline widgets. +/// +/// A theme describes the colors and typographic choices of an application. +/// +/// Descendant widgets obtain the current theme's [TimelineThemeData] object +/// using [TimelineTheme.of]. When a widget uses [TimelineTheme.of], it is +/// automatically rebuilt if the theme later changes, so that the changes can be +/// applied. +/// +/// See also: +/// +/// * [TimelineThemeData], which describes the actual configuration of a theme. +class TimelineTheme extends StatelessWidget { + /// Applies the given theme [data] to [child]. + /// + /// The [data] and [child] arguments must not be null. + const TimelineTheme({ + required this.data, + required this.child, + Key? key, + }) : super(key: key); + + /// Specifies the direction for descendant widgets. + final TimelineThemeData data; + + /// The widget below this widget in the tree. + /// + /// {@macro flutter.widgets.child} + final Widget child; + + static final TimelineThemeData _kFallbackTheme = TimelineThemeData.fallback(); + + /// The data from the closest [TimelineTheme] instance that encloses the given + /// context. + /// + /// Defaults to [ThemeData.fallback] if there is no [Theme] in the given + /// build context. + /// + /// When the [TimelineTheme] is actually created in the same `build` function + /// (possibly indirectly, e.g. as part of a [Timeline]), the `context` + /// argument to the `build` function can't be used to find the [TimelineTheme] + /// (since it's "above" the widget being returned). In such cases, the + /// following technique with a [Builder] can be used to provide a new scope + /// with a [BuildContext] that is "under" the [TimelineTheme]: + /// + /// ```dart + /// @override + /// Widget build(BuildContext context) { + /// // TODO: replace to Timeline + /// return TimelineTheme( + /// data: TimelineThemeData.vertical(), + /// child: Builder( + /// // Create an inner BuildContext so that we can refer to the Theme with TimelineTheme.of(). + /// builder: (BuildContext context) { + /// return Center( + /// child: TimelineNode( + /// direction: TimelineTheme.of(context).direction, + /// child: Text('Example'), + /// ), + /// ); + /// }, + /// ), + /// ); + /// } + /// ``` + static TimelineThemeData of(BuildContext context) { + final _InheritedTheme? inheritedTheme = + context.dependOnInheritedWidgetOfExactType<_InheritedTheme>(); + return inheritedTheme?.theme.data ?? _kFallbackTheme; + } + + @override + Widget build(BuildContext context) => _InheritedTheme( + theme: this, + child: IndicatorTheme( + data: data.indicatorTheme, + child: child, + ), + ); + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties.add( + DiagnosticsProperty('data', data, showName: false)); + } +} + +class _InheritedTheme extends InheritedTheme { + const _InheritedTheme({ + required this.theme, + required Widget child, + Key? key, + }) : super(key: key, child: child); + + final TimelineTheme theme; + + @override + Widget wrap(BuildContext context, Widget child) { + final _InheritedTheme? ancestorTheme = + context.findAncestorWidgetOfExactType<_InheritedTheme>(); + return identical(this, ancestorTheme) + ? child + : TimelineTheme(data: theme.data, child: child); + } + + @override + bool updateShouldNotify(_InheritedTheme old) => theme.data != old.theme.data; +} + +/// Defines the configuration of the overall visual [TimelineTheme] for a +/// [Timeline] or a widget subtree within the app. +/// +/// The [Timeline] theme property can be used to configure the appearance of the +/// entire timeline. Widget subtree's within an timeline can override the +/// timeline's theme by including a [TimelineTheme] widget at the top of the +/// subtree. +/// +/// Widgets whose appearance should align with the overall theme can obtain the +/// current theme's configuration with [TimelineTheme.of]. +/// +/// The static [TimelineTheme.of] method finds the [TimelineThemeData] value +/// specified for the nearest [BuildContext] ancestor. This lookup is +/// inexpensive, essentially just a single HashMap access. It can sometimes be a +/// little confusing because [TimelineTheme.of] can not see a [TimelineTheme] +/// widget that is defined in the current build method's context. To overcome +/// that, create a new custom widget for the subtree that appears below the new +/// [TimelineTheme], or insert a widget that creates a new BuildContext, like +/// [Builder]. +/// +/// {@tool snippet} +/// In this example, the [Container] widget uses [Theme.of] to retrieve the +/// color from the theme's [color] to draw an amber square. +/// The [Builder] widget separates the parent theme's [BuildContext] from the +/// child's [BuildContext]. +/// +/// ![](https://flutter.github.io/assets-for-api-docs/assets/material/theme_data.png) +/// +/// ```dart +/// TimelineTheme( +/// data: TimelineThemeData( +/// color: Colors.red, +/// ), +/// child: Builder( +/// builder: (BuildContext context) { +/// return Container( +/// width: 100, +/// height: 100, +/// color: TimelineTheme.of(context).color, +/// ); +/// }, +/// ), +/// ) +/// ``` +/// {@end-tool} +/// +/// {@tool snippet} +@immutable +class TimelineThemeData with Diagnosticable { + /// Create a [TimelineThemeData] that's used to configure a [TimelineTheme]. + /// + /// See also: + /// + /// * [TimelineThemeData.vertical], which creates a vertical direction + /// TimelineThemeData. + /// * [TimelineThemeData.horizontal], which creates a horizontal direction + /// TimelineThemeData. + factory TimelineThemeData({ + Axis? direction, + Color? color, + double? nodePosition, + bool? nodeItemOverlap, + double? indicatorPosition, + IndicatorThemeData? indicatorTheme, + ConnectorThemeData? connectorTheme, + }) { + direction ??= Axis.vertical; + color ??= Colors + .blue; // TODO: Need to change the default color to the theme color? + nodePosition ??= 0.5; + nodeItemOverlap ??= false; + indicatorPosition ??= 0.5; + indicatorTheme ??= const IndicatorThemeData(); + connectorTheme ??= const ConnectorThemeData(); + return TimelineThemeData.raw( + direction: direction, + color: color, + nodePosition: nodePosition, + nodeItemOverlap: nodeItemOverlap, + indicatorPosition: indicatorPosition, + indicatorTheme: indicatorTheme, + connectorTheme: connectorTheme, + ); + } + + /// The default direction theme. Same as [TimelineThemeData.vertical]. + /// + /// This is used by [TimelineTheme.of] when no theme has been specified. + factory TimelineThemeData.fallback() => TimelineThemeData.vertical(); + + /// Create a [TimelineThemeData] given a set of exact values. All the values + /// must be specified. They all must also be non-null. + /// + /// This will rarely be used directly. It is used by [lerp] to create + /// intermediate themes based on two themes created with the + /// [TimelineThemeData] constructor. + const TimelineThemeData.raw({ + required this.direction, + required this.color, + required this.nodePosition, + required this.nodeItemOverlap, + required this.indicatorPosition, + required this.indicatorTheme, + required this.connectorTheme, + }); + + /// A default vertical theme. + factory TimelineThemeData.vertical() => TimelineThemeData( + direction: Axis.vertical, + ); + + /// A default horizontal theme. + factory TimelineThemeData.horizontal() => TimelineThemeData( + direction: Axis.horizontal, + ); + + /// {@macro timelines.direction} + final Axis direction; + + /// The color for major parts of the timeline (indicator, connector, etc) + final Color color; + + /// The position for [TimelineNode] in [TimelineTile]. + /// + /// Defaults to 0.5. + final double nodePosition; + + /// Determine whether each connectors and indicator will overlap in + /// [TimelineNode]. + /// + /// When each connectors overlap, they are drawn from the center offset of the + /// indicator. + final bool nodeItemOverlap; + + /// The position for indicator in [TimelineNode]. + /// + /// Defaults to 0.5. + final double indicatorPosition; + + /// A theme for customizing the appearance and layout of + /// [ThemedIndicatorComponent] widgets. + final IndicatorThemeData indicatorTheme; + + /// A theme for customizing the appearance and layout of + /// [ThemedConnectorComponent] widgets. + final ConnectorThemeData connectorTheme; + + /// Creates a copy of this theme but with the given fields replaced with the + /// new values. + TimelineThemeData copyWith({ + Axis? direction, + Color? color, + double? nodePosition, + bool? nodeItemOverlap, + double? indicatorPosition, + IndicatorThemeData? indicatorTheme, + ConnectorThemeData? connectorTheme, + }) => + TimelineThemeData.raw( + direction: direction ?? this.direction, + color: color ?? this.color, + nodePosition: nodePosition ?? this.nodePosition, + nodeItemOverlap: nodeItemOverlap ?? this.nodeItemOverlap, + indicatorPosition: indicatorPosition ?? this.indicatorPosition, + indicatorTheme: indicatorTheme ?? this.indicatorTheme, + connectorTheme: connectorTheme ?? this.connectorTheme, + ); + + /// Linearly interpolate between two themes. + /// + /// The arguments must not be null. + /// + /// {@macro dart.ui.shadow.lerp} + static TimelineThemeData lerp( + TimelineThemeData a, TimelineThemeData b, double t) => + // Warning: make sure these properties are in the exact same order as in + // hashValues() and in the raw constructor and in the order of fields in + // the class and in the lerp() method. + TimelineThemeData.raw( + direction: t < 0.5 ? a.direction : b.direction, + color: Color.lerp(a.color, b.color, t)!, + nodePosition: lerpDouble(a.nodePosition, b.nodePosition, t)!, + nodeItemOverlap: t < 0.5 ? a.nodeItemOverlap : b.nodeItemOverlap, + indicatorPosition: + lerpDouble(a.indicatorPosition, b.indicatorPosition, t)!, + indicatorTheme: + IndicatorThemeData.lerp(a.indicatorTheme, b.indicatorTheme, t), + connectorTheme: + ConnectorThemeData.lerp(a.connectorTheme, b.connectorTheme, t), + ); + + @override + bool operator ==(Object other) { + if (other.runtimeType != runtimeType) { + return false; + } + // Warning: make sure these properties are in the exact same order as in + // hashValues() and in the raw constructor and in the order of fields in + // the class and in the lerp() method. + return other is TimelineThemeData && + other.direction == direction && + other.color == color && + other.nodePosition == nodePosition && + other.nodeItemOverlap == nodeItemOverlap && + other.indicatorPosition == indicatorPosition && + other.indicatorTheme == indicatorTheme && + other.connectorTheme == connectorTheme; + } + + @override + int get hashCode { + // Warning: For the sanity of the reader, please make sure these properties + // are in the exact same order as in operator == and in the raw constructor + // and in the order of fields in the class and in the lerp() method. + final List values = [ + direction, + color, + nodePosition, + nodeItemOverlap, + indicatorPosition, + indicatorTheme, + connectorTheme, + ]; + return Object.hashAll(values); + } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + final TimelineThemeData defaultData = TimelineThemeData.fallback(); + properties + ..add(DiagnosticsProperty('direction', direction, + defaultValue: defaultData.direction, level: DiagnosticLevel.debug)) + ..add(ColorProperty('color', color, + defaultValue: defaultData.color, level: DiagnosticLevel.debug)) + ..add(DoubleProperty('nodePosition', nodePosition, + defaultValue: defaultData.nodePosition, level: DiagnosticLevel.debug)) + ..add(FlagProperty('nodeItemOverlap', + value: nodeItemOverlap, ifTrue: 'overlap connector and indicator')) + ..add(DoubleProperty('indicatorPosition', indicatorPosition, + defaultValue: defaultData.indicatorPosition, + level: DiagnosticLevel.debug)) + ..add(DiagnosticsProperty( + 'indicatorTheme', + indicatorTheme, + defaultValue: defaultData.indicatorTheme, + level: DiagnosticLevel.debug, + )) + ..add(DiagnosticsProperty( + 'connectorTheme', + connectorTheme, + defaultValue: defaultData.connectorTheme, + level: DiagnosticLevel.debug, + )); + } +} diff --git a/packages/deriv_ui/lib/components/timeline/src/timeline_tile.dart b/packages/deriv_ui/lib/components/timeline/src/timeline_tile.dart new file mode 100644 index 000000000..9884f80b3 --- /dev/null +++ b/packages/deriv_ui/lib/components/timeline/src/timeline_tile.dart @@ -0,0 +1,215 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; +import 'indicator_theme.dart'; +import 'timeline_node.dart'; +import 'timeline_theme.dart'; +import 'util.dart'; + +/// Align the timeline node within the timeline tile. +enum TimelineNodeAlign { + /// Align [TimelineTile.node] to start side. + start, + + /// Align [TimelineTile.node] to end side. + end, + + /// Align according to the [TimelineTile.nodePosition]. + basic, +} + +/// A widget that displays timeline node and two contents. +/// +/// The [contents] are displayed on the end side, and the [oppositeContents] are +/// displayed on the start side. +/// The [node] is displayed between the two. +class TimelineTile extends StatelessWidget { + const TimelineTile({ + required this.node, + Key? key, + this.direction, + this.nodeAlign = TimelineNodeAlign.basic, + this.nodePosition, + this.contents, + this.oppositeContents, + this.mainAxisExtent, + this.crossAxisExtent, + }) : assert( + nodeAlign == TimelineNodeAlign.basic || + (nodeAlign != TimelineNodeAlign.basic && nodePosition == null), + 'Cannot provide both a nodeAlign and a nodePosition', + ), + assert(nodePosition == null || nodePosition >= 0), + super(key: key); + + /// {@template timelines.direction} + /// The axis along which the timeline scrolls. + /// {@endtemplate} + final Axis? direction; + + /// A widget that displays indicator and two connectors. + final Widget node; + + /// Align the [node] within the timeline tile. + /// + /// If try to use indicators with different sizes in each timeline tile, the + /// timeline node may be broken. + /// This can be prevented by set [IndicatorThemeData.size] to an appropriate + /// size. + /// + /// If [nodeAlign] is not [TimelineNodeAlign.basic], then [nodePosition] is + /// ignored. + final TimelineNodeAlign nodeAlign; + + /// A position of [node] inside both two contents. + /// + /// {@macro timelines.node.position} + final double? nodePosition; + + /// The contents to display inside the timeline tile. + final Widget? contents; + + /// The contents to display on the opposite side of the [contents]. + final Widget? oppositeContents; + + /// The extent of the child in the scrolling axis. + /// If the scroll axis is vertical, this extent is the child's height. If the + /// scroll axis is horizontal, this extent is the child's width. + /// + /// If non-null, forces the tile to have the given extent in the scroll + /// direction. + /// + /// Specifying an [mainAxisExtent] is more efficient than letting the tile + /// determine their own extent because the because it don't use the Intrinsic + /// widget([IntrinsicHeight]/[IntrinsicWidth]) when building. + final double? mainAxisExtent; + + /// The extent of the child in the non-scrolling axis. + /// + /// If the scroll axis is vertical, this extent is the child's width. If the + /// scroll axis is horizontal, this extent is the child's height. + final double? crossAxisExtent; + + double _getEffectiveNodePosition(BuildContext context) { + if (nodeAlign == TimelineNodeAlign.start) { + return 0; + } + if (nodeAlign == TimelineNodeAlign.end) { + return 1; + } + double? nodePosition = this.nodePosition; + return nodePosition ??= (node is TimelineTileNode) + ? (node as TimelineTileNode).getEffectivePosition(context) + : TimelineTheme.of(context).nodePosition; + } + + @override + Widget build(BuildContext context) { + // TODO: reduce direction check + final Axis direction = + this.direction ?? TimelineTheme.of(context).direction; + final double nodeFlex = + _getEffectiveNodePosition(context) * kFlexMultiplier; + + final double minNodeExtent = + TimelineTheme.of(context).indicatorTheme.size ?? 0.0; + final List items = [ + if (nodeFlex > 0) + Expanded( + flex: nodeFlex.toInt(), + child: Align( + alignment: direction == Axis.vertical + ? AlignmentDirectional.centerEnd + : Alignment.bottomCenter, + child: oppositeContents ?? const SizedBox.shrink(), + ), + ), + ConstrainedBox( + constraints: BoxConstraints( + minWidth: direction == Axis.vertical ? minNodeExtent : 0.0, + minHeight: direction == Axis.vertical ? 0.0 : minNodeExtent, + ), + child: node, + ), + if (nodeFlex < kFlexMultiplier) + Expanded( + flex: (kFlexMultiplier - nodeFlex).toInt(), + child: Align( + alignment: direction == Axis.vertical + ? AlignmentDirectional.centerStart + : Alignment.topCenter, + child: contents ?? const SizedBox.shrink(), + ), + ), + ]; + + Widget result; + switch (direction) { + case Axis.vertical: + result = Row( + mainAxisAlignment: MainAxisAlignment.center, + children: items, + ); + + if (mainAxisExtent != null) { + result = SizedBox( + width: crossAxisExtent, + height: mainAxisExtent, + child: result, + ); + } else { + result = IntrinsicHeight( + child: result, + ); + + if (crossAxisExtent != null) { + result = SizedBox( + width: crossAxisExtent, + child: result, + ); + } + } + break; + case Axis.horizontal: + result = Column( + mainAxisAlignment: MainAxisAlignment.center, + children: items, + ); + if (mainAxisExtent != null) { + result = SizedBox( + width: mainAxisExtent, + height: crossAxisExtent, + child: result, + ); + } else { + result = IntrinsicWidth( + child: result, + ); + + if (crossAxisExtent != null) { + result = SizedBox( + height: crossAxisExtent, + child: result, + ); + } + } + break; + default: + throw ArgumentError.value(direction, '$direction is invalid.'); + } + + result = Align( + child: result, + ); + + if (TimelineTheme.of(context).direction != direction) { + result = TimelineTheme( + data: TimelineTheme.of(context).copyWith( + direction: direction, + ), + child: result, + ); + } + + return result; + } +} diff --git a/packages/deriv_ui/lib/components/timeline/src/timeline_tile_builder.dart b/packages/deriv_ui/lib/components/timeline/src/timeline_tile_builder.dart new file mode 100644 index 000000000..d357e7e13 --- /dev/null +++ b/packages/deriv_ui/lib/components/timeline/src/timeline_tile_builder.dart @@ -0,0 +1,545 @@ +import 'package:flutter/material.dart'; +import 'connectors.dart'; +import 'indicators.dart'; +import 'timeline_node.dart'; +import 'timeline_theme.dart'; +import 'timeline_tile.dart'; + +/// How a contents displayed be into timeline. +/// +/// See also: +/// * [TimelineTileBuilder.fromStyle] +enum ContentsAlign { + /// The contents aligned end of timeline. And the opposite contents aligned + /// start of timeline. + /// + /// Example: + /// ``` + /// opposite contents | contents + /// opposite contents | contents + /// opposite contents | contents + /// ``` + basic, + + /// The contents aligned start of timeline. And the opposite contents aligned + /// end of timeline. + /// + /// Example: + /// + /// ``` + /// contents | opposite contents + /// contents | opposite contents + /// contents | opposite contents + /// ``` + reverse, + + /// The contents and opposite contents displayed alternating. + /// + /// Example: + /// ``` + /// contents | opposite contents + /// opposite contents | contents + /// contents | opposite contents + /// opposite contents | contents + /// contents | opposite contents + /// ``` + alternating, +} + +/// An enum that representing the direction the connector is connected through +/// the builder. +/// +/// See also: +/// +/// * [TimelineTileBuilder.connected], which is how the builder uses this enum +/// to connect each connector. +/// * [TimelineTileBuilder.connectedFromStyle], which is how the builder uses +/// this enum to connect each connector. +enum ConnectionDirection { before, after } + +/// An enum that representing the connector type in [TimelineNode]. +/// +/// For example, if the timeline direction is Axis.horizontal and the text +/// direction is LTR: +/// ``` +/// start end +/// ---- O ---- +/// ``` +/// See also: +/// +/// * [ConnectedConnectorBuilder], which is use this. +enum ConnectorType { start, end } + +/// An enum that determines the style of indicator in timeline tile builder. +/// +/// TODO: replace with class to support parameters +/// +/// See also: +/// +/// * [TimelineTileBuilder.fromStyle], which is use this. +/// * [TimelineTileBuilder.connectedFromStyle], which is use this. +enum IndicatorStyle { + /// Draw dot indicator. + dot, + + /// Draw outlined dot indicator. + outlined, + + /// Draw container indicator. TODO: need child to builds... + container, + + /// Draw transparent indicator. (invisible indicator) + transparent, +} + +/// Types of connectors displayed into timeline +/// +/// See also: +/// * [TimelineTileBuilder.fromStyle]. +enum ConnectorStyle { + /// Draw solid line connector. + solidLine, + + /// Draw dashed line connector. + dashedLine, + + /// Draw transparent connector. (invisible connector) + transparent, +} + +/// Signature for a function that creates a connected connector widget for a +/// given index and type, e.g., in a timeline tile builder. +typedef ConnectedConnectorBuilder = Widget? Function( + BuildContext context, int index, ConnectorType type); + +/// Signature for a function that creates a typed value for a given index, e.g., +/// in a timeline tile builder. +/// +/// Used by [TimelineTileBuilder] that use lazily-generated typed value. +typedef IndexedValueBuilder = T Function(BuildContext context, int index); + +/// WARNING: The interface of this class is not yet clear. It may change +/// frequently. +/// +/// A delegate that supplies [TimelineTile] for timeline using a builder +/// callback. +class TimelineTileBuilder { + /// Create a connected tile builder, which builds tiles using each component + /// builder. + /// + /// Check below for how to build: + /// + /// Original build system: + /// + /// ``` + /// | <-- builder(0) + /// O contents1 <-- builder(0) + /// | <-- builder(0) + /// | <-- builder(1) + /// O contents2 <-- builder(1) + /// | <-- builder(1) + /// ``` + /// + /// Connected build system(before): + /// + /// ``` + /// | <-- draw if provided [firstConnectorBuilder] + /// O contents1 <-- builder(0) + /// | <-- builder(1) + /// | <-- builder(1) + /// O contents2 <-- builder(1) + /// | <-- builder(2) + /// | <-- builder(2) + /// O <-- builder(2) + /// | <-- builder(3) + /// .. + /// | <-- draw if provided [lastConnectorBuilder] + /// ``` + /// + /// + /// Connected build system(after): + /// + /// ``` + /// | <-- draw if provided [firstConnectorBuilder] + /// O contents1 <-- builder(0) + /// | <-- builder(0) + /// | <-- builder(0) + /// O contents2 <-- builder(1) + /// | <-- builder(1) + /// | <-- builder(1) + /// O <-- builder(2) + /// | <-- builder(2) + /// .. + /// | <-- draw if provided [lastConnectorBuilder] + /// ``` + /// + /// The above example can be made similar by just set the + /// [TimelineNode.indicatorPosition] as 0 or 1, but the contents position may + /// be limited. + /// + /// {@macro timelines.itemExtentBuilder} + /// + /// See also: + /// + /// * [TimelineTileBuilder.connectedFromStyle], which builds connected tiles + /// from style. + factory TimelineTileBuilder.connected({ + required int itemCount, + ContentsAlign contentsAlign = ContentsAlign.basic, + ConnectionDirection connectionDirection = ConnectionDirection.after, + NullableIndexedWidgetBuilder? contentsBuilder, + NullableIndexedWidgetBuilder? oppositeContentsBuilder, + NullableIndexedWidgetBuilder? indicatorBuilder, + ConnectedConnectorBuilder? connectorBuilder, + WidgetBuilder? firstConnectorBuilder, + WidgetBuilder? lastConnectorBuilder, + double? itemExtent, + IndexedValueBuilder? itemExtentBuilder, + IndexedValueBuilder? nodePositionBuilder, + IndexedValueBuilder? indicatorPositionBuilder, + bool addAutomaticKeepAlives = true, + bool addRepaintBoundaries = true, + bool addSemanticIndexes = true, + }) => + TimelineTileBuilder( + itemCount: itemCount, + contentsAlign: contentsAlign, + contentsBuilder: contentsBuilder, + oppositeContentsBuilder: oppositeContentsBuilder, + indicatorBuilder: indicatorBuilder, + startConnectorBuilder: _createConnectedStartConnectorBuilder( + connectionDirection: connectionDirection, + firstConnectorBuilder: firstConnectorBuilder, + connectorBuilder: connectorBuilder, + ), + endConnectorBuilder: _createConnectedEndConnectorBuilder( + connectionDirection: connectionDirection, + lastConnectorBuilder: lastConnectorBuilder, + connectorBuilder: connectorBuilder, + itemCount: itemCount, + ), + itemExtent: itemExtent, + itemExtentBuilder: itemExtentBuilder, + nodePositionBuilder: nodePositionBuilder, + indicatorPositionBuilder: indicatorPositionBuilder, + ); + + /// Create a connected tile builder, which builds tiles using each style. + /// + /// {@macro timelines.itemExtentBuilder} + /// + /// See also: + /// + /// * [TimelineTileBuilder.connected], which builds connected tiles. + /// * [TimelineTileBuilder.fromStyle], which builds tiles from style. + factory TimelineTileBuilder.connectedFromStyle({ + @required required int itemCount, + ConnectionDirection connectionDirection = ConnectionDirection.after, + NullableIndexedWidgetBuilder? contentsBuilder, + NullableIndexedWidgetBuilder? oppositeContentsBuilder, + ContentsAlign contentsAlign = ContentsAlign.basic, + IndexedValueBuilder? indicatorStyleBuilder, + IndexedValueBuilder? connectorStyleBuilder, + ConnectorStyle firstConnectorStyle = ConnectorStyle.solidLine, + ConnectorStyle lastConnectorStyle = ConnectorStyle.solidLine, + double? itemExtent, + IndexedValueBuilder? itemExtentBuilder, + IndexedValueBuilder? nodePositionBuilder, + IndexedValueBuilder? indicatorPositionBuilder, + }) => + TimelineTileBuilder( + itemCount: itemCount, + contentsAlign: contentsAlign, + contentsBuilder: contentsBuilder, + oppositeContentsBuilder: oppositeContentsBuilder, + indicatorBuilder: (BuildContext context, int index) => + _createStyledIndicatorBuilder( + indicatorStyleBuilder?.call(context, index))(context), + startConnectorBuilder: _createConnectedStartConnectorBuilder( + connectionDirection: connectionDirection, + firstConnectorBuilder: (BuildContext context) => + _createStyledConnectorBuilder(firstConnectorStyle)(context), + connectorBuilder: (BuildContext context, int index, __) => + _createStyledConnectorBuilder( + connectorStyleBuilder?.call(context, index))(context), + ), + endConnectorBuilder: _createConnectedEndConnectorBuilder( + connectionDirection: connectionDirection, + lastConnectorBuilder: (BuildContext context) => + _createStyledConnectorBuilder(lastConnectorStyle)(context), + connectorBuilder: (BuildContext context, int index, __) => + _createStyledConnectorBuilder( + connectorStyleBuilder?.call(context, index))(context), + itemCount: itemCount, + ), + itemExtent: itemExtent, + itemExtentBuilder: itemExtentBuilder, + nodePositionBuilder: nodePositionBuilder, + indicatorPositionBuilder: indicatorPositionBuilder, + ); + + /// Create a tile builder, which builds tiles using each style. + /// + /// {@macro timelines.itemExtentBuilder} + /// TODO: style each index like fromStyleBuilder + /// + /// See also: + /// + /// * [IndicatorStyle] + /// * [ConnectorStyle] + /// * [ContentsAlign] + factory TimelineTileBuilder.fromStyle({ + required int itemCount, + NullableIndexedWidgetBuilder? contentsBuilder, + NullableIndexedWidgetBuilder? oppositeContentsBuilder, + ContentsAlign contentsAlign = ContentsAlign.basic, + IndicatorStyle indicatorStyle = IndicatorStyle.dot, + ConnectorStyle connectorStyle = ConnectorStyle.solidLine, + ConnectorStyle endConnectorStyle = ConnectorStyle.solidLine, + double? itemExtent, + IndexedValueBuilder? itemExtentBuilder, + IndexedValueBuilder? nodePositionBuilder, + IndexedValueBuilder? indicatorPositionBuilder, + bool addAutomaticKeepAlives = true, + bool addRepaintBoundaries = true, + bool addSemanticIndexes = true, + }) => + TimelineTileBuilder( + itemCount: itemCount, + contentsAlign: contentsAlign, + contentsBuilder: contentsBuilder, + oppositeContentsBuilder: oppositeContentsBuilder, + indicatorBuilder: (BuildContext context, int index) => + _createStyledIndicatorBuilder(indicatorStyle)(context), + startConnectorBuilder: (BuildContext context, _) => + _createStyledConnectorBuilder(connectorStyle)(context), + endConnectorBuilder: (BuildContext context, _) => + _createStyledConnectorBuilder(connectorStyle)(context), + itemExtent: itemExtent, + itemExtentBuilder: itemExtentBuilder, + nodePositionBuilder: nodePositionBuilder, + indicatorPositionBuilder: indicatorPositionBuilder, + ); + + /// Create a tile builder, which builds tiles using each component builder. + /// + /// {@template timelines.itemExtentBuilder} + /// If each item has a fixed extent, use [itemExtent], and if each item has a + /// different extent, use [itemExtentBuilder]. + /// {@endtemplate} + /// + /// TODO: need refactoring, is it has many builders...? + factory TimelineTileBuilder({ + required int itemCount, + ContentsAlign contentsAlign = ContentsAlign.basic, + NullableIndexedWidgetBuilder? contentsBuilder, + NullableIndexedWidgetBuilder? oppositeContentsBuilder, + NullableIndexedWidgetBuilder? indicatorBuilder, + NullableIndexedWidgetBuilder? startConnectorBuilder, + NullableIndexedWidgetBuilder? endConnectorBuilder, + double? itemExtent, + IndexedValueBuilder? itemExtentBuilder, + IndexedValueBuilder? nodePositionBuilder, + IndexedValueBuilder? nodeItemOverlapBuilder, + IndexedValueBuilder? indicatorPositionBuilder, + IndexedValueBuilder? themeBuilder, + }) { + assert( + itemExtent == null || itemExtentBuilder == null, + 'Cannot provide both a itemExtent and a itemExtentBuilder.', + ); + + final NullableIndexedWidgetBuilder effectiveContentsBuilder = + _createAlignedContentsBuilder( + align: contentsAlign, + contentsBuilder: contentsBuilder, + oppositeContentsBuilder: oppositeContentsBuilder, + ); + final NullableIndexedWidgetBuilder effectiveOppositeContentsBuilder = + _createAlignedContentsBuilder( + align: contentsAlign, + contentsBuilder: oppositeContentsBuilder, + oppositeContentsBuilder: contentsBuilder, + ); + + return TimelineTileBuilder._( + (BuildContext context, int index) { + final TimelineTile tile = TimelineTile( + mainAxisExtent: itemExtent ?? itemExtentBuilder?.call(context, index), + node: TimelineNode( + indicator: indicatorBuilder?.call(context, index) ?? + Indicator.transparent(), + startConnector: startConnectorBuilder?.call(context, index), + endConnector: endConnectorBuilder?.call(context, index), + overlap: nodeItemOverlapBuilder?.call(context, index), + position: nodePositionBuilder?.call(context, index), + indicatorPosition: indicatorPositionBuilder?.call(context, index), + ), + contents: effectiveContentsBuilder(context, index), + oppositeContents: effectiveOppositeContentsBuilder(context, index), + ); + + final TimelineThemeData? theme = themeBuilder?.call(context, index); + if (theme != null) { + return TimelineTheme( + data: theme, + child: tile, + ); + } else { + return tile; + } + }, + itemCount: itemCount, + ); + } + + const TimelineTileBuilder._( + this._builder, { + required this.itemCount, + }) : assert(itemCount >= 0); + + final IndexedWidgetBuilder _builder; + final int itemCount; + + Widget build(BuildContext context, int index) => _builder(context, index); + + static NullableIndexedWidgetBuilder _createConnectedStartConnectorBuilder({ + ConnectionDirection? connectionDirection, + WidgetBuilder? firstConnectorBuilder, + ConnectedConnectorBuilder? connectorBuilder, + }) => + (BuildContext context, int index) { + if (index == 0) { + if (firstConnectorBuilder != null) { + return firstConnectorBuilder.call(context); + } else { + return null; + } + } + + if (connectionDirection == ConnectionDirection.before) { + return connectorBuilder?.call(context, index, ConnectorType.start); + } else { + return connectorBuilder?.call( + context, index - 1, ConnectorType.start); + } + }; + + static NullableIndexedWidgetBuilder _createConnectedEndConnectorBuilder({ + required int itemCount, + ConnectionDirection? connectionDirection, + WidgetBuilder? lastConnectorBuilder, + ConnectedConnectorBuilder? connectorBuilder, + }) => + (BuildContext context, int index) { + if (index == itemCount - 1) { + if (lastConnectorBuilder != null) { + return lastConnectorBuilder.call(context); + } else { + return null; + } + } + + if (connectionDirection == ConnectionDirection.before) { + return connectorBuilder?.call(context, index + 1, ConnectorType.end); + } else { + return connectorBuilder?.call(context, index, ConnectorType.end); + } + }; + + static NullableIndexedWidgetBuilder _createAlignedContentsBuilder({ + required ContentsAlign align, + NullableIndexedWidgetBuilder? contentsBuilder, + NullableIndexedWidgetBuilder? oppositeContentsBuilder, + }) => + (BuildContext context, int index) { + switch (align) { + case ContentsAlign.alternating: + if (index.isOdd) { + return oppositeContentsBuilder?.call(context, index); + } + + return contentsBuilder?.call(context, index); + case ContentsAlign.reverse: + return oppositeContentsBuilder?.call(context, index); + case ContentsAlign.basic: + default: + return contentsBuilder?.call(context, index); + } + }; + + static WidgetBuilder _createStyledIndicatorBuilder(IndicatorStyle? style) => + (_) { + switch (style) { + case IndicatorStyle.dot: + return Indicator.dot(); + case IndicatorStyle.outlined: + return Indicator.outlined(); + case IndicatorStyle.container: + return Indicator.widget(); + case IndicatorStyle.transparent: + default: + return Indicator.transparent(); + } + }; + + static WidgetBuilder _createStyledConnectorBuilder(ConnectorStyle? style) => + (_) { + switch (style) { + case ConnectorStyle.solidLine: + return Connector.solidLine(); + case ConnectorStyle.dashedLine: + return Connector.dashedLine(); + case ConnectorStyle.transparent: + default: + return Connector.transparent(); + } + }; +} + +int _kDefaultSemanticIndexCallback(Widget _, int localIndex) => localIndex; + +/// The widgets returned from the builder callback are automatically wrapped in +/// [AutomaticKeepAlive] widgets if [addAutomaticKeepAlives] is true +/// (the default) and in [RepaintBoundary] widgets if [addRepaintBoundaries] is +/// true (also the default). +/// +/// ## Accessibility +/// +/// The [CustomScrollView] requires that its semantic children are annotated +/// using [IndexedSemantics]. This is done by default in the delegate with the +/// `addSemanticIndexes` parameter set to true. +/// +/// If multiple delegates are used in a single scroll view, then the indexes +/// will not be correct by default. The `semanticIndexOffset` can be used to +/// offset the semantic indexes of each delegate so that the indexes are +/// monotonically increasing. For example, if a scroll view contains two +/// delegates where the first has 10 children contributing semantics, then the +/// second delegate should offset its children by 10. +/// +/// See also: +/// +/// * [IndexedSemantics], for an example of manually annotating child nodes +/// with semantic indexes. +class TimelineTileBuilderDelegate extends SliverChildBuilderDelegate { + TimelineTileBuilderDelegate( + NullableIndexedWidgetBuilder builder, { + ChildIndexGetter? findChildIndexCallback, + int? childCount, + bool addAutomaticKeepAlives = true, + bool addRepaintBoundaries = true, + bool addSemanticIndexes = true, + SemanticIndexCallback semanticIndexCallback = + _kDefaultSemanticIndexCallback, + int semanticIndexOffset = 0, + }) : super( + builder, + findChildIndexCallback: findChildIndexCallback, + childCount: childCount, + addAutomaticKeepAlives: addAutomaticKeepAlives, + addRepaintBoundaries: addRepaintBoundaries, + addSemanticIndexes: addSemanticIndexes, + semanticIndexCallback: semanticIndexCallback, + semanticIndexOffset: semanticIndexOffset, + ); +} diff --git a/packages/deriv_ui/lib/components/timeline/src/timelines.dart b/packages/deriv_ui/lib/components/timeline/src/timelines.dart new file mode 100644 index 000000000..fa9d61db0 --- /dev/null +++ b/packages/deriv_ui/lib/components/timeline/src/timelines.dart @@ -0,0 +1,483 @@ +import 'package:flutter/gestures.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; + +import 'timeline_theme.dart'; +import 'timeline_tile_builder.dart'; + +/// A scrollable timeline of widgets arranged linearly. +class Timeline extends BoxScrollView { + /// Creates a scrollable, linear array of widgets that are created on demand. + /// + /// This constructor is appropriate for list views with a large (or infinite) + /// number of children because the builder is called only for those children + /// that are actually visible. + /// + /// Providing a non-null `itemCount` improves the ability of the [Timeline] to + /// estimate the maximum scroll extent. + /// + /// The `itemBuilder` callback will be called only with indices greater than + /// or equal to zero and less than `itemCount`. + /// + /// The `itemBuilder` should always return a non-null widget, and actually + /// create the widget instances when called. + /// Avoid using a builder that returns a previously-constructed widget; if the + /// timeline view's children are created in advance, or all at once when the + /// [Timeline] itself is created, it is more efficient to use the [Timeline] + /// constructor. Even more efficient, however, is to create the instances on + /// demand using this constructor's `itemBuilder` callback. + /// + /// The `addAutomaticKeepAlives` argument corresponds to the + /// [SliverChildBuilderDelegate.addAutomaticKeepAlives] property. The + /// `addRepaintBoundaries` argument corresponds to the + /// [SliverChildBuilderDelegate.addRepaintBoundaries] property. The + /// `addSemanticIndexes` argument corresponds to the + /// [SliverChildBuilderDelegate.addSemanticIndexes] property. None + /// may be null. + /// + /// [Timeline.builder] by default does not support child reordering. If you + /// are planning to change child order at a + /// later time, consider using [Timeline] or [Timeline.custom]. + factory Timeline.tileBuilder({ + required TimelineTileBuilder builder, Key? key, + Axis? scrollDirection, + bool reverse = false, + ScrollController? controller, + bool? primary, + ScrollPhysics? physics, + bool shrinkWrap = false, + EdgeInsetsGeometry? padding, + // double itemExtent, TODO: fixedExtentTileBuilder? + double? cacheExtent, + int? semanticChildCount, + DragStartBehavior dragStartBehavior = DragStartBehavior.start, + ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = + ScrollViewKeyboardDismissBehavior.manual, + String? restorationId, + Clip clipBehavior = Clip.hardEdge, + TimelineThemeData? theme, + }) { + assert(builder.itemCount >= 0); + assert( + semanticChildCount == null || semanticChildCount <= builder.itemCount); + return Timeline.custom( + key: key, + childrenDelegate: SliverChildBuilderDelegate( + builder.build, + childCount: builder.itemCount, + // TODO: apply some fields if needed. + ), + scrollDirection: scrollDirection, + reverse: reverse, + controller: controller, + primary: primary, + physics: physics, + shrinkWrap: shrinkWrap, + padding: padding, + // itemExtent: itemExtent, + cacheExtent: cacheExtent, + semanticChildCount: semanticChildCount ?? builder.itemCount, + dragStartBehavior: dragStartBehavior, + keyboardDismissBehavior: keyboardDismissBehavior, + restorationId: restorationId, + clipBehavior: clipBehavior, + theme: theme, + ); + } + + /// Creates a scrollable, linear array of widgets from an explicit [List]. + /// + /// This constructor is appropriate for timeline views with a small number of + /// children because constructing the [List] requires doing work for every + /// child that could possibly be displayed in the timeline view instead of + /// just those children that are actually visible. + /// + /// It is usually more efficient to create children on demand using + /// [Timeline.builder] because it will create the widget children lazily as + /// necessary. + /// + /// The `addAutomaticKeepAlives` argument corresponds to the + /// [SliverChildListDelegate.addAutomaticKeepAlives] property. The + /// `addRepaintBoundaries` argument corresponds to the + /// [SliverChildListDelegate.addRepaintBoundaries] property. The + /// `addSemanticIndexes` argument corresponds to the + /// [SliverChildListDelegate.addSemanticIndexes] property. None may be null. + Timeline({ + Key? key, + Axis? scrollDirection, + bool reverse = false, + ScrollController? controller, + bool? primary, + ScrollPhysics? physics, + bool shrinkWrap = false, + EdgeInsetsGeometry? padding, + this.itemExtent, + bool addAutomaticKeepAlives = true, + bool addRepaintBoundaries = true, + bool addSemanticIndexes = true, + double? cacheExtent, + List children = const [], + int? semanticChildCount, + DragStartBehavior dragStartBehavior = DragStartBehavior.start, + ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = + ScrollViewKeyboardDismissBehavior.manual, + String? restorationId, + Clip clipBehavior = Clip.hardEdge, + this.theme, + }) : childrenDelegate = SliverChildListDelegate( + children, + addAutomaticKeepAlives: addAutomaticKeepAlives, + addRepaintBoundaries: addRepaintBoundaries, + addSemanticIndexes: addSemanticIndexes, + ), + assert(scrollDirection == null || theme == null, + 'Cannot provide both a scrollDirection and a theme.'), + super( + key: key, + scrollDirection: scrollDirection ?? theme?.direction ?? Axis.vertical, + reverse: reverse, + controller: controller, + primary: primary, + physics: physics, + shrinkWrap: shrinkWrap, + padding: padding, + cacheExtent: cacheExtent, + semanticChildCount: semanticChildCount ?? children.length, + dragStartBehavior: dragStartBehavior, + keyboardDismissBehavior: keyboardDismissBehavior, + restorationId: restorationId, + clipBehavior: clipBehavior, + ); + + /// Creates a scrollable, linear array of widgets that are created on demand. + /// + /// This constructor is appropriate for list views with a large (or infinite) + /// number of children because the builder is called only for those children + /// that are actually visible. + /// + /// Providing a non-null `itemCount` improves the ability of the [Timeline] to + /// estimate the maximum scroll extent. + /// + /// The `itemBuilder` callback will be called only with indices greater than + /// or equal to zero and less than `itemCount`. + /// + /// The `itemBuilder` should always return a non-null widget, and actually + /// create the widget instances when called. + /// Avoid using a builder that returns a previously-constructed widget; if the + /// timeline view's children are created in advance, or all at once when the + /// [Timeline] itself is created, it is more efficient to use the [Timeline] + /// constructor. Even more efficient, however, is to create the instances on + /// demand using this constructor's `itemBuilder` callback. + /// + /// The `addAutomaticKeepAlives` argument corresponds to the + /// [SliverChildBuilderDelegate.addAutomaticKeepAlives] property. The + /// `addRepaintBoundaries` argument corresponds to the + /// [SliverChildBuilderDelegate.addRepaintBoundaries] property. The + /// `addSemanticIndexes` argument corresponds to the + /// [SliverChildBuilderDelegate.addSemanticIndexes] property. None + /// may be null. + /// + /// [Timeline.builder] by default does not support child reordering. If you + /// are planning to change child order at a + /// later time, consider using [Timeline] or [Timeline.custom]. + Timeline.builder({ + required IndexedWidgetBuilder itemBuilder, required int itemCount, Key? key, + Axis? scrollDirection, + bool reverse = false, + ScrollController? controller, + bool? primary, + ScrollPhysics? physics, + bool shrinkWrap = false, + EdgeInsetsGeometry? padding, + this.itemExtent, + bool addAutomaticKeepAlives = true, + bool addRepaintBoundaries = true, + bool addSemanticIndexes = true, + double? cacheExtent, + int? semanticChildCount, + DragStartBehavior dragStartBehavior = DragStartBehavior.start, + ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = + ScrollViewKeyboardDismissBehavior.manual, + String? restorationId, + Clip clipBehavior = Clip.hardEdge, + this.theme, + }) : assert(itemCount >= 0), + assert(semanticChildCount == null || semanticChildCount <= itemCount), + assert(scrollDirection == null || theme == null, + 'Cannot provide both a scrollDirection and a theme.'), + childrenDelegate = SliverChildBuilderDelegate( + itemBuilder, + childCount: itemCount, + addAutomaticKeepAlives: addAutomaticKeepAlives, + addRepaintBoundaries: addRepaintBoundaries, + addSemanticIndexes: addSemanticIndexes, + ), + super( + key: key, + scrollDirection: scrollDirection ?? theme?.direction ?? Axis.vertical, + reverse: reverse, + controller: controller, + primary: primary, + physics: physics, + shrinkWrap: shrinkWrap, + padding: padding, + cacheExtent: cacheExtent, + semanticChildCount: semanticChildCount ?? itemCount, + dragStartBehavior: dragStartBehavior, + keyboardDismissBehavior: keyboardDismissBehavior, + restorationId: restorationId, + clipBehavior: clipBehavior, + ); + + /// Creates a scrollable, linear array of widgets with a custom child model. + /// + /// For example, a custom child model can control the algorithm used to + /// estimate the size of children that are not actually visible. + /// + /// See also: + /// + /// * This works similarly to [ListView.custom]. + Timeline.custom({ + required this.childrenDelegate, Key? key, + Axis? scrollDirection, + bool reverse = false, + ScrollController? controller, + bool? primary, + ScrollPhysics? physics, + bool shrinkWrap = false, + EdgeInsetsGeometry? padding, + this.itemExtent, + double? cacheExtent, + int? semanticChildCount, + DragStartBehavior dragStartBehavior = DragStartBehavior.start, + ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = + ScrollViewKeyboardDismissBehavior.manual, + String? restorationId, + Clip clipBehavior = Clip.hardEdge, + this.theme, + }) : assert(scrollDirection == null || theme == null, + 'Cannot provide both a scrollDirection and a theme.'), + super( + key: key, + scrollDirection: scrollDirection ?? theme?.direction ?? Axis.vertical, + reverse: reverse, + controller: controller, + primary: primary, + physics: physics, + shrinkWrap: shrinkWrap, + padding: padding, + cacheExtent: cacheExtent, + semanticChildCount: semanticChildCount, + dragStartBehavior: dragStartBehavior, + keyboardDismissBehavior: keyboardDismissBehavior, + restorationId: restorationId, + clipBehavior: clipBehavior, + ); + + /// If non-null, forces the children to have the given extent in the scroll + /// direction. + /// + /// Specifying an [itemExtent] is more efficient than letting the children + /// determine their own extent because the scrolling machinery can make use + /// of the foreknowledge of the children's extent to save work, for example + /// when the scroll position changes drastically. + final double? itemExtent; + + /// A delegate that provides the children for the [Timeline]. + /// + /// The [Timeline.custom] constructor lets you specify this delegate + /// explicitly. The [Timeline] and [Timeline.builder] constructors create a + /// [childrenDelegate] that wraps the given [List] and [IndexedWidgetBuilder], + /// respectively. + final SliverChildDelegate childrenDelegate; + + /// Default visual properties, like colors, size and spaces, for this + /// timeline's component widgets. + /// + /// The default value of this property is the value of + /// [TimelineThemeData.vertical()]. + final TimelineThemeData? theme; + + @override + Widget buildChildLayout(BuildContext context) { + Widget result; + if (itemExtent != null) { + result = SliverFixedExtentList( + delegate: childrenDelegate, + itemExtent: itemExtent!, + ); + } else { + result = SliverList(delegate: childrenDelegate); + } + + TimelineThemeData? theme; + if (this.theme != null) { + theme = this.theme; + } else if (scrollDirection != TimelineTheme.of(context).direction) { + theme = TimelineTheme.of(context).copyWith(direction: scrollDirection); + } + + if (theme != null) { + return TimelineTheme( + data: theme, + child: result, + ); + } else { + return result; + } + } +} + +/// A widget that displays its children in a one-dimensional array with +/// timeline theme. +class FixedTimeline extends StatelessWidget { + /// Creates a timeline flex layout. + factory FixedTimeline.tileBuilder({ + required TimelineTileBuilder builder, + TimelineThemeData? theme, + Axis? direction, + MainAxisSize mainAxisSize = MainAxisSize.max, + TextDirection? textDirection, + VerticalDirection verticalDirection = VerticalDirection.down, + Clip clipBehavior = Clip.none, + }) => + // TODO: how remove Builders? + FixedTimeline( + children: [ + for (int i = 0; i < builder.itemCount; i++) + Builder( + builder: (BuildContext context) => builder.build(context, i), + ), + ], + theme: theme, + direction: direction, + mainAxisSize: mainAxisSize, + textDirection: textDirection, + verticalDirection: verticalDirection, + clipBehavior: clipBehavior, + ); + + /// Creates a timeline flex layout. + /// + /// The [direction], [verticalDirection] arguments must not be null. + /// + /// The [textDirection] argument defaults to the ambient [Directionality], + /// if any. If there is no ambient directionality, and a text direction is + /// going to be necessary to decide which direction to lay the children in or + /// to disambiguate `start` or `end` values for the main or cross axis + /// directions, the [textDirection] must not be null. + const FixedTimeline({ + Key? key, + this.theme, + this.direction, + this.mainAxisSize = MainAxisSize.max, + this.textDirection, + this.verticalDirection = VerticalDirection.down, + this.clipBehavior = Clip.none, + this.children = const [], + }) : assert(direction == null || theme == null, + 'Cannot provide both a direction and a theme.'), + super(key: key); + + /// Default visual properties, like colors, size and spaces, for this + /// timeline's component widgets. + /// + /// The default value of this property is the value of + /// [TimelineThemeData.vertical()]. + final TimelineThemeData? theme; + + /// The direction to use as the main axis. + final Axis? direction; + + /// The widgets below this widget in the tree. + /// + /// If this list is going to be mutated, it is usually wise to put a [Key] on + /// each of the child widgets, so that the framework can match old + /// configurations to new configurations and maintain the underlying + /// render objects. + /// + /// See also: + /// + /// * [MultiChildRenderObjectWidget.children] + final List children; + + /// How much space should be occupied in the main axis. + /// + /// After allocating space to children, there might be some remaining free + /// space. This value controls whether to maximize or minimize the amount of + /// free space, subject to the incoming layout constraints. + /// + /// If some children have a non-zero flex factors (and none have a fit of + /// [FlexFit.loose]), they will expand to consume all the available space and + /// there will be no remaining free space to maximize or minimize, making this + /// value irrelevant to the final layout. + final MainAxisSize mainAxisSize; + + /// Determines the order to lay children out horizontally and how to interpret + /// `start` and `end` in the horizontal direction. + /// + /// Defaults to the ambient [Directionality]. + /// + /// If [textDirection] is [TextDirection.rtl], then the direction in which + /// text flows starts from right to left. Otherwise, if [textDirection] is + /// [TextDirection.ltr], then the direction in which text flows starts from + /// left to right. + /// + /// If the [direction] is [Axis.horizontal], this controls the order in which + /// the children are positioned (left-to-right or right-to-left). + /// + /// If the [direction] is [Axis.horizontal], and there's more than one child, + /// then the [textDirection] (or the ambient [Directionality]) must not + /// be null. + final TextDirection? textDirection; + + /// Determines the order to lay children out vertically and how to interpret + /// `start` and `end` in the vertical direction. + /// + /// Defaults to [VerticalDirection.down]. + /// + /// If the [direction] is [Axis.vertical], there's more than one child, then + /// the [verticalDirection] must not be null. + final VerticalDirection verticalDirection; + + /// The content will be clipped (or not) according to this option. + /// + /// See the enum Clip for details of all possible options and their common + /// use cases. + /// + /// Defaults to [Clip.none]. + final Clip clipBehavior; + + @override + Widget build(BuildContext context) { + final Axis direction = + this.direction ?? this.theme?.direction ?? Axis.vertical; + + final Widget result = Flex( + direction: direction, + children: children, + mainAxisSize: mainAxisSize, + textDirection: textDirection, + verticalDirection: verticalDirection, + clipBehavior: clipBehavior, + ); + + TimelineThemeData? theme; + if (this.direction != null) { + if (direction != TimelineTheme.of(context).direction) { + theme = TimelineTheme.of(context).copyWith(direction: this.direction); + } + } else if (this.theme != null) { + theme = this.theme; + } + + if (theme != null) { + return TimelineTheme( + data: theme, + child: result, + ); + } else { + return result; + } + } +} diff --git a/packages/deriv_ui/lib/components/timeline/src/util.dart b/packages/deriv_ui/lib/components/timeline/src/util.dart new file mode 100644 index 000000000..e331f567a --- /dev/null +++ b/packages/deriv_ui/lib/components/timeline/src/util.dart @@ -0,0 +1,2 @@ + +const double kFlexMultiplier = 1000; diff --git a/packages/deriv_ui/lib/components/timeline/timelines.dart b/packages/deriv_ui/lib/components/timeline/timelines.dart new file mode 100644 index 000000000..1b65013cb --- /dev/null +++ b/packages/deriv_ui/lib/components/timeline/timelines.dart @@ -0,0 +1,12 @@ +/// Widgets that make it easy to implement the timeline UI component. +library timelines; + +export 'src/connector_theme.dart'; +export 'src/connectors.dart'; +export 'src/indicator_theme.dart'; +export 'src/indicators.dart'; +export 'src/timelines.dart'; +export 'src/timeline_node.dart'; +export 'src/timeline_theme.dart'; +export 'src/timeline_tile.dart'; +export 'src/timeline_tile_builder.dart'; diff --git a/packages/update_checker/example/lib/update_bloc_page.dart b/packages/update_checker/example/lib/update_bloc_page.dart index 55b0b079f..761cc61a6 100644 --- a/packages/update_checker/example/lib/update_bloc_page.dart +++ b/packages/update_checker/example/lib/update_bloc_page.dart @@ -10,7 +10,7 @@ class UpdateBlocPage extends StatefulWidget { class _UpdateBlocPageState extends State { final UpdateBloc updateBloc = - UpdateBloc(firebaseRepository: const FirebaseRemoteConfigRepository()); + UpdateBloc(firebaseRepository: FirebaseRemoteConfigRepository()); @override Widget build(BuildContext context) => Scaffold( diff --git a/packages/update_checker/example/lib/update_checker_page.dart b/packages/update_checker/example/lib/update_checker_page.dart index 1d54f4043..672a432a0 100644 --- a/packages/update_checker/example/lib/update_checker_page.dart +++ b/packages/update_checker/example/lib/update_checker_page.dart @@ -10,7 +10,7 @@ class UpdateCheckerPage extends StatelessWidget { ), body: Builder( builder: (BuildContext context) => UpdateChecker( - firebaseRepository: const FirebaseRemoteConfigRepository(), + firebaseRepository: FirebaseRemoteConfigRepository(), onNotAvailable: () => _showSnackBar( context, 'Update not available', From a0a6df21cbc6681b923ec3e060752de20ddad32b Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Tue, 16 Jul 2024 11:56:37 +0800 Subject: [PATCH 155/162] refactor(deriv_localizations): Crowdin Localization Generated (#686) Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: sagar-deriv --- CHANGELOG.md | 41 +++++++++++++++++++ README.md | 14 +++---- packages/deriv_auth/CHANGELOG.md | 4 ++ packages/deriv_auth/pubspec.yaml | 10 ++--- packages/deriv_language_selector/CHANGELOG.md | 4 ++ packages/deriv_language_selector/pubspec.yaml | 4 +- .../deriv_mobile_chart_wrapper/CHANGELOG.md | 4 ++ .../deriv_mobile_chart_wrapper/pubspec.yaml | 4 +- packages/deriv_passkeys/CHANGELOG.md | 4 ++ packages/deriv_passkeys/pubspec.yaml | 4 +- packages/deriv_ui/CHANGELOG.md | 4 ++ packages/deriv_ui/pubspec.yaml | 2 +- packages/deriv_widgetbook/CHANGELOG.md | 4 ++ packages/deriv_widgetbook/pubspec.yaml | 4 +- packages/update_checker/CHANGELOG.md | 4 ++ packages/update_checker/pubspec.yaml | 2 +- 16 files changed, 91 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14e05be1d..d75589791 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,47 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-07-15 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_ui` - `v0.0.8`](#deriv_ui---v008) + - [`update_checker` - `v1.5.0`](#update_checker---v150) + - [`deriv_auth` - `v6.7.14`](#deriv_auth---v6714) + - [`deriv_mobile_chart_wrapper` - `v0.0.2+2`](#deriv_mobile_chart_wrapper---v0022) + - [`deriv_passkeys` - `v0.0.3+2`](#deriv_passkeys---v0032) + - [`deriv_widgetbook` - `v0.0.2+10`](#deriv_widgetbook---v00210) + - [`deriv_language_selector` - `v0.0.2+8`](#deriv_language_selector---v0028) + +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.7.14` + - `deriv_mobile_chart_wrapper` - `v0.0.2+2` + - `deriv_passkeys` - `v0.0.3+2` + - `deriv_widgetbook` - `v0.0.2+10` + - `deriv_language_selector` - `v0.0.2+8` + +--- + +#### `deriv_ui` - `v0.0.8` + + - **FEAT**(deriv_ui): [DERG 2450] Added Timeline Widget to Deriv UI ([#631](https://github.com/regentmarkets/flutter-deriv-packages/issues/631)). ([e34d78b3](https://github.com/regentmarkets/flutter-deriv-packages/commit/e34d78b303358cb5f91abab14a2a042ce3650b0f)) + +#### `update_checker` - `v1.5.0` + + - **FEAT**(deriv_ui): [DERG 2450] Added Timeline Widget to Deriv UI ([#631](https://github.com/regentmarkets/flutter-deriv-packages/issues/631)). ([e34d78b3](https://github.com/regentmarkets/flutter-deriv-packages/commit/e34d78b303358cb5f91abab14a2a042ce3650b0f)) + + ## 2024-07-11 ### Changes diff --git a/README.md b/README.md index b3274b283..893e3569b 100644 --- a/README.md +++ b/README.md @@ -15,14 +15,14 @@ cp $HOME/Downloads/commit-msg $HOME/.git/hooks/commit-msg \ ## Using the packages -Each package has been released as git tag with convention as **packageName-vVersionNumber**`(Example: deriv_auth-v6.7.13)`. 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.7.14)`. To use the package, add the following to your pubspec.yaml file: ```yaml deriv_ui: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.7+9 #your prefered version + ref: deriv_ui-v0.0.8 #your prefered version ``` ## Packages @@ -30,7 +30,7 @@ deriv_ui: | Name | Description | Version | | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | | [analytics](./packages/analytics) | Used to collect and send analytical information to 'Firebase' and 'Segment'. | [v2.1.0](./packages/analytics/CHANGELOG.md) | -| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.13 ](./packages/deriv_auth/CHANGELOG.md) | +| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.14 ](./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) | @@ -41,20 +41,20 @@ 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+2](./packages/deriv_live_chat/CHANGELOG.md) | -| [deriv_language_selector](./packages/deriv_language_selector) | A package to handle language change of the app. | [v0.0.2+7](./packages/deriv_language_selector/CHANGELOG.md) | +| [deriv_language_selector](./packages/deriv_language_selector) | A package to handle language change of the app. | [v0.0.2+8](./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.5.1](./packages/deriv_localizations/CHANGELOG.md) | | [deriv_numpad](./packages/deriv_numpad) | Number Pad Widget for number input. | [v1.1.5](./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+9](./packages/deriv_ui/CHANGELOG.md) | +| [deriv_ui](./packages/deriv_ui) | A package that contains the UI components used by Deriv products. | [v0.0.8](./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+3](./packages/deriv_web_view/CHANGELOG.md) | -| [deriv_widgetbook](./packages/deriv_widgetbook) | Storybook for Deriv UI Widgets and Components | [v0.0.2+9](./packages/deriv_widgetbook/CHANGELOG.md) | +| [deriv_widgetbook](./packages/deriv_widgetbook) | Storybook for Deriv UI Widgets and Components | [v0.0.2+10](./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.4.0](./packages/update_checker/CHANGELOG.md) | +| [update_checker](./packages/update_checker) | Check and retrieve update information from the server for the given package. | [v1.5.0](./packages/update_checker/CHANGELOG.md) | | [deriv_feature_flag](./packages/deriv_feature_flag) | A package to provide feature flag functionality for apps. | [v0.1.1](./packages/deriv_feature_flag/CHANGELOG.md) | ## Environment Setup diff --git a/packages/deriv_auth/CHANGELOG.md b/packages/deriv_auth/CHANGELOG.md index 4e7128bcd..a340e4890 100644 --- a/packages/deriv_auth/CHANGELOG.md +++ b/packages/deriv_auth/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.7.14 + + - Update a dependency to the latest release. + ## 6.7.13 - Update a dependency to the latest release. diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index 8431f7db8..38d0b3742 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.7.13 +version: 6.7.14 environment: sdk: ">=3.0.0 <4.0.0" @@ -28,7 +28,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.7+9 + ref: deriv_ui-v0.0.8 deriv_http_client: git: @@ -57,13 +57,13 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: deriv_passkeys-v0.0.3+1 + ref: deriv_passkeys-v0.0.3+2 deriv_language_selector: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_language_selector - ref: deriv_language_selector-v0.0.2+7 + ref: deriv_language_selector-v0.0.2+8 flutter_bloc: ^8.1.3 flutter_svg: ^2.0.7 @@ -79,7 +79,7 @@ dependency_overrides: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.7+9 + ref: deriv_ui-v0.0.8 dev_dependencies: mocktail: ^1.0.3 diff --git a/packages/deriv_language_selector/CHANGELOG.md b/packages/deriv_language_selector/CHANGELOG.md index 042e415f2..4b720ff9a 100644 --- a/packages/deriv_language_selector/CHANGELOG.md +++ b/packages/deriv_language_selector/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.2+8 + + - Update a dependency to the latest release. + ## 0.0.2+7 - Update a dependency to the latest release. diff --git a/packages/deriv_language_selector/pubspec.yaml b/packages/deriv_language_selector/pubspec.yaml index 65dbe3b48..1a61c8f1f 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+7 +version: 0.0.2+8 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+9 + ref: deriv_ui-v0.0.8 shared_preferences: ^2.2.2 flutter_bloc: ^8.1.4 equatable: ^2.0.5 diff --git a/packages/deriv_mobile_chart_wrapper/CHANGELOG.md b/packages/deriv_mobile_chart_wrapper/CHANGELOG.md index 021636ca8..9126f26c3 100644 --- a/packages/deriv_mobile_chart_wrapper/CHANGELOG.md +++ b/packages/deriv_mobile_chart_wrapper/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.2+2 + + - Update a dependency to the latest release. + ## 0.0.2+1 - **FIX**(deriv_mobile_chart_wrapper): update readme file ([#672](https://github.com/regentmarkets/flutter-deriv-packages/issues/672)). ([13e6b3f3](https://github.com/regentmarkets/flutter-deriv-packages/commit/13e6b3f35ba863098fd9785daaa8ccc7cb23b388)) diff --git a/packages/deriv_mobile_chart_wrapper/pubspec.yaml b/packages/deriv_mobile_chart_wrapper/pubspec.yaml index 081c65add..30d362ed4 100644 --- a/packages/deriv_mobile_chart_wrapper/pubspec.yaml +++ b/packages/deriv_mobile_chart_wrapper/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_mobile_chart_wrapper description: A new Flutter package project. -version: 0.0.2+1 +version: 0.0.2+2 homepage: environment: @@ -31,7 +31,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.7+9 + ref: deriv_ui-v0.0.8 provider: ^6.0.5 flutter_svg: ^2.0.9 diff --git a/packages/deriv_passkeys/CHANGELOG.md b/packages/deriv_passkeys/CHANGELOG.md index 1a9902631..55b9826e6 100644 --- a/packages/deriv_passkeys/CHANGELOG.md +++ b/packages/deriv_passkeys/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.3+2 + + - Update a dependency to the latest release. + ## 0.0.3+1 - **FIX**(deriv_passkeys): add keys to passkey login page ([#676](https://github.com/regentmarkets/flutter-deriv-packages/issues/676)). ([aa84a46d](https://github.com/regentmarkets/flutter-deriv-packages/commit/aa84a46dfb9cd22a335276c1ae0063ffee7852ef)) diff --git a/packages/deriv_passkeys/pubspec.yaml b/packages/deriv_passkeys/pubspec.yaml index 1a2a3ccbb..0131d723a 100644 --- a/packages/deriv_passkeys/pubspec.yaml +++ b/packages/deriv_passkeys/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_passkeys description: Deriv Passkeys Flutter Plugin -version: 0.0.3+1 +version: 0.0.3+2 publish_to: "none" environment: @@ -32,7 +32,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.7+9 + ref: deriv_ui-v0.0.8 deriv_http_client: git: diff --git a/packages/deriv_ui/CHANGELOG.md b/packages/deriv_ui/CHANGELOG.md index 84203b2c2..d310854c6 100644 --- a/packages/deriv_ui/CHANGELOG.md +++ b/packages/deriv_ui/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.8 + + - **FEAT**(deriv_ui): [DERG 2450] Added Timeline Widget to Deriv UI ([#631](https://github.com/regentmarkets/flutter-deriv-packages/issues/631)). ([e34d78b3](https://github.com/regentmarkets/flutter-deriv-packages/commit/e34d78b303358cb5f91abab14a2a042ce3650b0f)) + ## 0.0.7+9 - Update a dependency to the latest release. diff --git a/packages/deriv_ui/pubspec.yaml b/packages/deriv_ui/pubspec.yaml index 08fa0368b..bb6c34629 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+9 +version: 0.0.8 publish_to: none environment: diff --git a/packages/deriv_widgetbook/CHANGELOG.md b/packages/deriv_widgetbook/CHANGELOG.md index 5163095e0..0fab7b799 100644 --- a/packages/deriv_widgetbook/CHANGELOG.md +++ b/packages/deriv_widgetbook/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.2+10 + + - Update a dependency to the latest release. + ## 0.0.2+9 - Update a dependency to the latest release. diff --git a/packages/deriv_widgetbook/pubspec.yaml b/packages/deriv_widgetbook/pubspec.yaml index 79424c1a1..48d11be3f 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+9 +version: 0.0.2+10 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+9 + ref: deriv_ui-v0.0.8 deriv_theme: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git diff --git a/packages/update_checker/CHANGELOG.md b/packages/update_checker/CHANGELOG.md index caf0d3f95..40819a7b1 100644 --- a/packages/update_checker/CHANGELOG.md +++ b/packages/update_checker/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.5.0 + + - **FEAT**(deriv_ui): [DERG 2450] Added Timeline Widget to Deriv UI ([#631](https://github.com/regentmarkets/flutter-deriv-packages/issues/631)). ([e34d78b3](https://github.com/regentmarkets/flutter-deriv-packages/commit/e34d78b303358cb5f91abab14a2a042ce3650b0f)) + ## 1.4.0 - **FEAT**(update_checker): add the ability to change the key from the app side ([#628](https://github.com/regentmarkets/flutter-deriv-packages/issues/628)). ([b18609a0](https://github.com/regentmarkets/flutter-deriv-packages/commit/b18609a00533aaab6d6962eb89f323e2f560df8b)) diff --git a/packages/update_checker/pubspec.yaml b/packages/update_checker/pubspec.yaml index 5d50c0fc9..396ec682d 100644 --- a/packages/update_checker/pubspec.yaml +++ b/packages/update_checker/pubspec.yaml @@ -1,6 +1,6 @@ name: update_checker description: Check and retrieve update information from the server for the given package. -version: 1.4.0 +version: 1.5.0 homepage: https://deriv.com/ publish_to: "none" From d27a5f61449087b8e45dec3e43ccb88c1c1a1266 Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Tue, 16 Jul 2024 13:19:27 +0800 Subject: [PATCH 156/162] chore(version): bump version and update changelog (#689) Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: sahani-deriv --- CHANGELOG.md | 51 +++++++++++++++++++ README.md | 14 ++--- packages/deriv_auth/CHANGELOG.md | 4 ++ packages/deriv_auth/pubspec.yaml | 10 ++-- packages/deriv_language_selector/CHANGELOG.md | 4 ++ packages/deriv_language_selector/pubspec.yaml | 4 +- .../deriv_mobile_chart_wrapper/CHANGELOG.md | 4 ++ .../deriv_mobile_chart_wrapper/pubspec.yaml | 4 +- packages/deriv_passkeys/CHANGELOG.md | 4 ++ packages/deriv_passkeys/pubspec.yaml | 4 +- packages/deriv_ui/CHANGELOG.md | 4 ++ packages/deriv_ui/pubspec.yaml | 2 +- packages/deriv_widgetbook/CHANGELOG.md | 4 ++ packages/deriv_widgetbook/pubspec.yaml | 4 +- packages/update_checker/CHANGELOG.md | 4 ++ packages/update_checker/pubspec.yaml | 2 +- 16 files changed, 101 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d75589791..d29e4602b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,57 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-07-16 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_auth` - `v6.7.15`](#deriv_auth---v6715) + - [`deriv_language_selector` - `v0.0.2+9`](#deriv_language_selector---v0029) + - [`deriv_mobile_chart_wrapper` - `v0.0.2+3`](#deriv_mobile_chart_wrapper---v0023) + - [`deriv_passkeys` - `v0.0.3+3`](#deriv_passkeys---v0033) + - [`deriv_ui` - `v0.0.8+1`](#deriv_ui---v0081) + - [`deriv_widgetbook` - `v0.0.2+11`](#deriv_widgetbook---v00211) + - [`update_checker` - `v1.5.1`](#update_checker---v151) + +--- + +#### `deriv_auth` - `v6.7.15` + + - **REFACTOR**(deriv_localizations): Crowdin Localization Generated ([#686](https://github.com/regentmarkets/flutter-deriv-packages/issues/686)). ([a0a6df21](https://github.com/regentmarkets/flutter-deriv-packages/commit/a0a6df21cbc6681b923ec3e060752de20ddad32b)) + +#### `deriv_language_selector` - `v0.0.2+9` + + - **REFACTOR**(deriv_localizations): Crowdin Localization Generated ([#686](https://github.com/regentmarkets/flutter-deriv-packages/issues/686)). ([a0a6df21](https://github.com/regentmarkets/flutter-deriv-packages/commit/a0a6df21cbc6681b923ec3e060752de20ddad32b)) + +#### `deriv_mobile_chart_wrapper` - `v0.0.2+3` + + - **REFACTOR**(deriv_localizations): Crowdin Localization Generated ([#686](https://github.com/regentmarkets/flutter-deriv-packages/issues/686)). ([a0a6df21](https://github.com/regentmarkets/flutter-deriv-packages/commit/a0a6df21cbc6681b923ec3e060752de20ddad32b)) + +#### `deriv_passkeys` - `v0.0.3+3` + + - **REFACTOR**(deriv_localizations): Crowdin Localization Generated ([#686](https://github.com/regentmarkets/flutter-deriv-packages/issues/686)). ([a0a6df21](https://github.com/regentmarkets/flutter-deriv-packages/commit/a0a6df21cbc6681b923ec3e060752de20ddad32b)) + +#### `deriv_ui` - `v0.0.8+1` + + - **REFACTOR**(deriv_localizations): Crowdin Localization Generated ([#686](https://github.com/regentmarkets/flutter-deriv-packages/issues/686)). ([a0a6df21](https://github.com/regentmarkets/flutter-deriv-packages/commit/a0a6df21cbc6681b923ec3e060752de20ddad32b)) + +#### `deriv_widgetbook` - `v0.0.2+11` + + - **REFACTOR**(deriv_localizations): Crowdin Localization Generated ([#686](https://github.com/regentmarkets/flutter-deriv-packages/issues/686)). ([a0a6df21](https://github.com/regentmarkets/flutter-deriv-packages/commit/a0a6df21cbc6681b923ec3e060752de20ddad32b)) + +#### `update_checker` - `v1.5.1` + + - **REFACTOR**(deriv_localizations): Crowdin Localization Generated ([#686](https://github.com/regentmarkets/flutter-deriv-packages/issues/686)). ([a0a6df21](https://github.com/regentmarkets/flutter-deriv-packages/commit/a0a6df21cbc6681b923ec3e060752de20ddad32b)) + + ## 2024-07-15 ### Changes diff --git a/README.md b/README.md index 893e3569b..0e54830c2 100644 --- a/README.md +++ b/README.md @@ -15,14 +15,14 @@ cp $HOME/Downloads/commit-msg $HOME/.git/hooks/commit-msg \ ## Using the packages -Each package has been released as git tag with convention as **packageName-vVersionNumber**`(Example: deriv_auth-v6.7.14)`. 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.7.15)`. To use the package, add the following to your pubspec.yaml file: ```yaml deriv_ui: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.8 #your prefered version + ref: deriv_ui-v0.0.8+1 #your prefered version ``` ## Packages @@ -30,7 +30,7 @@ deriv_ui: | Name | Description | Version | | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | | [analytics](./packages/analytics) | Used to collect and send analytical information to 'Firebase' and 'Segment'. | [v2.1.0](./packages/analytics/CHANGELOG.md) | -| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.14 ](./packages/deriv_auth/CHANGELOG.md) | +| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.15 ](./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) | @@ -41,20 +41,20 @@ 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+2](./packages/deriv_live_chat/CHANGELOG.md) | -| [deriv_language_selector](./packages/deriv_language_selector) | A package to handle language change of the app. | [v0.0.2+8](./packages/deriv_language_selector/CHANGELOG.md) | +| [deriv_language_selector](./packages/deriv_language_selector) | A package to handle language change of the app. | [v0.0.2+9](./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.5.1](./packages/deriv_localizations/CHANGELOG.md) | | [deriv_numpad](./packages/deriv_numpad) | Number Pad Widget for number input. | [v1.1.5](./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.8](./packages/deriv_ui/CHANGELOG.md) | +| [deriv_ui](./packages/deriv_ui) | A package that contains the UI components used by Deriv products. | [v0.0.8+1](./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+3](./packages/deriv_web_view/CHANGELOG.md) | -| [deriv_widgetbook](./packages/deriv_widgetbook) | Storybook for Deriv UI Widgets and Components | [v0.0.2+10](./packages/deriv_widgetbook/CHANGELOG.md) | +| [deriv_widgetbook](./packages/deriv_widgetbook) | Storybook for Deriv UI Widgets and Components | [v0.0.2+11](./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.5.0](./packages/update_checker/CHANGELOG.md) | +| [update_checker](./packages/update_checker) | Check and retrieve update information from the server for the given package. | [v1.5.1](./packages/update_checker/CHANGELOG.md) | | [deriv_feature_flag](./packages/deriv_feature_flag) | A package to provide feature flag functionality for apps. | [v0.1.1](./packages/deriv_feature_flag/CHANGELOG.md) | ## Environment Setup diff --git a/packages/deriv_auth/CHANGELOG.md b/packages/deriv_auth/CHANGELOG.md index a340e4890..0903f7832 100644 --- a/packages/deriv_auth/CHANGELOG.md +++ b/packages/deriv_auth/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.7.15 + + - **REFACTOR**(deriv_localizations): Crowdin Localization Generated ([#686](https://github.com/regentmarkets/flutter-deriv-packages/issues/686)). ([a0a6df21](https://github.com/regentmarkets/flutter-deriv-packages/commit/a0a6df21cbc6681b923ec3e060752de20ddad32b)) + ## 6.7.14 - Update a dependency to the latest release. diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index 38d0b3742..1134bcd94 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.7.14 +version: 6.7.15 environment: sdk: ">=3.0.0 <4.0.0" @@ -28,7 +28,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.8 + ref: deriv_ui-v0.0.8+1 deriv_http_client: git: @@ -57,13 +57,13 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: deriv_passkeys-v0.0.3+2 + ref: deriv_passkeys-v0.0.3+3 deriv_language_selector: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_language_selector - ref: deriv_language_selector-v0.0.2+8 + ref: deriv_language_selector-v0.0.2+9 flutter_bloc: ^8.1.3 flutter_svg: ^2.0.7 @@ -79,7 +79,7 @@ dependency_overrides: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.8 + ref: deriv_ui-v0.0.8+1 dev_dependencies: mocktail: ^1.0.3 diff --git a/packages/deriv_language_selector/CHANGELOG.md b/packages/deriv_language_selector/CHANGELOG.md index 4b720ff9a..d26895b3c 100644 --- a/packages/deriv_language_selector/CHANGELOG.md +++ b/packages/deriv_language_selector/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.2+9 + + - **REFACTOR**(deriv_localizations): Crowdin Localization Generated ([#686](https://github.com/regentmarkets/flutter-deriv-packages/issues/686)). ([a0a6df21](https://github.com/regentmarkets/flutter-deriv-packages/commit/a0a6df21cbc6681b923ec3e060752de20ddad32b)) + ## 0.0.2+8 - Update a dependency to the latest release. diff --git a/packages/deriv_language_selector/pubspec.yaml b/packages/deriv_language_selector/pubspec.yaml index 1a61c8f1f..69b39cafe 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+8 +version: 0.0.2+9 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.8 + ref: deriv_ui-v0.0.8+1 shared_preferences: ^2.2.2 flutter_bloc: ^8.1.4 equatable: ^2.0.5 diff --git a/packages/deriv_mobile_chart_wrapper/CHANGELOG.md b/packages/deriv_mobile_chart_wrapper/CHANGELOG.md index 9126f26c3..0323f0d7c 100644 --- a/packages/deriv_mobile_chart_wrapper/CHANGELOG.md +++ b/packages/deriv_mobile_chart_wrapper/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.2+3 + + - **REFACTOR**(deriv_localizations): Crowdin Localization Generated ([#686](https://github.com/regentmarkets/flutter-deriv-packages/issues/686)). ([a0a6df21](https://github.com/regentmarkets/flutter-deriv-packages/commit/a0a6df21cbc6681b923ec3e060752de20ddad32b)) + ## 0.0.2+2 - Update a dependency to the latest release. diff --git a/packages/deriv_mobile_chart_wrapper/pubspec.yaml b/packages/deriv_mobile_chart_wrapper/pubspec.yaml index 30d362ed4..55e0f4d69 100644 --- a/packages/deriv_mobile_chart_wrapper/pubspec.yaml +++ b/packages/deriv_mobile_chart_wrapper/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_mobile_chart_wrapper description: A new Flutter package project. -version: 0.0.2+2 +version: 0.0.2+3 homepage: environment: @@ -31,7 +31,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.8 + ref: deriv_ui-v0.0.8+1 provider: ^6.0.5 flutter_svg: ^2.0.9 diff --git a/packages/deriv_passkeys/CHANGELOG.md b/packages/deriv_passkeys/CHANGELOG.md index 55b9826e6..14d788317 100644 --- a/packages/deriv_passkeys/CHANGELOG.md +++ b/packages/deriv_passkeys/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.3+3 + + - **REFACTOR**(deriv_localizations): Crowdin Localization Generated ([#686](https://github.com/regentmarkets/flutter-deriv-packages/issues/686)). ([a0a6df21](https://github.com/regentmarkets/flutter-deriv-packages/commit/a0a6df21cbc6681b923ec3e060752de20ddad32b)) + ## 0.0.3+2 - Update a dependency to the latest release. diff --git a/packages/deriv_passkeys/pubspec.yaml b/packages/deriv_passkeys/pubspec.yaml index 0131d723a..b002a90fe 100644 --- a/packages/deriv_passkeys/pubspec.yaml +++ b/packages/deriv_passkeys/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_passkeys description: Deriv Passkeys Flutter Plugin -version: 0.0.3+2 +version: 0.0.3+3 publish_to: "none" environment: @@ -32,7 +32,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: deriv_ui-v0.0.8 + ref: deriv_ui-v0.0.8+1 deriv_http_client: git: diff --git a/packages/deriv_ui/CHANGELOG.md b/packages/deriv_ui/CHANGELOG.md index d310854c6..ae7fb41da 100644 --- a/packages/deriv_ui/CHANGELOG.md +++ b/packages/deriv_ui/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.8+1 + + - **REFACTOR**(deriv_localizations): Crowdin Localization Generated ([#686](https://github.com/regentmarkets/flutter-deriv-packages/issues/686)). ([a0a6df21](https://github.com/regentmarkets/flutter-deriv-packages/commit/a0a6df21cbc6681b923ec3e060752de20ddad32b)) + ## 0.0.8 - **FEAT**(deriv_ui): [DERG 2450] Added Timeline Widget to Deriv UI ([#631](https://github.com/regentmarkets/flutter-deriv-packages/issues/631)). ([e34d78b3](https://github.com/regentmarkets/flutter-deriv-packages/commit/e34d78b303358cb5f91abab14a2a042ce3650b0f)) diff --git a/packages/deriv_ui/pubspec.yaml b/packages/deriv_ui/pubspec.yaml index bb6c34629..acdf81391 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.8 +version: 0.0.8+1 publish_to: none environment: diff --git a/packages/deriv_widgetbook/CHANGELOG.md b/packages/deriv_widgetbook/CHANGELOG.md index 0fab7b799..da7b68d4c 100644 --- a/packages/deriv_widgetbook/CHANGELOG.md +++ b/packages/deriv_widgetbook/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.2+11 + + - **REFACTOR**(deriv_localizations): Crowdin Localization Generated ([#686](https://github.com/regentmarkets/flutter-deriv-packages/issues/686)). ([a0a6df21](https://github.com/regentmarkets/flutter-deriv-packages/commit/a0a6df21cbc6681b923ec3e060752de20ddad32b)) + ## 0.0.2+10 - Update a dependency to the latest release. diff --git a/packages/deriv_widgetbook/pubspec.yaml b/packages/deriv_widgetbook/pubspec.yaml index 48d11be3f..919c759af 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+10 +version: 0.0.2+11 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.8 + ref: deriv_ui-v0.0.8+1 deriv_theme: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git diff --git a/packages/update_checker/CHANGELOG.md b/packages/update_checker/CHANGELOG.md index 40819a7b1..9d0d5fc46 100644 --- a/packages/update_checker/CHANGELOG.md +++ b/packages/update_checker/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.5.1 + + - **REFACTOR**(deriv_localizations): Crowdin Localization Generated ([#686](https://github.com/regentmarkets/flutter-deriv-packages/issues/686)). ([a0a6df21](https://github.com/regentmarkets/flutter-deriv-packages/commit/a0a6df21cbc6681b923ec3e060752de20ddad32b)) + ## 1.5.0 - **FEAT**(deriv_ui): [DERG 2450] Added Timeline Widget to Deriv UI ([#631](https://github.com/regentmarkets/flutter-deriv-packages/issues/631)). ([e34d78b3](https://github.com/regentmarkets/flutter-deriv-packages/commit/e34d78b303358cb5f91abab14a2a042ce3650b0f)) diff --git a/packages/update_checker/pubspec.yaml b/packages/update_checker/pubspec.yaml index 396ec682d..ac5909996 100644 --- a/packages/update_checker/pubspec.yaml +++ b/packages/update_checker/pubspec.yaml @@ -1,6 +1,6 @@ name: update_checker description: Check and retrieve update information from the server for the given package. -version: 1.5.0 +version: 1.5.1 homepage: https://deriv.com/ publish_to: "none" From 3e8c4606f4280bc48d6593b4557739a7f19418bf Mon Sep 17 00:00:00 2001 From: sahani-deriv <125638269+sahani-deriv@users.noreply.github.com> Date: Tue, 16 Jul 2024 13:34:33 +0800 Subject: [PATCH 157/162] ci: change automated localisation pr branch name (#690) --- .github/workflows/localization.yml | 4 ++-- .github/workflows/version.yaml | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/localization.yml b/.github/workflows/localization.yml index 6976e40e1..7107bf766 100644 --- a/.github/workflows/localization.yml +++ b/.github/workflows/localization.yml @@ -25,7 +25,7 @@ jobs: channel: "stable" flutter-version: "3.10.2" cache: true - + - name: Setup Config run: | git config --global user.name 'mobile-apps-deriv' @@ -38,11 +38,11 @@ jobs: ./l10n.sh env: GITHUB_TOKEN: ${{ secrets.PAT }} - - name: Create Pull Request. uses: peter-evans/create-pull-request@76c6f5c20e2111bfee3cd30fae52a25e410f5efc with: token: ${{ secrets.PAT }} title: "refactor(deriv_localizations): Crowdin Localization Generated" + branch: create-pull-request/localisation base: master diff --git a/.github/workflows/version.yaml b/.github/workflows/version.yaml index 7a764da3c..37d18284a 100644 --- a/.github/workflows/version.yaml +++ b/.github/workflows/version.yaml @@ -77,13 +77,6 @@ jobs: run: bash readme.sh working-directory: ./scripts - - name: Create Pull Request on updated changelog and pubspec file. - uses: peter-evans/create-pull-request@76c6f5c20e2111bfee3cd30fae52a25e410f5efc - with: - token: ${{ secrets.PAT }} - title: "chore(version): bump version and update changelog" - base: master - - name: Send Slack Notification uses: ./.github/actions/send_slack_notifications if: ${{ contains(steps.push-tag.outputs.PUSH_OUTPUT, 'Packages updated') }} @@ -91,3 +84,10 @@ jobs: SLACK_WEBHOOK_PACKAGE_UPDATE: ${{ secrets.SLACK_WEBHOOK_PACKAGE_UPDATE }} PR_TITLE: ${{ github.event.pull_request.title }} TAGS: ${{ steps.new-tags.outputs.NEW_TAGS }} + + - name: Create Pull Request on updated changelog and pubspec file. + uses: peter-evans/create-pull-request@76c6f5c20e2111bfee3cd30fae52a25e410f5efc + with: + token: ${{ secrets.PAT }} + title: "chore(version): bump version and update changelog" + base: master From d944a1c37f127f35143d9920532f76bc3487ebd4 Mon Sep 17 00:00:00 2001 From: emad-deriv <134991873+emad-deriv@users.noreply.github.com> Date: Tue, 16 Jul 2024 15:38:34 +0800 Subject: [PATCH 158/162] fix(deriv_passkeys): fix some missing keys in passkey login page (#692) --- .../pages/effortless_passkeys_login_page.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/deriv_passkeys/lib/src/presentation/pages/effortless_passkeys_login_page.dart b/packages/deriv_passkeys/lib/src/presentation/pages/effortless_passkeys_login_page.dart index 6906c94cc..4e097b3d9 100644 --- a/packages/deriv_passkeys/lib/src/presentation/pages/effortless_passkeys_login_page.dart +++ b/packages/deriv_passkeys/lib/src/presentation/pages/effortless_passkeys_login_page.dart @@ -95,8 +95,6 @@ class EffortlessPasskeysPage extends StatelessWidget child: Padding( padding: const EdgeInsets.all(16), child: TextButton( - key: effortlessPasskeysPageKeys - ?.maybeLaterTextButtonKey, onPressed: () { trackMaybeLater(); onPageClosed(context); @@ -105,6 +103,8 @@ class EffortlessPasskeysPage extends StatelessWidget context.derivPasskeysLocalizations .maybeLater .toUpperCase(), + key: effortlessPasskeysPageKeys + ?.maybeLaterTextButtonKey, style: TextStyle( color: context.theme.colors.coral, ), @@ -237,8 +237,6 @@ class EffortlessPasskeysPage extends StatelessWidget child: Padding( padding: const EdgeInsets.all(16), child: PrimaryButton( - key: effortlessPasskeysPageKeys - ?.createPasskeyButtonKey, onPressed: () { trackCreatePasskey(); context.read().add( @@ -247,6 +245,8 @@ class EffortlessPasskeysPage extends StatelessWidget child: Text( context.derivPasskeysLocalizations .createPasskey, + key: effortlessPasskeysPageKeys + ?.createPasskeyButtonKey, style: TextStyle( color: context.theme.colors.prominent, ), From 2a604b99a3b5648658d0cbcab11b8eaf04df7088 Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Tue, 16 Jul 2024 16:33:54 +0800 Subject: [PATCH 159/162] chore(version): bump version and update changelog (#693) Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: emad-deriv --- CHANGELOG.md | 28 ++++++++++++++++++++++++++++ README.md | 4 ++-- packages/deriv_auth/CHANGELOG.md | 4 ++++ packages/deriv_auth/pubspec.yaml | 4 ++-- packages/deriv_passkeys/CHANGELOG.md | 4 ++++ packages/deriv_passkeys/pubspec.yaml | 2 +- 6 files changed, 41 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d29e4602b..c69417496 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,34 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-07-16 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_passkeys` - `v0.0.3+4`](#deriv_passkeys---v0034) + - [`deriv_auth` - `v6.7.16`](#deriv_auth---v6716) + +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.7.16` + +--- + +#### `deriv_passkeys` - `v0.0.3+4` + + - **FIX**(deriv_passkeys): fix some missing keys in passkey login page ([#692](https://github.com/regentmarkets/flutter-deriv-packages/issues/692)). ([d944a1c3](https://github.com/regentmarkets/flutter-deriv-packages/commit/d944a1c37f127f35143d9920532f76bc3487ebd4)) + + ## 2024-07-16 ### Changes diff --git a/README.md b/README.md index 0e54830c2..c13489467 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ cp $HOME/Downloads/commit-msg $HOME/.git/hooks/commit-msg \ ## Using the packages -Each package has been released as git tag with convention as **packageName-vVersionNumber**`(Example: deriv_auth-v6.7.15)`. 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.7.16)`. To use the package, add the following to your pubspec.yaml file: ```yaml deriv_ui: @@ -30,7 +30,7 @@ deriv_ui: | Name | Description | Version | | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | | [analytics](./packages/analytics) | Used to collect and send analytical information to 'Firebase' and 'Segment'. | [v2.1.0](./packages/analytics/CHANGELOG.md) | -| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.15 ](./packages/deriv_auth/CHANGELOG.md) | +| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.16 ](./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) | diff --git a/packages/deriv_auth/CHANGELOG.md b/packages/deriv_auth/CHANGELOG.md index 0903f7832..b3f168f04 100644 --- a/packages/deriv_auth/CHANGELOG.md +++ b/packages/deriv_auth/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.7.16 + + - Update a dependency to the latest release. + ## 6.7.15 - **REFACTOR**(deriv_localizations): Crowdin Localization Generated ([#686](https://github.com/regentmarkets/flutter-deriv-packages/issues/686)). ([a0a6df21](https://github.com/regentmarkets/flutter-deriv-packages/commit/a0a6df21cbc6681b923ec3e060752de20ddad32b)) diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index 1134bcd94..e5b3ce7af 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.7.15 +version: 6.7.16 environment: sdk: ">=3.0.0 <4.0.0" @@ -57,7 +57,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: deriv_passkeys-v0.0.3+3 + ref: deriv_passkeys-v0.0.3+4 deriv_language_selector: git: diff --git a/packages/deriv_passkeys/CHANGELOG.md b/packages/deriv_passkeys/CHANGELOG.md index 14d788317..ba8fbe370 100644 --- a/packages/deriv_passkeys/CHANGELOG.md +++ b/packages/deriv_passkeys/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.3+4 + + - **FIX**(deriv_passkeys): fix some missing keys in passkey login page ([#692](https://github.com/regentmarkets/flutter-deriv-packages/issues/692)). ([d944a1c3](https://github.com/regentmarkets/flutter-deriv-packages/commit/d944a1c37f127f35143d9920532f76bc3487ebd4)) + ## 0.0.3+3 - **REFACTOR**(deriv_localizations): Crowdin Localization Generated ([#686](https://github.com/regentmarkets/flutter-deriv-packages/issues/686)). ([a0a6df21](https://github.com/regentmarkets/flutter-deriv-packages/commit/a0a6df21cbc6681b923ec3e060752de20ddad32b)) diff --git a/packages/deriv_passkeys/pubspec.yaml b/packages/deriv_passkeys/pubspec.yaml index b002a90fe..bfa022152 100644 --- a/packages/deriv_passkeys/pubspec.yaml +++ b/packages/deriv_passkeys/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_passkeys description: Deriv Passkeys Flutter Plugin -version: 0.0.3+3 +version: 0.0.3+4 publish_to: "none" environment: From 1a770f5946cb7a9966dec9308e3dc4d93feff107 Mon Sep 17 00:00:00 2001 From: Osama Ghazal <124760982+osama-deriv@users.noreply.github.com> Date: Tue, 16 Jul 2024 16:50:33 +0800 Subject: [PATCH 160/162] chore(deriv_mobile_chart_wrapper): add colours palettes widget (#687) --- .../src/mobile_tools_ui/colours_palettes.dart | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 packages/deriv_mobile_chart_wrapper/lib/src/mobile_tools_ui/colours_palettes.dart diff --git a/packages/deriv_mobile_chart_wrapper/lib/src/mobile_tools_ui/colours_palettes.dart b/packages/deriv_mobile_chart_wrapper/lib/src/mobile_tools_ui/colours_palettes.dart new file mode 100644 index 000000000..f368f247f --- /dev/null +++ b/packages/deriv_mobile_chart_wrapper/lib/src/mobile_tools_ui/colours_palettes.dart @@ -0,0 +1,72 @@ +import 'package:flutter/material.dart'; + +class ColoursPalettes extends StatefulWidget { + final ValueChanged onColorSelected; + + const ColoursPalettes({super.key, required this.onColorSelected}); + + @override + ColoursPalettesState createState() => ColoursPalettesState(); +} + +class ColoursPalettesState extends State { + final List colors = [ + const Color(0xFFFFFFFF), // White + const Color(0xFFF39230), // Orange + const Color(0xFFEF6B53), // Deep Orange + const Color(0xFFD73737), // Red + const Color(0xFF03BFF0), // Light Blue + const Color(0xFF3271B4), // Blue + const Color(0xFF2FBCB5), // Teal + const Color(0xFF8EC648), // Light Green + const Color(0xFF48A25C), // Green + const Color(0xFFFFF224), // Yellow + const Color(0xFFEE6EA9), // Pink + const Color(0xFF853289), // Purple + ]; + + final Color borderColor = const Color(0xFF85ACB0); + Color? selectedColor; + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.all(20.0), + child: GridView.builder( + gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 6, + crossAxisSpacing: 10, + mainAxisSpacing: 10, + ), + itemCount: colors.length, + itemBuilder: (context, index) { + return GestureDetector( + onTap: () { + setState(() { + selectedColor = colors[index]; + }); + widget.onColorSelected(colors[index]); + }, + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4), + border: selectedColor == colors[index] + ? Border.all(color: borderColor, width: 1) + : null, + ), + child: Padding( + padding: const EdgeInsets.all(5.0), + child: Container( + decoration: BoxDecoration( + color: colors[index], + borderRadius: BorderRadius.circular(4), + ), + ), + ), + ), + ); + }, + ), + ); + } +} From eac7e8cba4e9310d30296e07a47731f08d4d7342 Mon Sep 17 00:00:00 2001 From: John <139219226+akhil-deriv@users.noreply.github.com> Date: Wed, 17 Jul 2024 08:00:56 +0400 Subject: [PATCH 161/162] refactor(version): updated the version of flutter deriv api (#694) --- packages/deriv_auth/example/pubspec.yaml | 2 +- packages/deriv_auth/pubspec.yaml | 2 +- packages/deriv_passkeys/pubspec.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/deriv_auth/example/pubspec.yaml b/packages/deriv_auth/example/pubspec.yaml index a2b58d10e..24fd8a335 100644 --- a/packages/deriv_auth/example/pubspec.yaml +++ b/packages/deriv_auth/example/pubspec.yaml @@ -23,7 +23,7 @@ dependency_overrides: flutter_deriv_api: git: url: git@github.com:deriv-com/flutter-deriv-api.git - ref: v1.0.0 + ref: v1.1.0 dev_dependencies: flutter_test: diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index e5b3ce7af..72b07302f 100644 --- a/packages/deriv_auth/pubspec.yaml +++ b/packages/deriv_auth/pubspec.yaml @@ -39,7 +39,7 @@ dependencies: flutter_deriv_api: git: url: git@github.com:deriv-com/flutter-deriv-api.git - ref: v1.0.0 + ref: v1.1.0 deriv_web_view: git: diff --git a/packages/deriv_passkeys/pubspec.yaml b/packages/deriv_passkeys/pubspec.yaml index bfa022152..dd3a1969a 100644 --- a/packages/deriv_passkeys/pubspec.yaml +++ b/packages/deriv_passkeys/pubspec.yaml @@ -43,7 +43,7 @@ dependencies: flutter_deriv_api: git: url: git@github.com:deriv-com/flutter-deriv-api.git - ref: v1.0.0 + ref: v1.1.0 flutter_svg: ^2.0.9 plugin_platform_interface: ^2.0.2 From de3435a903a120dff53e392f869d43b34668ddd1 Mon Sep 17 00:00:00 2001 From: mobile-apps-deriv <134251399+mobile-apps-deriv@users.noreply.github.com> Date: Wed, 17 Jul 2024 12:15:53 +0800 Subject: [PATCH 162/162] chore(version): bump version and update changelog (#696) Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: sahani-deriv --- CHANGELOG.md | 26 ++++++++++++++++++++++++++ README.md | 4 ++-- packages/deriv_auth/CHANGELOG.md | 4 ++++ packages/deriv_auth/pubspec.yaml | 4 ++-- packages/deriv_passkeys/CHANGELOG.md | 4 ++++ packages/deriv_passkeys/pubspec.yaml | 2 +- 6 files changed, 39 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c69417496..3df7b664a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,32 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-07-17 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`deriv_auth` - `v6.7.17`](#deriv_auth---v6717) + - [`deriv_passkeys` - `v0.0.3+5`](#deriv_passkeys---v0035) + +--- + +#### `deriv_auth` - `v6.7.17` + + - **REFACTOR**(version): updated the version of flutter deriv api ([#694](https://github.com/regentmarkets/flutter-deriv-packages/issues/694)). ([eac7e8cb](https://github.com/regentmarkets/flutter-deriv-packages/commit/eac7e8cba4e9310d30296e07a47731f08d4d7342)) + +#### `deriv_passkeys` - `v0.0.3+5` + + - **REFACTOR**(version): updated the version of flutter deriv api ([#694](https://github.com/regentmarkets/flutter-deriv-packages/issues/694)). ([eac7e8cb](https://github.com/regentmarkets/flutter-deriv-packages/commit/eac7e8cba4e9310d30296e07a47731f08d4d7342)) + + ## 2024-07-16 ### Changes diff --git a/README.md b/README.md index c13489467..829032b11 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ cp $HOME/Downloads/commit-msg $HOME/.git/hooks/commit-msg \ ## Using the packages -Each package has been released as git tag with convention as **packageName-vVersionNumber**`(Example: deriv_auth-v6.7.16)`. 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.7.17)`. To use the package, add the following to your pubspec.yaml file: ```yaml deriv_ui: @@ -30,7 +30,7 @@ deriv_ui: | Name | Description | Version | | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | | [analytics](./packages/analytics) | Used to collect and send analytical information to 'Firebase' and 'Segment'. | [v2.1.0](./packages/analytics/CHANGELOG.md) | -| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.16 ](./packages/deriv_auth/CHANGELOG.md) | +| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.17 ](./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) | diff --git a/packages/deriv_auth/CHANGELOG.md b/packages/deriv_auth/CHANGELOG.md index b3f168f04..0560ff53b 100644 --- a/packages/deriv_auth/CHANGELOG.md +++ b/packages/deriv_auth/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.7.17 + + - **REFACTOR**(version): updated the version of flutter deriv api ([#694](https://github.com/regentmarkets/flutter-deriv-packages/issues/694)). ([eac7e8cb](https://github.com/regentmarkets/flutter-deriv-packages/commit/eac7e8cba4e9310d30296e07a47731f08d4d7342)) + ## 6.7.16 - Update a dependency to the latest release. diff --git a/packages/deriv_auth/pubspec.yaml b/packages/deriv_auth/pubspec.yaml index 72b07302f..e7a52565d 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.7.16 +version: 6.7.17 environment: sdk: ">=3.0.0 <4.0.0" @@ -57,7 +57,7 @@ dependencies: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: deriv_passkeys-v0.0.3+4 + ref: deriv_passkeys-v0.0.3+5 deriv_language_selector: git: diff --git a/packages/deriv_passkeys/CHANGELOG.md b/packages/deriv_passkeys/CHANGELOG.md index ba8fbe370..18d4afa6a 100644 --- a/packages/deriv_passkeys/CHANGELOG.md +++ b/packages/deriv_passkeys/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.3+5 + + - **REFACTOR**(version): updated the version of flutter deriv api ([#694](https://github.com/regentmarkets/flutter-deriv-packages/issues/694)). ([eac7e8cb](https://github.com/regentmarkets/flutter-deriv-packages/commit/eac7e8cba4e9310d30296e07a47731f08d4d7342)) + ## 0.0.3+4 - **FIX**(deriv_passkeys): fix some missing keys in passkey login page ([#692](https://github.com/regentmarkets/flutter-deriv-packages/issues/692)). ([d944a1c3](https://github.com/regentmarkets/flutter-deriv-packages/commit/d944a1c37f127f35143d9920532f76bc3487ebd4)) diff --git a/packages/deriv_passkeys/pubspec.yaml b/packages/deriv_passkeys/pubspec.yaml index dd3a1969a..bc67652da 100644 --- a/packages/deriv_passkeys/pubspec.yaml +++ b/packages/deriv_passkeys/pubspec.yaml @@ -1,6 +1,6 @@ name: deriv_passkeys description: Deriv Passkeys Flutter Plugin -version: 0.0.3+4 +version: 0.0.3+5 publish_to: "none" environment: