-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added theme support for Widgetbook. This had been casuing issues where the theme mode was not rendering the correct widgets. This also lead to the discovery of theme issues on checkbox and avatar, which have been fixed. * fix type story and add icon story * Adding spacing widgetbook * adding icon names
- Loading branch information
1 parent
de6d76d
commit 5e1c48a
Showing
26 changed files
with
820 additions
and
401 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,63 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter/services.dart'; | ||
import 'package:widgetbook/widgetbook.dart'; | ||
import 'package:zeta_flutter/zeta_flutter.dart'; | ||
|
||
import '../../test/test_components.dart'; | ||
|
||
WidgetbookComponent iconWidgetbook() { | ||
return WidgetbookComponent( | ||
isInitiallyExpanded: false, | ||
name: 'Icons', | ||
useCases: [ | ||
WidgetbookUseCase( | ||
name: 'All Icons', | ||
builder: (context) { | ||
Map<String, IconData> icons = | ||
(context.knobs.boolean(label: 'Rounded', initialValue: true)) ? iconsRounded : iconsSharp; | ||
|
||
return WidgetbookTestWidget( | ||
removeBody: true, | ||
widget: SingleChildScrollView( | ||
child: Center( | ||
child: Column( | ||
children: [ | ||
Text('Tap icon to copy name to clipboard', style: ZetaTextStyles.titleMedium) | ||
.paddingAll(ZetaSpacing.l), | ||
Wrap( | ||
spacing: ZetaSpacing.l, | ||
runSpacing: ZetaSpacing.l, | ||
children: icons.entries.map( | ||
(e) { | ||
final nameArr = e.key.split('_')..removeLast(); | ||
return Container( | ||
width: 100, | ||
height: 100, | ||
child: InkWell( | ||
borderRadius: ZetaRadius.rounded, | ||
hoverColor: Zeta.of(context).colors.surfaceHovered, | ||
onTap: () async { | ||
await Clipboard.setData(ClipboardData(text: 'ZetaIcons.' + e.key)); | ||
}, | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: [ | ||
Icon(e.value, size: 40), | ||
Text(nameArr.join(' '), textAlign: TextAlign.center) | ||
], | ||
), | ||
), | ||
); | ||
}, | ||
).toList(), | ||
), | ||
], | ||
), | ||
), | ||
), | ||
); | ||
}, | ||
), | ||
], | ||
); | ||
} |
40 changes: 40 additions & 0 deletions
40
example/widgetbook/pages/components/accordion_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,40 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:widgetbook/widgetbook.dart'; | ||
import 'package:zeta_flutter/zeta_flutter.dart'; | ||
|
||
import '../../test/test_components.dart'; | ||
|
||
WidgetbookComponent accordionWidgetBook() { | ||
return WidgetbookComponent( | ||
isInitiallyExpanded: false, | ||
name: 'Accordion', | ||
useCases: [ | ||
WidgetbookUseCase( | ||
name: 'Accordion', | ||
builder: (context) { | ||
return WidgetbookTestWidget( | ||
widget: Padding( | ||
padding: const EdgeInsets.all(20), | ||
child: ZetaAccordion( | ||
child: context.knobs.boolean(label: 'Disabled') | ||
? null | ||
: Column( | ||
children: [ | ||
ListTile(title: Text('Item One')), | ||
ListTile(title: Text('Item two')), | ||
ListTile(title: Text('Item three')), | ||
ListTile(title: Text('Item four')), | ||
], | ||
), | ||
title: context.knobs.string(label: 'Accordion Title', initialValue: 'Title'), | ||
contained: context.knobs.boolean(label: 'Contained', initialValue: false), | ||
isOpen: context.knobs.boolean(label: 'Open', initialValue: false), | ||
rounded: context.knobs.boolean(label: 'Rounded', initialValue: false), | ||
), | ||
), | ||
); | ||
}, | ||
), | ||
], | ||
); | ||
} |
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
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
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
Oops, something went wrong.