Skip to content

Commit

Permalink
play/pause icon in list view
Browse files Browse the repository at this point in the history
  • Loading branch information
iamsh4shank committed Oct 21, 2020
1 parent c8f3f90 commit 09d411a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 7 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.amfoss.raag"
minSdkVersion 25

This comment has been minimized.

Copy link
@ashwinkey04

ashwinkey04 Oct 22, 2020

Member

The library we use for playing music needs minSdk to be at 25 to function properly

This comment has been minimized.

Copy link
@iamsh4shank

iamsh4shank Oct 22, 2020

Author Member

Yeah actually I was testing it in mobile of SDK version 25 and forgot to udpate, we will update this in next PR.

minSdkVersion 23
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down
27 changes: 22 additions & 5 deletions lib/provider/SongWidget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ class _SongWidgetState extends State<SongWidget> with TickerProviderStateMixin {
children: <Widget>[
getAlbumArt(song),
Container(
padding: const EdgeInsets.all(8.0),
width: MediaQuery.of(context).size.width * 0.75,
padding: const EdgeInsets.all(6.0),
width: MediaQuery.of(context).size.width * 0.65,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
Expand All @@ -83,9 +83,23 @@ class _SongWidgetState extends State<SongWidget> with TickerProviderStateMixin {
],
),
),
Icon(
Icons.play_arrow,
),

FloatingActionButton(
child: AnimatedIcon(
icon: AnimatedIcons.play_pause,
size: 20.0,
progress: playFABController,
),
elevation: 2,
mini: true,
backgroundColor: Colors.white70,
splashColor: Colors.purple,
onPressed: () {
audioManagerInstance.isPlaying
? playFABController.reverse()
: playFABController.forward();
audioManagerInstance.playOrPause();
}),
],
),
),
Expand Down Expand Up @@ -143,6 +157,9 @@ class _SongWidgetState extends State<SongWidget> with TickerProviderStateMixin {
else
return CircleAvatar(
backgroundImage: FileImage(File(song.albumArtwork)),
radius: 50,
minRadius: 30,
maxRadius: 70,
);
}
}
1 change: 1 addition & 0 deletions lib/view/My_Music_List.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class MyMusicList extends StatelessWidget {
padding: EdgeInsets.all(20),
height: MediaQuery.of(context).size.height*0.8,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Row(
Expand Down
2 changes: 1 addition & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,5 @@ packages:
source: hosted
version: "2.1.0-nullsafety.3"
sdks:
dart: ">=2.10.0-110 <=2.11.0-177.0.dev"
dart: ">=2.10.0-110 <2.11.0"
flutter: ">=1.12.13 <2.0.0"

0 comments on commit 09d411a

Please sign in to comment.