-
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
Osman
authored and
Osman
committed
Mar 12, 2024
1 parent
6c6adaf
commit 412ad89
Showing
7 changed files
with
552 additions
and
40 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:zeta_example/widgets.dart'; | ||
import 'package:zeta_flutter/zeta_flutter.dart'; | ||
|
||
class BreadCrumbsExample extends StatefulWidget { | ||
static const String name = 'Breadcrumbs'; | ||
|
||
const BreadCrumbsExample({super.key}); | ||
|
||
@override | ||
State<BreadCrumbsExample> createState() => _BreadCrumbsExampleState(); | ||
} | ||
|
||
class _BreadCrumbsExampleState extends State<BreadCrumbsExample> { | ||
List<String> _children = [ | ||
'Icon before with seperator', | ||
]; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return ExampleScaffold( | ||
name: 'Breadcrumbs', | ||
child: Center( | ||
child: SingleChildScrollView( | ||
child: SizedBox( | ||
width: double.infinity, | ||
child: Column(children: [ | ||
ZetaBreadCrumbs(children: _children), | ||
SizedBox( | ||
height: 50, | ||
), | ||
FilledButton( | ||
onPressed: () { | ||
setState(() { | ||
_children.add('Icon before with seperator'); | ||
}); | ||
}, | ||
child: Text("Add Breadcrumb")) | ||
])), | ||
), | ||
), | ||
); | ||
} | ||
} |
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
68 changes: 68 additions & 0 deletions
68
example/widgetbook/pages/components/breadcrumbs_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,68 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:widgetbook/widgetbook.dart'; | ||
import 'package:zeta_flutter/zeta_flutter.dart'; | ||
|
||
import '../../test/test_components.dart'; | ||
|
||
Widget breadCrumbsUseCase(BuildContext context) => WidgetbookTestWidget( | ||
widget: Center( | ||
child: BreadCrumbExample(context), | ||
)); | ||
|
||
class BreadCrumbExample extends StatefulWidget { | ||
const BreadCrumbExample(this.c); | ||
final BuildContext c; | ||
|
||
@override | ||
State<BreadCrumbExample> createState() => _BreadCrumbExampleState(); | ||
} | ||
|
||
class _BreadCrumbExampleState extends State<BreadCrumbExample> { | ||
List<String> _children = [ | ||
'Icon before with seperator', | ||
]; | ||
|
||
@override | ||
Widget build(BuildContext _) { | ||
return SingleChildScrollView( | ||
child: SizedBox( | ||
width: double.infinity, | ||
child: Column(children: [ | ||
ZetaBreadCrumbs( | ||
children: _children, | ||
rounded: widget.c.knobs.boolean(label: 'Rounded'), | ||
activeIcon: widget.c.knobs.list( | ||
label: 'ActiveIcon', | ||
options: [ | ||
ZetaIcons.star_round, | ||
ZetaIcons.add_alert_round, | ||
ZetaIcons.add_box_round, | ||
ZetaIcons.barcode_round, | ||
], | ||
labelBuilder: (value) { | ||
if (value == ZetaIcons.star_round) | ||
return 'ZetaIcons.star_round'; | ||
if (value == ZetaIcons.add_alert_round) | ||
return 'ZetaIcons.add_alert_round'; | ||
if (value == ZetaIcons.add_box_round) | ||
return 'ZetaIcons.add_box_round'; | ||
if (value == ZetaIcons.barcode_round) | ||
return 'ZetaIcons.barcode_round'; | ||
return ''; | ||
}, | ||
), | ||
), | ||
SizedBox( | ||
height: 50, | ||
), | ||
FilledButton( | ||
onPressed: () { | ||
setState(() { | ||
_children.add('Icon before with seperator'); | ||
}); | ||
}, | ||
child: Text("Add Breadcrumb")) | ||
])), | ||
); | ||
} | ||
} |
Oops, something went wrong.