diff --git a/Sources/justMUSIC/lib/components/editable_post_component.dart b/Sources/justMUSIC/lib/components/editable_post_component.dart index fa60606..82e0d30 100644 --- a/Sources/justMUSIC/lib/components/editable_post_component.dart +++ b/Sources/justMUSIC/lib/components/editable_post_component.dart @@ -1,8 +1,6 @@ import 'dart:io'; - import 'package:animated_appear/animated_appear.dart'; import 'package:auto_size_text/auto_size_text.dart'; -import 'package:circular_reveal_animation/circular_reveal_animation.dart'; import 'package:flutter/Material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/services.dart'; @@ -143,8 +141,14 @@ class _EditablePostComponentState extends State with Tick // implement image child: widget.music == null ? Container( - color: grayColor, width: double.infinity, + child: Center( + child: Icon( + Icons.headphones, + color: grayColor.withOpacity(0.4), + size: 150, + ), + ), ) : Image( image: NetworkImage(widget.music?.cover ?? ""), diff --git a/Sources/justMUSIC/lib/screens/search_song_screen.dart b/Sources/justMUSIC/lib/screens/search_song_screen.dart index 9e20070..8b702de 100644 --- a/Sources/justMUSIC/lib/screens/search_song_screen.dart +++ b/Sources/justMUSIC/lib/screens/search_song_screen.dart @@ -21,6 +21,7 @@ class SearchSongScreen extends StatefulWidget { class _SearchSongScreenState extends State { final ScrollController _scrollController = ScrollController(); final TextEditingController _textEditingController = TextEditingController(); + int? playingIndex; Future resetFullScreen() async { @@ -32,9 +33,18 @@ class _SearchSongScreenState extends State { @override void initState() { super.initState(); + fetchTrendingMusic(); _scrollController.addListener(_scrollListener); } + Future fetchTrendingMusic() async { + await MyApp.musicViewModel.getMusicsWithPlaylistId('37i9dQZF1DX1X23oiQRTB5').then((value) { + setState(() { + filteredData = value; + }); + }); + } + Future _scrollListener() async { if (_scrollController.position.pixels == _scrollController.position.maxScrollExtent) { filteredData.addAll(await MyApp.musicViewModel @@ -120,8 +130,7 @@ class _SearchSongScreenState extends State { onEditingComplete: resetFullScreen, onSubmitted: (value) async { if (_textEditingController.text.isEmpty) { - } else if (value == " ") { - print("popular"); + fetchTrendingMusic(); } else { filteredData = await MyApp.musicViewModel.getMusicsWithNameOrArtistName(value); setState(() {