mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 16:05: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(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
TextField(
|
SearchBar(
|
||||||
onChanged: (value) => searchText.value = value,
|
onChanged: (value) => searchText.value = value,
|
||||||
decoration: InputDecoration(
|
leading: const Icon(SpotubeIcons.filter),
|
||||||
prefixIcon: const Icon(SpotubeIcons.filter),
|
|
||||||
hintText: context.l10n.filter_albums,
|
hintText: context.l10n.filter_albums,
|
||||||
),
|
),
|
||||||
),
|
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
AnimatedCrossFade(
|
AnimatedCrossFade(
|
||||||
duration: const Duration(milliseconds: 300),
|
duration: const Duration(milliseconds: 300),
|
||||||
|
@ -53,16 +53,14 @@ class UserArtists extends HookConsumerWidget {
|
|||||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||||
child: ColoredBox(
|
child: ColoredBox(
|
||||||
color: theme.scaffoldBackgroundColor,
|
color: theme.scaffoldBackgroundColor,
|
||||||
child: TextField(
|
child: SearchBar(
|
||||||
onChanged: (value) => searchText.value = value,
|
onChanged: (value) => searchText.value = value,
|
||||||
decoration: InputDecoration(
|
leading: const Icon(SpotubeIcons.filter),
|
||||||
prefixIcon: const Icon(SpotubeIcons.filter),
|
|
||||||
hintText: context.l10n.filter_artist,
|
hintText: context.l10n.filter_artist,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
backgroundColor: theme.scaffoldBackgroundColor,
|
backgroundColor: theme.scaffoldBackgroundColor,
|
||||||
body: artistQuery.data?.isEmpty == true
|
body: artistQuery.data?.isEmpty == true
|
||||||
? Padding(
|
? Padding(
|
||||||
|
@ -77,12 +77,10 @@ class UserPlaylists extends HookConsumerWidget {
|
|||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(10),
|
padding: const EdgeInsets.all(10),
|
||||||
child: TextField(
|
child: SearchBar(
|
||||||
onChanged: (value) => searchText.value = value,
|
onChanged: (value) => searchText.value = value,
|
||||||
decoration: InputDecoration(
|
|
||||||
hintText: context.l10n.filter_playlists,
|
hintText: context.l10n.filter_playlists,
|
||||||
prefixIcon: const Icon(SpotubeIcons.filter),
|
leading: const Icon(SpotubeIcons.filter),
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
AnimatedCrossFade(
|
AnimatedCrossFade(
|
||||||
|
@ -49,5 +49,21 @@ ThemeData theme(Color seed, Brightness brightness) {
|
|||||||
contentTextStyle: TextStyle(color: scheme.surface),
|
contentTextStyle: TextStyle(color: scheme.surface),
|
||||||
),
|
),
|
||||||
sliderTheme: SliderThemeData(overlayShape: SliderComponentShape.noOverlay),
|
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