mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-08 15:08:18 -07:00
feature: Auto next-up preview, skip to next in queue. (#96)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
f72ae9e3ca
commit
66f2b6cd4e
13 changed files with 971 additions and 137 deletions
|
|
@ -13,7 +13,7 @@ final videoPlayerSettingsProvider =
|
|||
});
|
||||
|
||||
class VideoPlayerSettingsProviderNotifier extends StateNotifier<VideoPlayerSettingsModel> {
|
||||
VideoPlayerSettingsProviderNotifier(this.ref) : super(const VideoPlayerSettingsModel());
|
||||
VideoPlayerSettingsProviderNotifier(this.ref) : super(VideoPlayerSettingsModel());
|
||||
|
||||
final Ref ref;
|
||||
|
||||
|
|
@ -29,7 +29,7 @@ class VideoPlayerSettingsProviderNotifier extends StateNotifier<VideoPlayerSetti
|
|||
|
||||
void setScreenBrightness(double? value) async {
|
||||
state = state.copyWith(
|
||||
screenBrightness: () => value,
|
||||
screenBrightness: value,
|
||||
);
|
||||
if (state.screenBrightness != null) {
|
||||
ScreenBrightness().setScreenBrightness(state.screenBrightness!);
|
||||
|
|
@ -45,13 +45,13 @@ class VideoPlayerSettingsProviderNotifier extends StateNotifier<VideoPlayerSetti
|
|||
}
|
||||
|
||||
void setFillScreen(bool? value, {BuildContext? context}) {
|
||||
state = state.copyWith(fillScreen: value);
|
||||
state = state.copyWith(fillScreen: value ?? false);
|
||||
}
|
||||
|
||||
void setHardwareAccel(bool? value) => state = state.copyWith(hardwareAccel: value);
|
||||
void setUseLibass(bool? value) => state = state.copyWith(useLibass: value);
|
||||
void setHardwareAccel(bool? value) => state = state.copyWith(hardwareAccel: value ?? true);
|
||||
void setUseLibass(bool? value) => state = state.copyWith(useLibass: value ?? false);
|
||||
|
||||
void setFitType(BoxFit? value) => state = state.copyWith(videoFit: value);
|
||||
void setFitType(BoxFit? value) => state = state.copyWith(videoFit: value ?? BoxFit.contain);
|
||||
|
||||
void setVolume(double value) {
|
||||
state = state.copyWith(internalVolume: value);
|
||||
|
|
|
|||
|
|
@ -170,15 +170,15 @@ class SharedUtility {
|
|||
|
||||
VideoPlayerSettingsModel get videoPlayerSettings {
|
||||
try {
|
||||
return VideoPlayerSettingsModel.fromJson(sharedPreferences.getString(_videoPlayerSettingsKey) ?? "");
|
||||
return VideoPlayerSettingsModel.fromJson(jsonDecode(sharedPreferences.getString(_videoPlayerSettingsKey) ?? ""));
|
||||
} catch (e) {
|
||||
log(e.toString());
|
||||
return const VideoPlayerSettingsModel();
|
||||
return VideoPlayerSettingsModel();
|
||||
}
|
||||
}
|
||||
|
||||
set videoPlayerSettings(VideoPlayerSettingsModel settings) {
|
||||
sharedPreferences.setString(_videoPlayerSettingsKey, settings.toJson());
|
||||
sharedPreferences.setString(_videoPlayerSettingsKey, jsonEncode(settings.toJson()));
|
||||
}
|
||||
|
||||
PhotoViewSettingsModel get photoViewSettings {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue