Skip to content

Commit 1c864c3

Browse files
committed
refactor(details): Simplify UI elements
- Removed info icon - Adjusted follow button color - Moved description to main content
1 parent 77a9a10 commit 1c864c3

File tree

1 file changed

+17
-39
lines changed

1 file changed

+17
-39
lines changed

lib/entity_details/view/entity_details_page.dart

Lines changed: 17 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,7 @@ class _EntityDetailsViewState extends State<EntityDetailsView> {
156156
state.isFollowing
157157
? Icons.check_circle // Filled when following
158158
: Icons.add_circle_outline,
159-
color: state.isFollowing
160-
? theme.colorScheme.primary
161-
: theme.colorScheme.onSurfaceVariant,
159+
color: theme.colorScheme.primary, // Use primary for both states for accent
162160
),
163161
tooltip: state.isFollowing
164162
? l10n.unfollowButtonLabel
@@ -204,35 +202,7 @@ class _EntityDetailsViewState extends State<EntityDetailsView> {
204202
overflow: TextOverflow.ellipsis,
205203
),
206204
),
207-
if (description != null && description.isNotEmpty)
208-
Tooltip(
209-
message: description,
210-
child: IconButton(
211-
icon: Icon(Icons.info_outline, color: theme.colorScheme.onSurfaceVariant),
212-
onPressed: () {
213-
// On mobile, show dialog for description
214-
if (!kIsWeb) { // kIsWeb can be used to differentiate behavior
215-
showDialog<void>(
216-
context: context,
217-
builder: (BuildContext dialogContext) {
218-
return AlertDialog(
219-
title: Text(appBarTitle),
220-
content: SingleChildScrollView(child: Text(description)),
221-
actions: <Widget>[
222-
TextButton(
223-
child: Text(MaterialLocalizations.of(dialogContext).closeButtonLabel),
224-
onPressed: () {
225-
Navigator.of(dialogContext).pop();
226-
},
227-
),
228-
],
229-
);
230-
},
231-
);
232-
}
233-
},
234-
),
235-
),
205+
// Info icon removed from here
236206
],
237207
);
238208

@@ -243,19 +213,27 @@ class _EntityDetailsViewState extends State<EntityDetailsView> {
243213
title: appBarTitleWidget,
244214
pinned: true,
245215
actions: [followButton],
246-
// Removed expandedHeight and flexibleSpace for a standard AppBar
247216
),
248-
SliverToBoxAdapter( // This adapter is now just for spacing and the section title/divider
217+
SliverToBoxAdapter(
249218
child: Padding(
250-
padding: const EdgeInsets.symmetric(horizontal: AppSpacing.paddingMedium)
251-
.copyWith(top: AppSpacing.lg), // Add top padding
219+
padding: const EdgeInsets.all(AppSpacing.paddingMedium), // Consistent padding
252220
child: Column(
253-
crossAxisAlignment: CrossAxisAlignment.start,
221+
crossAxisAlignment: CrossAxisAlignment.start,
254222
children: [
255-
if (state.headlines.isNotEmpty || state.headlinesStatus == EntityHeadlinesStatus.loadingMore) ...[
223+
if (description != null && description.isNotEmpty) ...[
224+
Text(
225+
description,
226+
style: theme.textTheme.bodyLarge?.copyWith(
227+
color: theme.colorScheme.onSurfaceVariant,
228+
),
229+
),
230+
const SizedBox(height: AppSpacing.lg),
231+
],
232+
if (state.headlines.isNotEmpty ||
233+
state.headlinesStatus == EntityHeadlinesStatus.loadingMore) ...[
256234
Text(l10n.headlinesSectionTitle, style: theme.textTheme.titleLarge),
257235
const Divider(height: AppSpacing.md),
258-
]
236+
]
259237
],
260238
),
261239
),

0 commit comments

Comments
 (0)