mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-07 21:48:14 -08: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
|
|
@ -55,8 +55,8 @@ class _PhotoViewerControllsState extends ConsumerState<PhotoViewerControls> with
|
|||
double dragUpDelta = 0.0;
|
||||
|
||||
final controller = TextEditingController();
|
||||
late final timerController =
|
||||
RestarableTimerController(ref.read(photoViewSettingsProvider).timer, const Duration(milliseconds: 32), () {
|
||||
late final timerController = RestarableTimerController(
|
||||
ref.read(photoViewSettingsProvider).timer, const Duration(milliseconds: 32), onTimeout: () {
|
||||
if (widget.pageController.page == widget.itemCount - 1) {
|
||||
widget.pageController.animateToPage(0, duration: const Duration(milliseconds: 250), curve: Curves.easeInOut);
|
||||
} else {
|
||||
|
|
@ -314,6 +314,13 @@ class _PhotoViewerControllsState extends ConsumerState<PhotoViewerControls> with
|
|||
),
|
||||
ProgressFloatingButton(
|
||||
controller: timerController,
|
||||
onLongPress: (duration) {
|
||||
if (duration != null) {
|
||||
ref
|
||||
.read(photoViewSettingsProvider.notifier)
|
||||
.update((state) => state.copyWith(timer: duration));
|
||||
}
|
||||
},
|
||||
),
|
||||
].addPadding(const EdgeInsets.symmetric(horizontal: 8)),
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue