Skip to content

Commit

Permalink
fix: [MDS-1010] Fix modal and combobox code snippets (#370)
Browse files Browse the repository at this point in the history
Co-authored-by: Birgitt Majas <birgitt.majas@yolo.com>
  • Loading branch information
GittHub-d and Birgitt Majas committed Feb 26, 2024
1 parent bb718dd commit 1badea7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
8 changes: 4 additions & 4 deletions example/assets/code_snippets/combobox.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ extension OptionsX on Options {
}
}

class ComboboxStory extends StatefulWidget {
const ComboboxStory({super.key});
class Combobox extends StatefulWidget {
const Combobox({super.key});

@override
State<ComboboxStory> createState() => _ComboboxStoryState();
State<Combobox> createState() => _ComboboxState();
}

class _ComboboxStoryState extends State<ComboboxStory> {
class _ComboboxState extends State<Combobox> {
final Map<Options, bool> _optionsList = {
Options.accordion: false,
Options.alert: false,
Expand Down
18 changes: 10 additions & 8 deletions example/assets/code_snippets/modal.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Modal extends StatelessWidget {
Future<void> modalBuilder(BuildContext context) {
return showMoonModal<void>(
context: context,
builder: (BuildContext _) {
builder: (BuildContext context) {
return MoonModal(
child: SizedBox(
height: 150,
Expand All @@ -23,13 +23,15 @@ class Modal extends StatelessWidget {
);
}

return Builder(
builder: (BuildContext context) {
return MoonFilledButton(
label: const Text("Open MoonModal"),
onTap: () => modalBuilder(context),
);
},
return Center(
child: Builder(
builder: (BuildContext context) {
return MoonFilledButton(
label: const Text("Open MoonModal"),
onTap: () => modalBuilder(context),
);
},
),
);
}
}

0 comments on commit 1badea7

Please sign in to comment.