mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-16 10:46:00 -07:00
chore: Shortcuts improvements (#446)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
d0d6a2ffa6
commit
70e346b8a2
15 changed files with 481 additions and 198 deletions
|
|
@ -70,15 +70,8 @@ class VideoPlayerSettingsProviderNotifier extends StateNotifier<VideoPlayerSetti
|
|||
void toggleOrientation(Set<DeviceOrientation>? orientation) =>
|
||||
state = state.copyWith(allowedOrientations: orientation);
|
||||
|
||||
void setShortcuts(MapEntry<VideoHotKeys, KeyCombination?> newEntry) {
|
||||
final currentShortcuts = Map.fromEntries(state.hotKeys.entries);
|
||||
currentShortcuts.update(
|
||||
newEntry.key,
|
||||
(value) => newEntry.value,
|
||||
ifAbsent: () => newEntry.value,
|
||||
);
|
||||
currentShortcuts.removeWhere((key, value) => value == null);
|
||||
state = state.copyWith(hotKeys: currentShortcuts);
|
||||
void setShortcuts(MapEntry<VideoHotKeys, KeyCombination> newEntry) {
|
||||
state = state.copyWith(hotKeys: state.hotKeys.setOrRemove(newEntry, state.defaultShortCuts));
|
||||
}
|
||||
|
||||
void nextChapter() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue