small ui fixes

This commit is contained in:
Moritz Weber 2023-01-28 20:43:31 +01:00
parent 104b27c379
commit eb56b9d3ef
7 changed files with 84 additions and 74 deletions

View file

@ -26,79 +26,82 @@ class CurrentlyPlayingPage extends StatelessWidget {
return Scaffold(
body: Stack(
children: [
GestureDetector(
onVerticalDragEnd: (dragEndDetails) {
if (dragEndDetails.primaryVelocity! < 0) {
_openQueue(context);
} else if (dragEndDetails.primaryVelocity! > 0) {
Navigator.pop(context);
}
},
child: const AlbumBackground(),
),
const AlbumBackground(),
SafeArea(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12.0),
child: CurrentlyPlayingHeader(
onTap: _openQueue,
onMoreTap: _openMoreMenu,
),
),
const Spacer(
flex: 10,
),
const Expanded(
flex: 720,
child: Center(
child: AlbumArtSwipe(),
),
),
const Spacer(
flex: 50,
),
Observer(
builder: (BuildContext context) {
final Song? song = audioStore.currentSongStream.value;
if (song == null) return Container();
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0 + 12.0),
child: SizedBox(
width: double.infinity,
height: 74.0,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
song.title,
overflow: TextOverflow.fade,
softWrap: false,
maxLines: 1,
style: TEXT_BIG,
),
Text(
'${song.artist}${song.album}',
style: TextStyle(
color: Colors.grey[300],
fontSize: 18.0,
fontWeight: FontWeight.w300,
),
maxLines: 2,
),
],
),
child: GestureDetector(
onVerticalDragEnd: (dragEndDetails) {
if (dragEndDetails.primaryVelocity! < 0) {
_openQueue(context);
} else if (dragEndDetails.primaryVelocity! > 0) {
Navigator.pop(context);
}
},
child: Container(
color: Colors.transparent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12.0),
child: CurrentlyPlayingHeader(
onTap: _openQueue,
onMoreTap: _openMoreMenu,
),
);
},
),
const Spacer(
flex: 10,
),
const Expanded(
flex: 720,
child: Center(
child: AlbumArtSwipe(),
),
),
const Spacer(
flex: 50,
),
Observer(
builder: (BuildContext context) {
final Song? song = audioStore.currentSongStream.value;
if (song == null) return Container();
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0 + 12.0),
child: SizedBox(
width: double.infinity,
height: 74.0,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
song.title,
overflow: TextOverflow.fade,
softWrap: false,
maxLines: 1,
style: TEXT_BIG,
),
Text(
'${song.artist}${song.album}',
style: TextStyle(
color: Colors.grey[300],
fontSize: 18.0,
fontWeight: FontWeight.w300,
),
maxLines: 2,
),
],
),
),
);
},
),
const Spacer(
flex: 10,
),
const CurrentlyPlayingControl(),
],
),
const Spacer(
flex: 10,
),
const CurrentlyPlayingControl(),
],
),
),
),
],

View file

@ -30,6 +30,7 @@ class LoopButton extends StatelessWidget {
onPressed: () {
audioStore.setLoopMode(LoopMode.all);
},
splashRadius: iconSize / 2 + 6.0,
);
case LoopMode.one:
return IconButton(
@ -41,6 +42,7 @@ class LoopButton extends StatelessWidget {
onPressed: () {
audioStore.setLoopMode(LoopMode.off);
},
splashRadius: iconSize / 2 + 6.0,
);
case LoopMode.all:
return IconButton(
@ -52,6 +54,7 @@ class LoopButton extends StatelessWidget {
onPressed: () {
audioStore.setLoopMode(LoopMode.one);
},
splashRadius: iconSize / 2 + 6.0,
);
case null:
return Container();

View file

@ -25,7 +25,7 @@ class NextButton extends StatelessWidget {
icon: const Icon(Icons.skip_next_rounded),
iconSize: iconSize,
onPressed: audioStore.skipToNext,
splashRadius: iconSize + 2,
splashRadius: iconSize / 2 + 6.0,
);
}
return IconButton(

View file

@ -29,7 +29,7 @@ class PlayPauseButton extends StatelessWidget {
onPressed: () {
audioStore.pause();
},
splashRadius: iconSize + 2,
splashRadius: iconSize / 2 + 6.0,
);
} else {
return IconButton(
@ -40,7 +40,7 @@ class PlayPauseButton extends StatelessWidget {
onPressed: () {
audioStore.play();
},
splashRadius: iconSize + 2,
splashRadius: iconSize / 2 + 6.0,
);
}
},

View file

@ -18,6 +18,7 @@ class PreviousButton extends StatelessWidget {
onPressed: () {
audioStore.skipToPrevious();
},
splashRadius: iconSize / 2 + 6.0,
);
}
}

View file

@ -25,7 +25,7 @@ class QueueControlBar extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
children: <Widget>[
const Material(
color: DARK3,
color: DARK1,
child: Padding(
padding: EdgeInsets.symmetric(horizontal: HORIZONTAL_PADDING + 2, vertical: 8.0),
child: PlaybackControl(),

View file

@ -29,6 +29,7 @@ class ShuffleButton extends StatelessWidget {
),
iconSize: iconSize,
onPressed: () => audioStore.setShuffleMode(ShuffleMode.standard),
splashRadius: iconSize / 2 + 6.0,
);
case ShuffleMode.standard:
return IconButton(
@ -38,6 +39,7 @@ class ShuffleButton extends StatelessWidget {
),
iconSize: iconSize,
onPressed: () => audioStore.setShuffleMode(ShuffleMode.plus),
splashRadius: iconSize / 2 + 6.0,
);
case ShuffleMode.plus:
return IconButton(
@ -48,6 +50,7 @@ class ShuffleButton extends StatelessWidget {
),
iconSize: iconSize,
onPressed: () => audioStore.setShuffleMode(ShuffleMode.none),
splashRadius: iconSize / 2 + 6.0,
);
case null:
return Container();