From 42a553610f516d11a1df6891f4ce909cf53156a6 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 5 Sep 2024 16:55:09 +0000 Subject: [PATCH] chore(automated): Lint commit and format --- .../notification_list_item_widgetbook.dart | 46 ++++++++----------- .../list_item/notification_list_item.dart | 29 ++++-------- 2 files changed, 27 insertions(+), 48 deletions(-) diff --git a/example/widgetbook/pages/components/notification_list_item_widgetbook.dart b/example/widgetbook/pages/components/notification_list_item_widgetbook.dart index 028f42b6..628d57a6 100644 --- a/example/widgetbook/pages/components/notification_list_item_widgetbook.dart +++ b/example/widgetbook/pages/components/notification_list_item_widgetbook.dart @@ -6,30 +6,23 @@ import '../../utils/scaffold.dart'; Widget notificationListItemUseCase(BuildContext context) => WidgetbookScaffold( builder: (context, _) => Padding( - padding: EdgeInsets.symmetric( - horizontal: - context.knobs.list(label: "Size", options: [100, 200, 400])), + padding: EdgeInsets.symmetric(horizontal: context.knobs.list(label: "Size", options: [100, 200, 400])), child: ZetaNotificationListItem( body: Text( "New urgent message " * 300, maxLines: 2, overflow: TextOverflow.ellipsis, ), - attachment: - context.knobs.boolean(label: "Attachment", initialValue: false) - ? Text("Spring-Donation-Drive.pdf") - : null, - title: context.knobs - .string(label: "Title", initialValue: "Urgent Notification"), - notificationTime: context.knobs.stringOrNull( - label: "Notification Time", initialValue: "Just Now"), - notificationRead: context.knobs - .boolean(label: "Notification Read", initialValue: false), + attachment: context.knobs.boolean(label: "Attachment", initialValue: false) + ? Text("Spring-Donation-Drive.pdf") + : null, + title: context.knobs.string(label: "Title", initialValue: "Urgent Notification"), + notificationTime: context.knobs.stringOrNull(label: "Notification Time", initialValue: "Just Now"), + notificationRead: context.knobs.boolean(label: "Notification Read", initialValue: false), leading: context.knobs.list( label: 'Badge', options: [ - ZetaNotificationBadge.avatar( - avatar: ZetaAvatar.initials(initials: "JS")), + ZetaNotificationBadge.avatar(avatar: ZetaAvatar.initials(initials: "JS")), ZetaNotificationBadge.icon(icon: ZetaIcons.check_circle), ZetaNotificationBadge.image( image: Image.network( @@ -41,19 +34,16 @@ Widget notificationListItemUseCase(BuildContext context) => WidgetbookScaffold( ? "Icon" : "Image", ), - action: - context.knobs.boolean(label: "Show action", initialValue: true) - ? ZetaButton.outline( - label: "User Action", - onPressed: () {}, - size: ZetaWidgetSize.small, - borderType: ZetaWidgetBorder.rounded, - ) - : null, - showDivider: - context.knobs.boolean(label: "Show Divider", initialValue: false), - showBellIcon: context.knobs - .boolean(label: "Show Bell Icon", initialValue: true), + action: context.knobs.boolean(label: "Show action", initialValue: true) + ? ZetaButton.outline( + label: "User Action", + onPressed: () {}, + size: ZetaWidgetSize.small, + borderType: ZetaWidgetBorder.rounded, + ) + : null, + showDivider: context.knobs.boolean(label: "Show Divider", initialValue: false), + showBellIcon: context.knobs.boolean(label: "Show Bell Icon", initialValue: true), ), ), ); diff --git a/lib/src/components/list_item/notification_list_item.dart b/lib/src/components/list_item/notification_list_item.dart index a82b3948..1ea51c95 100644 --- a/lib/src/components/list_item/notification_list_item.dart +++ b/lib/src/components/list_item/notification_list_item.dart @@ -77,7 +77,7 @@ class ZetaNotificationListItem extends ZetaStatelessWidget { final extend = actionWith / maxScreenWidth; if (extend.clamp(0, maxButtonWidth).toDouble() > 1) { return 1; - } + } return extend.clamp(0, maxButtonWidth).toDouble(); } @@ -148,8 +148,7 @@ class ZetaNotificationListItem extends ZetaStatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ MergeSemantics( child: Row( @@ -160,9 +159,7 @@ class ZetaNotificationListItem extends ZetaStatelessWidget { size: ZetaWidgetSize.small, ), SizedBox( - width: Zeta.of(context) - .spacing - .minimum, + width: Zeta.of(context).spacing.minimum, ), Text( title, @@ -176,8 +173,7 @@ class ZetaNotificationListItem extends ZetaStatelessWidget { if (notificationTime != null) Text( notificationTime!, - style: - ZetaTextStyles.bodySmall.apply( + style: ZetaTextStyles.bodySmall.apply( color: colors.textDisabled, ), ), @@ -186,15 +182,12 @@ class ZetaNotificationListItem extends ZetaStatelessWidget { padding: const EdgeInsets.all(2), decoration: BoxDecoration( color: colors.surfaceNegative, - borderRadius: - Zeta.of(context).radius.full, + borderRadius: Zeta.of(context).radius.full, ), child: ZetaIcon( ZetaIcons.important_notification, color: colors.white, - size: Zeta.of(context) - .spacing - .large, + size: Zeta.of(context).spacing.large, ), ), ].gap(Zeta.of(context).spacing.minimum), @@ -205,8 +198,7 @@ class ZetaNotificationListItem extends ZetaStatelessWidget { if (attachment != null) Container( padding: EdgeInsets.symmetric( - vertical: - Zeta.of(context).spacing.minimum, + vertical: Zeta.of(context).spacing.minimum, ), child: Row( children: [ @@ -216,8 +208,7 @@ class ZetaNotificationListItem extends ZetaStatelessWidget { color: colors.primary, ), DefaultTextStyle( - style: ZetaTextStyles.bodyXSmall - .apply(color: colors.primary), + style: ZetaTextStyles.bodyXSmall.apply(color: colors.primary), child: attachment!, ), ], @@ -228,9 +219,7 @@ class ZetaNotificationListItem extends ZetaStatelessWidget { ), ].gap(Zeta.of(context).spacing.small), ), - if (action != null) - Container( - alignment: Alignment.bottomRight, child: action), + if (action != null) Container(alignment: Alignment.bottomRight, child: action), ], ).paddingAll(Zeta.of(context).spacing.small), ),