Skip to content

Commit

Permalink
chore(automated): Lint commit and format
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Sep 5, 2024
1 parent aa38dcc commit 42a5536
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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),
),
),
);
29 changes: 9 additions & 20 deletions lib/src/components/list_item/notification_list_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down Expand Up @@ -148,8 +148,7 @@ class ZetaNotificationListItem extends ZetaStatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
MergeSemantics(
child: Row(
Expand All @@ -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,
Expand All @@ -176,8 +173,7 @@ class ZetaNotificationListItem extends ZetaStatelessWidget {
if (notificationTime != null)
Text(
notificationTime!,
style:
ZetaTextStyles.bodySmall.apply(
style: ZetaTextStyles.bodySmall.apply(
color: colors.textDisabled,
),
),
Expand All @@ -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),
Expand All @@ -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: [
Expand All @@ -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!,
),
],
Expand All @@ -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),
),
Expand Down

0 comments on commit 42a5536

Please sign in to comment.