Skip to content

Commit 50c2bd1

Browse files
committed
style(search): refine headlines search page UI
- Adjust dropdown text style - Update hint text appearance - Change initial state icon - Add list item spacing
1 parent 0e5528a commit 50c2bd1

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

lib/headlines-search/view/headlines_search_page.dart

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,10 @@ class _HeadlinesSearchViewState extends State<_HeadlinesSearchView> {
114114
horizontal: AppSpacing.xs, // Minimal horizontal padding
115115
),
116116
),
117-
// Style the dropdown text to match AppBar title
118-
style: appBarTheme.titleTextStyle ?? theme.textTheme.titleLarge,
117+
// Style the dropdown text to match AppBar title - Adjusted
118+
style: theme.textTheme.titleMedium?.copyWith(
119+
color: appBarTheme.titleTextStyle?.color ?? colorScheme.onSurface,
120+
),
119121
dropdownColor: colorScheme.surfaceContainerHighest, // Match theme
120122
icon: Icon(
121123
Icons.arrow_drop_down,
@@ -141,12 +143,10 @@ class _HeadlinesSearchViewState extends State<_HeadlinesSearchView> {
141143
value: type,
142144
child: Text(
143145
displayLocalizedName,
144-
style: appBarTheme.titleTextStyle?.copyWith(
145-
color: colorScheme.onSurface,
146-
) ??
147-
theme.textTheme.titleLarge?.copyWith(
148-
color: colorScheme.onSurface,
149-
),
146+
// Adjusted style for dropdown items
147+
style: theme.textTheme.titleMedium?.copyWith(
148+
color: colorScheme.onSurface,
149+
),
150150
),
151151
);
152152
}).toList(),
@@ -168,9 +168,12 @@ class _HeadlinesSearchViewState extends State<_HeadlinesSearchView> {
168168
style: appBarTheme.titleTextStyle ?? theme.textTheme.titleLarge,
169169
decoration: InputDecoration(
170170
hintText: _getHintTextForModelType(_selectedModelType, l10n),
171-
hintStyle: (appBarTheme.titleTextStyle ??
172-
theme.textTheme.titleLarge)
173-
?.copyWith(color: colorScheme.onSurface.withAlpha(153)),
171+
// Adjusted hintStyle to use a smaller font
172+
hintStyle: theme.textTheme.bodyMedium?.copyWith(
173+
color: (appBarTheme.titleTextStyle?.color ??
174+
colorScheme.onSurface)
175+
.withAlpha(153),
176+
),
174177
border: InputBorder.none,
175178
filled: true,
176179
fillColor: colorScheme.surface.withAlpha(26),
@@ -207,7 +210,7 @@ class _HeadlinesSearchViewState extends State<_HeadlinesSearchView> {
207210
builder: (context, state) {
208211
return switch (state) {
209212
HeadlinesSearchInitial() => InitialStateWidget(
210-
icon: Icons.search_off_rounded,
213+
icon: Icons.search, // Changed icon
211214
headline: l10n.headlinesSearchInitialHeadline,
212215
subheadline: l10n.headlinesSearchInitialSubheadline,
213216
),
@@ -238,15 +241,18 @@ class _HeadlinesSearchViewState extends State<_HeadlinesSearchView> {
238241
message:
239242
'${l10n.headlinesSearchNoResultsHeadline} for "${lastSearchTerm}" in ${resultsModelType.displayName.toLowerCase()}.\n${l10n.headlinesSearchNoResultsSubheadline}',
240243
)
241-
: ListView.builder(
244+
: ListView.separated(
242245
controller: _scrollController,
246+
padding: const EdgeInsets.all(AppSpacing.paddingMedium), // Add overall padding
243247
itemCount:
244248
hasMore ? results.length + 1 : results.length,
249+
separatorBuilder: (context, index) =>
250+
const SizedBox(height: AppSpacing.md), // Add separator
245251
itemBuilder: (context, index) {
246252
if (index >= results.length) {
247253
return const Padding(
248254
padding:
249-
EdgeInsets.all(AppSpacing.paddingLarge),
255+
EdgeInsets.symmetric(vertical: AppSpacing.lg), // Adjusted padding for loader
250256
child:
251257
Center(child: CircularProgressIndicator()),
252258
);

0 commit comments

Comments
 (0)