-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7cb0242
commit 88f70c9
Showing
3 changed files
with
109 additions
and
2 deletions.
There are no files selected for viewing
99 changes: 99 additions & 0 deletions
99
example/widgetbook/pages/components/navigation_bar_widgetbook.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:widgetbook/widgetbook.dart'; | ||
import 'package:zeta_flutter/zeta_flutter.dart'; | ||
|
||
import '../../test/test_components.dart'; | ||
|
||
WidgetbookComponent navigationBarWidgetbook() { | ||
return WidgetbookComponent( | ||
name: 'Navigation Bar', | ||
isInitiallyExpanded: false, | ||
useCases: [ | ||
WidgetbookUseCase( | ||
name: 'Navigation bar', | ||
builder: (context) { | ||
final items = [ | ||
ZetaNavigationBarItem( | ||
icon: ZetaIcons.star_round, | ||
label: 'Label', | ||
showBadge: true, | ||
badgeValue: 2, | ||
), | ||
ZetaNavigationBarItem(icon: ZetaIcons.star_round, label: 'Label'), | ||
ZetaNavigationBarItem(icon: ZetaIcons.star_round, label: 'Label'), | ||
ZetaNavigationBarItem(icon: ZetaIcons.star_round, label: 'Label'), | ||
ZetaNavigationBarItem(icon: ZetaIcons.star_round, label: 'Label'), | ||
ZetaNavigationBarItem(icon: ZetaIcons.star_round, label: 'Label'), | ||
]; | ||
return WidgetbookTestWidget( | ||
widget: Center( | ||
child: ZetaNavigationBar( | ||
items: items, | ||
currentIndex: context.knobs.intOrNull.input( | ||
label: 'Selected index', | ||
initialValue: 0, | ||
), | ||
), | ||
), | ||
); | ||
}, | ||
), | ||
WidgetbookUseCase( | ||
name: 'Divided navigation bar', | ||
builder: (context) { | ||
final items = [ | ||
ZetaNavigationBarItem(icon: ZetaIcons.star_round, label: 'Label'), | ||
ZetaNavigationBarItem(icon: ZetaIcons.star_round, label: 'Label'), | ||
ZetaNavigationBarItem(icon: ZetaIcons.star_round, label: 'Label'), | ||
ZetaNavigationBarItem(icon: ZetaIcons.star_round, label: 'Label'), | ||
ZetaNavigationBarItem(icon: ZetaIcons.star_round, label: 'Label'), | ||
]; | ||
return WidgetbookTestWidget( | ||
widget: Center( | ||
child: ZetaNavigationBar.divided( | ||
items: items, | ||
dividerIndex: context.knobs.intOrNull.input( | ||
label: 'Divider index', | ||
initialValue: 3, | ||
), | ||
), | ||
), | ||
); | ||
}, | ||
), | ||
WidgetbookUseCase( | ||
name: 'Split navigation bar', | ||
builder: (context) { | ||
final items = [ | ||
ZetaNavigationBarItem(icon: ZetaIcons.star_round, label: 'Label'), | ||
ZetaNavigationBarItem(icon: ZetaIcons.star_round, label: 'Label'), | ||
ZetaNavigationBarItem(icon: ZetaIcons.star_round, label: 'Label'), | ||
ZetaNavigationBarItem(icon: ZetaIcons.star_round, label: 'Label'), | ||
]; | ||
return WidgetbookTestWidget( | ||
widget: Center( | ||
child: ZetaNavigationBar.split(items: items), | ||
), | ||
); | ||
}, | ||
), | ||
WidgetbookUseCase( | ||
name: 'Navigation bar with action', | ||
builder: (context) { | ||
final items = [ | ||
ZetaNavigationBarItem(icon: ZetaIcons.star_round, label: 'Label'), | ||
ZetaNavigationBarItem(icon: ZetaIcons.star_round, label: 'Label'), | ||
]; | ||
return WidgetbookTestWidget( | ||
widget: Center( | ||
child: ZetaNavigationBar.action( | ||
items: items, | ||
action: ZetaButton.primary(label: 'Button'), | ||
), | ||
), | ||
); | ||
}, | ||
), | ||
], | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters