@@ -2,6 +2,7 @@ import 'dart:ui';
2
2
3
3
import 'package:assets_audio_player/assets_audio_player.dart' ;
4
4
import 'package:flutter/material.dart' ;
5
+ import 'package:marquee/marquee.dart' ;
5
6
import 'package:music_player/core/constants.dart' ;
6
7
import 'package:music_player/presentation/now_playing/widgets/add_fav_button.dart' ;
7
8
import 'package:music_player/presentation/now_playing/widgets/add_playlist_button.dart' ;
@@ -75,13 +76,25 @@ class NowPlaying extends StatelessWidget {
75
76
76
77
//Songs Name
77
78
SizedBox (
78
- width: 200 ,
79
- child: Text (
80
- audioPlayer.getCurrentAudioTitle,
81
- style: whitetxt22,
82
- overflow: TextOverflow .ellipsis,
83
- ),
84
- ),
79
+ width: 280 ,
80
+ height: 50 ,
81
+ child: Marquee (
82
+ text: audioPlayer.getCurrentAudioTitle,
83
+ style: whitetxt22,
84
+ scrollAxis: Axis .horizontal,
85
+ blankSpace: 50 ,
86
+ velocity: 30 ,
87
+ pauseAfterRound: const Duration (seconds: 1 ),
88
+ showFadingOnlyWhenScrolling: true ,
89
+ fadingEdgeStartFraction: 0.1 ,
90
+ fadingEdgeEndFraction: 0.1 ,
91
+ startPadding: 10 ,
92
+ accelerationDuration: const Duration (seconds: 1 ),
93
+ accelerationCurve: Curves .linear,
94
+ decelerationDuration:
95
+ const Duration (milliseconds: 500 ),
96
+ decelerationCurve: Curves .easeOut,
97
+ )),
85
98
SizedBox (height: screenSize.height * 0.035 ),
86
99
87
100
//Bottom controls Container
@@ -105,12 +118,36 @@ class NowPlaying extends StatelessWidget {
105
118
// Add Favorites Button
106
119
AddFavButtonWidget (),
107
120
121
+ IconButton (
122
+ onPressed: () {
123
+ audioPlayer.toggleShuffle ();
124
+ ScaffoldMessenger .of (context)
125
+ .showSnackBar (SnackBar (
126
+ content: const Text ('Shuffled songs' ),
127
+ backgroundColor: Colors .purple[600 ],
128
+ margin: EdgeInsets .only (
129
+ bottom: screenSize.height * 0.12 ,
130
+ left: screenSize.height * 0.15 ,
131
+ right: screenSize.height * 0.15 ),
132
+ behavior: SnackBarBehavior .floating,
133
+ duration: const Duration (seconds: 1 ),
134
+ shape: RoundedRectangleBorder (
135
+ borderRadius:
136
+ BorderRadius .circular (20 )),
137
+ ));
138
+ },
139
+ icon: const Icon (
140
+ Icons .shuffle_rounded,
141
+ color: white,
142
+ size: 30 ,
143
+ )),
144
+
108
145
// Add Playlist Button
109
146
const AddPlaylistButtonWidget ()
110
147
],
111
148
),
112
149
SizedBox (
113
- height: screenSize.height * 0.045 ,
150
+ height: screenSize.height * 0.04 ,
114
151
),
115
152
116
153
//Slider bar
0 commit comments