Skip to content

Commit ffb7b8b

Browse files
committed
refactor(search): use withAlpha instead of withOpacity
- Replaced withOpacity with withAlpha - More performant color manipulation
1 parent d639bb7 commit ffb7b8b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/headlines-search/view/headlines_search_page.dart

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,12 @@ class _HeadlinesSearchViewState extends State<_HeadlinesSearchView> {
119119
appBarTheme.titleTextStyle?.copyWith(
120120
color: (appBarTheme.titleTextStyle?.color ??
121121
colorScheme.onSurface)
122-
.withOpacity(0.6),
122+
.withAlpha(153), // Replaced withOpacity(0.6)
123123
) ??
124124
theme.textTheme.titleLarge?.copyWith(
125-
color: colorScheme.onSurface.withOpacity(0.6),
125+
color: colorScheme.onSurface.withAlpha(
126+
153,
127+
), // Replaced withOpacity(0.6)
126128
),
127129
// Remove the default border
128130
border: InputBorder.none,
@@ -133,7 +135,9 @@ class _HeadlinesSearchViewState extends State<_HeadlinesSearchView> {
133135
// Add a subtle background fill
134136
filled: true,
135137

136-
fillColor: colorScheme.surface.withOpacity(0.1),
138+
fillColor: colorScheme.surface.withAlpha(
139+
26,
140+
), // Replaced withOpacity(0.1)
137141
// Apply consistent padding using AppSpacing
138142
contentPadding: const EdgeInsets.symmetric(
139143
horizontal: AppSpacing.paddingMedium,

0 commit comments

Comments
 (0)