diff --git a/CHANGELOG.md b/CHANGELOG.md index 35d73a2e5..f149e381e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,217 @@ 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 + +--- + +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 + +--- + +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 + +--- + +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 + +--- + +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 + +--- + +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..28ded8060 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.7)`. To use the package, add the following to your pubspec.yaml file: ```yaml @@ -12,39 +12,39 @@ 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 | 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) | +| [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_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_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_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.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.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) | +| [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/melos.yaml b/melos.yaml index 8e75065c7..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: @@ -43,3 +44,4 @@ scripts: ignore: # Ignore until we have a proper test. - "deriv_feature_flag" + - "deriv_auth" 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/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/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/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 { diff --git a/packages/deriv_auth/CHANGELOG.md b/packages/deriv_auth/CHANGELOG.md index f88243977..f6108faa2 100644 --- a/packages/deriv_auth/CHANGELOG.md +++ b/packages/deriv_auth/CHANGELOG.md @@ -1,3 +1,23 @@ +## 6.6.8 + + - Update a dependency to the latest release. + +## 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)) + +## 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)) + ## 6.6.3 - **REFACTOR**: update dependencies. ([af89e148](https://github.com/regentmarkets/flutter-deriv-packages/commit/af89e148dfecb6dbc8552b2b883cbad4102a56f8)) 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 23e6083df..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.3 +version: 6.6.8 environment: sdk: ">=3.0.0 <4.0.0" @@ -20,10 +20,10 @@ dependencies: deriv_ui: git: - url: git@github.com:emad-deriv/flutter-deriv-packages.git + url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: emad/add-language-parameter_to-webview-package - + ref: deriv_ui-v0.0.7+6 + deriv_http_client: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git @@ -37,28 +37,28 @@ dependencies: deriv_web_view: git: - url: git@github.com:emad-deriv/flutter-deriv-packages.git + url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_web_view - ref: emad/add-language-parameter_to-webview-package + ref: deriv_web_view-v0.2.2+1 deriv_localizations: git: url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_localizations - ref: deriv_localizations-v1.4.1 + ref: deriv_localizations-v1.4.4 deriv_passkeys: git: - url: git@github.com:emad-deriv/flutter-deriv-packages.git + url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_passkeys - ref: emad/add-language-parameter_to-webview-package - + ref: deriv_passkeys-v0.0.2 + deriv_language_selector: git: - url: git@github.com:emad-deriv/flutter-deriv-packages.git + url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_language_selector - ref: emad/add-language-parameter_to-webview-package - + ref: deriv_language_selector-v0.0.2+4 + flutter_bloc: ^8.1.3 flutter_svg: ^2.0.7 smooth_page_indicator: ^1.1.0 @@ -73,15 +73,13 @@ 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 bloc_test: ^9.1.6 flutter_test: sdk: flutter - integration_test: - sdk: flutter flutter_lints: ^2.0.0 patrol_finders: ^1.0.0 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 0f2966938..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: @@ -12,9 +12,9 @@ dependencies: sdk: flutter deriv_ui: git: - url: git@github.com:emad-deriv/flutter-deriv-packages.git + url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: emad/add-language-parameter_to-webview-package + 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_localizations/CHANGELOG.md b/packages/deriv_localizations/CHANGELOG.md index 2feffb3f2..d162f2858 100644 --- a/packages/deriv_localizations/CHANGELOG.md +++ b/packages/deriv_localizations/CHANGELOG.md @@ -1,3 +1,15 @@ +## 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)) + +## 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/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..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.", @@ -52,7 +55,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_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_en.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_en.arb index e97a76898..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.", @@ -51,8 +54,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/deriv_passkeys/app_es.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_es.arb index bd11a3527..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.", @@ -51,7 +54,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..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.", @@ -52,7 +55,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_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 a425d9c1f..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 키체인.", @@ -52,7 +55,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_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 da5958826..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,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 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.", @@ -45,18 +48,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_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 60ecace66..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,6 +26,9 @@ "howToCreatePasskey": "จะสร้าง Passkey ได้อย่างไร?", "howToCreatePasskeyDescription1": "ไปที่ 'การตั้งค่าบัญชี' บน Deriv", "howToCreatePasskeyDescription2": "คุณสามารถสร้างหนึ่ง Passkey ต่ออุปกรณ์", + "p2pHowToCreatePasskey": "จะสร้าง Passkey ได้อย่างไร?", + "p2pHowToCreatePasskeyDescription1": "ไปที่ 'โปรไฟล์' ในแอป Deriv P2P ของคุณ", + "p2pHowToCreatePasskeyDescription2": "แตะ 'Passkeys' เพื่อสร้าง Passkey ของคุณ", "whereArePasskeysSaved": "Passkey จะถูกบันทึกไว้ที่ไหน?", "whereArePasskeysSavedDescriptionAndroid": "Android: ตัวจัดการรหัสผ่าน Google", "whereArePasskeysSavedDescriptionIOS": "iOS: พวงกุญแจ iCloud", @@ -51,7 +54,7 @@ "lastUsed": "ใช้ครั้งล่าสุด", "rename": "เปลี่ยนชื่อ", "revoke": "เพิกถอน", - "continueTradingButtonText": "ทำการเทรดต่อไป", + "continueTradingButtonText": "ดำเนินการเทรดต่อ", "addMorePasskeysButtonText": "เพิ่มจำนวน Passkey", "unableToSetupPasskey": "ไม่สามารถตั้งค่า Passkey ได้", "unableToSetupPasskeyDescription": "เราพบปัญหาขณะตั้งค่า Passkey ของคุณ กระบวนการอาจถูกขัดจังหวะหรือเซสชั่นหมดเวลา โปรดลองอีกครั้ง", 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..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,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": "Passkey nasıl oluşturulur?", + "p2pHowToCreatePasskeyDescription1": "Deriv P2P uygulamanızdaki 'Profil' bölümüne gidin.", + "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.", @@ -52,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_vi.arb b/packages/deriv_localizations/lib/l10n/deriv_passkeys/app_vi.arb index 39a97ff12..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.", @@ -52,7 +55,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", 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..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,6 +26,9 @@ "howToCreatePasskey": "如何建立金鑰?", "howToCreatePasskeyDescription1": "轉到 Deriv 的‘帳戶設定‘。", "howToCreatePasskeyDescription2": "可以為每個裝置建立一個金鑰。", + "p2pHowToCreatePasskey": "如何建立金鑰?", + "p2pHowToCreatePasskeyDescription1": "在 Deriv P2P 應用程式中轉到‘個人資料‘。", + "p2pHowToCreatePasskeyDescription2": "點選‘密鑰‘以建立密鑰。", "whereArePasskeysSaved": "金鑰儲存在哪裡?", "whereArePasskeysSavedDescriptionAndroid": "Android: Google 密碼管理器。", "whereArePasskeysSavedDescriptionIOS": "iOS:iCloud 鑰匙圈。", 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 c694130ce..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: @@ -390,13 +408,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_ar.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_ar.dart index e99ec19f7..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 @@ -63,6 +63,15 @@ class DerivPasskeysLocalizationsAr extends DerivPasskeysLocalizations { @override String get howToCreatePasskeyDescription2 => 'يمكنك إنشاء Passkey واحد لكل جهاز.'; + @override + String get p2pHowToCreatePasskey => 'كيفية إنشاء مفتاح مرور؟'; + + @override + String get p2pHowToCreatePasskeyDescription1 => 'انتقل إلى «الملف الشخصي» في تطبيق Deriv P2P الخاص بك.'; + + @override + String get p2pHowToCreatePasskeyDescription2 => 'انقر فوق «مفاتيح المرور» لإنشاء مفتاح المرور الخاص بك.'; + @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..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 @@ -63,6 +63,15 @@ class DerivPasskeysLocalizationsBn extends DerivPasskeysLocalizations { @override String get howToCreatePasskeyDescription2 => 'Passkey প্রতি ডিভাইসে একটি পাসকি তৈরি করতে পারেন।'; + @override + String get p2pHowToCreatePasskey => 'কিভাবে পাসকি তৈরি করবেন?'; + + @override + String get p2pHowToCreatePasskeyDescription1 => 'আপনার ডেরিভ পি 2 পি অ্যাপের \'প্রোফাইল\' এ যান।'; + + @override + 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 fb68e5a10..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 @@ -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 => 'Wie erstelle ich einen Passkey?'; + + @override + String get p2pHowToCreatePasskeyDescription1 => 'Gehen Sie in Ihrer Deriv P2P-App zu „Profil“.'; + + @override + 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_en.dart b/packages/deriv_localizations/lib/l10n/generated/deriv_passkeys/deriv_passkeys_localizations_en.dart index 991953ef4..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?'; @@ -139,10 +148,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'; 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..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 @@ -63,6 +63,15 @@ class DerivPasskeysLocalizationsEs extends DerivPasskeysLocalizations { @override String get howToCreatePasskeyDescription2 => 'Puede crear una passkey por dispositivo.'; + @override + String get p2pHowToCreatePasskey => '¿Cómo crear una clave de paso?'; + + @override + String get p2pHowToCreatePasskeyDescription1 => 'Ir a «Perfil» en tu aplicación Deriv P2P.'; + + @override + String get p2pHowToCreatePasskeyDescription2 => 'Pulsa «Claves de paso» para crear tu clave de paso.'; + @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..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 @@ -63,6 +63,15 @@ class DerivPasskeysLocalizationsFr extends DerivPasskeysLocalizations { @override String get howToCreatePasskeyDescription2 => 'Vous pouvez créer une Passkey par appareil.'; + @override + String get p2pHowToCreatePasskey => 'Comment créer une clé d\'accès ?'; + + @override + String get p2pHowToCreatePasskeyDescription1 => 'Accéder à « Profil » dans votre application Deriv P2P.'; + + @override + 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 ?'; @@ -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..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 @@ -63,6 +63,15 @@ class DerivPasskeysLocalizationsIt extends DerivPasskeysLocalizations { @override String get howToCreatePasskeyDescription2 => 'Può creare una sola Passkey per dispositivo.'; + @override + String get p2pHowToCreatePasskey => 'Come creare una passkey?'; + + @override + String get p2pHowToCreatePasskeyDescription1 => 'Vai a «Profilo» nella tua app Deriv P2P.'; + + @override + 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 9187c63c8..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 @@ -63,6 +63,15 @@ class DerivPasskeysLocalizationsKo extends DerivPasskeysLocalizations { @override String get howToCreatePasskeyDescription2 => '기기당 하나의 Passkey를 만들 수 있습니다.'; + @override + String get p2pHowToCreatePasskey => '암호 키는 어떻게 만드나요?'; + + @override + String get p2pHowToCreatePasskeyDescription1 => 'Deriv P2P 앱에서 \'프로필\'로 이동합니다.'; + + @override + String get p2pHowToCreatePasskeyDescription2 => '\'암호\'를 눌러 암호를 생성합니다.'; + @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..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 @@ -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 => 'Jak utworzyć klucz hasłowy?'; + + @override + String get p2pHowToCreatePasskeyDescription1 => 'Przejdź do „Profil” w aplikacji Deriv P2P.'; + + @override + 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 d6d15b89a..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 @@ -63,6 +63,15 @@ class DerivPasskeysLocalizationsPt extends DerivPasskeysLocalizations { @override String get howToCreatePasskeyDescription2 => 'Pode criar uma passkey por dispositivo.'; + @override + String get p2pHowToCreatePasskey => 'Como criar uma chave de acesso?'; + + @override + String get p2pHowToCreatePasskeyDescription1 => 'Vá para \'Perfil\' em seu aplicativo Deriv P2P.'; + + @override + 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?'; @@ -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..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 @@ -63,6 +63,15 @@ class DerivPasskeysLocalizationsRu extends DerivPasskeysLocalizations { @override String get howToCreatePasskeyDescription2 => 'Вы можете создать один passkey для каждого устройства.'; + @override + String get p2pHowToCreatePasskey => 'Как создать пароль?'; + + @override + String get p2pHowToCreatePasskeyDescription1 => 'Перейдите на «Профиль» в приложении Deriv P2P.'; + + @override + 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 a6e443611..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 @@ -63,6 +63,15 @@ class DerivPasskeysLocalizationsSi extends DerivPasskeysLocalizations { @override String get howToCreatePasskeyDescription2 => 'ඔබට එක් උපාංගයකට එක් passkey එකක් සෑදිය හැක.'; + @override + String get p2pHowToCreatePasskey => 'මුරපද නිර්මාණය කරන්නේ කෙසේද?'; + + @override + String get p2pHowToCreatePasskeyDescription1 => 'ඔබේ ඩෙරිව් පී 2 පී යෙදුමේ \'පැතිකඩ\' වෙත යන්න.'; + + @override + 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 d60317234..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 @@ -63,6 +63,15 @@ class DerivPasskeysLocalizationsSw extends DerivPasskeysLocalizations { @override String get howToCreatePasskeyDescription2 => 'Unaweza kuunda passkey moja kwa kila kifaa.'; + @override + String get p2pHowToCreatePasskey => 'Jinsi ya kuunda passkey?'; + + @override + String get p2pHowToCreatePasskeyDescription1 => 'Nenda kwenye \'Profaili\' katika programu yako ya Deriv P2P.'; + + @override + 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 8fcd074a0..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 @@ -63,6 +63,15 @@ class DerivPasskeysLocalizationsTh extends DerivPasskeysLocalizations { @override String get howToCreatePasskeyDescription2 => 'คุณสามารถสร้างหนึ่ง Passkey ต่ออุปกรณ์'; + @override + String get p2pHowToCreatePasskey => 'วิธีการสร้างรหัสผ่าน'; + + @override + String get p2pHowToCreatePasskeyDescription1 => 'ไปที่ \'โปรไฟล์\' ในแอป Deriv P2P ของคุณ'; + + @override + String get p2pHowToCreatePasskeyDescription2 => 'แตะ \'รหัสผ่าน\' เพื่อสร้างรหัสผ่านของคุณ'; + @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..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 @@ -63,6 +63,15 @@ class DerivPasskeysLocalizationsTr extends DerivPasskeysLocalizations { @override String get howToCreatePasskeyDescription2 => 'Cihaz başına bir passkey oluşturabilirsiniz.'; + @override + String get p2pHowToCreatePasskey => 'Parola 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.'; + @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..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 @@ -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 => 'Làm thế nào để tạo mật khẩu?'; + + @override + String get p2pHowToCreatePasskeyDescription1 => 'Chuyển đến \'Hồ sơ\' trong ứng dụng Deriv P2P của bạn.'; + + @override + 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?'; @@ -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..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 @@ -63,6 +63,15 @@ class DerivPasskeysLocalizationsZh extends DerivPasskeysLocalizations { @override String get howToCreatePasskeyDescription2 => '可以為每個裝置建立一個金鑰。'; + @override + String get p2pHowToCreatePasskey => '如何建立密碼?'; + + @override + String get p2pHowToCreatePasskeyDescription1 => '在您的 Deriv P2P 應用程序中轉到「個人資料」。'; + + @override + String get p2pHowToCreatePasskeyDescription2 => '點擊「密碼」以建立您的密碼。'; + @override String get whereArePasskeysSaved => '金鑰儲存在哪裡?'; diff --git a/packages/deriv_localizations/pubspec.yaml b/packages/deriv_localizations/pubspec.yaml index 7db5a04da..aa2b18e4f 100644 --- a/packages/deriv_localizations/pubspec.yaml +++ b/packages/deriv_localizations/pubspec.yaml @@ -3,12 +3,11 @@ description: This packages contains all localizations for the deriv packages publish_to: 'none' -version: 1.4.1 +version: 1.4.4 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 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..ac0b885f0 --- /dev/null +++ b/packages/deriv_logger/CHANGELOG.md @@ -0,0 +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/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 000000000..db77bb4b7 Binary files /dev/null and b/packages/deriv_logger/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ 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 000000000..17987b79b Binary files /dev/null and b/packages/deriv_logger/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/packages/deriv_logger/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/packages/deriv_logger/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000..09d439148 Binary files /dev/null and b/packages/deriv_logger/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ 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 000000000..d5f1c8d34 Binary files /dev/null and b/packages/deriv_logger/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ 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 000000000..4d6372eeb Binary files /dev/null and b/packages/deriv_logger/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ 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 000000000..dc9ada472 Binary files /dev/null and b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 000000000..7353c41ec Binary files /dev/null and b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ 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 000000000..797d452e4 Binary files /dev/null and b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ 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 000000000..6ed2d933e Binary files /dev/null and b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ 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 000000000..4cd7b0099 Binary files /dev/null and b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ 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 000000000..fe730945a Binary files /dev/null and b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 000000000..321773cd8 Binary files /dev/null and b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 000000000..797d452e4 Binary files /dev/null and b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ 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 000000000..502f463a9 Binary files /dev/null and b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 000000000..0ec303439 Binary files /dev/null and b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ 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 000000000..0ec303439 Binary files /dev/null and b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ 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 000000000..e9f5fea27 Binary files /dev/null and b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 000000000..84ac32ae7 Binary files /dev/null and b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 000000000..8953cba09 Binary files /dev/null and b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ 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 000000000..0467bf12a Binary files /dev/null and b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ 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 000000000..9da19eaca Binary files /dev/null and b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ 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 000000000..9da19eaca Binary files /dev/null and b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ 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 000000000..9da19eaca Binary files /dev/null and b/packages/deriv_logger/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ 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..8b85a3d84 --- /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.2 + +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/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..4a8a4e3b9 100644 --- a/packages/deriv_passkeys/CHANGELOG.md +++ b/packages/deriv_passkeys/CHANGELOG.md @@ -1,3 +1,25 @@ +## 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. + +## 0.0.1+7 + + - Update a dependency to the latest release. + +## 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)) + - **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/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 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/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/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/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 cc308d638..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,222 +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 - .derivPasskeysLocalizations.howToCreatePasskey, - texts: [ - context.derivPasskeysLocalizations - .howToCreatePasskeyDescription1, - context.derivPasskeysLocalizations - .howToCreatePasskeyDescription2 - ], - ), - 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 - .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.whyPasskeys, + texts: [ + context.derivPasskeysLocalizations + .whyPasskeysDescription1, + context.derivPasskeysLocalizations + .whyPasskeysDescription2 + ], ), - ), - 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, + Padding( + padding: const EdgeInsets.symmetric(vertical: 16), + child: Divider( + color: context.theme.colors.hover, + ), + ), + SectionTitleAndContent( + title: context.read().isDp2p + ? context.derivPasskeysLocalizations + .p2pHowToCreatePasskey + : context.derivPasskeysLocalizations + .howToCreatePasskey, + texts: [ + context.read().isDp2p + ? context.derivPasskeysLocalizations + .p2pHowToCreatePasskeyDescription1 + : context.derivPasskeysLocalizations + .howToCreatePasskeyDescription1, + context.read().isDp2p + ? context.derivPasskeysLocalizations + .p2pHowToCreatePasskeyDescription2 + : 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, ), ), - 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 a3dfe172d..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'; @@ -10,6 +12,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 +20,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 +49,7 @@ class DerivPasskeysBloc extends Bloc { await derivPasskeysService .verifyCredential( jwtToken: jwtToken, - passkeysConnectionInfoEntity: connectionInfo, + passkeysConnectionInfoEntity: passkeysConnectionInfo ?? connectionInfo, userAgent: WebSocket.userAgent, ) .then((DerivPasskeysVerifyCredentialsResponseEntity @@ -144,8 +147,24 @@ class DerivPasskeysBloc extends Bloc { add(const SetDerivPasskeysNotSupportedEvent()); } }); + + /// Initialize the analytics repository. + AnalyticsRepository.init( + connectionInfo.appId, + derivRudderstack: DerivRudderstack(), + ); } + /// 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/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 c739f35f9..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( @@ -28,6 +32,7 @@ class ContinueWithPasskeyButton extends StatelessWidget { } return InkWell( + key: const Key('continueWithPasskeysButtonKey'), child: Container( padding: const EdgeInsets.symmetric( horizontal: 16, @@ -70,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 0a2f5ad58..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+4 +version: 0.0.2 publish_to: "none" environment: @@ -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.1 + ref: deriv_localizations-v1.4.4 + deriv_ui: git: - url: git@github.com:emad-deriv/flutter-deriv-packages.git + url: git@github.com:regentmarkets/flutter-deriv-packages.git path: packages/deriv_ui - ref: emad/add-language-parameter_to-webview-package + 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 b6ae89df7..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,13 +36,23 @@ class _TestPage extends StatelessWidget { } void main() { + late MockDerivRudderstack derivRudderstack; group('LearnMorePasskeysPage', () { - late MockDerivPasskeysBloc derivPasskeysBloc; setUp(() { - derivPasskeysBloc = MockDerivPasskeysBloc(); + setupDerivPasskeysBloc(); + + derivRudderstack = MockDerivRudderstack(); + + when(() => derivRudderstack.track( + eventName: any(named: 'eventName'), + properties: any(named: 'properties'), + )).thenAnswer( + (_) => Future.value(true), + ); - when(() => derivPasskeysBloc.state).thenReturn( - DerivPasskeysInitializedState(), + 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: () {}, + ), ), ); } 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 dcb08b259..a64bcb381 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 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.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" 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"