diff --git a/.idea/libraries/Dart_Packages.xml b/.idea/libraries/Dart_Packages.xml
index 70bceed..7f7c6f9 100644
--- a/.idea/libraries/Dart_Packages.xml
+++ b/.idea/libraries/Dart_Packages.xml
@@ -114,27 +114,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -373,20 +352,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -541,48 +506,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -744,13 +667,6 @@
-
-
-
-
-
-
-
@@ -842,20 +758,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -884,20 +786,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1057,9 +945,6 @@
-
-
-
@@ -1093,8 +978,6 @@
-
-
@@ -1115,12 +998,6 @@
-
-
-
-
-
-
@@ -1144,7 +1021,6 @@
-
@@ -1158,13 +1034,9 @@
-
-
-
-
diff --git a/Sources/justMUSIC/lib/screens/search_song_screen.dart b/Sources/justMUSIC/lib/screens/search_song_screen.dart
index 05353df..017e5c2 100644
--- a/Sources/justMUSIC/lib/screens/search_song_screen.dart
+++ b/Sources/justMUSIC/lib/screens/search_song_screen.dart
@@ -23,6 +23,7 @@ class _SearchSongScreenState extends State {
final ScrollController _scrollController = ScrollController();
final TextEditingController _textEditingController = TextEditingController();
PageController controller = PageController();
+ bool isCollectionSelected = false;
int? playingIndex;
@@ -83,6 +84,20 @@ class _SearchSongScreenState extends State {
}
}
+ _changePage(int index) {
+ /*if (isCollectionSelected) {
+ setState(() {
+ isCollectionSelected = !isCollectionSelected;
+ controller.animateTo(1, duration: Duration(milliseconds: 200), curve: Curves.easeOut);
+ });
+ } else {
+ setState(() {
+ isCollectionSelected = !isCollectionSelected;
+ controller.animateTo(0, duration: Duration(milliseconds: 200), curve: Curves.easeOut);
+ });
+ }*/
+ }
+
Future> _fetchSavedSong() async {
return await MyApp.musicViewModel.getFavoriteMusicsByUserId(MyApp.userViewModel.userCurrent.id);
}
@@ -171,10 +186,45 @@ class _SearchSongScreenState extends State {
),
),
),
+ Padding(
+ padding: const EdgeInsets.only(top: 10, bottom: 20),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.spaceEvenly,
+ children: [
+ GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: _changePage(0),
+ child: Text(
+ "Recherche",
+ style: GoogleFonts.plusJakartaSans(
+ color: isCollectionSelected ? Color(0xFF9A9A9A) : Colors.white,
+ fontWeight: isCollectionSelected ? FontWeight.w500 : FontWeight.w700),
+ ),
+ ),
+ GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: _changePage(1),
+ child: Text("Collection",
+ style: GoogleFonts.plusJakartaSans(
+ color: isCollectionSelected ? Colors.white : Color(0xFF9A9A9A),
+ fontWeight: isCollectionSelected ? FontWeight.w700 : FontWeight.w500)),
+ ),
+ ],
+ ),
+ ),
Flexible(
child: PageView(
controller: controller,
physics: BouncingScrollPhysics(),
+ onPageChanged: (index) {
+ setState(() {
+ if (index == 1) {
+ isCollectionSelected = true;
+ } else {
+ isCollectionSelected = false;
+ }
+ });
+ },
children: [
ScrollConfiguration(
behavior: ScrollBehavior().copyWith(scrollbars: true),