Skip to content

Commit

Permalink
Merge branch 'master' into deriv_logger/add_network_logs
Browse files Browse the repository at this point in the history
  • Loading branch information
sahani-deriv authored Jul 19, 2024
2 parents 8b9a3f6 + b48fcfd commit e14d79b
Show file tree
Hide file tree
Showing 26 changed files with 867 additions and 45 deletions.
53 changes: 53 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,59 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 2024-07-18

### Changes

---

Packages with breaking changes:

- There are no breaking changes in this release.

Packages with other changes:

- [`deriv_mobile_chart_wrapper` - `v0.0.3`](#deriv_mobile_chart_wrapper---v003)

---

#### `deriv_mobile_chart_wrapper` - `v0.0.3`

- **FEAT**(deriv_mobile_chart_wrapper): Add Indicator bottom sheet and categories_ ([#683](https://github.com/regentmarkets/flutter-deriv-packages/issues/683)). ([a32c7ed0](https://github.com/regentmarkets/flutter-deriv-packages/commit/a32c7ed0f61e1c9965cc7d92f12e64eacb0faf52))


## 2024-07-18

### Changes

---

Packages with breaking changes:

- There are no breaking changes in this release.

Packages with other changes:

- [`deriv_localizations` - `v1.5.2`](#deriv_localizations---v152)
- [`deriv_auth` - `v6.7.18`](#deriv_auth---v6718)
- [`deriv_mobile_chart_wrapper` - `v0.0.2+4`](#deriv_mobile_chart_wrapper---v0024)
- [`deriv_passkeys` - `v0.0.3+6`](#deriv_passkeys---v0036)

Packages with dependency updates only:

> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
- `deriv_auth` - `v6.7.18`
- `deriv_mobile_chart_wrapper` - `v0.0.2+4`
- `deriv_passkeys` - `v0.0.3+6`

---

#### `deriv_localizations` - `v1.5.2`

- **REFACTOR**(deriv_localizations): Crowdin Localization Generated ([#697](https://github.com/regentmarkets/flutter-deriv-packages/issues/697)). ([0aca8f2f](https://github.com/regentmarkets/flutter-deriv-packages/commit/0aca8f2fd4f0e3a16ab54a0bf040c1fabcff2324))


## 2024-07-17

### Changes
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cp $HOME/Downloads/commit-msg $HOME/.git/hooks/commit-msg \

## Using the packages

Each package has been released as git tag with convention as **packageName-vVersionNumber**`(Example: deriv_auth-v6.7.17)`. To use the package, add the following to your pubspec.yaml file:
Each package has been released as git tag with convention as **packageName-vVersionNumber**`(Example: deriv_auth-v6.7.18)`. To use the package, add the following to your pubspec.yaml file:

```yaml
deriv_ui:
Expand All @@ -30,7 +30,7 @@ deriv_ui:
| Name | Description | Version |
| ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| [analytics](./packages/analytics) | Used to collect and send analytical information to 'Firebase' and 'Segment'. | [v2.1.0](./packages/analytics/CHANGELOG.md) |
| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.17 ](./packages/deriv_auth/CHANGELOG.md) |
| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.18 ](./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) |
Expand All @@ -42,7 +42,7 @@ deriv_ui:
| [deriv_lint](./packages/deriv_lint) | A Dart package that provides lint rules for Dart and Flutter. | [v1.0.0](./packages/deriv_lint/CHANGELOG.md) |
| [deriv_live_chat](./packages/deriv_live_chat) | A plugin for live chat SDK support to dart. | [v0.0.1+2](./packages/deriv_live_chat/CHANGELOG.md) |
| [deriv_language_selector](./packages/deriv_language_selector) | A package to handle language change of the app. | [v0.0.2+9](./packages/deriv_language_selector/CHANGELOG.md) |
| [deriv_localizations](./packages/deriv_localizations) | A Package that contains the localization arb(coming from Crowdin) and dart generated files for flutter_deriv_packages. | [v1.5.1](./packages/deriv_localizations/CHANGELOG.md) |
| [deriv_localizations](./packages/deriv_localizations) | A Package that contains the localization arb(coming from Crowdin) and dart generated files for flutter_deriv_packages. | [v1.5.2](./packages/deriv_localizations/CHANGELOG.md) |
| [deriv_numpad](./packages/deriv_numpad) | Number Pad Widget for number input. | [v1.1.5](./packages/deriv_numpad/CHANGELOG.md) |
| [deriv_rudderstack](./packages/deriv_rudderstack) | A plugin that add RudderStack SDK support to Flutter. | [v1.1.0](./packages/deriv_rudderstack/CHANGELOG.md) |
| [deriv_store_launcher](./packages/deriv_store_launcher) | A plugin to launch app stores base on platform and manufacturer. | [v0.0.1+1](./packages/deriv_store_launcher/CHANGELOG.md) |
Expand Down
4 changes: 4 additions & 0 deletions packages/deriv_auth/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 6.7.18

- Update a dependency to the latest release.

## 6.7.17

- **REFACTOR**(version): updated the version of flutter deriv api ([#694](https://github.com/regentmarkets/flutter-deriv-packages/issues/694)). ([eac7e8cb](https://github.com/regentmarkets/flutter-deriv-packages/commit/eac7e8cba4e9310d30296e07a47731f08d4d7342))
Expand Down
6 changes: 3 additions & 3 deletions packages/deriv_auth/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: deriv_auth
description: Provides deriv authentication functionalities for dart/flutter apps.
version: 6.7.17
version: 6.7.18

environment:
sdk: ">=3.0.0 <4.0.0"
Expand Down Expand Up @@ -51,13 +51,13 @@ dependencies:
git:
url: [email protected]:regentmarkets/flutter-deriv-packages.git
path: packages/deriv_localizations
ref: deriv_localizations-v1.5.1
ref: deriv_localizations-v1.5.2

deriv_passkeys:
git:
url: [email protected]:regentmarkets/flutter-deriv-packages.git
path: packages/deriv_passkeys
ref: deriv_passkeys-v0.0.3+5
ref: deriv_passkeys-v0.0.3+6

deriv_language_selector:
git:
Expand Down
4 changes: 4 additions & 0 deletions packages/deriv_localizations/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.5.2

- **REFACTOR**(deriv_localizations): Crowdin Localization Generated ([#697](https://github.com/regentmarkets/flutter-deriv-packages/issues/697)). ([0aca8f2f](https://github.com/regentmarkets/flutter-deriv-packages/commit/0aca8f2fd4f0e3a16ab54a0bf040c1fabcff2324))

## 1.5.1

- **REFACTOR**(deriv_localizations): Crowdin Localization Generated ([#648](https://github.com/regentmarkets/flutter-deriv-packages/issues/648)). ([c925c22a](https://github.com/regentmarkets/flutter-deriv-packages/commit/c925c22a97e6e13568fefa0d86d993985093617c))
Expand Down
2 changes: 1 addition & 1 deletion packages/deriv_localizations/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: This packages contains all localizations for the deriv packages

publish_to: 'none'

version: 1.5.1
version: 1.5.2

environment:
sdk: '>=3.0.2 <4.0.0'
Expand Down
8 changes: 8 additions & 0 deletions packages/deriv_mobile_chart_wrapper/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 0.0.3

- **FEAT**(deriv_mobile_chart_wrapper): Add Indicator bottom sheet and categories_ ([#683](https://github.com/regentmarkets/flutter-deriv-packages/issues/683)). ([a32c7ed0](https://github.com/regentmarkets/flutter-deriv-packages/commit/a32c7ed0f61e1c9965cc7d92f12e64eacb0faf52))

## 0.0.2+4

- Update a dependency to the latest release.

## 0.0.2+3

- **REFACTOR**(deriv_localizations): Crowdin Localization Generated ([#686](https://github.com/regentmarkets/flutter-deriv-packages/issues/686)). ([a0a6df21](https://github.com/regentmarkets/flutter-deriv-packages/commit/a0a6df21cbc6681b923ec3e060752de20ddad32b))
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions packages/deriv_mobile_chart_wrapper/lib/src/assets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ const String rsiIcon = '${iconAssetsFolder}ic_rsi.svg';
const String bollingerBandsIcon = '${iconAssetsFolder}ic_bollinger_bands.svg';
const String movingAverageIcon = '${iconAssetsFolder}ic_moving_average.svg';
const String indicatorsMenuIcon = '${iconAssetsFolder}ic_indicators_menu.svg';
const String emptyStateIndicatorsIcon =
'${iconAssetsFolder}ic_indicators_empty_state.svg';
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import 'package:deriv_theme/deriv_theme.dart';
import 'package:flutter/material.dart';

import 'custom_chip.dart';

/// A widget to show a list of `CustomChip` widgets.
class ChipsList extends StatelessWidget {
/// Constructor of the widget
const ChipsList({
required this.items,
this.isHorizontalPaddingEnabled = false,
double? horizontalPadding,
Key? key,
}) : horizontalPadding = isHorizontalPaddingEnabled
? (horizontalPadding ?? ThemeProvider.margin16)
: ThemeProvider.zeroMargin,
super(key: key);

/// The list of the items.
final List<CustomChip> items;

/// If true enable a padding at the start and end of the list.
/// Default value is false.
final bool isHorizontalPaddingEnabled;

/// The padding value for the horizontal padding.
/// If [isHorizontalPaddingEnabled] is true and [horizontalPadding] is null
/// then [ThemeProvider.margin16] will be used as default value.
/// Otherwise [ThemeProvider.zeroMargin] will be used as default value.
final double horizontalPadding;

@override
Widget build(BuildContext context) => SizedBox(
height: ThemeProvider.margin36,
child: ListView.builder(
padding: EdgeInsets.symmetric(horizontal: horizontalPadding),
scrollDirection: Axis.horizontal,
itemCount: items.length,
itemBuilder: (_, int index) => Padding(
padding: const EdgeInsets.only(
left: ThemeProvider.zeroMargin, right: ThemeProvider.margin08),
child: items[index],
),
),
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export 'custom_chip.dart';
export 'chips_list.dart';
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
import 'package:flutter/material.dart';

import 'package:deriv_theme/deriv_theme.dart';

/// The type of function to be passed to [CustomChip]'s `onTap` property.
typedef OnTapCustomChip<T> = void Function(T? value, String? title);

/// Will be called to get the content that needs to be shown inside chips.
typedef LabelBuilder<T> = String Function(T? value, String? title);

/// Will be called to get the content that needs to be shown inside chips.
typedef LabelWidgetBuilder<T> = Widget Function(T? value, String? title);

/// A Custom chip with a disabled and enabled design based on [isSelected].
class CustomChip<T> extends StatelessWidget {
/// Initializes a [CustomChip] widget.
const CustomChip({
this.value,
this.labelBuilder,
this.labelWidgetBuilder,
this.title,
this.isSelected = true,
this.textStyle,
this.onTap,
this.borderRadius = ThemeProvider.borderRadius04,
this.activeBackgroundColor,
Key? key,
}) : assert(
value != null || labelWidgetBuilder != null,
'Both value and labelWidgetBuilder cannot be null at the same time.',
),
super(key: key);

/// Whether the chip is displayed as selected or not.
final bool isSelected;

/// The title text to be shown inside of the chip.
final String? title;

/// The value text to be shown inside of the chip.
final T? value;

/// To get the content to be shown inside chips.
final LabelBuilder<T>? labelBuilder;

/// To get the widget to be shown inside chips.
final LabelWidgetBuilder<T>? labelWidgetBuilder;

/// Called when a custom chip is tapped.
/// Pass [onTap] as null to disable the functionality of the chips.
final OnTapCustomChip<T>? onTap;

/// The border radius of chips container.
final double borderRadius;

/// Container background color when [isSelected] is true.
///
/// If null then [base6] apply as container background.
final Color? activeBackgroundColor;

/// TextStyle of the chip title.
final TextStyle? textStyle;

@override
Widget build(BuildContext context) => TextButton(
style: TextButton.styleFrom(
backgroundColor: _backgroundColor(context),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(borderRadius),
),
),
),
onPressed: onTap == null ? null : () => onTap?.call(value, title),
child: labelWidgetBuilder?.call(value, title) ??
Text(
labelBuilder?.call(value, title) ??
"${title ?? ''}${title == null ? '' : ': '}$value",
style: context.theme.textStyle(
textStyle: textStyle ?? TextStyles.body1,
color: _textColor(context),
),
),
);

Color _backgroundColor(BuildContext context) => isSelected
? activeBackgroundColor ?? context.theme.colors.active
: context.theme.colors.secondary;

Color _textColor(BuildContext context) => isSelected
? context.theme.colors.prominent
: context.theme.colors.lessProminent;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import 'package:flutter/material.dart';

import 'package:deriv_theme/deriv_theme.dart';

/// This widget displays a widget with the possibility of showing a badge icon
/// with a count value on the widget
class DerivBadge extends StatelessWidget {
/// Initializes the widget.
const DerivBadge({
super.key,
this.child,
this.count,
this.enabled = true,
this.alignment = Alignment.topRight,
});

/// The widget that is going to be displayed.
final Widget? child;

/// Is the badge of the widget is going to be displayed or not
///
/// Default is true.
final bool enabled;

/// Displays a count value in the badge widget.
final int? count;

/// The position of the badge.
///
/// Default is [Alignment.topRight].
final Alignment alignment;

@override
Widget build(BuildContext context) {
final bool showDot = count == null;
final bool hasCount = !showDot && count! > 0;

return Stack(
alignment: alignment,
children: <Widget>[
Padding(
padding: const EdgeInsets.all(ThemeProvider.margin04),
child: child ?? const SizedBox(),
),
Visibility(
visible: enabled,
child: Container(
decoration: showDot || hasCount
? BoxDecoration(
shape: BoxShape.circle,
color: context.theme.colors.danger,
)
: const BoxDecoration(),
constraints: BoxConstraints(
minWidth:
showDot ? ThemeProvider.margin12 : ThemeProvider.margin16,
minHeight:
showDot ? ThemeProvider.margin12 : ThemeProvider.margin16,
),
child: hasCount
? SizedBox(
width: ThemeProvider.margin16,
height: ThemeProvider.margin16,
child: Center(
child: Text(
'$count',
textAlign: TextAlign.center,
style: context.theme.textStyle(
textStyle: TextStyles.badgeCounter,
),
),
),
)
: const SizedBox.shrink(),
),
),
],
);
}
}
Loading

0 comments on commit e14d79b

Please sign in to comment.