From 232adb0b553f03a32cacb291c5e712787bbeca45 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 15 Mar 2024 15:17:16 +0000 Subject: [PATCH] [automated commit] lint format and import sort --- example/lib/home.dart | 18 +-- example/widgetbook/main.dart | 129 +++++------------- .../components/breadcrumbs/breadcrumbs.dart | 14 +- 3 files changed, 45 insertions(+), 116 deletions(-) diff --git a/example/lib/home.dart b/example/lib/home.dart index 79051b0f..02538b11 100644 --- a/example/lib/home.dart +++ b/example/lib/home.dart @@ -38,10 +38,8 @@ final List components = [ Component(ButtonExample.name, (context) => const ButtonExample()), Component(CheckBoxExample.name, (context) => const CheckBoxExample()), Component(ChipExample.name, (context) => const ChipExample()), - Component( - NavigationBarExample.name, (context) => const NavigationBarExample()), - Component( - PasswordInputExample.name, (context) => const PasswordInputExample()), + Component(NavigationBarExample.name, (context) => const NavigationBarExample()), + Component(PasswordInputExample.name, (context) => const PasswordInputExample()), Component(ProgressExample.name, (context) => const ProgressExample()), Component(DialPadExample.name, (context) => const DialPadExample()), ]; @@ -108,27 +106,21 @@ class _HomeState extends State { title: Text('Widgets'), backgroundColor: Zeta.of(context).colors.warm.shade30, children: _components - .map((item) => ListTile( - title: Text(item.name), - onTap: () => context.go('/${item.name}'))) + .map((item) => ListTile(title: Text(item.name), onTap: () => context.go('/${item.name}'))) .toList(), ), ExpansionTile( title: Text('Theme'), backgroundColor: Zeta.of(context).colors.warm.shade30, children: _theme - .map((item) => ListTile( - title: Text(item.name), - onTap: () => context.go('/${item.name}'))) + .map((item) => ListTile(title: Text(item.name), onTap: () => context.go('/${item.name}'))) .toList(), ), ExpansionTile( title: Text('Assets'), backgroundColor: Zeta.of(context).colors.warm.shade30, children: _assets - .map((item) => ListTile( - title: Text(item.name), - onTap: () => context.go('/${item.name}'))) + .map((item) => ListTile(title: Text(item.name), onTap: () => context.go('/${item.name}'))) .toList(), ), ], diff --git a/example/widgetbook/main.dart b/example/widgetbook/main.dart index b08e0c0c..c6d2620d 100644 --- a/example/widgetbook/main.dart +++ b/example/widgetbook/main.dart @@ -40,92 +40,48 @@ class HotReload extends StatelessWidget { WidgetbookComponent( name: 'Badge', useCases: [ + WidgetbookUseCase(name: 'Status Label', builder: (context) => statusLabelUseCase(context)), + WidgetbookUseCase(name: 'Priority Pill', builder: (context) => priorityPillUseCase(context)), + WidgetbookUseCase(name: 'Badge', builder: (context) => badgeUseCase(context)), + WidgetbookUseCase(name: 'Indicators', builder: (context) => indicatorsUseCase(context)), + WidgetbookUseCase(name: 'Tags', builder: (context) => tagsUseCase(context)), WidgetbookUseCase( - name: 'Status Label', - builder: (context) => statusLabelUseCase(context)), - WidgetbookUseCase( - name: 'Priority Pill', - builder: (context) => priorityPillUseCase(context)), - WidgetbookUseCase( - name: 'Badge', builder: (context) => badgeUseCase(context)), - WidgetbookUseCase( - name: 'Indicators', - builder: (context) => indicatorsUseCase(context)), - WidgetbookUseCase( - name: 'Tags', builder: (context) => tagsUseCase(context)), - WidgetbookUseCase( - name: 'Workcloud Indicators', - builder: (context) => workcloudIndicatorsUseCase(context)), + name: 'Workcloud Indicators', builder: (context) => workcloudIndicatorsUseCase(context)), ], ), - WidgetbookUseCase( - name: 'Avatar', builder: (context) => avatarUseCase(context)), - WidgetbookUseCase( - name: 'Checkbox', - builder: (context) => checkboxUseCase(context)), + WidgetbookUseCase(name: 'Avatar', builder: (context) => avatarUseCase(context)), + WidgetbookUseCase(name: 'Checkbox', builder: (context) => checkboxUseCase(context)), WidgetbookComponent( name: 'Buttons', useCases: [ + WidgetbookUseCase(name: 'Button', builder: (context) => buttonUseCase(context)), + WidgetbookUseCase(name: 'Icon Button', builder: (context) => iconButtonUseCase(context)), WidgetbookUseCase( - name: 'Button', - builder: (context) => buttonUseCase(context)), - WidgetbookUseCase( - name: 'Icon Button', - builder: (context) => iconButtonUseCase(context)), - WidgetbookUseCase( - name: 'Floating Action Button', - builder: (context) => floatingActionButtonUseCase(context)), - WidgetbookUseCase( - name: 'Group Button', - builder: (context) => buttonGroupUseCase(context)), + name: 'Floating Action Button', builder: (context) => floatingActionButtonUseCase(context)), + WidgetbookUseCase(name: 'Group Button', builder: (context) => buttonGroupUseCase(context)), ], ), - WidgetbookUseCase( - name: 'BreadCrumbs', - builder: (context) => breadCrumbsUseCase(context)), - WidgetbookUseCase( - name: 'Banners', builder: (context) => bannerUseCase(context)), - WidgetbookUseCase( - name: 'In Page Banners', - builder: (context) => inPageBannerUseCase(context)), - WidgetbookUseCase( - name: 'Accordion', - builder: (context) => accordionUseCase(context)), + WidgetbookUseCase(name: 'BreadCrumbs', builder: (context) => breadCrumbsUseCase(context)), + WidgetbookUseCase(name: 'Banners', builder: (context) => bannerUseCase(context)), + WidgetbookUseCase(name: 'In Page Banners', builder: (context) => inPageBannerUseCase(context)), + WidgetbookUseCase(name: 'Accordion', builder: (context) => accordionUseCase(context)), WidgetbookComponent( name: 'Chips', useCases: [ - WidgetbookUseCase( - name: 'Filter Chip', - builder: (context) => filterChipUseCase(context)), - WidgetbookUseCase( - name: 'Input Chip', - builder: (context) => inputChipUseCase(context)), - WidgetbookUseCase( - name: 'Assist Chip', - builder: (context) => assistChipUseCase(context)), + WidgetbookUseCase(name: 'Filter Chip', builder: (context) => filterChipUseCase(context)), + WidgetbookUseCase(name: 'Input Chip', builder: (context) => inputChipUseCase(context)), + WidgetbookUseCase(name: 'Assist Chip', builder: (context) => assistChipUseCase(context)), ], ), - WidgetbookUseCase( - name: 'Password Input', - builder: (context) => passwordInputUseCase(context)), - WidgetbookUseCase( - name: 'Content', - builder: (context) => bottomSheetContentUseCase(context)), - WidgetbookUseCase( - name: 'Dial Pad', - builder: (context) => dialPadUseCase(context)), - WidgetbookUseCase( - name: 'Navigation Bar', - builder: (context) => navigationBarUseCase(context)), + WidgetbookUseCase(name: 'Password Input', builder: (context) => passwordInputUseCase(context)), + WidgetbookUseCase(name: 'Content', builder: (context) => bottomSheetContentUseCase(context)), + WidgetbookUseCase(name: 'Dial Pad', builder: (context) => dialPadUseCase(context)), + WidgetbookUseCase(name: 'Navigation Bar', builder: (context) => navigationBarUseCase(context)), WidgetbookComponent( name: 'Progress', useCases: [ - WidgetbookUseCase( - name: 'Bar', - builder: (context) => progressBarUseCase(context)), - WidgetbookUseCase( - name: 'Circle', - builder: (context) => progressCircleUseCase(context)) + WidgetbookUseCase(name: 'Bar', builder: (context) => progressBarUseCase(context)), + WidgetbookUseCase(name: 'Circle', builder: (context) => progressCircleUseCase(context)) ], ), ]..sort((a, b) => a.name.compareTo(b.name)), @@ -134,23 +90,17 @@ class HotReload extends StatelessWidget { name: 'Theme', isInitiallyExpanded: false, children: [ - WidgetbookUseCase( - name: 'Typography', - builder: (context) => typographyUseCase(context)), - WidgetbookUseCase( - name: 'Color', builder: (context) => colorUseCase(context)), - WidgetbookUseCase( - name: 'Spacing', builder: (context) => spacingUseCase(context)), - WidgetbookUseCase( - name: 'Radius', builder: (context) => radiusUseCase(context)), + WidgetbookUseCase(name: 'Typography', builder: (context) => typographyUseCase(context)), + WidgetbookUseCase(name: 'Color', builder: (context) => colorUseCase(context)), + WidgetbookUseCase(name: 'Spacing', builder: (context) => spacingUseCase(context)), + WidgetbookUseCase(name: 'Radius', builder: (context) => radiusUseCase(context)), ]..sort((a, b) => a.name.compareTo(b.name)), ), WidgetbookCategory( name: 'Assets', isInitiallyExpanded: false, children: [ - WidgetbookUseCase( - name: 'Icons', builder: (context) => iconsUseCase(context)), + WidgetbookUseCase(name: 'Icons', builder: (context) => iconsUseCase(context)), ]..sort((a, b) => a.name.compareTo(b.name)), ), ], @@ -167,23 +117,16 @@ class HotReload extends StatelessWidget { ), ThemeAddon( themes: [ - WidgetbookTheme( - name: 'Light Mode', data: _Theme(isDark: false, isAAA: false)), - WidgetbookTheme( - name: 'Dark Mode', data: _Theme(isDark: true, isAAA: false)), - WidgetbookTheme( - name: 'Light Mode AAA', - data: _Theme(isDark: false, isAAA: true)), - WidgetbookTheme( - name: 'Dark Mode AAA', data: _Theme(isDark: true, isAAA: true)), + WidgetbookTheme(name: 'Light Mode', data: _Theme(isDark: false, isAAA: false)), + WidgetbookTheme(name: 'Dark Mode', data: _Theme(isDark: true, isAAA: false)), + WidgetbookTheme(name: 'Light Mode AAA', data: _Theme(isDark: false, isAAA: true)), + WidgetbookTheme(name: 'Dark Mode AAA', data: _Theme(isDark: true, isAAA: true)), ], themeBuilder: (context, theme, child) { _Theme _theme = theme; return ZetaProvider( - initialContrast: - _theme.isAAA ? ZetaContrast.aaa : ZetaContrast.aa, - initialThemeMode: - _theme.isDark ? ThemeMode.dark : ThemeMode.light, + initialContrast: _theme.isAAA ? ZetaContrast.aaa : ZetaContrast.aa, + initialThemeMode: _theme.isDark ? ThemeMode.dark : ThemeMode.light, builder: (context, theme, themeMode) { return Builder( builder: (context) { diff --git a/lib/src/components/breadcrumbs/breadcrumbs.dart b/lib/src/components/breadcrumbs/breadcrumbs.dart index cb791273..b1a79d43 100644 --- a/lib/src/components/breadcrumbs/breadcrumbs.dart +++ b/lib/src/components/breadcrumbs/breadcrumbs.dart @@ -106,8 +106,7 @@ class _ZetaBreadCrumbsState extends State { final List truncatedChildren = []; - for (final (index, element) - in children.sublist(1, children.length - 1).indexed) { + for (final (index, element) in children.sublist(1, children.length - 1).indexed) { truncatedChildren.add(createBreadCrumb(element, index + 1)); } returnList @@ -296,8 +295,7 @@ class _BreadCrumbsTruncatedState extends State { }), shape: MaterialStatePropertyAll( RoundedRectangleBorder( - borderRadius: - (widget.rounded ? ZetaRadius.minimal : ZetaRadius.none), + borderRadius: (widget.rounded ? ZetaRadius.minimal : ZetaRadius.none), ), ), side: MaterialStateProperty.resolveWith((states) { @@ -317,13 +315,9 @@ class _BreadCrumbsTruncatedState extends State { elevation: const MaterialStatePropertyAll(0), ), child: Icon( - widget.rounded - ? ZetaIcons.more_horizontal_round - : ZetaIcons.more_horizontal_sharp, + widget.rounded ? ZetaIcons.more_horizontal_round : ZetaIcons.more_horizontal_sharp, size: ZetaSpacing.x4, - ) - .paddingHorizontal(ZetaSpacing.xs) - .paddingVertical(ZetaSpacing.xxs), + ).paddingHorizontal(ZetaSpacing.xs).paddingVertical(ZetaSpacing.xxs), ); }