Skip to content

Commit

Permalink
Merge branch 'master' of github.com:regentmarkets/flutter-deriv-packa…
Browse files Browse the repository at this point in the history
…ges into deriv-auth/feat/single_entry
  • Loading branch information
ahrar-deriv committed Jan 26, 2024
2 parents 0e592c4 + 1f6eb85 commit fc8b0bb
Show file tree
Hide file tree
Showing 35 changed files with 287 additions and 134 deletions.
118 changes: 118 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,124 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 2024-01-26

### Changes

---

Packages with breaking changes:

- There are no breaking changes in this release.

Packages with other changes:

- [`deriv_auth` - `v2.0.6`](#deriv_auth---v206)

---

#### `deriv_auth` - `v2.0.6`

- **REFACTOR**(deriv_auth): improve reset password error handling ([#417](https://github.com/regentmarkets/flutter-deriv-packages/issues/417)). ([cc2d2ebb](https://github.com/regentmarkets/flutter-deriv-packages/commit/cc2d2ebbbecf53de56aa7c067aec4ad505fcc6b5))


## 2024-01-23

### Changes

---

Packages with breaking changes:

- There are no breaking changes in this release.

Packages with other changes:

- [`deriv_auth` - `v2.0.4`](#deriv_auth---v204)

---

#### `deriv_auth` - `v2.0.4`

- **REFACTOR**(deriv_auth): renamed localization getter in ContextExtension ([#414](https://github.com/regentmarkets/flutter-deriv-packages/issues/414)). ([b625fbce](https://github.com/regentmarkets/flutter-deriv-packages/commit/b625fbce37e7acfd9454ba16b908207aee3c9a86))
- **REFACTOR**(deriv_auth): Update package info plus deriv auth ([#410](https://github.com/regentmarkets/flutter-deriv-packages/issues/410)). ([e2e717f3](https://github.com/regentmarkets/flutter-deriv-packages/commit/e2e717f36e93039cadc706cc29b12b48a7c1b411))


## 2024-01-23

### Changes

---

Packages with breaking changes:

- There are no breaking changes in this release.

Packages with other changes:

- [`deriv_ui` - `v0.0.2+2`](#deriv_ui---v0022)
- [`deriv_auth` - `v2.0.3`](#deriv_auth---v203)

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` - `v2.0.3`

---

#### `deriv_ui` - `v0.0.2+2`

- **REFACTOR**(deriv_ui): updated flutter_svg ([#411](https://github.com/regentmarkets/flutter-deriv-packages/issues/411)). ([2289efcb](https://github.com/regentmarkets/flutter-deriv-packages/commit/2289efcbfe3b7de160e0c4cee58b72a347d78eb9))


## 2024-01-23

### Changes

---

Packages with breaking changes:

- There are no breaking changes in this release.

Packages with other changes:

- [`deriv_banner` - `v0.0.1+1`](#deriv_banner---v0011)
- [`deriv_store_launcher` - `v0.0.1+1`](#deriv_store_launcher---v0011)

---

#### `deriv_banner` - `v0.0.1+1`

- **REFACTOR**(deriv_banner): updated kotlin version ([#399](https://github.com/regentmarkets/flutter-deriv-packages/issues/399)). ([9c19b5b4](https://github.com/regentmarkets/flutter-deriv-packages/commit/9c19b5b45aaa40897a7b9884794ab9cbb29fe4ff))

#### `deriv_store_launcher` - `v0.0.1+1`

- **REFACTOR**(deriv_store_launcher): udpated kotlin and gradle version ([#400](https://github.com/regentmarkets/flutter-deriv-packages/issues/400)). ([ad9d72e1](https://github.com/regentmarkets/flutter-deriv-packages/commit/ad9d72e10186e695a72d022d3b3f6ebdd5120666))


## 2024-01-23

### Changes

---

Packages with breaking changes:

- There are no breaking changes in this release.

Packages with other changes:

- [`update_checker` - `v1.2.1`](#update_checker---v121)

---

#### `update_checker` - `v1.2.1`

- **REFACTOR**(update_checker): increase package info plus version ([#407](https://github.com/regentmarkets/flutter-deriv-packages/issues/407)). ([5147c12b](https://github.com/regentmarkets/flutter-deriv-packages/commit/5147c12bd6b49aed82dd4e3036f63de79816edba))


## 2024-01-23

### Changes
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ 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-v2.0.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-v2.0.6)`. To use the package, add the following to your pubspec.yaml file:

```yaml
deriv_ui:
git:
url: [email protected]:regentmarkets/flutter-deriv-packages.git
path: packages/deriv_ui
ref: deriv_ui-v0.0.2+1 #your prefered version
ref: deriv_ui-v0.0.2+2 #your prefered version
```
## Packages
| Name | Description | Version |
| ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| [analytics](./packages/analytics) | Used to collect and send analytical information to 'Firebase' and 'Segment'. | [v1.0.2](./packages/analytics/CHANGELOG.md) |
| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v2.0.2 ](./packages/deriv_auth/CHANGELOG.md) |
| [deriv_banner](./packages/deriv_banner) | A widget to show banner in apps. | [v0.0.1](./packages/deriv_banner/CHANGELOG.md) |
| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v2.0.6 ](./packages/deriv_auth/CHANGELOG.md) |
| [deriv_banner](./packages/deriv_banner) | A widget to show banner in apps. | [v0.0.1+1](./packages/deriv_banner/CHANGELOG.md) |
| [deriv_bloc_manager](./packages/deriv_bloc_manager) | Provides some tools to manage blocs. | [v0.0.1](./packages/deriv_bloc_manager/CHANGELOG.md) |
| [deriv_datadog](./packages/deriv_datadog) | A package that helps you monitor the performance and user interactions of your Flutter app by sending data to Datadog. | [v0.0.1](./packages/deriv_datadog/CHANGELOG.md) |
| [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+2](./packages/deriv_date_range_picker/CHANGELOG.md) |
Expand All @@ -33,15 +33,15 @@ deriv_ui:
| [deriv_localizations](./packages/deriv_localizations) | A Package that contains the localization arb(coming from Crowdin) and dart generated files for flutter_deriv_packages. |
| [deriv_numpad](./packages/deriv_numpad) | Number Pad Widget for number input. | [v1.1.0](./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](./packages/deriv_store_launcher/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.2.0](./packages/deriv_theme/CHANGELOG.md) |
| [deriv_ui](./packages/deriv_ui) | A package that contains the UI components used by Deriv products. | [v0.0.2+1](./packages/deriv_ui/CHANGELOG.md) |
| [deriv_ui](./packages/deriv_ui) | A package that contains the UI components used by Deriv products. | [v0.0.2+2](./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.0.1+1](./packages/deriv_web_view/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.0](./packages/update_checker/CHANGELOG.md) |
| [update_checker](./packages/update_checker) | Check and retrieve update information from the server for the given package. | [v1.2.1](./packages/update_checker/CHANGELOG.md) |
| [deriv_feature_flag](./packages/deriv_feature_flag) | A package to provide feature flag functionality for apps. | [v0.0.1](./packages/deriv_feature_flag/CHANGELOG.md) |
## Environment Setup
Expand Down
13 changes: 13 additions & 0 deletions packages/deriv_auth/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## 2.0.6

- **REFACTOR**(deriv_auth): improve reset password error handling ([#417](https://github.com/regentmarkets/flutter-deriv-packages/issues/417)). ([cc2d2ebb](https://github.com/regentmarkets/flutter-deriv-packages/commit/cc2d2ebbbecf53de56aa7c067aec4ad505fcc6b5))

## 2.0.4

- **REFACTOR**(deriv_auth): renamed localization getter in ContextExtension ([#414](https://github.com/regentmarkets/flutter-deriv-packages/issues/414)). ([b625fbce](https://github.com/regentmarkets/flutter-deriv-packages/commit/b625fbce37e7acfd9454ba16b908207aee3c9a86))
- **REFACTOR**(deriv_auth): Update package info plus deriv auth ([#410](https://github.com/regentmarkets/flutter-deriv-packages/issues/410)). ([e2e717f3](https://github.com/regentmarkets/flutter-deriv-packages/commit/e2e717f36e93039cadc706cc29b12b48a7c1b411))

## 2.0.3

- Update a dependency to the latest release.

## 2.0.2

- **FIX**(deriv_auth): fix overflow issue in change password layout ([#404](https://github.com/regentmarkets/flutter-deriv-packages/issues/404)). ([abd05684](https://github.com/regentmarkets/flutter-deriv-packages/commit/abd056841f774ffb806e76569b60701d2fa74808))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ import 'package:flutter/material.dart';
/// Extension methods for [BuildContext].
extension ContextExtension on BuildContext {
/// Gets [DerivAuthUILocalization].
DerivAuthLocalization get localization => DerivAuthLocalization.of(this);
DerivAuthLocalization get derivAuthLocalization =>
DerivAuthLocalization.of(this);
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ String getCountryConsentMessage(
}

final Map<String, String> consentMessages = <String, String>{
'br': context.localization.labelCountryConsentBrazil,
'br': context.derivAuthLocalization.labelCountryConsentBrazil,
// Add more countries and consent messages here.
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class DerivUnavailableCountryLayout extends StatelessWidget {
Widget build(BuildContext context) => Scaffold(
appBar: AppBar(
elevation: ThemeProvider.zeroMargin,
title: Text(context.localization.labelNotAvailable),
title: Text(context.derivAuthLocalization.labelNotAvailable),
),
body: Container(
padding:
Expand All @@ -50,22 +50,23 @@ class DerivUnavailableCountryLayout extends StatelessWidget {
children: <Widget>[
const SizedBox(height: ThemeProvider.margin16),
Text(
context.localization.warnNotAvailableCountriesTitle(appName),
context.derivAuthLocalization
.warnNotAvailableCountriesTitle(appName),
style: TextStyles.title,
textAlign: TextAlign.center,
),
const SizedBox(height: ThemeProvider.margin08),
RichText(
text: TextSpan(
text: context.localization.warnNotAvailableCountries,
text: context.derivAuthLocalization.warnNotAvailableCountries,
style: context.theme.textStyle(
textStyle: TextStyles.body1,
color: context.theme.colors.general,
),
children: <InlineSpan>[
buildTextSpanHyperlink(
context: context,
label: context.localization.labelLiveChat,
label: context.derivAuthLocalization.labelLiveChat,
onTap: onLiveChatPressed,
style: context.theme.textStyle(
textStyle: TextStyles.body1Bold,
Expand Down
48 changes: 24 additions & 24 deletions packages/deriv_auth/lib/core/states/auth_error_state_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,107 +20,107 @@ base class AuthErrorStateHandler {
void invalid2faCode(DerivAuthErrorState state) {
showErrorDialog(
context: context,
errorMessage: context.localization.informInvalid2FACode,
actionLabel: context.localization.actionTryAgain,
errorMessage: context.derivAuthLocalization.informInvalid2FACode,
actionLabel: context.derivAuthLocalization.actionTryAgain,
);
}

/// On account is not activated.
void onAccountUnavailable(DerivAuthErrorState state) {
showErrorDialog(
context: context,
errorMessage: context.localization.informDeactivatedAccount,
actionLabel: context.localization.actionTryAgain,
errorMessage: context.derivAuthLocalization.informDeactivatedAccount,
actionLabel: context.derivAuthLocalization.actionTryAgain,
);
}

/// On expired account.
void onExpiredAccount(DerivAuthErrorState state) {
showErrorDialog(
context: context,
errorMessage: context.localization.informExpiredAccount,
actionLabel: context.localization.actionTryAgain,
errorMessage: context.derivAuthLocalization.informExpiredAccount,
actionLabel: context.derivAuthLocalization.actionTryAgain,
);
}

/// On failed authorization.
void onFailedAuthorization(DerivAuthErrorState state) {
showErrorDialog(
context: context,
errorMessage: context.localization.informFailedAuthorization,
actionLabel: context.localization.actionTryAgain,
errorMessage: context.derivAuthLocalization.informFailedAuthorization,
actionLabel: context.derivAuthLocalization.actionTryAgain,
);
}

/// User is trying to authenticate from an unsupported residence.
void onInavlidResidence(DerivAuthErrorState state) {
showErrorDialog(
context: context,
errorMessage: context.localization.informInvalidResidence,
actionLabel: context.localization.actionTryAgain,
errorMessage: context.derivAuthLocalization.informInvalidResidence,
actionLabel: context.derivAuthLocalization.actionTryAgain,
);
}

/// On invalid credentials.
void onInvalidCredentials(DerivAuthErrorState state) {
showErrorDialog(
context: context,
errorMessage: context.localization.informInvalidCredentials,
actionLabel: context.localization.actionTryAgain,
errorMessage: context.derivAuthLocalization.informInvalidCredentials,
actionLabel: context.derivAuthLocalization.actionTryAgain,
);
}

/// User has set up 2FA and needs to enter 2FA.
void onMissingOtp(DerivAuthErrorState state) {
showErrorDialog(
context: context,
errorMessage: context.localization.informMissingOtp,
actionLabel: context.localization.actionTryAgain,
errorMessage: context.derivAuthLocalization.informMissingOtp,
actionLabel: context.derivAuthLocalization.actionTryAgain,
);
}

/// On self closed account.
void onSelfClosed(DerivAuthErrorState state) {
showErrorDialog(
context: context,
errorMessage: context.localization.informSelfClosed,
actionLabel: context.localization.actionTryAgain,
errorMessage: context.derivAuthLocalization.informSelfClosed,
actionLabel: context.derivAuthLocalization.actionTryAgain,
);
}

/// On unexpected error.
void onUnexpectedError(DerivAuthErrorState state) {
showErrorDialog(
context: context,
errorMessage: context.localization.informUnexpectedError,
actionLabel: context.localization.actionTryAgain,
errorMessage: context.derivAuthLocalization.informUnexpectedError,
actionLabel: context.derivAuthLocalization.actionTryAgain,
);
}

/// Account is not supported in the country.
void onUnsupportedCountry(DerivAuthErrorState state) {
showErrorDialog(
context: context,
errorMessage: context.localization.informUnsupportedCountry,
actionLabel: context.localization.actionTryAgain,
errorMessage: context.derivAuthLocalization.informUnsupportedCountry,
actionLabel: context.derivAuthLocalization.actionTryAgain,
);
}

/// On connection error.
void onConnectionError(DerivAuthErrorState state) {
showErrorDialog(
context: context,
errorMessage: context.localization.informConnectionError,
actionLabel: context.localization.actionTryAgain,
errorMessage: context.derivAuthLocalization.informConnectionError,
actionLabel: context.derivAuthLocalization.actionTryAgain,
);
}

/// On switch account error.
void onSwitchAccountError(DerivAuthErrorState state) {
showErrorDialog(
context: context,
errorMessage: context.localization.informSwitchAccountError,
actionLabel: context.localization.actionTryAgain,
errorMessage: context.derivAuthLocalization.informSwitchAccountError,
actionLabel: context.derivAuthLocalization.actionTryAgain,
);
}
}
Loading

0 comments on commit fc8b0bb

Please sign in to comment.