cpd_2022_zi/lib/widgets/buttons/mute_button.dart

22 lines
601 B
Dart
Raw Normal View History

2023-03-01 12:34:35 +01:00
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
2023-03-05 18:17:08 +01:00
import '../../providers/audio_provider.dart';
2023-03-01 12:34:35 +01:00
class MuteButton extends StatelessWidget {
const MuteButton({super.key});
@override
Widget build(BuildContext context) {
2023-03-04 12:14:29 +01:00
AudioProvider workoutProvider = context.watch<AudioProvider>();
2023-03-01 12:34:35 +01:00
return IconButton(
onPressed: workoutProvider.isMuted
? workoutProvider.unMutePlayer
: workoutProvider.mutePlayer,
icon: Icon(workoutProvider.isMuted
? Icons.volume_off_outlined
: Icons.volume_up_outlined),
);
}
}