Skip to content

Commit

Permalink
fix: widgetbook max lines avatar rail
Browse files Browse the repository at this point in the history
  • Loading branch information
DE7924 committed Oct 28, 2024
1 parent 5cfe6ec commit 8870e98
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion example/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Foundation

import path_provider_foundation
import shared_preferences_foundation
import sqflite_darwin
import sqflite
import url_launcher_macos

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
Expand Down
3 changes: 2 additions & 1 deletion example/widgetbook/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@ class _HotReloadState extends State<HotReload> {
ZetaAddon(),
InspectorAddon(enabled: false),
ZoomAddon(initialZoom: 1.0),
TextScaleAddon(min: 1, max: 2, divisions: 4, initialScale: 1),
// TextScaleAddon(min: 1, max: 2, divisions: 4, initialScale: 1),
TextScaleAddon(scales: [1, 1.25, 1.75, 2], initialScale: 1),
],
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Widget avatarRailUseCase(BuildContext context) {

return WidgetbookScaffold(
builder: (context, _) => ZetaAvatarRail(
labelMaxLines: context.knobs.int.slider(label: 'Label Max Lines', min: 1, max: 3, initialValue: 1),
avatars: [
ZetaAvatar(
image: context.knobs.boolean(label: 'Image') ? image : null,
Expand All @@ -36,7 +37,6 @@ Widget avatarRailUseCase(BuildContext context) {
backgroundColor: context.knobs.colorOrNull(label: 'Background color', initialValue: colors.purple.shade80),
onTap: () => print('Avatar tapped'),
label: context.knobs.stringOrNull(label: 'Label', initialValue: 'ABC'),
labelMaxLines: context.knobs.int.slider(label: 'Label Max Lines', min: 1, max: 3, initialValue: 1),
),
ZetaAvatar(
image: context.knobs.boolean(label: 'Image') ? image : null,
Expand All @@ -63,7 +63,6 @@ Widget avatarRailUseCase(BuildContext context) {
backgroundColor: context.knobs.colorOrNull(label: 'Background color', initialValue: colors.purple.shade80),
onTap: () => print('Avatar tapped'),
label: context.knobs.stringOrNull(label: 'Label', initialValue: 'ABC'),
labelMaxLines: context.knobs.int.slider(label: 'Label Max Lines', min: 1, max: 3, initialValue: 1),
),
ZetaAvatar(
image: context.knobs.boolean(label: 'Image') ? image : null,
Expand All @@ -90,7 +89,6 @@ Widget avatarRailUseCase(BuildContext context) {
backgroundColor: context.knobs.colorOrNull(label: 'Background color', initialValue: colors.purple.shade80),
onTap: () => print('Avatar tapped'),
label: context.knobs.stringOrNull(label: 'Label', initialValue: 'ABC'),
labelMaxLines: context.knobs.int.slider(label: 'Label Max Lines', min: 1, max: 3, initialValue: 1),
),
ZetaAvatar(
image: context.knobs.boolean(label: 'Image') ? image : null,
Expand All @@ -117,7 +115,6 @@ Widget avatarRailUseCase(BuildContext context) {
backgroundColor: context.knobs.colorOrNull(label: 'Background color', initialValue: colors.purple.shade80),
onTap: () => print('Avatar tapped'),
label: context.knobs.stringOrNull(label: 'Label', initialValue: 'ABC'),
labelMaxLines: context.knobs.int.slider(label: 'Label Max Lines', min: 1, max: 3, initialValue: 1),
),
ZetaAvatar(
image: context.knobs.boolean(label: 'Image') ? image : null,
Expand All @@ -144,7 +141,6 @@ Widget avatarRailUseCase(BuildContext context) {
backgroundColor: context.knobs.colorOrNull(label: 'Background color', initialValue: colors.purple.shade80),
onTap: () => print('Avatar tapped'),
label: context.knobs.stringOrNull(label: 'Label', initialValue: 'ABC'),
labelMaxLines: context.knobs.int.slider(label: 'Label Max Lines', min: 1, max: 3, initialValue: 1),
),
ZetaAvatar(
image: context.knobs.boolean(label: 'Image') ? image : null,
Expand All @@ -171,7 +167,6 @@ Widget avatarRailUseCase(BuildContext context) {
backgroundColor: context.knobs.colorOrNull(label: 'Background color', initialValue: colors.purple.shade80),
onTap: () => print('Avatar tapped'),
label: context.knobs.stringOrNull(label: 'Label', initialValue: 'ABC'),
labelMaxLines: context.knobs.int.slider(label: 'Label Max Lines', min: 1, max: 3, initialValue: 1),
),
],
),
Expand Down

0 comments on commit 8870e98

Please sign in to comment.