22 lines
601 B
Dart
22 lines
601 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:provider/provider.dart';
|
|
import '../../providers/audio_provider.dart';
|
|
|
|
class MuteButton extends StatelessWidget {
|
|
const MuteButton({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
AudioProvider workoutProvider = context.watch<AudioProvider>();
|
|
|
|
return IconButton(
|
|
onPressed: workoutProvider.isMuted
|
|
? workoutProvider.unMutePlayer
|
|
: workoutProvider.mutePlayer,
|
|
icon: Icon(workoutProvider.isMuted
|
|
? Icons.volume_off_outlined
|
|
: Icons.volume_up_outlined),
|
|
);
|
|
}
|
|
}
|