chore: Follow up imageviewer
This commit is contained in:
parent
b2131e65e5
commit
1ef0289b6a
2 changed files with 21 additions and 9 deletions
|
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
|||
|
||||
import 'package:matrix/matrix.dart';
|
||||
|
||||
import 'package:fluffychat/config/themes.dart';
|
||||
import 'package:fluffychat/pages/image_viewer/image_viewer_view.dart';
|
||||
import 'package:fluffychat/utils/platform_infos.dart';
|
||||
import 'package:fluffychat/utils/show_scaffold_dialog.dart';
|
||||
|
|
@ -44,6 +45,24 @@ class ImageViewerController extends State<ImageViewer> {
|
|||
|
||||
late final List<Event> allEvents;
|
||||
|
||||
void prevImage() {
|
||||
setState(() {
|
||||
pageController.previousPage(
|
||||
duration: FluffyThemes.animationDuration,
|
||||
curve: FluffyThemes.animationCurve,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
void nextImage() {
|
||||
setState(() {
|
||||
pageController.nextPage(
|
||||
duration: FluffyThemes.animationDuration,
|
||||
curve: FluffyThemes.animationCurve,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
int get _index => pageController.page?.toInt() ?? 0;
|
||||
|
||||
Event get currentEvent => allEvents[_index];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue