mucke/lib/presentation/widgets/song_customization_buttons.dart

61 lines
1.8 KiB
Dart
Raw Normal View History

2020-09-19 17:08:48 +02:00
import 'package:flutter/material.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:provider/provider.dart';
2020-09-19 20:30:41 +02:00
import '../../domain/entities/song.dart';
2020-09-19 17:08:48 +02:00
import '../state/audio_store.dart';
import '../state/music_data_store.dart';
import '../theming.dart';
class SongCustomizationButtons extends StatelessWidget {
const SongCustomizationButtons({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
final MusicDataStore musicDataStore = Provider.of<MusicDataStore>(context);
final AudioStore audioStore = Provider.of<AudioStore>(context);
return Observer(
2020-09-19 20:30:41 +02:00
builder: (BuildContext context) {
final Song song = audioStore.currentSongStream.value;
return Row(
children: [
IconButton(
2020-09-20 12:33:11 +02:00
icon: Icon(
Icons.link,
size: 20.0,
color: song.next == null ? Colors.white70 : LIGHT1,
2020-09-20 12:33:11 +02:00
),
onPressed: () => musicDataStore.toggleNextSongLink(song),
2020-09-19 17:08:48 +02:00
),
2020-09-19 20:30:41 +02:00
Container(
width: 40,
),
2020-09-20 12:33:11 +02:00
const IconButton(
icon: Icon(
Icons.favorite,
size: 20.0,
color: Colors.white10,
),
onPressed: null,
2020-09-19 20:30:41 +02:00
),
Container(
width: 40,
),
IconButton(
icon: Icon(
Icons.remove_circle_outline,
size: 20.0,
2020-09-20 12:33:11 +02:00
color: song.blocked ? RASPBERRY : Colors.white70,
2020-09-19 20:30:41 +02:00
),
2020-09-20 12:33:11 +02:00
onPressed: () =>
musicDataStore.setSongBlocked(song, !song.blocked),
2020-09-19 20:30:41 +02:00
),
],
mainAxisAlignment: MainAxisAlignment.center,
);
},
2020-09-19 17:08:48 +02:00
);
}
}