mirror of
https://github.com/immich-app/immich.git
synced 2025-01-09 05:16:47 +01:00
e1feba2198
* refactor video controls * inline * make mute icon const * move placeholder to private widget * adjust text width, move volume button slightly right
23 lines
754 B
Dart
23 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,
|
|
);
|
|
}
|
|
}
|