mirror of
https://github.com/immich-app/immich.git
synced 2025-01-24 12:42:44 +01:00
24 lines
754 B
Dart
24 lines
754 B
Dart
|
import 'package:flutter/material.dart';
|
||
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||
|
import 'package:immich_mobile/providers/asset_viewer/video_player_controls_provider.dart';
|
||
|
|
||
|
class VideoMuteButton extends ConsumerWidget {
|
||
|
const VideoMuteButton({super.key});
|
||
|
|
||
|
@override
|
||
|
Widget build(BuildContext context, WidgetRef ref) {
|
||
|
return IconButton(
|
||
|
icon: ref.watch(
|
||
|
videoPlayerControlsProvider.select((value) => value.mute),
|
||
|
)
|
||
|
? const Icon(Icons.volume_off)
|
||
|
: const Icon(Icons.volume_up),
|
||
|
onPressed: () =>
|
||
|
ref.read(videoPlayerControlsProvider.notifier).toggleMute(),
|
||
|
color: Colors.white,
|
||
|
padding: const EdgeInsets.all(0),
|
||
|
alignment: Alignment.centerRight,
|
||
|
);
|
||
|
}
|
||
|
}
|