mucke/lib/presentation/widgets/shuffle_all_button.dart

35 lines
995 B
Dart
Raw Normal View History

2020-08-25 16:23:52 +02:00
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../state/audio_store.dart';
class ShuffleAllButton extends StatelessWidget {
2020-08-28 11:28:58 +02:00
const ShuffleAllButton({Key key, this.verticalPad, this.horizontalPad}) : super(key: key);
final double verticalPad;
final double horizontalPad;
2020-08-25 16:23:52 +02:00
@override
Widget build(BuildContext context) {
final AudioStore audioStore = Provider.of<AudioStore>(context);
2020-08-28 11:28:58 +02:00
return Container(
constraints: BoxConstraints.expand(height: 40.0 + verticalPad * 2),
child: Padding(
padding: EdgeInsets.symmetric(
vertical: verticalPad,
horizontal: horizontalPad,
),
child: ElevatedButton.icon(
2020-08-28 11:28:58 +02:00
icon: const Icon(Icons.shuffle),
label: const Text('SHUFFLE ALL'),
onPressed: () => audioStore.shuffleAll(),
style: ElevatedButton.styleFrom(
primary: Theme.of(context).accentColor,
2020-08-28 11:28:58 +02:00
),
),
),
2020-08-25 16:23:52 +02:00
);
}
}