mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-17 19:26:35 -07:00
feat: Customizable shortcuts/hotkeys (#439)
This implements the logic for allowing hotkeys with modifiers. Implemented globalhotkeys and videocontrol hotkeys Also implements saving the forward backwards seconds to the user. Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
23385d8e62
commit
fa30e634b4
29 changed files with 1360 additions and 162 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:iconsax_plus/iconsax_plus.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:iconsax_plus/iconsax_plus.dart';
|
||||
|
||||
import 'package:fladder/providers/settings/video_player_settings_provider.dart';
|
||||
import 'package:fladder/util/list_padding.dart';
|
||||
|
|
@ -19,6 +19,8 @@ class VideoVolumeSlider extends ConsumerStatefulWidget {
|
|||
class _VideoVolumeSliderState extends ConsumerState<VideoVolumeSlider> {
|
||||
bool sliderActive = false;
|
||||
|
||||
double? previousVolume;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final volume = ref.watch(videoPlayerSettingsProvider.select((value) => value.volume));
|
||||
|
|
@ -27,7 +29,12 @@ class _VideoVolumeSliderState extends ConsumerState<VideoVolumeSlider> {
|
|||
children: [
|
||||
IconButton(
|
||||
icon: Icon(volumeIcon(volume)),
|
||||
onPressed: () => ref.read(videoPlayerSettingsProvider.notifier).setVolume(0),
|
||||
onPressed: () {
|
||||
if (volume != 0) {
|
||||
previousVolume = volume;
|
||||
}
|
||||
ref.read(videoPlayerSettingsProvider.notifier).setVolume(volume == 0 ? (previousVolume ?? 100) : 0);
|
||||
},
|
||||
),
|
||||
AnimatedSize(
|
||||
duration: const Duration(milliseconds: 250),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue