mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00
refactor: use new search for filter text field
This commit is contained in:
parent
9d14517202
commit
51e427e83c
@ -62,13 +62,11 @@ class UserAlbums extends HookConsumerWidget {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
TextField(
|
||||
SearchBar(
|
||||
onChanged: (value) => searchText.value = value,
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: const Icon(SpotubeIcons.filter),
|
||||
leading: const Icon(SpotubeIcons.filter),
|
||||
hintText: context.l10n.filter_albums,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
AnimatedCrossFade(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
|
@ -53,16 +53,14 @@ class UserArtists extends HookConsumerWidget {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: ColoredBox(
|
||||
color: theme.scaffoldBackgroundColor,
|
||||
child: TextField(
|
||||
child: SearchBar(
|
||||
onChanged: (value) => searchText.value = value,
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: const Icon(SpotubeIcons.filter),
|
||||
leading: const Icon(SpotubeIcons.filter),
|
||||
hintText: context.l10n.filter_artist,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
backgroundColor: theme.scaffoldBackgroundColor,
|
||||
body: artistQuery.data?.isEmpty == true
|
||||
? Padding(
|
||||
|
@ -77,12 +77,10 @@ class UserPlaylists extends HookConsumerWidget {
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: TextField(
|
||||
child: SearchBar(
|
||||
onChanged: (value) => searchText.value = value,
|
||||
decoration: InputDecoration(
|
||||
hintText: context.l10n.filter_playlists,
|
||||
prefixIcon: const Icon(SpotubeIcons.filter),
|
||||
),
|
||||
leading: const Icon(SpotubeIcons.filter),
|
||||
),
|
||||
),
|
||||
AnimatedCrossFade(
|
||||
|
@ -49,5 +49,21 @@ ThemeData theme(Color seed, Brightness brightness) {
|
||||
contentTextStyle: TextStyle(color: scheme.surface),
|
||||
),
|
||||
sliderTheme: SliderThemeData(overlayShape: SliderComponentShape.noOverlay),
|
||||
searchBarTheme: SearchBarThemeData(
|
||||
constraints: const BoxConstraints(maxWidth: double.infinity),
|
||||
backgroundColor: MaterialStatePropertyAll(
|
||||
Color.lerp(
|
||||
scheme.surfaceVariant,
|
||||
scheme.surface,
|
||||
brightness == Brightness.light ? .9 : .7,
|
||||
),
|
||||
),
|
||||
elevation: const MaterialStatePropertyAll(0),
|
||||
shape: MaterialStatePropertyAll(
|
||||
RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user