Skip to content

Commit d6a12e8

Browse files
committed
refactor(account): improve code formatting and structure
- Adjust indentation and line breaks for better readability - Remove unnecessary BlocBuilder widget - Simplify AlertDialog content creation
1 parent dca6112 commit d6a12e8

File tree

1 file changed

+5
-19
lines changed

1 file changed

+5
-19
lines changed

lib/account/view/in_app_notification_center_page.dart

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,9 @@ class _InAppNotificationCenterPageState
8989
context: context,
9090
builder: (context) => AlertDialog(
9191
title: Text(l10n.deleteConfirmationDialogTitle),
92-
content:
93-
Text(l10n.deleteReadNotificationsDialogContent),
92+
content: Text(
93+
l10n.deleteReadNotificationsDialogContent,
94+
),
9495
actions: [
9596
TextButton(
9697
onPressed: () => Navigator.pop(context, false),
@@ -105,29 +106,14 @@ class _InAppNotificationCenterPageState
105106
);
106107
if (confirmed == true && context.mounted) {
107108
context.read<InAppNotificationCenterBloc>().add(
108-
const InAppNotificationCenterReadItemsDeleted(),
109-
);
109+
const InAppNotificationCenterReadItemsDeleted(),
110+
);
110111
}
111112
}
112113
: null,
113114
);
114115
},
115116
),
116-
BlocBuilder<InAppNotificationCenterBloc, InAppNotificationCenterState>(
117-
builder: (context, state) {
118-
final hasUnread = state.notifications.any((n) => !n.isRead);
119-
return IconButton(
120-
onPressed: hasUnread
121-
? () {
122-
context.read<InAppNotificationCenterBloc>().add(
123-
const InAppNotificationCenterMarkAllAsRead(),
124-
);
125-
}
126-
: null,
127-
icon: const Icon(Icons.done_all),
128-
);
129-
},
130-
),
131117
],
132118
bottom: TabBar(
133119
controller: _tabController,

0 commit comments

Comments
 (0)