Skip to content

Commit

Permalink
fix: [MDS-1318] Fix Accordion clip behavior (#439)
Browse files Browse the repository at this point in the history
Co-authored-by: GittHub-d <birgitt.majas@yolo.com>
  • Loading branch information
GittHub-d and GittHub-d authored Aug 30, 2024
1 parent 15d1959 commit 2c33904
Show file tree
Hide file tree
Showing 2 changed files with 207 additions and 104 deletions.
25 changes: 18 additions & 7 deletions example/lib/src/storybook/stories/primitives/accordion.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ class _AccordionStoryState extends State<AccordionStory> {

final expandedTextColorKnob = context.knobs.nullable.options(
label: "expandedTextColor",
description: "MoonColors variants for expanded MoonAccordion header text.",
description:
"MoonColors variants for expanded MoonAccordion header text.",
enabled: false,
initial: 0,
// piccolo
Expand Down Expand Up @@ -108,7 +109,8 @@ class _AccordionStoryState extends State<AccordionStory> {
options: colorOptions,
);

final expandedBackgroundColor = colorTable(context)[expandedBackgroundColorKnob ?? 40];
final expandedBackgroundColor =
colorTable(context)[expandedBackgroundColorKnob ?? 40];

final borderColorKnob = context.knobs.nullable.options(
label: "borderColor",
Expand Down Expand Up @@ -158,10 +160,17 @@ class _AccordionStoryState extends State<AccordionStory> {
);

const String contentText =
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do "
"eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim "
"ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut "
"aliquip ex ea commodo consequat. Duis aute irure dolor in "
"reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla "
"pariatur. Excepteur sint occaecat cupidatat non proident, sunt in "
"culpa qui officia deserunt mollit anim id est laborum.";

final BorderRadiusGeometry? borderRadius =
borderRadiusKnob != null ? BorderRadius.circular(borderRadiusKnob.toDouble()) : null;
final BorderRadiusGeometry? borderRadius = borderRadiusKnob != null
? BorderRadius.circular(borderRadiusKnob.toDouble())
: null;

return ListView(
clipBehavior: Clip.none,
Expand All @@ -188,7 +197,8 @@ class _AccordionStoryState extends State<AccordionStory> {
showDivider: showDividerKnob,
shadows: showShadowKnob == true ? null : [],
childrenPadding: const EdgeInsets.all(12),
onExpansionChanged: (AccordionItems? value) => setState(() => _currentlyOpenAccordionItem = value),
onExpansionChanged: (AccordionItems? value) =>
setState(() => _currentlyOpenAccordionItem = value),
leading: const Icon(MoonIcons.other_frame_24_light),
label: const Text("Grouped MoonAccordion item #1"),
children: [
Expand Down Expand Up @@ -216,7 +226,8 @@ class _AccordionStoryState extends State<AccordionStory> {
showDivider: showDividerKnob,
shadows: showShadowKnob == true ? null : [],
childrenPadding: const EdgeInsets.all(12),
onExpansionChanged: (AccordionItems? value) => setState(() => _currentlyOpenAccordionItem = value),
onExpansionChanged: (AccordionItems? value) =>
setState(() => _currentlyOpenAccordionItem = value),
leading: const Icon(MoonIcons.other_frame_24_light),
label: const Text("Grouped MoonAccordion item #2"),
children: [
Expand Down
Loading

0 comments on commit 2c33904

Please sign in to comment.