Skip to content

Commit

Permalink
replaced search icon with icon button. and also added circular progre…
Browse files Browse the repository at this point in the history
…ss indicator for user feedback
  • Loading branch information
kapiljhajhria committed Aug 15, 2020
1 parent 8cc8206 commit 04f9328
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@ class AppState extends State<AppName> {
search() async {
String searchQuery = searchBar.text;
if (searchQuery.isEmpty) return;
// fetchingSongs = true;
fetchingSongs = true;
setState(() {});
await fetchSongsList(searchQuery);
fetchingSongs = false;
setState(() {});
}

Expand Down Expand Up @@ -369,10 +370,21 @@ class AppState extends State<AppName> {
borderSide: BorderSide(color: accent),
),
suffixIcon: IconButton(
icon: Icon(
Icons.search,
color: accent,
),
icon: fetchingSongs
? SizedBox(
height: 18,
width: 18,
child: Center(
child: CircularProgressIndicator(
valueColor:
new AlwaysStoppedAnimation<Color>(
accent)),
),
)
: Icon(
Icons.search,
color: accent,
),
color: accent,
onPressed: () {
search();
Expand Down

0 comments on commit 04f9328

Please sign in to comment.