From b5b61bb2231bc260e9acb8cec01764476c1c7fa7 Mon Sep 17 00:00:00 2001 From: Luke Date: Tue, 2 Jul 2024 17:12:46 +0100 Subject: [PATCH] refactor: Implement global rounded in example app --- example/lib/pages/assets/icons_example.dart | 17 +-- .../pages/components/accordion_example.dart | 42 +------ .../lib/pages/components/avatar_example.dart | 4 +- .../lib/pages/components/badges_example.dart | 28 +---- .../lib/pages/components/banner_example.dart | 34 +++--- .../components/bottom_sheet_example.dart | 4 +- .../lib/pages/components/button_example.dart | 45 +++---- .../pages/components/checkbox_example.dart | 13 +- .../lib/pages/components/chip_example.dart | 111 ++++-------------- .../pages/components/date_input_example.dart | 30 ++--- .../lib/pages/components/dialog_example.dart | 17 ++- .../lib/pages/components/dialpad_example.dart | 4 +- .../pages/components/dropdown_example.dart | 4 +- .../components/filter_selection_example.dart | 13 -- .../components/global_header_example.dart | 57 +++++---- .../lib/pages/components/list_example.dart | 2 +- .../pages/components/list_item_example.dart | 6 +- .../components/navigation_bar_example.dart | 8 +- .../components/navigation_rail_example.dart | 8 +- .../components/notification_list_example.dart | 4 +- .../components/password_input_example.dart | 6 +- .../pages/components/phone_input_example.dart | 24 ---- .../pages/components/progress_example.dart | 11 +- .../components/segmented_control_example.dart | 2 +- .../components/select_input_example.dart | 5 +- .../pages/components/snackbar_example.dart | 3 +- .../lib/pages/components/stepper_example.dart | 13 +- .../components/stepper_input_example.dart | 2 +- .../lib/pages/components/tabs_example.dart | 14 +-- .../pages/components/text_input_example.dart | 10 +- .../pages/components/time_input_example.dart | 1 - .../lib/pages/components/tooltip_example.dart | 26 ---- .../pages/components/top_app_bar_example.dart | 38 +++--- example/lib/utils/theme_color_switch.dart | 2 +- example/lib/utils/theme_mode_switch.dart | 2 +- .../pages/assets/icon_widgetbook.dart | 2 +- .../pages/components/avatar_widgetbook.dart | 2 +- .../pages/components/banner_widgetbook.dart | 4 +- .../components/bottom_sheet_widgetbook.dart | 6 +- .../pages/components/button_widgetbook.dart | 4 +- .../pages/components/chip_widgetbook.dart | 4 +- .../pages/components/dialog_widgetbook.dart | 8 +- .../dropdown_list_item_widgetbook.dart | 2 +- .../pages/components/dropdown_widgetbook.dart | 4 +- .../components/global_header_widgetbook.dart | 8 +- .../components/list_item_widgetbook.dart | 2 +- .../navigation_rail_widgetbook.dart | 4 +- .../notification_list_item_widgetbook.dart | 2 +- .../segmented_control_widgetbook.dart | 4 +- .../components/select_input_widgetbook.dart | 4 +- .../components/snack_bar_widgetbook.dart | 4 +- .../pages/components/tabs_widgetbook.dart | 4 +- .../components/text_input_widgetbook.dart | 2 +- .../components/top_app_bar_widgetbook.dart | 28 ++--- lib/src/components/badges/tag.dart | 8 +- lib/src/components/snack_bar/snack_bar.dart | 6 +- 56 files changed, 238 insertions(+), 484 deletions(-) diff --git a/example/lib/pages/assets/icons_example.dart b/example/lib/pages/assets/icons_example.dart index c39695a0..6d15709a 100644 --- a/example/lib/pages/assets/icons_example.dart +++ b/example/lib/pages/assets/icons_example.dart @@ -15,6 +15,7 @@ class IconsExample extends StatefulWidget { class _IconsExampleState extends State { bool showGeneratedColors = false; +//TODO: LUKE ADD NAMES TO ICONS @override Widget build(BuildContext context) { return ExampleScaffold( @@ -23,22 +24,12 @@ class _IconsExampleState extends State { padding: EdgeInsets.all(ZetaSpacing.medium), child: Column( children: [ - Text('Round', style: ZetaTextStyles.bodyLarge), Wrap( - spacing: 8, - runSpacing: 8, - children: icons.values.map((e) => Icon(e)).toList(), + spacing: 20, + runSpacing: 20, + children: icons.values.map((e) => ZetaIcon(e, size: 48)).toList(), ), const SizedBox(height: 20), - Text('Sharp', style: ZetaTextStyles.bodyLarge), - Wrap( - spacing: 8, - runSpacing: 8, - children: icons.values - .map((e) => - Icon(IconData(e.codePoint, fontFamily: ZetaIcons.familySharp, fontPackage: ZetaIcons.package))) - .toList(), - ), ], ), ), diff --git a/example/lib/pages/components/accordion_example.dart b/example/lib/pages/components/accordion_example.dart index b0561a66..669835c8 100644 --- a/example/lib/pages/components/accordion_example.dart +++ b/example/lib/pages/components/accordion_example.dart @@ -15,7 +15,7 @@ class AccordionExample extends StatelessWidget { padding: EdgeInsets.all(ZetaSpacing.medium), child: Column( children: [ - Text('Rounded Divider'), + Text('Divider'), const SizedBox(height: 20), ZetaAccordion( title: 'title', @@ -29,7 +29,7 @@ class AccordionExample extends StatelessWidget { ), ZetaAccordion(title: 'title'), const SizedBox(height: 40), - Text('Rounded Contained'), + Text('Contained'), const SizedBox(height: 20), ZetaAccordion( contained: true, @@ -47,44 +47,6 @@ class AccordionExample extends StatelessWidget { title: 'title', ), const SizedBox(height: 40), - Text('Sharp Divider'), - const SizedBox(height: 20), - ZetaAccordion( - contained: false, - title: 'title', - rounded: false, - child: Column( - children: [ - ListTile(title: Text('List Item')), - ListTile(title: Text('List Item')), - ListTile(title: Text('List Item')), - ], - ), - ), - ZetaAccordion( - contained: false, - title: 'title', - rounded: false, - ), - Text('Sharp Contained'), - const SizedBox(height: 20), - ZetaAccordion( - contained: true, - title: 'title', - rounded: false, - child: Column( - children: [ - ListTile(title: Text('List Item')), - ListTile(title: Text('List Item')), - ListTile(title: Text('List Item')), - ], - ), - ), - ZetaAccordion( - contained: true, - title: 'title', - rounded: false, - ), ].divide(const SizedBox.square(dimension: 10)).toList(), ), ), diff --git a/example/lib/pages/components/avatar_example.dart b/example/lib/pages/components/avatar_example.dart index ff84aa2d..de548db9 100644 --- a/example/lib/pages/components/avatar_example.dart +++ b/example/lib/pages/components/avatar_example.dart @@ -12,8 +12,8 @@ class AvatarExample extends StatelessWidget { Widget build(BuildContext context) { final Widget image = CachedNetworkImage( imageUrl: "https://i.ytimg.com/vi/KItsWUzFUOs/maxresdefault.jpg", - placeholder: (context, url) => Icon(ZetaIcons.user_round), - errorWidget: (context, url, error) => Icon(Icons.error), + placeholder: (context, url) => ZetaIcon(ZetaIcons.user), + errorWidget: (context, url, error) => ZetaIcon(ZetaIcons.error), fit: BoxFit.cover, ); diff --git a/example/lib/pages/components/badges_example.dart b/example/lib/pages/components/badges_example.dart index 5fe86ef2..9d33f3df 100644 --- a/example/lib/pages/components/badges_example.dart +++ b/example/lib/pages/components/badges_example.dart @@ -19,9 +19,9 @@ class BadgesExample extends StatelessWidget { _DividingText('Status Label'), _StatusLabel(), _DividingText('Priority Pill'), - _PriorityPill(), + _PriorityPill(ZetaPriorityPillSize.large), const SizedBox(height: ZetaSpacing.xl_4), - _PriorityPill(size: ZetaPriorityPillSize.small), + _PriorityPill(ZetaPriorityPillSize.small), _DividingText('Badge'), _Badge(), _DividingText('Indicators'), @@ -57,9 +57,7 @@ class _StatusLabel extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ ZetaStatusLabel(label: 'Label', status: type), - ZetaStatusLabel(label: 'Label', status: type, customIcon: ZetaIcons.star_round), - ZetaStatusLabel(label: 'Label', status: type, rounded: false), - ZetaStatusLabel(label: 'Label', status: type, rounded: false, customIcon: ZetaIcons.star_sharp), + ZetaStatusLabel(label: 'Label', status: type, customIcon: ZetaIcons.star), ], ); } @@ -79,9 +77,7 @@ class _StatusLabel extends StatelessWidget { } class _PriorityPill extends StatelessWidget { - const _PriorityPill({ - this.size = ZetaPriorityPillSize.large, - }); + const _PriorityPill(this.size); final ZetaPriorityPillSize size; @@ -108,15 +104,6 @@ class _PriorityPill extends StatelessWidget { ZetaPriorityPill(size: size, type: ZetaPriorityPillType.low), ].divide(const SizedBox.square(dimension: ZetaSpacing.xl_2)).toList(), ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ZetaPriorityPill(size: size, rounded: false), - ZetaPriorityPill(size: size, rounded: false, type: ZetaPriorityPillType.high), - ZetaPriorityPill(size: size, rounded: false, type: ZetaPriorityPillType.medium), - ZetaPriorityPill(size: size, rounded: false, type: ZetaPriorityPillType.low), - ].divide(const SizedBox.square(dimension: ZetaSpacing.xl_2)).toList(), - ), ], ); } @@ -131,7 +118,6 @@ class _Badge extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ ZetaLabel(label: 'Label', status: type), - ZetaLabel(label: 'Label', status: type, rounded: false), ], ); } @@ -243,10 +229,8 @@ class _Tags extends StatelessWidget { child: Row( mainAxisSize: MainAxisSize.min, children: [ - ZetaTag.left(label: 'Sharp', rounded: false), - ZetaTag.right(label: 'Sharp', rounded: false), - ZetaTag.left(label: 'Rounded'), - ZetaTag.right(label: 'Rounded'), + ZetaTag.left(label: 'Left'), + ZetaTag.right(label: 'Right'), ].divide(SizedBox.square(dimension: ZetaSpacing.xl_2)).toList(), ), ); diff --git a/example/lib/pages/components/banner_example.dart b/example/lib/pages/components/banner_example.dart index 002848c8..800879fc 100644 --- a/example/lib/pages/components/banner_example.dart +++ b/example/lib/pages/components/banner_example.dart @@ -24,7 +24,7 @@ class BannerExample extends StatelessWidget { title: 'Centered', context: context, titleStart: true, - leadingIcon: ZetaIcons.info_round, + leadingIcon: ZetaIcons.info, ), ZetaBanner( type: ZetaBannerStatus.primary, @@ -36,30 +36,30 @@ class BannerExample extends StatelessWidget { context: context, title: 'Title left with arrow', titleStart: true, - trailing: Icon(ZetaIcons.chevron_right_round), + trailing: ZetaIcon(ZetaIcons.chevron_right), ), ZetaBanner( type: ZetaBannerStatus.primary, title: 'Title left + Icon', titleStart: true, context: context, - leadingIcon: ZetaIcons.info_round, + leadingIcon: ZetaIcons.info, ), ZetaBanner( type: ZetaBannerStatus.primary, context: context, title: 'Title left + Icon with Arrow', titleStart: true, - leadingIcon: ZetaIcons.info_round, + leadingIcon: ZetaIcons.info, trailing: IconButton( - icon: Icon(ZetaIcons.chevron_right_round), + icon: ZetaIcon(ZetaIcons.chevron_right), onPressed: () { ScaffoldMessenger.of(context).showMaterialBanner(ZetaBanner( title: 'Title', context: context, type: ZetaBannerStatus.primary, trailing: IconButton( - icon: Icon(ZetaIcons.close_round), + icon: ZetaIcon(ZetaIcons.close), onPressed: () => ScaffoldMessenger.of(context).clearMaterialBanners(), ), )); @@ -72,16 +72,16 @@ class BannerExample extends StatelessWidget { context: context, title: 'Centered', titleStart: true, - leadingIcon: ZetaIcons.info_round, + leadingIcon: ZetaIcons.info, trailing: IconButton( - icon: Icon(ZetaIcons.chevron_right_round), + icon: ZetaIcon(ZetaIcons.chevron_right), onPressed: () { ScaffoldMessenger.of(context).showMaterialBanner(ZetaBanner( title: 'Title', context: context, type: ZetaBannerStatus.positive, trailing: IconButton( - icon: Icon(ZetaIcons.close_round), + icon: ZetaIcon(ZetaIcons.close), onPressed: () => ScaffoldMessenger.of(context).clearMaterialBanners(), ), )); @@ -93,16 +93,16 @@ class BannerExample extends StatelessWidget { title: 'Centered', context: context, titleStart: true, - leadingIcon: ZetaIcons.info_round, + leadingIcon: ZetaIcons.info, trailing: IconButton( - icon: Icon(ZetaIcons.chevron_right_round), + icon: ZetaIcon(ZetaIcons.chevron_right), onPressed: () { ScaffoldMessenger.of(context).showMaterialBanner(ZetaBanner( title: 'Title', context: context, type: ZetaBannerStatus.warning, trailing: IconButton( - icon: Icon(ZetaIcons.close_round), + icon: ZetaIcon(ZetaIcons.close), onPressed: () => ScaffoldMessenger.of(context).clearMaterialBanners(), ), )); @@ -114,16 +114,16 @@ class BannerExample extends StatelessWidget { title: 'Centered', context: context, titleStart: true, - leadingIcon: ZetaIcons.info_round, + leadingIcon: ZetaIcons.info, trailing: IconButton( - icon: Icon(ZetaIcons.chevron_right_round), + icon: ZetaIcon(ZetaIcons.chevron_right), onPressed: () { ScaffoldMessenger.of(context).showMaterialBanner(ZetaBanner( title: 'Title', context: context, type: ZetaBannerStatus.negative, trailing: IconButton( - icon: Icon(ZetaIcons.close_round), + icon: ZetaIcon(ZetaIcons.close), onPressed: () => ScaffoldMessenger.of(context).clearMaterialBanners(), ), )); @@ -141,7 +141,6 @@ class BannerExample extends StatelessWidget { onClose: () {}, status: ZetaWidgetStatus.positive, title: 'Banner Title', - rounded: false, ), ZetaInPageBanner( content: Text(_content), @@ -155,7 +154,6 @@ class BannerExample extends StatelessWidget { onClose: () {}, status: ZetaWidgetStatus.negative, title: 'Banner Title Banner Title Banner Title Banner Title', - rounded: false, ), ZetaInPageBanner( content: Text(_content), @@ -177,7 +175,6 @@ class BannerExample extends StatelessWidget { Column buildExampleBannerColumn( ZetaWidgetStatus status, { - bool rounded = true, IconData? customIcon, }) { return Column( @@ -187,7 +184,6 @@ class BannerExample extends StatelessWidget { ZetaInPageBanner( content: Text(_content), onClose: () {}, - rounded: rounded, status: status, title: 'Banner Title', customIcon: customIcon, diff --git a/example/lib/pages/components/bottom_sheet_example.dart b/example/lib/pages/components/bottom_sheet_example.dart index ff627041..16d51987 100644 --- a/example/lib/pages/components/bottom_sheet_example.dart +++ b/example/lib/pages/components/bottom_sheet_example.dart @@ -38,7 +38,7 @@ class _BottomSheetExampleState extends State { 6, (index) => ZetaMenuItem.vertical( label: Text('Menu Item'), - icon: Icon(ZetaIcons.star_round), + icon: ZetaIcon(ZetaIcons.star), onTap: () {}, ), ), @@ -63,7 +63,7 @@ class _BottomSheetExampleState extends State { (index) => ZetaMenuItem.horizontal( label: Text('Menu Item'), onTap: () {}, - leading: Icon(ZetaIcons.star_round), + leading: ZetaIcon(ZetaIcons.star), ), ), ), diff --git a/example/lib/pages/components/button_example.dart b/example/lib/pages/components/button_example.dart index 5f6005af..c2c77ad8 100644 --- a/example/lib/pages/components/button_example.dart +++ b/example/lib/pages/components/button_example.dart @@ -110,21 +110,16 @@ class _ButtonExampleState extends State { flex: 8, child: Column( children: [ - Text('Rounded Buttons', style: ZetaTextStyles.displayMedium), - Column(children: buttons(ZetaWidgetBorder.rounded)), - Text('Sharp Buttons', style: ZetaTextStyles.displayMedium), - Column(children: buttons(ZetaWidgetBorder.sharp)), + Text('Regular Buttons', style: ZetaTextStyles.displayMedium), + Column(children: buttons(null)), Text('Full Buttons', style: ZetaTextStyles.displayMedium), Column(children: buttons(ZetaWidgetBorder.full)), Text('Icon Buttons', style: ZetaTextStyles.displayLarge), - Text('Rounded Buttons', style: ZetaTextStyles.displayMedium), - Column(children: inputButtons(ZetaWidgetBorder.rounded)), - Text('Sharp Buttons', style: ZetaTextStyles.displayMedium), - Column(children: inputButtons(ZetaWidgetBorder.sharp)), + Column(children: iconButtons(null)), + Text('Full Icon Buttons', style: ZetaTextStyles.displayMedium), + Column(children: iconButtons(ZetaWidgetBorder.full)), Text('Group Buttons', style: ZetaTextStyles.displayLarge), - Column( - children: groupButtons(ZetaWidgetBorder.rounded), - ), + Column(children: groupButtons(null)), Text('Floating Action Buttons', style: ZetaTextStyles.displayMedium), Text('Tap buttons to change current FAB: ', style: ZetaTextStyles.bodyMedium), Wrap(children: fabs.divide(SizedBox.square(dimension: 10)).toList()), @@ -138,7 +133,7 @@ class _ButtonExampleState extends State { ); } - List buttons(ZetaWidgetBorder borderType) { + List buttons(ZetaWidgetBorder? borderType) { return List.generate( ZetaWidgetSize.values.length + 1, (index) => SingleChildScrollView( @@ -160,7 +155,7 @@ class _ButtonExampleState extends State { ).reversed.divide(const SizedBox.square(dimension: ZetaSpacing.xl_2)).toList(); } - List inputButtons(ZetaWidgetBorder borderType) { + List iconButtons(ZetaWidgetBorder? borderType) { return List.generate( ZetaWidgetSize.values.length + 1, (index) => SingleChildScrollView( @@ -175,8 +170,8 @@ class _ButtonExampleState extends State { size: ZetaWidgetSize.values[index == 0 ? 0 : index - 1], borderType: borderType, icon: ZetaButtonType.values[index2] == ZetaButtonType.negative - ? ZetaIcons.delete_round - : ZetaIcons.more_horizontal_round, + ? ZetaIcons.delete + : ZetaIcons.more_horizontal, ), ).divide(const SizedBox.square(dimension: ZetaSpacing.xl_2)).toList(), ), @@ -184,9 +179,9 @@ class _ButtonExampleState extends State { ).reversed.divide(const SizedBox.square(dimension: ZetaSpacing.xl_2)).toList(); } - List groupButtons(ZetaWidgetBorder) { + List groupButtons(ZetaWidgetBorder? ZetaWidgetBorder) { return [ - ZetaButtonGroup(isLarge: true, rounded: true, buttons: [ + ZetaButtonGroup(isLarge: true, buttons: [ ZetaGroupButton( onPressed: () {}, label: "Label", @@ -196,7 +191,7 @@ class _ButtonExampleState extends State { label: "Label", ), ]), - ZetaButtonGroup(isLarge: true, rounded: true, buttons: [ + ZetaButtonGroup(isLarge: true, buttons: [ ZetaGroupButton( onPressed: () {}, label: "Label", @@ -212,11 +207,10 @@ class _ButtonExampleState extends State { ]), ZetaButtonGroup( isLarge: true, - rounded: true, isInverse: true, buttons: [ ZetaGroupButton.icon( - icon: ZetaIcons.star_round, + icon: ZetaIcons.star, onPressed: () {}, label: "Label", ), @@ -229,33 +223,32 @@ class _ButtonExampleState extends State { items: [ ZetaDropdownItem( value: 'Item 1', - icon: Icon(ZetaIcons.star_half), + icon: ZetaIcon(ZetaIcons.star_half), ), ZetaDropdownItem(value: 'Item 2'), ], ), ZetaGroupButton.icon( - icon: ZetaIcons.star_round, + icon: ZetaIcons.star, label: "Label", ), ], ), ZetaButtonGroup( isLarge: true, - rounded: true, buttons: [ ZetaGroupButton.icon( - icon: ZetaIcons.star_round, + icon: ZetaIcons.star, label: "Label", onPressed: () {}, ), ZetaGroupButton.icon( - icon: ZetaIcons.star_round, + icon: ZetaIcons.star, label: "Label", onPressed: () {}, ), ZetaGroupButton.icon( - icon: ZetaIcons.star_round, + icon: ZetaIcons.star, label: "Label", onPressed: () {}, ), diff --git a/example/lib/pages/components/checkbox_example.dart b/example/lib/pages/components/checkbox_example.dart index 4249cd27..4dc69b46 100644 --- a/example/lib/pages/components/checkbox_example.dart +++ b/example/lib/pages/components/checkbox_example.dart @@ -43,14 +43,10 @@ class _CheckBoxExampleState extends State { ), ], ), - Row(children: [Text('Sharp Checkbox Enabled')]), + Row(children: [Text('Checkbox Enabled')]), getCheckBoxRow(isEnabled: true), - Row(children: [Text('Sharp Checkbox Disabled')]), + Row(children: [Text('Checkbox Disabled')]), getCheckBoxRow(isEnabled: false), - Row(children: [Text('Rounded Checkbox Enabled')]), - getCheckBoxRow(isEnabled: true, isSharp: false), - Row(children: [Text('Rounded Checkbox Disabled')]), - getCheckBoxRow(isEnabled: false, isSharp: false), ], ), ), @@ -58,7 +54,7 @@ class _CheckBoxExampleState extends State { } } -Row getCheckBoxRow({required bool isEnabled, bool isSharp = true}) { +Row getCheckBoxRow({required bool isEnabled}) { return Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.spaceAround, @@ -66,17 +62,14 @@ Row getCheckBoxRow({required bool isEnabled, bool isSharp = true}) { ZetaCheckbox( value: true, label: 'Label', - rounded: !isSharp, onChanged: isEnabled ? (value) => {} : null, ), ZetaCheckbox( value: false, label: 'Label', - rounded: !isSharp, onChanged: isEnabled ? (value) => {} : null, ), ZetaCheckbox( - rounded: !isSharp, onChanged: isEnabled ? (value) => {} : null, value: false, ) diff --git a/example/lib/pages/components/chip_example.dart b/example/lib/pages/components/chip_example.dart index 8eb0222f..2294e231 100644 --- a/example/lib/pages/components/chip_example.dart +++ b/example/lib/pages/components/chip_example.dart @@ -21,33 +21,10 @@ class _ChipExampleState extends State { style: TextStyle(fontWeight: FontWeight.bold), ), const SizedBox(height: 10), - Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Expanded( - child: Column( - children: [ - ZetaInputChip( - label: 'Label', - leading: ZetaAvatar.initials(initials: "ZA"), - trailing: IconButton(icon: Icon(ZetaIcons.close_round), onPressed: () {}), - ), - ], - ), - ), - Expanded( - child: Column( - children: [ - ZetaInputChip( - label: 'Label', - rounded: false, - leading: const Icon(ZetaIcons.user_round), - trailing: Icon(ZetaIcons.close_sharp), - ), - ], - ), - ), - ], + ZetaInputChip( + label: 'Label', + leading: const ZetaIcon(ZetaIcons.user), + trailing: ZetaIcon(ZetaIcons.close), ), ]); @@ -58,35 +35,14 @@ class _ChipExampleState extends State { style: TextStyle(fontWeight: FontWeight.bold), ), const SizedBox(height: 10), - Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Expanded( - child: Column( - children: [ - ZetaAssistChip( - label: 'Label', - leading: Icon(ZetaIcons.star_round), - draggable: true, - data: 'Round Assist chip', - ), - ], - ), - ), - Expanded( - child: Column( - children: [ - ZetaAssistChip( - label: 'Label', - rounded: false, - leading: Icon(ZetaIcons.star_round), - data: 'Sharp Assist chip', - draggable: true, - ), - ], - ), - ), - ], + SizedBox( + height: 40, + child: ZetaAssistChip( + label: 'Label', + leading: ZetaIcon(ZetaIcons.star), + draggable: true, + data: 'Assist chip', + ), ), ]); @@ -97,35 +53,14 @@ class _ChipExampleState extends State { style: TextStyle(fontWeight: FontWeight.bold), ), const SizedBox(height: 10), - Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Expanded( - child: Column( - children: [ - ZetaFilterChip( - label: 'Label', - selected: true, - data: 'Round filter chip', - draggable: true, - ), - ], - ), - ), - Expanded( - child: Column( - children: [ - ZetaFilterChip( - label: 'Label', - rounded: false, - selected: true, - data: 'Sharp filter chip', - draggable: true, - ), - ], - ), - ), - ], + SizedBox( + height: 40, + child: ZetaFilterChip( + label: 'Label', + selected: true, + data: 'Filter chip', + draggable: true, + ), ), ]); final colors = Zeta.of(context).colors; @@ -136,12 +71,6 @@ class _ChipExampleState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - Row( - children: [ - Expanded(child: Center(child: Text('Rounded'))), - Expanded(child: Center(child: Text('Sharp'))), - ], - ), inputChipExample, assistChipExample, filterChipExample, diff --git a/example/lib/pages/components/date_input_example.dart b/example/lib/pages/components/date_input_example.dart index 89037f82..a1e3218a 100644 --- a/example/lib/pages/components/date_input_example.dart +++ b/example/lib/pages/components/date_input_example.dart @@ -23,7 +23,7 @@ class _DateInputExampleState extends State { children: [ Padding( padding: const EdgeInsets.only(top: 20), - child: Text('Rounded', style: ZetaTextStyles.titleMedium), + child: Text('Large', style: ZetaTextStyles.titleMedium), ), Padding( padding: const EdgeInsets.all(20), @@ -32,12 +32,13 @@ class _DateInputExampleState extends State { hintText: 'Enter birthdate', errorText: _errorText ?? 'Invalid date', initialValue: DateTime.now(), + size: ZetaWidgetSize.large, ), ), Divider(color: Colors.grey[200]), Padding( padding: const EdgeInsets.only(top: 20), - child: Text('Sharp', style: ZetaTextStyles.titleMedium), + child: Text('Medium', style: ZetaTextStyles.titleMedium), ), Padding( padding: const EdgeInsets.all(20), @@ -45,27 +46,13 @@ class _DateInputExampleState extends State { label: 'Label', hintText: 'Default hint text', errorText: 'Oops! Error hint text', - rounded: false, - dateFormat: 'yyyy-MM-dd', - ), - ), - Divider(color: Colors.grey[200]), - Padding( - padding: const EdgeInsets.only(top: 20), - child: Text('Disabled', style: ZetaTextStyles.titleMedium), - ), - Padding( - padding: const EdgeInsets.all(20), - child: ZetaDateInput( - label: 'Label', - hintText: 'Default hint text', - disabled: true, + size: ZetaWidgetSize.medium, ), ), Divider(color: Colors.grey[200]), Padding( padding: const EdgeInsets.only(top: 20), - child: Text('Medium', style: ZetaTextStyles.titleMedium), + child: Text('Small', style: ZetaTextStyles.titleMedium), ), Padding( padding: const EdgeInsets.all(20), @@ -73,21 +60,20 @@ class _DateInputExampleState extends State { label: 'Label', hintText: 'Default hint text', errorText: 'Oops! Error hint text', - size: ZetaWidgetSize.medium, + size: ZetaWidgetSize.small, ), ), Divider(color: Colors.grey[200]), Padding( padding: const EdgeInsets.only(top: 20), - child: Text('Small', style: ZetaTextStyles.titleMedium), + child: Text('Disabled', style: ZetaTextStyles.titleMedium), ), Padding( padding: const EdgeInsets.all(20), child: ZetaDateInput( label: 'Label', hintText: 'Default hint text', - errorText: 'Oops! Error hint text', - size: ZetaWidgetSize.small, + disabled: true, ), ), ], diff --git a/example/lib/pages/components/dialog_example.dart b/example/lib/pages/components/dialog_example.dart index 6e13cca9..25072683 100644 --- a/example/lib/pages/components/dialog_example.dart +++ b/example/lib/pages/components/dialog_example.dart @@ -20,8 +20,8 @@ class DialogExample extends StatelessWidget { context, useRootNavigator: false, title: 'Dialog Title', - icon: Icon( - ZetaIcons.warning_round, + icon: ZetaIcon( + ZetaIcons.warning, color: zeta.colors.surfaceWarning, ), message: @@ -35,8 +35,8 @@ class DialogExample extends StatelessWidget { context, useRootNavigator: false, title: 'Dialog Title', - icon: Icon( - ZetaIcons.warning_round, + icon: ZetaIcon( + ZetaIcons.warning, color: zeta.colors.surfaceWarning, ), message: @@ -51,8 +51,8 @@ class DialogExample extends StatelessWidget { context, useRootNavigator: false, title: 'Dialog Title', - icon: Icon( - ZetaIcons.warning_round, + icon: ZetaIcon( + ZetaIcons.warning, color: zeta.colors.surfaceWarning, ), message: @@ -69,8 +69,8 @@ class DialogExample extends StatelessWidget { context, useRootNavigator: false, title: 'Dialog Title', - icon: Icon( - ZetaIcons.warning_round, + icon: ZetaIcon( + ZetaIcons.warning, color: zeta.colors.surfaceWarning, ), message: @@ -78,7 +78,6 @@ class DialogExample extends StatelessWidget { headerAlignment: ZetaDialogHeaderAlignment.left, primaryButtonLabel: 'Confirm', secondaryButtonLabel: 'Cancel', - rounded: false, ), child: Text( 'Show dialog with header to the left\nand sharp buttons', diff --git a/example/lib/pages/components/dialpad_example.dart b/example/lib/pages/components/dialpad_example.dart index 774467d0..d77d76e6 100644 --- a/example/lib/pages/components/dialpad_example.dart +++ b/example/lib/pages/components/dialpad_example.dart @@ -45,7 +45,7 @@ class _DialPadExampleState extends State { ), ), IconButton( - icon: Icon(Icons.backspace), + icon: ZetaIcon(Icons.backspace), onPressed: () => number.length == 0 ? null : setState( @@ -66,7 +66,7 @@ class _DialPadExampleState extends State { textAlign: TextAlign.center, ), IconButton( - icon: Icon(Icons.backspace), + icon: ZetaIcon(Icons.backspace), onPressed: () => text.length == 0 ? null : setState( diff --git a/example/lib/pages/components/dropdown_example.dart b/example/lib/pages/components/dropdown_example.dart index 37967d48..04a7e314 100644 --- a/example/lib/pages/components/dropdown_example.dart +++ b/example/lib/pages/components/dropdown_example.dart @@ -18,11 +18,11 @@ class _DropdownExampleState extends State { final items = [ ZetaDropdownItem( value: "Item 1", - icon: Icon(ZetaIcons.star_round), + icon: ZetaIcon(ZetaIcons.star), ), ZetaDropdownItem( value: "Item 2", - icon: Icon(ZetaIcons.star_half_round), + icon: ZetaIcon(ZetaIcons.star_half), ), ZetaDropdownItem( value: "Item 3", diff --git a/example/lib/pages/components/filter_selection_example.dart b/example/lib/pages/components/filter_selection_example.dart index 89ab64fe..49d8e006 100644 --- a/example/lib/pages/components/filter_selection_example.dart +++ b/example/lib/pages/components/filter_selection_example.dart @@ -34,19 +34,6 @@ class _FilterSelectionExampleState extends State { ], onPressed: () {}, ), - const SizedBox(height: ZetaSpacing.large), - ZetaFilterSelection( - rounded: false, - items: [ - for (int i = 0; i < items2.length; i++) - ZetaFilterChip( - label: 'Label ${i + 1}', - selected: items2[i], - onTap: (value) => setState(() => items2[i] = value), - ), - ], - onPressed: () {}, - ), ], ), ); diff --git a/example/lib/pages/components/global_header_example.dart b/example/lib/pages/components/global_header_example.dart index e83759ae..5a1a2b9c 100644 --- a/example/lib/pages/components/global_header_example.dart +++ b/example/lib/pages/components/global_header_example.dart @@ -18,38 +18,35 @@ class _GroupHeaderExampleState extends State { Widget build(BuildContext context) { return ExampleScaffold( name: "Global Header", - child: LayoutBuilder(builder: (context, constraints) { - return Center( - child: SingleChildScrollView( - child: Column(children: [ - Text(constraints.maxWidth.toString()), - ZetaGlobalHeader( - title: "Title", - tabItems: childrenOne, - searchBar: ZetaSearchBar(shape: ZetaWidgetBorder.full, size: ZetaWidgetSize.large), - onAppsButton: () {}, - actionButtons: [ - IconButton( - onPressed: () {}, - icon: const Icon( - ZetaIcons.alert_round, - ), + child: Center( + child: SingleChildScrollView( + child: Column(children: [ + ZetaGlobalHeader( + title: "Title", + tabItems: childrenOne, + searchBar: ZetaSearchBar(shape: ZetaWidgetBorder.full, size: ZetaWidgetSize.large), + onAppsButton: () {}, + actionButtons: [ + IconButton( + onPressed: () {}, + icon: const ZetaIcon( + ZetaIcons.alert, ), - IconButton( - onPressed: () {}, - icon: const Icon( - ZetaIcons.help_round, - ), + ), + IconButton( + onPressed: () {}, + icon: const ZetaIcon( + ZetaIcons.help, ), - ], - avatar: const ZetaAvatar(initials: 'PS'), - ), - const SizedBox(height: ZetaSpacing.xl_1), - ZetaGlobalHeader(title: "Title", tabItems: childrenTwo), - ]), - ), - ); - }), + ), + ], + avatar: const ZetaAvatar(initials: 'PS'), + ), + const SizedBox(height: ZetaSpacing.xl_1), + ZetaGlobalHeader(title: "Title", tabItems: childrenTwo), + ]), + ), + ), ); } } diff --git a/example/lib/pages/components/list_example.dart b/example/lib/pages/components/list_example.dart index da9c6341..2c188a23 100644 --- a/example/lib/pages/components/list_example.dart +++ b/example/lib/pages/components/list_example.dart @@ -18,7 +18,7 @@ class ListExample extends StatelessWidget { ZetaListItem(primaryText: 'Item 2'), ZetaDropdownListItem( primaryText: 'Item 3', - leading: Icon(ZetaIcons.star_round), + leading: ZetaIcon(ZetaIcons.star), expanded: true, items: [ ZetaListItem.checkbox( diff --git a/example/lib/pages/components/list_item_example.dart b/example/lib/pages/components/list_item_example.dart index 14a48adf..cc0cf1d4 100644 --- a/example/lib/pages/components/list_item_example.dart +++ b/example/lib/pages/components/list_item_example.dart @@ -40,7 +40,7 @@ class _ListItemExampleState extends State { )), _buildListItem( 'Icon Left', - ZetaListItem(primaryText: 'List Item', leading: Icon(ZetaIcons.star_round)), + ZetaListItem(primaryText: 'List Item', leading: ZetaIcon(ZetaIcons.star)), ), _buildListItem( 'Toggle Right', @@ -102,8 +102,8 @@ class _ListItemExampleState extends State { ], expanded: true, primaryText: 'List Item', - leading: Icon( - ZetaIcons.star_round, + leading: ZetaIcon( + ZetaIcons.star, ), ), ), diff --git a/example/lib/pages/components/navigation_bar_example.dart b/example/lib/pages/components/navigation_bar_example.dart index 87731510..b1497528 100644 --- a/example/lib/pages/components/navigation_bar_example.dart +++ b/example/lib/pages/components/navigation_bar_example.dart @@ -17,10 +17,10 @@ class _NavigationBarExampleState extends State { @override Widget build(BuildContext context) { final items = [ - ZetaNavigationBarItem(icon: ZetaIcons.star_round, label: 'Label', badge: ZetaIndicator(value: 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, label: 'Label', badge: ZetaIndicator(value: 2)), + ZetaNavigationBarItem(icon: ZetaIcons.star, label: 'Label'), + ZetaNavigationBarItem(icon: ZetaIcons.star, label: 'Label'), + ZetaNavigationBarItem(icon: ZetaIcons.star, label: 'Label'), ]; return ExampleScaffold( diff --git a/example/lib/pages/components/navigation_rail_example.dart b/example/lib/pages/components/navigation_rail_example.dart index 3f0b5d47..bb050ef1 100644 --- a/example/lib/pages/components/navigation_rail_example.dart +++ b/example/lib/pages/components/navigation_rail_example.dart @@ -37,19 +37,19 @@ class _NavigationRailExampleState extends State { items: [ ZetaNavigationRailItem( label: 'Label', - icon: Icon(ZetaIcons.star_round), + icon: ZetaIcon(ZetaIcons.star), ), ZetaNavigationRailItem( label: 'User\nPreferences', - icon: Icon(ZetaIcons.star_round), + icon: ZetaIcon(ZetaIcons.star), ), ZetaNavigationRailItem( label: 'Account Settings', - icon: Icon(ZetaIcons.star_round), + icon: ZetaIcon(ZetaIcons.star), ), ZetaNavigationRailItem( label: 'Label', - icon: Icon(ZetaIcons.star_round), + icon: ZetaIcon(ZetaIcons.star), disabled: true, ), ], diff --git a/example/lib/pages/components/notification_list_example.dart b/example/lib/pages/components/notification_list_example.dart index e4b52927..5b908b70 100644 --- a/example/lib/pages/components/notification_list_example.dart +++ b/example/lib/pages/components/notification_list_example.dart @@ -28,7 +28,7 @@ class _NotificationListItemExampleState extends State { Padding(padding: EdgeInsets.only(top: 20)), ZetaPasswordInput( size: ZetaWidgetSize.medium, - rounded: false, hintText: 'Password', controller: _passwordController, validator: (value) { @@ -68,17 +67,15 @@ class _PasswordInputExampleState extends State { } } -List passwordInputExampleRow(ZetaWidgetSize size, {bool rounded = true}) { +List passwordInputExampleRow(ZetaWidgetSize size) { return [ ZetaPasswordInput( size: size, hintText: 'Password', - rounded: rounded, placeholder: 'Password', ), SizedBox(height: 20), ZetaPasswordInput( - rounded: rounded, size: size, placeholder: 'Password', disabled: true, @@ -89,7 +86,6 @@ List passwordInputExampleRow(ZetaWidgetSize size, {bool rounded = true}) label: 'Label', placeholder: 'Password', hintText: 'Default hint text', - rounded: rounded, ), ]; } diff --git a/example/lib/pages/components/phone_input_example.dart b/example/lib/pages/components/phone_input_example.dart index 49ccf0c0..cd0ab5cd 100644 --- a/example/lib/pages/components/phone_input_example.dart +++ b/example/lib/pages/components/phone_input_example.dart @@ -21,10 +21,6 @@ class _PhoneInputExampleState extends State { child: SingleChildScrollView( child: Column( children: [ - Padding( - padding: const EdgeInsets.only(top: 20), - child: Text('Rounded', style: ZetaTextStyles.titleMedium), - ), Padding( padding: const EdgeInsets.all(20), child: ZetaPhoneInput( @@ -40,26 +36,6 @@ class _PhoneInputExampleState extends State { ), ), Divider(color: Colors.grey[200]), - Padding( - padding: const EdgeInsets.only(top: 20), - child: Text('Sharp', style: ZetaTextStyles.titleMedium), - ), - Padding( - padding: const EdgeInsets.all(20), - child: ZetaPhoneInput( - label: 'Phone number', - hint: 'Enter your phone number', - countryDialCode: '+44', - phoneNumber: '987654321', - hasError: _errorText != null, - errorText: _errorText, - onChanged: (value) { - if (value?.isEmpty ?? true) return setState(() => _errorText = null); - }, - rounded: false, - ), - ), - Divider(color: Colors.grey[200]), Padding( padding: const EdgeInsets.only(top: 20), child: Text('Disabled', style: ZetaTextStyles.titleMedium), diff --git a/example/lib/pages/components/progress_example.dart b/example/lib/pages/components/progress_example.dart index 20cbb604..fdc0ef81 100644 --- a/example/lib/pages/components/progress_example.dart +++ b/example/lib/pages/components/progress_example.dart @@ -57,7 +57,6 @@ class ProgressExampleState extends State { Wrapper( stepsCompleted: 0, circleSize: ZetaCircleSizes.xl, - rounded: false, isCircle: true, ), SizedBox( @@ -78,7 +77,6 @@ class Wrapper extends StatefulWidget { required this.stepsCompleted, this.type = ZetaProgressBarType.standard, this.isThin = false, - this.rounded = true, this.stateChangeable = false, this.label, this.isCircle = false, @@ -86,7 +84,7 @@ class Wrapper extends StatefulWidget { }); final int stepsCompleted; - final bool? rounded; + final ZetaProgressBarType? type; final bool? isThin; final String? label; @@ -139,12 +137,7 @@ class _WrapperState extends State { ) : SizedBox( width: 400, - child: ZetaProgressBar( - progress: progress, - rounded: widget.rounded!, - type: type, - isThin: widget.isThin!, - label: widget.label), + child: ZetaProgressBar(progress: progress, type: type, isThin: widget.isThin!, label: widget.label), ), const SizedBox(width: 40), Row( diff --git a/example/lib/pages/components/segmented_control_example.dart b/example/lib/pages/components/segmented_control_example.dart index 2d9ff822..ef036160 100644 --- a/example/lib/pages/components/segmented_control_example.dart +++ b/example/lib/pages/components/segmented_control_example.dart @@ -70,7 +70,7 @@ class _SegmentedControlExampleState extends State { for (final value in _iconsSegments) ZetaButtonSegment( value: value, - child: Icon(ZetaIcons.star_round), + child: ZetaIcon(ZetaIcons.star), ), ], onChanged: (value) => setState( diff --git a/example/lib/pages/components/select_input_example.dart b/example/lib/pages/components/select_input_example.dart index e7c145e2..621310fa 100644 --- a/example/lib/pages/components/select_input_example.dart +++ b/example/lib/pages/components/select_input_example.dart @@ -18,11 +18,11 @@ class _SelectInputExampleState extends State { final items = [ ZetaDropdownItem( value: "Item 1", - icon: Icon(ZetaIcons.star_round), + icon: ZetaIcon(ZetaIcons.star), ), ZetaDropdownItem( value: "Item 2", - icon: Icon(ZetaIcons.star_half_round), + icon: ZetaIcon(ZetaIcons.star_half), ), ZetaDropdownItem( value: "Item 3", @@ -43,7 +43,6 @@ class _SelectInputExampleState extends State { label: 'Large', size: ZetaWidgetSize.large, hintText: 'Default hint text', - rounded: false, placeholder: 'Placeholder', initialValue: "Item 1", items: items, diff --git a/example/lib/pages/components/snackbar_example.dart b/example/lib/pages/components/snackbar_example.dart index 5ea2660c..83f0a86c 100644 --- a/example/lib/pages/components/snackbar_example.dart +++ b/example/lib/pages/components/snackbar_example.dart @@ -54,7 +54,6 @@ class SnackBarExample extends StatelessWidget { ScaffoldMessenger.of(context).hideCurrentSnackBar(); }, actionLabel: "Action", - rounded: false, content: Text('This is a snackbar'), ), ); @@ -72,7 +71,7 @@ class SnackBarExample extends StatelessWidget { ZetaSnackBar( context: context, type: ZetaSnackBarType.defaultType, - leadingIcon: Icon(Icons.mood_rounded), + leadingIcon: ZetaIcon(Icons.mood), content: Text('Message with icon'), ), ); diff --git a/example/lib/pages/components/stepper_example.dart b/example/lib/pages/components/stepper_example.dart index 50816f2c..b0bcd1b5 100644 --- a/example/lib/pages/components/stepper_example.dart +++ b/example/lib/pages/components/stepper_example.dart @@ -12,7 +12,7 @@ class StepperExample extends StatefulWidget { } class _StepperExampleState extends State { - int _roundedHorizontalStep = 0; + int edHorizontalStep = 0; int _sharpHorizontalStep = 0; int _verticalStep = 0; @@ -36,12 +36,12 @@ class _StepperExampleState extends State { SizedBox( height: 150, child: ZetaStepper( - currentStep: _roundedHorizontalStep, - onStepTapped: (index) => setState(() => _roundedHorizontalStep = index), + currentStep: edHorizontalStep, + onStepTapped: (index) => setState(() => edHorizontalStep = index), steps: [ ZetaStep( type: _getForStepIndex( - currentStep: _roundedHorizontalStep, + currentStep: edHorizontalStep, stepIndex: 0, ), title: Text("Title"), @@ -49,14 +49,14 @@ class _StepperExampleState extends State { ), ZetaStep( type: _getForStepIndex( - currentStep: _roundedHorizontalStep, + currentStep: edHorizontalStep, stepIndex: 1, ), title: Text("Title 2"), ), ZetaStep( type: _getForStepIndex( - currentStep: _roundedHorizontalStep, + currentStep: edHorizontalStep, stepIndex: 2, ), title: Text("Title 3"), @@ -68,7 +68,6 @@ class _StepperExampleState extends State { SizedBox( height: 150, child: ZetaStepper( - rounded: false, currentStep: _sharpHorizontalStep, onStepTapped: (index) => setState(() => _sharpHorizontalStep = index), steps: [ diff --git a/example/lib/pages/components/stepper_input_example.dart b/example/lib/pages/components/stepper_input_example.dart index f03fa351..e1e94b3b 100644 --- a/example/lib/pages/components/stepper_input_example.dart +++ b/example/lib/pages/components/stepper_input_example.dart @@ -26,7 +26,7 @@ class _StepperInputExampleState extends State { initialValue: 5, onChange: (_) {}, ), - ZetaStepperInput(rounded: false), + ZetaStepperInput(), ZetaStepperInput( size: ZetaStepperInputSize.large, onChange: (_) {}, diff --git a/example/lib/pages/components/tabs_example.dart b/example/lib/pages/components/tabs_example.dart index 8774c503..be2a5f7c 100644 --- a/example/lib/pages/components/tabs_example.dart +++ b/example/lib/pages/components/tabs_example.dart @@ -24,8 +24,8 @@ class _TabsExampleState extends State { context: context, onTap: (int) => print(int), tabs: [ - ZetaTab(icon: Icon(ZetaIcons.star_round), text: "Tab Item"), - ZetaTab(icon: Icon(ZetaIcons.star_round), text: "Tab Item"), + ZetaTab(icon: ZetaIcon(ZetaIcons.star), text: "Tab Item"), + ZetaTab(icon: ZetaIcon(ZetaIcons.star), text: "Tab Item"), ], ), ), @@ -55,11 +55,11 @@ class _TabsExampleState extends State { context: context, isScrollable: true, tabs: [ - ZetaTab(icon: Icon(ZetaIcons.star_sharp), text: "Tab Item"), - ZetaTab(icon: Icon(ZetaIcons.star_sharp), text: "Tab Item"), - ZetaTab(icon: Icon(ZetaIcons.star_sharp), text: "Tab Item"), - ZetaTab(icon: Icon(ZetaIcons.star_sharp), text: "Tab Item"), - ZetaTab(icon: Icon(ZetaIcons.star_sharp), text: "Tab Item"), + ZetaTab(icon: ZetaIcon(ZetaIcons.star), text: "Tab Item"), + ZetaTab(icon: ZetaIcon(ZetaIcons.star), text: "Tab Item"), + ZetaTab(icon: ZetaIcon(ZetaIcons.star), text: "Tab Item"), + ZetaTab(icon: ZetaIcon(ZetaIcons.star), text: "Tab Item"), + ZetaTab(icon: ZetaIcon(ZetaIcons.star), text: "Tab Item"), ], ), ), diff --git a/example/lib/pages/components/text_input_example.dart b/example/lib/pages/components/text_input_example.dart index 80bbb133..66b5cd1e 100644 --- a/example/lib/pages/components/text_input_example.dart +++ b/example/lib/pages/components/text_input_example.dart @@ -29,7 +29,7 @@ class TextInputExample extends StatelessWidget { disabled: false, hintText: 'hint text', suffix: IconButton( - icon: Icon(ZetaIcons.add_alert_round), + icon: ZetaIcon(ZetaIcons.add_alert), onPressed: () {}, ), ), @@ -49,8 +49,8 @@ class TextInputExample extends StatelessWidget { child: IconButton( iconSize: 12, splashRadius: 1, - icon: Icon( - ZetaIcons.add_alert_round, + icon: ZetaIcon( + ZetaIcons.add_alert, ), onPressed: () {}, ), @@ -59,8 +59,8 @@ class TextInputExample extends StatelessWidget { const SizedBox(height: 8), ZetaTextInput( placeholder: 'Placeholder', - prefix: Icon( - ZetaIcons.star_round, + prefix: ZetaIcon( + ZetaIcons.star, size: 20, ), ), diff --git a/example/lib/pages/components/time_input_example.dart b/example/lib/pages/components/time_input_example.dart index 75b4b9fb..24aee780 100644 --- a/example/lib/pages/components/time_input_example.dart +++ b/example/lib/pages/components/time_input_example.dart @@ -58,7 +58,6 @@ class TimeInputExample extends StatelessWidget { ), ZetaTimeInput(label: '12 Hr Time Picker', use12Hr: true), ZetaTimeInput(label: 'Disabled Time Picker', disabled: true, hintText: 'Disabled time picker'), - ZetaTimeInput(label: 'Sharp Time Picker', rounded: false), ].divide(const SizedBox(height: 12)).toList(), ), ), diff --git a/example/lib/pages/components/tooltip_example.dart b/example/lib/pages/components/tooltip_example.dart index 4e375ad1..ff94c86a 100644 --- a/example/lib/pages/components/tooltip_example.dart +++ b/example/lib/pages/components/tooltip_example.dart @@ -18,7 +18,6 @@ class TooltipExample extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Text('Rounded'), const SizedBox(height: ZetaSpacing.xl_4), ZetaTooltip( child: Text('Label'), @@ -38,31 +37,6 @@ class TooltipExample extends StatelessWidget { child: Text('Label'), arrowDirection: ZetaTooltipArrowDirection.left, ), - Divider(height: ZetaSpacing.xl_11), - Text('Sharp'), - const SizedBox(height: ZetaSpacing.xl_4), - ZetaTooltip( - child: Text('Label'), - rounded: false, - ), - const SizedBox(height: ZetaSpacing.xl_4), - ZetaTooltip( - child: Text('Label'), - arrowDirection: ZetaTooltipArrowDirection.right, - rounded: false, - ), - const SizedBox(height: ZetaSpacing.xl_4), - ZetaTooltip( - child: Text('Label'), - arrowDirection: ZetaTooltipArrowDirection.up, - rounded: false, - ), - const SizedBox(height: ZetaSpacing.xl_4), - ZetaTooltip( - child: Text('Label'), - arrowDirection: ZetaTooltipArrowDirection.left, - rounded: false, - ), ], ), ), diff --git a/example/lib/pages/components/top_app_bar_example.dart b/example/lib/pages/components/top_app_bar_example.dart index 18ac9c82..a0c37ad9 100644 --- a/example/lib/pages/components/top_app_bar_example.dart +++ b/example/lib/pages/components/top_app_bar_example.dart @@ -34,8 +34,8 @@ class _TopAppBarExampleState extends State { Widget build(BuildContext context) { final Widget image = CachedNetworkImage( imageUrl: "https://i.ytimg.com/vi/KItsWUzFUOs/maxresdefault.jpg", - placeholder: (context, url) => Icon(ZetaIcons.user_round), - errorWidget: (context, url, error) => Icon(Icons.error), + placeholder: (context, url) => ZetaIcon(ZetaIcons.user), + errorWidget: (context, url, error) => ZetaIcon(ZetaIcons.error), fit: BoxFit.cover, ); final colors = Zeta.of(context).colors; @@ -51,7 +51,7 @@ class _TopAppBarExampleState extends State { ZetaTopAppBar( leading: IconButton( onPressed: () {}, - icon: Icon(Icons.menu_rounded), + icon: Icon(Icons.menu), ), title: Row( children: [ @@ -65,15 +65,15 @@ class _TopAppBarExampleState extends State { actions: [ IconButton( onPressed: () {}, - icon: Icon(Icons.language), + icon: ZetaIcon(Icons.language), ), IconButton( onPressed: () {}, - icon: Icon(Icons.favorite), + icon: ZetaIcon(Icons.favorite), ), IconButton( onPressed: () {}, - icon: Icon(ZetaIcons.more_vertical_round), + icon: ZetaIcon(ZetaIcons.more_vertical), ) ], ), @@ -82,13 +82,13 @@ class _TopAppBarExampleState extends State { type: ZetaTopAppBarType.centeredTitle, leading: IconButton( onPressed: () {}, - icon: Icon(Icons.menu_rounded), + icon: ZetaIcon(Icons.menu), ), title: Text("Title"), actions: [ IconButton( onPressed: () {}, - icon: Icon(Icons.account_circle), + icon: ZetaIcon(Icons.account_circle), ), ], ), @@ -96,25 +96,25 @@ class _TopAppBarExampleState extends State { ZetaTopAppBar( leading: IconButton( onPressed: () {}, - icon: Icon(ZetaIcons.close_round), + icon: ZetaIcon(ZetaIcons.close), ), title: Text("2 items"), actions: [ IconButton( onPressed: () {}, - icon: Icon(ZetaIcons.edit_round), + icon: ZetaIcon(ZetaIcons.edit), ), IconButton( onPressed: () {}, - icon: Icon(ZetaIcons.share_round), + icon: ZetaIcon(ZetaIcons.share), ), IconButton( onPressed: () {}, - icon: Icon(ZetaIcons.delete_round), + icon: ZetaIcon(ZetaIcons.delete), ), IconButton( onPressed: () {}, - icon: Icon(ZetaIcons.more_vertical_round), + icon: ZetaIcon(ZetaIcons.more_vertical), ), ], ), @@ -126,7 +126,7 @@ class _TopAppBarExampleState extends State { actions: [ IconButton( onPressed: _showHideSearchRegular, - icon: Icon(ZetaIcons.search_round), + icon: ZetaIcon(ZetaIcons.search), ) ], searchController: _searchControllerRegular, @@ -148,7 +148,7 @@ class _TopAppBarExampleState extends State { ZetaTopAppBar.extended( leading: IconButton( onPressed: () {}, - icon: Icon(Icons.menu_rounded), + icon: ZetaIcon(Icons.menu), ), title: Row( children: [ @@ -162,15 +162,15 @@ class _TopAppBarExampleState extends State { actions: [ IconButton( onPressed: () {}, - icon: Icon(Icons.language), + icon: ZetaIcon(Icons.language), ), IconButton( onPressed: () {}, - icon: Icon(Icons.favorite), + icon: ZetaIcon(Icons.favorite), ), IconButton( onPressed: () {}, - icon: Icon(ZetaIcons.more_vertical_round), + icon: ZetaIcon(ZetaIcons.more_vertical), ) ], ), @@ -200,7 +200,7 @@ class _TopAppBarExampleState extends State { actions: [ IconButton( onPressed: _showHideSearchExtended, - icon: Icon(ZetaIcons.search_round), + icon: ZetaIcon(ZetaIcons.search), ) ], searchController: _searchControllerExtended, diff --git a/example/lib/utils/theme_color_switch.dart b/example/lib/utils/theme_color_switch.dart index 7677f189..1de614cc 100644 --- a/example/lib/utils/theme_color_switch.dart +++ b/example/lib/utils/theme_color_switch.dart @@ -53,7 +53,7 @@ class ZetaThemeColorSwitch extends StatelessWidget { child: ZetaAvatar( size: ZetaAvatarSize.xxs, backgroundColor: color.surface, - image: Icon(Icons.color_lens, color: color), + image: ZetaIcon(Icons.color_lens, color: color), ), ); }).toList(), diff --git a/example/lib/utils/theme_mode_switch.dart b/example/lib/utils/theme_mode_switch.dart index 8288c292..1250c93b 100644 --- a/example/lib/utils/theme_mode_switch.dart +++ b/example/lib/utils/theme_mode_switch.dart @@ -38,7 +38,7 @@ class ZetaThemeModeSwitch extends StatelessWidget { child: ZetaAvatar( size: ZetaAvatarSize.xxs, backgroundColor: colors.primary.surface, - image: Icon( + image: ZetaIcon( e == ThemeMode.system ? Icons.system_security_update_good : e == ThemeMode.light diff --git a/example/widgetbook/pages/assets/icon_widgetbook.dart b/example/widgetbook/pages/assets/icon_widgetbook.dart index ca195374..8f08649d 100644 --- a/example/widgetbook/pages/assets/icon_widgetbook.dart +++ b/example/widgetbook/pages/assets/icon_widgetbook.dart @@ -40,7 +40,7 @@ Widget iconsUseCase(BuildContext context) { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - Icon( + ZetaIcon( IconData( e.value.codePoint, fontFamily: rounded ? ZetaIcons.familyRound : ZetaIcons.familySharp, diff --git a/example/widgetbook/pages/components/avatar_widgetbook.dart b/example/widgetbook/pages/components/avatar_widgetbook.dart index 337670d0..4ed8fdde 100644 --- a/example/widgetbook/pages/components/avatar_widgetbook.dart +++ b/example/widgetbook/pages/components/avatar_widgetbook.dart @@ -19,7 +19,7 @@ Widget avatarUseCase(BuildContext context) { ), upperBadge: context.knobs.boolean(label: 'Status Badge', initialValue: false) ? ZetaAvatarBadge.icon( - icon: ZetaIcons.close_round, + icon: ZetaIcons.close, color: context.knobs.colorOrNull(label: "Upper Badge Color", initialValue: colors.green) ?? colors.iconDefault, ) diff --git a/example/widgetbook/pages/components/banner_widgetbook.dart b/example/widgetbook/pages/components/banner_widgetbook.dart index 69574bd4..d9ff3fd1 100644 --- a/example/widgetbook/pages/components/banner_widgetbook.dart +++ b/example/widgetbook/pages/components/banner_widgetbook.dart @@ -18,12 +18,12 @@ Widget bannerUseCase(BuildContext context) { ), leadingIcon: iconKnob(context, rounded: rounded, nullable: true), titleStart: context.knobs.boolean(label: 'Center title'), - trailing: Icon(iconKnob( + trailing: ZetaIcon(iconKnob( context, rounded: rounded, nullable: true, name: 'trailing', - initial: ZetaIcons.chevron_right_round, + initial: ZetaIcons.chevron_right, )), ); diff --git a/example/widgetbook/pages/components/bottom_sheet_widgetbook.dart b/example/widgetbook/pages/components/bottom_sheet_widgetbook.dart index 6fd44d2f..fc80b36a 100644 --- a/example/widgetbook/pages/components/bottom_sheet_widgetbook.dart +++ b/example/widgetbook/pages/components/bottom_sheet_widgetbook.dart @@ -28,7 +28,7 @@ Widget bottomSheetContentUseCase(BuildContext context) { ZetaBottomSheet _bottomSheet(BuildContext context) { final bool rounded = roundedKnob(context); final leadingIcon = iconKnob(context, rounded: rounded, nullable: true, initial: null); - final trailingIcon = iconKnob(context, rounded: rounded, nullable: true, initial: ZetaIcons.chevron_right_round); + final trailingIcon = iconKnob(context, rounded: rounded, nullable: true, initial: ZetaIcons.chevron_right); return ZetaBottomSheet( centerTitle: context.knobs.boolean(label: 'Center title', initialValue: true), @@ -40,8 +40,8 @@ ZetaBottomSheet _bottomSheet(BuildContext context) { 6, (index) => ZetaMenuItem( type: context.knobs.boolean(label: 'Grid') ? ZetaMenuItemType.vertical : ZetaMenuItemType.horizontal, - leading: leadingIcon != null ? Icon(leadingIcon) : null, - trailing: trailingIcon != null ? Icon(trailingIcon) : null, + leading: leadingIcon != null ? ZetaIcon(leadingIcon) : null, + trailing: trailingIcon != null ? ZetaIcon(trailingIcon) : null, label: Text('Menu Item'), onTap: context.knobs.boolean(label: 'Disabled') ? null : () {}, ), diff --git a/example/widgetbook/pages/components/button_widgetbook.dart b/example/widgetbook/pages/components/button_widgetbook.dart index 8b47a75c..588514da 100644 --- a/example/widgetbook/pages/components/button_widgetbook.dart +++ b/example/widgetbook/pages/components/button_widgetbook.dart @@ -82,11 +82,11 @@ Widget buttonGroupUseCase(BuildContext context) { items: [ ZetaDropdownItem( value: 'Item 1', - icon: Icon(ZetaIcons.star), + icon: ZetaIcon(ZetaIcons.star), ), ZetaDropdownItem( value: 'Item 2', - icon: Icon(ZetaIcons.star_half), + icon: ZetaIcon(ZetaIcons.star_half), ), ], ), diff --git a/example/widgetbook/pages/components/chip_widgetbook.dart b/example/widgetbook/pages/components/chip_widgetbook.dart index 9caaee6f..e7e0c008 100644 --- a/example/widgetbook/pages/components/chip_widgetbook.dart +++ b/example/widgetbook/pages/components/chip_widgetbook.dart @@ -21,7 +21,7 @@ Widget inputChipUseCase(BuildContext context) { ) : null, rounded: rounded, - trailing: trailing != null ? Icon(trailing) : null, + trailing: trailing != null ? ZetaIcon(trailing) : null, ), ); } @@ -40,7 +40,7 @@ Widget assistChipUseCase(BuildContext context) { widget: ZetaAssistChip( label: context.knobs.string(label: 'Label', initialValue: 'Label'), rounded: rounded, - leading: Icon(iconKnob(context, rounded: rounded)), + leading: ZetaIcon(iconKnob(context, rounded: rounded)), ), ); } diff --git a/example/widgetbook/pages/components/dialog_widgetbook.dart b/example/widgetbook/pages/components/dialog_widgetbook.dart index 6936dc55..f761861e 100644 --- a/example/widgetbook/pages/components/dialog_widgetbook.dart +++ b/example/widgetbook/pages/components/dialog_widgetbook.dart @@ -21,7 +21,7 @@ Widget dialogUseCase(BuildContext context) { context, name: "Icon", rounded: rounded, - initial: rounded ? Icons.warning_rounded : Icons.warning_sharp, + initial: Icons.warning, ); final barrierDismissible = context.knobs.boolean(label: 'Barrier dismissible', initialValue: true); final headerAlignment = context.knobs.list( @@ -43,7 +43,7 @@ Widget dialogUseCase(BuildContext context) { barrierDismissible: barrierDismissible, headerAlignment: headerAlignment, title: title, - icon: Icon( + icon: ZetaIcon( iconData, color: zeta.colors.surfaceWarning, ), @@ -60,7 +60,7 @@ Widget dialogUseCase(BuildContext context) { barrierDismissible: barrierDismissible, headerAlignment: headerAlignment, title: title, - icon: Icon( + icon: ZetaIcon( iconData, color: zeta.colors.surfaceWarning, ), @@ -78,7 +78,7 @@ Widget dialogUseCase(BuildContext context) { barrierDismissible: barrierDismissible, headerAlignment: headerAlignment, title: title, - icon: Icon( + icon: ZetaIcon( iconData, color: zeta.colors.surfaceWarning, ), diff --git a/example/widgetbook/pages/components/dropdown_list_item_widgetbook.dart b/example/widgetbook/pages/components/dropdown_list_item_widgetbook.dart index 9ca182cc..6ffd2a0a 100644 --- a/example/widgetbook/pages/components/dropdown_list_item_widgetbook.dart +++ b/example/widgetbook/pages/components/dropdown_list_item_widgetbook.dart @@ -19,7 +19,7 @@ Widget dropdownListItemUseCase(BuildContext context) { final rounded = roundedKnob(context); - final leading = showIcon ? Icon(ZetaIcons.star_round) : null; + final leading = showIcon ? ZetaIcon(ZetaIcons.star) : null; return ZetaDropdownListItem( primaryText: primaryText, diff --git a/example/widgetbook/pages/components/dropdown_widgetbook.dart b/example/widgetbook/pages/components/dropdown_widgetbook.dart index 5aea90a8..d022447f 100644 --- a/example/widgetbook/pages/components/dropdown_widgetbook.dart +++ b/example/widgetbook/pages/components/dropdown_widgetbook.dart @@ -20,11 +20,11 @@ class _DropdownExampleState extends State { final items = [ ZetaDropdownItem( value: "Item 1", - icon: Icon(ZetaIcons.star_round), + icon: ZetaIcon(ZetaIcons.star), ), ZetaDropdownItem( value: "Item 2", - icon: Icon(ZetaIcons.star_half_round), + icon: ZetaIcon(ZetaIcons.star_half), ), ZetaDropdownItem( value: "Item 3", diff --git a/example/widgetbook/pages/components/global_header_widgetbook.dart b/example/widgetbook/pages/components/global_header_widgetbook.dart index b0e59e76..252726e6 100644 --- a/example/widgetbook/pages/components/global_header_widgetbook.dart +++ b/example/widgetbook/pages/components/global_header_widgetbook.dart @@ -8,14 +8,14 @@ Widget globalHeaderUseCase(BuildContext context) { final actionButtons = [ IconButton( onPressed: () {}, - icon: const Icon( - ZetaIcons.alert_round, + icon: const ZetaIcon( + ZetaIcons.alert, ), ), IconButton( onPressed: () {}, - icon: const Icon( - ZetaIcons.help_round, + icon: const ZetaIcon( + ZetaIcons.help, ), ), ]; diff --git a/example/widgetbook/pages/components/list_item_widgetbook.dart b/example/widgetbook/pages/components/list_item_widgetbook.dart index 2acbbbee..02cafe63 100644 --- a/example/widgetbook/pages/components/list_item_widgetbook.dart +++ b/example/widgetbook/pages/components/list_item_widgetbook.dart @@ -26,7 +26,7 @@ Widget listItemUseCase(BuildContext context) { final rounded = roundedKnob(context); - final leading = showIcon ? Icon(ZetaIcons.star_round) : null; + final leading = showIcon ? ZetaIcon(ZetaIcons.star) : null; final onChanged = (bool? value) => setState(() { checkedValue = value!; diff --git a/example/widgetbook/pages/components/navigation_rail_widgetbook.dart b/example/widgetbook/pages/components/navigation_rail_widgetbook.dart index 392ada12..a791d2f5 100644 --- a/example/widgetbook/pages/components/navigation_rail_widgetbook.dart +++ b/example/widgetbook/pages/components/navigation_rail_widgetbook.dart @@ -17,7 +17,7 @@ Widget navigationRailUseCase(BuildContext context) { context, name: "Icon", rounded: rounded, - initial: rounded ? ZetaIcons.star_round : ZetaIcons.star_sharp, + initial: ZetaIcons.star, ); final wordWrap = context.knobs.boolean(label: 'Word wrap', initialValue: true); final disabled = disabledKnob(context); @@ -36,7 +36,7 @@ Widget navigationRailUseCase(BuildContext context) { items: itemsList .map((item) => ZetaNavigationRailItem( label: item, - icon: Icon(iconData), + icon: ZetaIcon(iconData), disabled: disabled, )) .toList(), diff --git a/example/widgetbook/pages/components/notification_list_item_widgetbook.dart b/example/widgetbook/pages/components/notification_list_item_widgetbook.dart index bd72b586..49a4d6ea 100644 --- a/example/widgetbook/pages/components/notification_list_item_widgetbook.dart +++ b/example/widgetbook/pages/components/notification_list_item_widgetbook.dart @@ -32,7 +32,7 @@ Widget notificationListItemUseCase(BuildContext context) => WidgetbookTestWidget label: 'Badge', options: [ ZetaNotificationBadge.avatar(avatar: ZetaAvatar.initials(initials: "AO")), - ZetaNotificationBadge.icon(icon: ZetaIcons.check_circle_round), + ZetaNotificationBadge.icon(icon: ZetaIcons.check_circle), ZetaNotificationBadge.image( image: Image.network( "https://www.google.com/url?sa=i&url=https%3A%2F%2Fgithub.com%2Fzebratechnologies&psig=AOvVaw0fBPVE5gUkkpFw8mVf6B8G&ust=1717073069230000&source=images&cd=vfe&opi=89978449&ved=0CBIQjRxqFwoTCPCwn-XxsoYDFQAAAAAdAAAAABAE")) diff --git a/example/widgetbook/pages/components/segmented_control_widgetbook.dart b/example/widgetbook/pages/components/segmented_control_widgetbook.dart index 72875836..3abb74c1 100644 --- a/example/widgetbook/pages/components/segmented_control_widgetbook.dart +++ b/example/widgetbook/pages/components/segmented_control_widgetbook.dart @@ -10,7 +10,7 @@ Widget segmentedControlUseCase(BuildContext context) { int selectedIconSegment = iconsSegments.first; final rounded = context.knobs.boolean(label: "Rounded", initialValue: true); - final icon = iconKnob(context, rounded: rounded, initial: ZetaIcons.star_round); + final icon = iconKnob(context, rounded: rounded, initial: ZetaIcons.star); final text = context.knobs.string(label: 'Text', initialValue: "Item"); @@ -29,7 +29,7 @@ Widget segmentedControlUseCase(BuildContext context) { for (final value in iconsSegments) ZetaButtonSegment( value: value, - child: Icon(icon), + child: ZetaIcon(icon), ), ], onChanged: (value) => setState( diff --git a/example/widgetbook/pages/components/select_input_widgetbook.dart b/example/widgetbook/pages/components/select_input_widgetbook.dart index d41f5a8f..53e6a505 100644 --- a/example/widgetbook/pages/components/select_input_widgetbook.dart +++ b/example/widgetbook/pages/components/select_input_widgetbook.dart @@ -9,11 +9,11 @@ Widget selectInputUseCase(BuildContext context) { final items = [ ZetaDropdownItem( value: "Item 1", - icon: Icon(ZetaIcons.star_round), + icon: ZetaIcon(ZetaIcons.star), ), ZetaDropdownItem( value: "Item 2", - icon: Icon(ZetaIcons.star_half_round), + icon: ZetaIcon(ZetaIcons.star_half), ), ZetaDropdownItem( value: "Item 3", diff --git a/example/widgetbook/pages/components/snack_bar_widgetbook.dart b/example/widgetbook/pages/components/snack_bar_widgetbook.dart index 92430c67..6b67dcbb 100644 --- a/example/widgetbook/pages/components/snack_bar_widgetbook.dart +++ b/example/widgetbook/pages/components/snack_bar_widgetbook.dart @@ -28,7 +28,7 @@ Widget snackBarUseCase(BuildContext context) { final leadingIcon = iconKnob( context, name: "Leading Icon", - initial: Icons.mood_rounded, + initial: Icons.mood, nullable: true, ); @@ -43,7 +43,7 @@ Widget snackBarUseCase(BuildContext context) { onPressed: () {}, actionLabel: actionLabel, type: type, - leadingIcon: leadingIcon != null ? Icon(leadingIcon) : null, + leadingIcon: leadingIcon != null ? ZetaIcon(leadingIcon) : null, rounded: rounded, content: Text(text), ); diff --git a/example/widgetbook/pages/components/tabs_widgetbook.dart b/example/widgetbook/pages/components/tabs_widgetbook.dart index a47dd059..50fcd23b 100644 --- a/example/widgetbook/pages/components/tabs_widgetbook.dart +++ b/example/widgetbook/pages/components/tabs_widgetbook.dart @@ -23,8 +23,8 @@ Widget tabsUseCase(BuildContext context) { ? null : (_) {}, tabs: [ - ZetaTab(icon: Icon(ZetaIcons.star_round), text: "Tab Item"), - ZetaTab(icon: Icon(ZetaIcons.star_round), text: "Tab Item"), + ZetaTab(icon: ZetaIcon(ZetaIcons.star), text: "Tab Item"), + ZetaTab(icon: ZetaIcon(ZetaIcons.star), text: "Tab Item"), ], ), ), diff --git a/example/widgetbook/pages/components/text_input_widgetbook.dart b/example/widgetbook/pages/components/text_input_widgetbook.dart index 75be9d50..fd313845 100644 --- a/example/widgetbook/pages/components/text_input_widgetbook.dart +++ b/example/widgetbook/pages/components/text_input_widgetbook.dart @@ -40,7 +40,7 @@ Widget textInputUseCase(BuildContext context) { errorText: errorText, prefixText: '£', suffix: IconButton( - icon: Icon(ZetaIcons.star_round), + icon: ZetaIcon(ZetaIcons.star), onPressed: () {}, ), onChange: (value) {}, diff --git a/example/widgetbook/pages/components/top_app_bar_widgetbook.dart b/example/widgetbook/pages/components/top_app_bar_widgetbook.dart index 9dc76be9..95ce2358 100644 --- a/example/widgetbook/pages/components/top_app_bar_widgetbook.dart +++ b/example/widgetbook/pages/components/top_app_bar_widgetbook.dart @@ -24,7 +24,7 @@ Widget defaultTopAppBarUseCase(BuildContext context) { label: "Enabled actions", initialValue: true, ); - final leadingIcon = iconKnob(context, name: 'Leading Icon', initial: ZetaIcons.hamburger_menu_round); + final leadingIcon = iconKnob(context, name: 'Leading Icon', initial: ZetaIcons.hamburger_menu); return WidgetbookTestWidget( backgroundColor: Colors.green, @@ -34,7 +34,7 @@ Widget defaultTopAppBarUseCase(BuildContext context) { ZetaTopAppBar( leading: IconButton( onPressed: () {}, - icon: Icon(leadingIcon), + icon: ZetaIcon(leadingIcon), ), type: type, title: Text(title), @@ -42,15 +42,15 @@ Widget defaultTopAppBarUseCase(BuildContext context) { ? [ IconButton( onPressed: () {}, - icon: Icon(Icons.language), + icon: ZetaIcon(Icons.language), ), IconButton( onPressed: () {}, - icon: Icon(Icons.favorite), + icon: ZetaIcon(Icons.favorite), ), IconButton( onPressed: () {}, - icon: Icon(ZetaIcons.more_vertical_round), + icon: ZetaIcon(ZetaIcons.more_vertical), ) ] : null, @@ -92,7 +92,7 @@ class _SearchUseCaseState extends State<_SearchUseCase> { }, ); - final leadingIcon = iconKnob(context, name: 'Leading Icon', initial: ZetaIcons.hamburger_menu_round); + final leadingIcon = iconKnob(context, name: 'Leading Icon', initial: ZetaIcons.hamburger_menu); final enabledSpeechRecognition = context.knobs.boolean( label: "Enabled speech recognition", @@ -104,7 +104,7 @@ class _SearchUseCaseState extends State<_SearchUseCase> { return ZetaTopAppBar( leading: IconButton( onPressed: () {}, - icon: Icon(leadingIcon), + icon: ZetaIcon(leadingIcon), ), type: type, title: Text(title), @@ -123,7 +123,7 @@ class _SearchUseCaseState extends State<_SearchUseCase> { onPressed: () { searchController.isEnabled ? searchController.closeSearch() : searchController.startSearch(); }, - icon: Icon(ZetaIcons.search_round)), + icon: ZetaIcon(ZetaIcons.search)), ], ); } @@ -151,7 +151,7 @@ class _ExtendedSearchState extends State { Widget build(BuildContext context) { final title = context.knobs.string(label: "Title", initialValue: "Title"); - final leadingIcon = iconKnob(context, name: 'Leading Icon', initial: ZetaIcons.hamburger_menu_round); + final leadingIcon = iconKnob(context, name: 'Leading Icon', initial: ZetaIcons.hamburger_menu); final showSearch = context.knobs.boolean(label: 'Search variant', initialValue: false); @@ -167,27 +167,27 @@ class _ExtendedSearchState extends State { child: CustomScrollView( slivers: [ ZetaTopAppBar.extended( - leading: IconButton(icon: Icon(leadingIcon), onPressed: () {}), + leading: IconButton(icon: ZetaIcon(leadingIcon), onPressed: () {}), title: Text(title), actions: showSearch ? [ IconButton( onPressed: _showHideSearchExtended, - icon: Icon(ZetaIcons.search_round), + icon: ZetaIcon(ZetaIcons.search), ) ] : [ IconButton( onPressed: () {}, - icon: Icon(Icons.language), + icon: ZetaIcon(Icons.language), ), IconButton( onPressed: () {}, - icon: Icon(Icons.favorite), + icon: ZetaIcon(Icons.favorite), ), IconButton( onPressed: () {}, - icon: Icon(ZetaIcons.more_vertical_round), + icon: ZetaIcon(ZetaIcons.more_vertical), ) ], searchController: showSearch ? _searchControllerExtended : null, diff --git a/lib/src/components/badges/tag.dart b/lib/src/components/badges/tag.dart index b2053803..13345a02 100644 --- a/lib/src/components/badges/tag.dart +++ b/lib/src/components/badges/tag.dart @@ -43,7 +43,7 @@ class ZetaTag extends ZetaStatelessWidget { Widget build(BuildContext context) { return Row( children: [ - if (direction == ZetaTagDirection.right) _buildCustomPaint(context), + if (direction == ZetaTagDirection.left) _buildCustomPaint(context), Container( decoration: BoxDecoration( color: Zeta.of(context).colors.surfaceHover, @@ -64,14 +64,14 @@ class ZetaTag extends ZetaStatelessWidget { ), ), ), - if (direction == ZetaTagDirection.left) _buildCustomPaint(context), + if (direction == ZetaTagDirection.right) _buildCustomPaint(context), ], ); } BorderRadius? _getBorderRadius(BuildContext context) { if (!context.rounded) return null; - if (direction == ZetaTagDirection.right) { + if (direction == ZetaTagDirection.left) { return const BorderRadius.only( topRight: Radius.circular(ZetaSpacingBase.x0_5), bottomRight: Radius.circular(ZetaSpacingBase.x0_5), @@ -121,7 +121,7 @@ class _TagPainter extends CustomPainter { final Paint paint = Paint() ..color = color ..style = PaintingStyle.fill; - final path = _drawPath(size, rounded, direction == ZetaTagDirection.right); + final path = _drawPath(size, rounded, direction == ZetaTagDirection.left); canvas.drawPath(path, paint); } diff --git a/lib/src/components/snack_bar/snack_bar.dart b/lib/src/components/snack_bar/snack_bar.dart index b4f18178..7b186230 100644 --- a/lib/src/components/snack_bar/snack_bar.dart +++ b/lib/src/components/snack_bar/snack_bar.dart @@ -53,7 +53,9 @@ class ZetaSnackBar extends SnackBar { ZetaSnackBarType? type, /// Icon to display at the start of the content. - Icon? leadingIcon, + /// + /// Should be of type [ZetaIcon] or [Icon]. + Widget? leadingIcon, /// {@macro zeta-widget-rounded} bool? rounded, @@ -354,7 +356,7 @@ class _ActionButton extends StatelessWidget { class _LeadingIcon extends StatelessWidget { const _LeadingIcon(this.type, this.icon); - final Icon? icon; + final Widget? icon; final ZetaSnackBarType? type; @override