Skip to content

Commit d939c2a

Browse files
authored
fix: Ensure suggestion chips trigger actions on click (#723)(#724)
1 parent 4cf1d19 commit d939c2a

4 files changed

Lines changed: 186 additions & 69 deletions

File tree

app/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
- [Library] update tokens 1.9.0 - Component Alert ([#672](https://github.com/Orange-OpenSource/ouds-flutter/issues/672))
1212

1313
### Fixed
14+
- [Library] Nothing happens when clicking on the `suggestion chip` ([#723](https://github.com/Orange-OpenSource/ouds-flutter/issues/723))
1415

1516
## [1.2.0](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.1.2...1.2.0) - 2026-04-21
1617
### Added

app/lib/ui/components/chip/chip_suggestion_demo_screen.dart

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import 'package:provider/provider.dart';
3636

3737
class ChipSuggestionDemoScreen extends StatefulWidget {
3838
final String? previousPageTitle;
39-
const ChipSuggestionDemoScreen({super.key,this.previousPageTitle});
39+
const ChipSuggestionDemoScreen({super.key, this.previousPageTitle});
4040

4141
@override
4242
State<StatefulWidget> createState() => _ChipSuggestionDemoScreenState();
@@ -58,7 +58,11 @@ class _ChipSuggestionDemoScreenState extends State<ChipSuggestionDemoScreen> {
5858
child: ChipCustomization(
5959
key: _scaffoldKey,
6060
child: Padding(
61-
padding: EdgeInsets.only(bottom: defaultTargetPlatform == TargetPlatform.android ? MediaQuery.of(context).viewPadding.bottom : OudsTheme.of(context).spaceScheme(context).paddingBlockNone),
61+
padding: EdgeInsets.only(
62+
bottom: defaultTargetPlatform == TargetPlatform.android
63+
? MediaQuery.of(context).viewPadding.bottom
64+
: OudsTheme.of(context).spaceScheme(context).paddingBlockNone,
65+
),
6266
child: Scaffold(
6367
bottomSheet: OudsSheetsBottom(
6468
onExpansionChanged: _onExpansionChanged,
@@ -69,7 +73,8 @@ class _ChipSuggestionDemoScreenState extends State<ChipSuggestionDemoScreen> {
6973
appBar: MainAppBar(
7074
title: context.l10n.app_components_suggestionChip_label,
7175
showBackButton: true,
72-
previousPageTitle: widget.previousPageTitle),
76+
previousPageTitle: widget.previousPageTitle,
77+
),
7378
body: ExcludeSemantics(
7479
excluding: !_isBottomSheetExpanded,
7580
child: _Body(),
@@ -92,19 +97,23 @@ class _Body extends StatefulWidget {
9297
class _BodyState extends State<_Body> {
9398
@override
9499
Widget build(BuildContext context) {
95-
ThemeController? themeController = Provider.of<ThemeController>(context, listen: false);
100+
ThemeController? themeController = Provider.of<ThemeController>(
101+
context,
102+
listen: false,
103+
);
96104
return DetailScreenDescription(
97-
description: context.l10n.app_components_chip_suggestionChip_description_text,
105+
description:
106+
context.l10n.app_components_chip_suggestionChip_description_text,
98107
widget: Column(
99108
children: [
100109
_ChipSuggestionDemo(),
101-
SizedBox(height: themeController.currentTheme.spaceScheme(context).fixedMedium),
102-
Code(
103-
code: ChipSuggestionCodeGenerator.updateCode(context),
110+
SizedBox(
111+
height: themeController.currentTheme
112+
.spaceScheme(context)
113+
.fixedMedium,
104114
),
105-
ReferenceDesignVersionComponent(
106-
version: OudsComponentVersion.chip,
107-
)
115+
Code(code: ChipSuggestionCodeGenerator.updateCode(context)),
116+
ReferenceDesignVersionComponent(version: OudsComponentVersion.chip),
108117
],
109118
),
110119
);
@@ -134,7 +143,10 @@ class _ChipSuggestionDemoState extends State<_ChipSuggestionDemo> {
134143
return LightDarkBox(
135144
child: OudsSuggestionChip(
136145
label: ChipCustomizationUtils.getText(customizationState),
137-
avatar: ChipCustomizationUtils.getIcon(customizationState, themeController!),
146+
avatar: ChipCustomizationUtils.getIcon(
147+
customizationState,
148+
themeController!,
149+
),
138150
onPressed: customizationState?.hasEnabled == true ? () {} : null,
139151
),
140152
);
@@ -167,7 +179,9 @@ class _CustomizationContentState extends State<_CustomizationContent> {
167179

168180
@override
169181
Widget build(BuildContext context) {
170-
final ChipCustomizationState? customizationState = ChipCustomization.of(context);
182+
final ChipCustomizationState? customizationState = ChipCustomization.of(
183+
context,
184+
);
171185

172186
return CustomizableSection(
173187
children: [
@@ -194,7 +208,7 @@ class _CustomizationContentState extends State<_CustomizationContent> {
194208
text: customizationState.labelText,
195209
focusNode: labelFocus,
196210
fieldType: FieldType.label,
197-
)
211+
),
198212
],
199213
);
200214
}

ouds_core/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
- [Library] update tokens 1.9.0 - Component Alert ([#672](https://github.com/Orange-OpenSource/ouds-flutter/issues/672))
1313

1414
### Fixed
15+
- [Library] Nothing happens when clicking on the `suggestion chip` ([#723](https://github.com/Orange-OpenSource/ouds-flutter/issues/723))
1516

1617
## [1.2.0](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.1.2...1.2.0) - 2026-04-21
1718
### Added

0 commit comments

Comments
 (0)