Skip to content

Commit

Permalink
271 bug ods components cards horizontal card divider (#311)
Browse files Browse the repository at this point in the history
* app : correction fix bug customization divider

* app : add changelog

* app and library : add version number 0.8.0
  • Loading branch information
Tayebsed93 authored Feb 1, 2024
1 parent e0973b3 commit 02ccbb9
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 7 deletions.
6 changes: 6 additions & 0 deletions app/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### [Unreleased](https://github.com/Orange-OpenSource/ods-flutter/releases)

### [0.8.O](https://github.com/Orange-OpenSource/ods-flutter/compare/0.1.1...0.8.0) - 2023-03-02

## Added

- [Bug]: ODS - Components - Cards - Horizontal card - divider ([#271](https://github.com/Orange-OpenSource/ods-flutter/issues/271))

### [0.7.O](https://github.com/Orange-OpenSource/ods-flutter/compare/0.1.1...0.7.0) - 2023-02-02

## Added
Expand Down
10 changes: 10 additions & 0 deletions app/lib/ui/components/cards/card_customization.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class CardCustomizationState extends State<CardCustomization> {
set numberOfItems(int value) {
setState(() {
_numberOfItems = value;
updateHasDivider();
});
}

Expand Down Expand Up @@ -100,6 +101,15 @@ class CardCustomizationState extends State<CardCustomization> {
});
}

/// Determine if _hasDivider should be enabled
void updateHasDivider() {
setState(() {
if (_numberOfItems == 0) {
_hasDivider = false;
}
});
}

@override
Widget build(BuildContext context) {
return _CardCustomization(
Expand Down
13 changes: 8 additions & 5 deletions app/lib/ui/components/cards/card_horizontal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,14 @@ class _CustomizationContentState extends State<_CustomizationContent> {
customizationState.numberOfItems = value;
}),
OdsListSwitch(
title: AppLocalizations.of(context)!.componentElementDivider,
checked: customizationState.hasDivider,
onCheckedChange: (bool value) {
customizationState.hasDivider = value;
}),
title: AppLocalizations.of(context)!.componentElementDivider,
checked: customizationState.hasDivider,
onCheckedChange: (customizationState.numberOfItems >= 1)
? (bool value) {
customizationState.hasDivider = value;
}
: null,
),
],
),
);
Expand Down
2 changes: 1 addition & 1 deletion app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# 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: 0.7.0+1
version: 0.8.0+1

environment:
sdk: '>=2.19.6 <3.0.0'
Expand Down
2 changes: 1 addition & 1 deletion library/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: ods_flutter
description: ODS Flutter provides Orange Flutter components for Android and iOS to developers, and a demo application.
version: 0.7.0
version: 0.8.0
repository: https://github.com/Orange-OpenSource/ods-flutter

environment:
Expand Down

0 comments on commit 02ccbb9

Please sign in to comment.