-
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.
* Add breadcrumbs * Rebase * change to have breadcrumb inputs * Respond to comments --------- Authored-by: Osman <[email protected]>
- Loading branch information
1 parent
0d23f7c
commit ad18f6d
Showing
7 changed files
with
591 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,58 @@ | ||
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<ZetaBreadCrumb> _children = [ | ||
ZetaBreadCrumb( | ||
label: 'Icon before with seperator', | ||
onPressed: () { | ||
print("Breadcrumb " + 0.toString() + "Clicked"); | ||
}, | ||
), | ||
]; | ||
int index = 1; | ||
|
||
@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( | ||
ZetaBreadCrumb( | ||
label: 'Icon before with seperator', | ||
onPressed: () { | ||
print("Breadcrumb clicked"); | ||
}, | ||
), | ||
); | ||
index++; | ||
}); | ||
}, | ||
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
64 changes: 64 additions & 0 deletions
64
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,64 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:widgetbook/widgetbook.dart'; | ||
import 'package:zeta_flutter/zeta_flutter.dart'; | ||
|
||
import '../../test/test_components.dart'; | ||
import '../../utils/utils.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<ZetaBreadCrumb> _children = [ | ||
ZetaBreadCrumb( | ||
label: 'Icon before with seperator', | ||
onPressed: () { | ||
print("Breadcrumb " + 0.toString() + "Clicked"); | ||
}, | ||
), | ||
]; | ||
int index = 1; | ||
|
||
@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: iconKnob(context), | ||
), | ||
SizedBox( | ||
height: 50, | ||
), | ||
FilledButton( | ||
onPressed: () { | ||
setState(() { | ||
_children.add( | ||
ZetaBreadCrumb( | ||
label: 'Icon before with seperator', | ||
onPressed: () { | ||
print("Breadcrumb clicked"); | ||
}, | ||
), | ||
); | ||
index++; | ||
}); | ||
}, | ||
child: Text("Add Breadcrumb")) | ||
])), | ||
); | ||
} | ||
} |
Oops, something went wrong.