diff --git a/example/lib/src/storybook/stories/avatar.dart b/example/lib/src/storybook/stories/avatar.dart index a115b46f..530578e8 100644 --- a/example/lib/src/storybook/stories/avatar.dart +++ b/example/lib/src/storybook/stories/avatar.dart @@ -23,6 +23,11 @@ class AvatarStory extends Story { ], ); + final setRtlModeKnob = context.knobs.boolean( + label: "RTL mode", + description: "Switch between LTR and RTL modes.", + ); + final customLabelTextKnob = context.knobs.text( label: "Custom label text", initial: "MD", @@ -72,39 +77,42 @@ class AvatarStory extends Story { final badgeColor = colorTable(context)[badgeColorKnob]; return Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - const SizedBox(height: 64), - const TextDivider(text: "Customisable avatar"), - const SizedBox(height: 32), - MoonAvatar( - avatarSize: avatarSizesKnob, - borderRadius: BorderRadius.circular(borderRadiusKnob.toDouble()), - backgroundColor: backgroundColor, - showBadge: showBadgeKnob, - badgeColor: badgeColor, - badgeAlignment: avatarBadgeAlignmentKnob, - child: Padding( - padding: const EdgeInsets.only(top: 1.0), - child: Text(customLabelTextKnob), + child: Directionality( + textDirection: setRtlModeKnob ? TextDirection.rtl : TextDirection.ltr, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const SizedBox(height: 64), + const TextDivider(text: "Customisable avatar"), + const SizedBox(height: 32), + MoonAvatar( + avatarSize: avatarSizesKnob, + borderRadius: BorderRadius.circular(borderRadiusKnob.toDouble()), + backgroundColor: backgroundColor, + showBadge: showBadgeKnob, + badgeColor: badgeColor, + badgeAlignment: avatarBadgeAlignmentKnob, + child: Padding( + padding: const EdgeInsets.only(top: 1.0), + child: Text(customLabelTextKnob), + ), ), - ), - const SizedBox(height: 40), - const TextDivider(text: "Preset avatar with picture background"), - const SizedBox(height: 32), - MoonAvatar( - avatarSize: avatarSizesKnob, - backgroundColor: backgroundColor, - showBadge: showBadgeKnob, - badgeColor: badgeColor, - badgeAlignment: avatarBadgeAlignmentKnob, - backgroundImage: const AssetImage( - "assets/images/placeholder-640x359.png", + const SizedBox(height: 40), + const TextDivider(text: "Preset avatar with picture background"), + const SizedBox(height: 32), + MoonAvatar( + avatarSize: avatarSizesKnob, + backgroundColor: backgroundColor, + showBadge: showBadgeKnob, + badgeColor: badgeColor, + badgeAlignment: avatarBadgeAlignmentKnob, + backgroundImage: const AssetImage( + "assets/images/placeholder-640x359.png", + ), ), - ), - const SizedBox(height: 64), - ], + const SizedBox(height: 64), + ], + ), ), ); }, diff --git a/example/lib/src/storybook/stories/button.dart b/example/lib/src/storybook/stories/button.dart index fd4ed6df..9ea5041b 100644 --- a/example/lib/src/storybook/stories/button.dart +++ b/example/lib/src/storybook/stories/button.dart @@ -120,7 +120,6 @@ class ButtonStory extends Story { borderRadius: BorderRadius.circular(borderRadiusKnob.toDouble()), showBorder: showBorderKnob, buttonSize: buttonSizesKnob, - isFullWidth: setFullWidthKnob, backgroundColor: color, showPulseEffect: showPulseEffectKnob, showPulseEffectJiggle: showPulseEffectJiggleKnob, diff --git a/example/lib/src/storybook/storybook.dart b/example/lib/src/storybook/storybook.dart index 0ab5e125..9b3b5f04 100644 --- a/example/lib/src/storybook/storybook.dart +++ b/example/lib/src/storybook/storybook.dart @@ -44,7 +44,6 @@ class StorybookPage extends StatelessWidget { child: Scaffold( extendBody: true, extendBodyBehindAppBar: true, - backgroundColor: context.moonColors!.beerus, body: Padding( padding: const EdgeInsets.symmetric(horizontal: 16.0), child: child, diff --git a/example/web/index.html b/example/web/index.html index fee9243e..73f3dc02 100644 --- a/example/web/index.html +++ b/example/web/index.html @@ -18,19 +18,19 @@ - + - + - example + Moon Design for Flutter