refactor(mobile): video controls (#14086)
* refactor video controls * inline * make mute icon const * move placeholder to private widget * adjust text width, move volume button slightly right
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
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,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user