2020-03-20 16:17:02 +01:00
|
|
|
import 'package:flutter/material.dart';
|
2020-04-09 17:50:28 +02:00
|
|
|
import 'package:flutter_mobx/flutter_mobx.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
2020-03-25 17:00:00 +01:00
|
|
|
|
2020-04-09 17:50:28 +02:00
|
|
|
import '../../domain/entities/song.dart';
|
|
|
|
import '../state/audio_store.dart';
|
|
|
|
import '../theming.dart';
|
2020-03-25 17:00:00 +01:00
|
|
|
import '../widgets/album_art.dart';
|
2020-08-12 20:59:00 +02:00
|
|
|
import '../widgets/next_indicator.dart';
|
|
|
|
import '../widgets/playback_control.dart';
|
2020-03-25 17:00:00 +01:00
|
|
|
import '../widgets/time_progress_indicator.dart';
|
2020-03-20 16:17:02 +01:00
|
|
|
|
2020-04-09 17:50:28 +02:00
|
|
|
class CurrentlyPlayingPage extends StatelessWidget {
|
|
|
|
const CurrentlyPlayingPage({Key key}) : super(key: key);
|
2020-03-20 16:17:02 +01:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2020-04-09 17:50:28 +02:00
|
|
|
print('CurrentlyPlayingPage.build');
|
|
|
|
final AudioStore audioStore = Provider.of<AudioStore>(context);
|
|
|
|
|
2020-03-20 16:17:02 +01:00
|
|
|
return Scaffold(
|
|
|
|
body: SafeArea(
|
|
|
|
child: LayoutBuilder(
|
2020-04-09 17:50:28 +02:00
|
|
|
builder: (BuildContext context, BoxConstraints constraints) =>
|
|
|
|
Observer(
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
print('CurrentlyPlayingPage.build -> Observer.build');
|
|
|
|
final Song song = audioStore.song;
|
|
|
|
|
2020-07-12 18:25:34 +02:00
|
|
|
print(audioStore.queueIndexStream.value);
|
|
|
|
|
2020-05-09 19:46:06 +02:00
|
|
|
return Padding(
|
|
|
|
padding: const EdgeInsets.only(
|
|
|
|
left: 12.0,
|
|
|
|
right: 12.0,
|
|
|
|
top: 8.0,
|
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
IconButton(
|
2020-08-12 20:59:00 +02:00
|
|
|
icon: const Icon(Icons.expand_more),
|
2020-05-09 19:46:06 +02:00
|
|
|
onPressed: () {
|
|
|
|
Navigator.pop(context);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
IconButton(
|
2020-08-12 20:59:00 +02:00
|
|
|
icon: const Icon(Icons.more_vert),
|
2020-05-09 19:46:06 +02:00
|
|
|
onPressed: () {},
|
|
|
|
)
|
|
|
|
],
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
),
|
|
|
|
const Spacer(),
|
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
|
|
|
child: AlbumArt(
|
|
|
|
song: song,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const Spacer(
|
|
|
|
flex: 4,
|
2020-03-28 09:39:59 +01:00
|
|
|
),
|
2020-05-09 19:46:06 +02:00
|
|
|
Row(
|
2020-03-28 09:39:59 +01:00
|
|
|
children: [
|
2020-08-12 20:59:00 +02:00
|
|
|
const Icon(
|
2020-05-09 19:46:06 +02:00
|
|
|
Icons.link,
|
|
|
|
size: 20.0,
|
2020-03-28 09:39:59 +01:00
|
|
|
),
|
2020-05-09 19:46:06 +02:00
|
|
|
Container(
|
|
|
|
width: 40,
|
|
|
|
),
|
2020-08-12 20:59:00 +02:00
|
|
|
const Icon(
|
2020-05-09 19:46:06 +02:00
|
|
|
Icons.favorite,
|
|
|
|
size: 20.0,
|
|
|
|
color: RASPBERRY,
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
width: 40,
|
2020-03-28 09:39:59 +01:00
|
|
|
),
|
2020-08-12 20:59:00 +02:00
|
|
|
const Icon(
|
2020-05-09 19:46:06 +02:00
|
|
|
Icons.remove_circle_outline,
|
|
|
|
size: 20.0,
|
2020-03-28 09:39:59 +01:00
|
|
|
),
|
2020-05-09 19:46:06 +02:00
|
|
|
],
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
),
|
|
|
|
const Spacer(
|
|
|
|
flex: 3,
|
|
|
|
),
|
|
|
|
const TimeProgressIndicator(),
|
|
|
|
const Spacer(
|
|
|
|
flex: 3,
|
|
|
|
),
|
2020-07-12 18:25:34 +02:00
|
|
|
const PlaybackControl(),
|
2020-05-09 19:46:06 +02:00
|
|
|
const Spacer(),
|
2020-08-12 20:59:00 +02:00
|
|
|
NextIndicator(
|
|
|
|
onTapAction: openQueue,
|
|
|
|
),
|
2020-05-09 19:46:06 +02:00
|
|
|
],
|
|
|
|
),
|
2020-04-09 17:50:28 +02:00
|
|
|
);
|
|
|
|
},
|
2020-03-28 09:39:59 +01:00
|
|
|
),
|
2020-03-20 16:17:02 +01:00
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
2020-08-12 20:59:00 +02:00
|
|
|
|
|
|
|
void openQueue(BuildContext context) {
|
|
|
|
print('Hello World');
|
|
|
|
}
|
2020-03-20 16:17:02 +01:00
|
|
|
}
|