2021-06-02 13:54:31 +00:00
|
|
|
import 'package:extended_image/extended_image.dart';
|
2020-03-24 19:59:36 +00:00
|
|
|
import 'package:flutter/material.dart';
|
2021-07-05 18:28:57 +00:00
|
|
|
import 'package:flutter/services.dart';
|
2021-06-09 13:38:27 +00:00
|
|
|
import 'package:logging/logging.dart';
|
2021-08-09 13:26:06 +00:00
|
|
|
import 'package:photos/core/configuration.dart';
|
2021-07-21 20:53:51 +00:00
|
|
|
import 'package:photos/core/constants.dart';
|
2021-08-09 13:26:06 +00:00
|
|
|
import 'package:photos/core/errors.dart';
|
2023-04-07 05:41:42 +00:00
|
|
|
import "package:photos/generated/l10n.dart";
|
2023-08-25 04:39:30 +00:00
|
|
|
import 'package:photos/models/file/file.dart';
|
2022-07-01 14:39:02 +00:00
|
|
|
import 'package:photos/ui/tools/editor/image_editor_page.dart';
|
2023-08-24 16:27:35 +00:00
|
|
|
import "package:photos/ui/viewer/file/file_app_bar.dart";
|
|
|
|
import "package:photos/ui/viewer/file/file_bottom_bar.dart";
|
2022-07-01 14:18:05 +00:00
|
|
|
import 'package:photos/ui/viewer/file/file_widget.dart';
|
|
|
|
import 'package:photos/ui/viewer/gallery/gallery.dart';
|
2020-10-23 15:20:51 +00:00
|
|
|
import 'package:photos/utils/dialog_util.dart';
|
2020-07-29 07:53:13 +00:00
|
|
|
import 'package:photos/utils/file_util.dart';
|
2021-06-02 13:54:31 +00:00
|
|
|
import 'package:photos/utils/navigation_util.dart';
|
2023-01-05 07:29:47 +00:00
|
|
|
import 'package:photos/utils/toast_util.dart';
|
2020-03-24 19:59:36 +00:00
|
|
|
|
2021-09-15 20:40:08 +00:00
|
|
|
enum DetailPageMode {
|
|
|
|
minimalistic,
|
|
|
|
full,
|
|
|
|
}
|
|
|
|
|
2021-06-09 13:38:27 +00:00
|
|
|
class DetailPageConfiguration {
|
2023-08-24 16:56:24 +00:00
|
|
|
final List<EnteFile> files;
|
2022-12-30 12:10:17 +00:00
|
|
|
final GalleryLoader? asyncLoader;
|
2020-04-18 14:10:31 +00:00
|
|
|
final int selectedIndex;
|
2020-07-13 21:33:43 +00:00
|
|
|
final String tagPrefix;
|
2021-09-15 20:40:08 +00:00
|
|
|
final DetailPageMode mode;
|
2023-06-07 06:31:06 +00:00
|
|
|
final bool sortOrderAsc;
|
2020-03-24 19:59:36 +00:00
|
|
|
|
2021-06-09 13:38:27 +00:00
|
|
|
DetailPageConfiguration(
|
|
|
|
this.files,
|
|
|
|
this.asyncLoader,
|
|
|
|
this.selectedIndex,
|
2021-09-15 20:40:08 +00:00
|
|
|
this.tagPrefix, {
|
|
|
|
this.mode = DetailPageMode.full,
|
2023-06-07 06:31:06 +00:00
|
|
|
this.sortOrderAsc = false,
|
2021-09-15 20:40:08 +00:00
|
|
|
});
|
2021-06-09 13:38:27 +00:00
|
|
|
|
|
|
|
DetailPageConfiguration copyWith({
|
2023-08-24 16:56:24 +00:00
|
|
|
List<EnteFile>? files,
|
2022-12-30 12:10:17 +00:00
|
|
|
GalleryLoader? asyncLoader,
|
|
|
|
int? selectedIndex,
|
|
|
|
String? tagPrefix,
|
2023-06-07 06:31:06 +00:00
|
|
|
bool? sortOrderAsc,
|
2021-06-09 13:38:27 +00:00
|
|
|
}) {
|
|
|
|
return DetailPageConfiguration(
|
|
|
|
files ?? this.files,
|
|
|
|
asyncLoader ?? this.asyncLoader,
|
|
|
|
selectedIndex ?? this.selectedIndex,
|
|
|
|
tagPrefix ?? this.tagPrefix,
|
2023-06-13 13:51:13 +00:00
|
|
|
sortOrderAsc: sortOrderAsc ?? this.sortOrderAsc,
|
2021-06-09 13:38:27 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class DetailPage extends StatefulWidget {
|
|
|
|
final DetailPageConfiguration config;
|
|
|
|
|
2022-07-04 08:43:01 +00:00
|
|
|
const DetailPage(this.config, {key}) : super(key: key);
|
2020-04-17 08:17:37 +00:00
|
|
|
|
|
|
|
@override
|
2022-07-03 09:45:00 +00:00
|
|
|
State<DetailPage> createState() => _DetailPageState();
|
2020-04-17 08:17:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
class _DetailPageState extends State<DetailPage> {
|
2021-05-08 17:49:06 +00:00
|
|
|
static const kLoadLimit = 100;
|
2020-05-06 16:43:03 +00:00
|
|
|
final _logger = Logger("DetailPageState");
|
2020-04-17 08:17:37 +00:00
|
|
|
bool _shouldDisableScroll = false;
|
2023-08-24 16:56:24 +00:00
|
|
|
List<EnteFile>? _files;
|
2023-07-03 11:04:37 +00:00
|
|
|
late PageController _pageController;
|
2023-08-02 05:52:38 +00:00
|
|
|
final _selectedIndexNotifier = ValueNotifier(0);
|
2021-05-08 17:49:06 +00:00
|
|
|
bool _hasLoadedTillStart = false;
|
|
|
|
bool _hasLoadedTillEnd = false;
|
2023-07-03 12:41:44 +00:00
|
|
|
final _enableFullScreenNotifier = ValueNotifier(false);
|
2023-08-02 06:33:17 +00:00
|
|
|
bool _isFirstOpened = true;
|
2020-04-23 20:00:20 +00:00
|
|
|
|
2020-03-24 19:59:36 +00:00
|
|
|
@override
|
2020-04-25 22:57:43 +00:00
|
|
|
void initState() {
|
2023-05-18 18:19:20 +00:00
|
|
|
super.initState();
|
2021-10-03 22:12:10 +00:00
|
|
|
_files = [
|
2023-08-19 11:39:56 +00:00
|
|
|
...widget.config.files,
|
2021-10-03 22:12:10 +00:00
|
|
|
]; // Make a copy since we append preceding and succeeding entries to this
|
2023-08-02 05:52:38 +00:00
|
|
|
_selectedIndexNotifier.value = widget.config.selectedIndex;
|
2021-07-07 01:10:02 +00:00
|
|
|
_preloadEntries();
|
2023-08-02 05:52:38 +00:00
|
|
|
_pageController = PageController(initialPage: _selectedIndexNotifier.value);
|
2020-04-25 22:57:43 +00:00
|
|
|
}
|
2020-04-23 20:00:20 +00:00
|
|
|
|
2021-07-06 22:46:34 +00:00
|
|
|
@override
|
|
|
|
void dispose() {
|
2023-07-03 11:04:37 +00:00
|
|
|
_pageController.dispose();
|
2023-07-31 23:24:14 +00:00
|
|
|
_enableFullScreenNotifier.dispose();
|
2023-08-02 05:52:38 +00:00
|
|
|
_selectedIndexNotifier.dispose();
|
2022-07-12 04:01:26 +00:00
|
|
|
SystemChrome.setEnabledSystemUIMode(
|
|
|
|
SystemUiMode.manual,
|
|
|
|
overlays: SystemUiOverlay.values,
|
|
|
|
);
|
2021-07-06 22:46:34 +00:00
|
|
|
super.dispose();
|
|
|
|
}
|
|
|
|
|
2020-04-25 22:57:43 +00:00
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2022-06-11 08:23:52 +00:00
|
|
|
_logger.info(
|
|
|
|
"Opening " +
|
2023-08-02 05:52:38 +00:00
|
|
|
_files![_selectedIndexNotifier.value].toString() +
|
2022-06-11 08:23:52 +00:00
|
|
|
". " +
|
2023-08-02 05:52:38 +00:00
|
|
|
(_selectedIndexNotifier.value + 1).toString() +
|
2022-06-11 08:23:52 +00:00
|
|
|
" / " +
|
2022-12-30 12:10:17 +00:00
|
|
|
_files!.length.toString() +
|
2022-06-11 08:23:52 +00:00
|
|
|
" files .",
|
|
|
|
);
|
2022-06-07 13:42:47 +00:00
|
|
|
return Scaffold(
|
2023-08-02 05:52:38 +00:00
|
|
|
appBar: PreferredSize(
|
|
|
|
preferredSize: const Size.fromHeight(80),
|
|
|
|
child: ValueListenableBuilder(
|
|
|
|
builder: (BuildContext context, int selectedIndex, _) {
|
2023-08-24 16:27:35 +00:00
|
|
|
return FileAppBar(
|
2023-08-02 05:52:38 +00:00
|
|
|
_files![selectedIndex],
|
|
|
|
_onFileRemoved,
|
|
|
|
Configuration.instance.getUserID(),
|
|
|
|
100,
|
|
|
|
widget.config.mode == DetailPageMode.full,
|
|
|
|
enableFullScreenNotifier: _enableFullScreenNotifier,
|
|
|
|
);
|
|
|
|
},
|
|
|
|
valueListenable: _selectedIndexNotifier,
|
|
|
|
),
|
2022-06-07 13:42:47 +00:00
|
|
|
),
|
|
|
|
extendBodyBehindAppBar: true,
|
2023-05-04 10:16:08 +00:00
|
|
|
resizeToAvoidBottomInset: false,
|
2022-06-07 13:42:47 +00:00
|
|
|
body: Center(
|
|
|
|
child: Stack(
|
|
|
|
children: [
|
2023-07-04 12:16:56 +00:00
|
|
|
_buildPageView(context),
|
2023-08-02 05:52:38 +00:00
|
|
|
ValueListenableBuilder(
|
|
|
|
builder: (BuildContext context, int selectedIndex, _) {
|
2023-08-24 16:27:35 +00:00
|
|
|
return FileBottomBar(
|
2023-08-02 05:52:38 +00:00
|
|
|
_files![_selectedIndexNotifier.value],
|
|
|
|
_onEditFileRequested,
|
|
|
|
widget.config.mode == DetailPageMode.minimalistic,
|
|
|
|
onFileRemoved: _onFileRemoved,
|
|
|
|
userID: Configuration.instance.getUserID(),
|
|
|
|
enableFullScreenNotifier: _enableFullScreenNotifier,
|
|
|
|
);
|
|
|
|
},
|
|
|
|
valueListenable: _selectedIndexNotifier,
|
2022-06-07 13:42:47 +00:00
|
|
|
),
|
|
|
|
],
|
2020-03-24 19:59:36 +00:00
|
|
|
),
|
2022-05-13 06:28:12 +00:00
|
|
|
),
|
2020-03-24 19:59:36 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2023-07-04 12:16:56 +00:00
|
|
|
Widget _buildPageView(BuildContext context) {
|
|
|
|
final bottomPadding = MediaQuery.of(context).padding.bottom;
|
2023-08-02 05:52:38 +00:00
|
|
|
_logger.info("Building with " + _selectedIndexNotifier.value.toString());
|
2020-06-17 15:09:47 +00:00
|
|
|
return PageView.builder(
|
2020-04-25 22:57:43 +00:00
|
|
|
itemBuilder: (context, index) {
|
2022-12-30 12:10:17 +00:00
|
|
|
final file = _files![index];
|
2020-06-19 23:03:26 +00:00
|
|
|
_preloadFiles(index);
|
2021-07-05 17:34:45 +00:00
|
|
|
return GestureDetector(
|
|
|
|
onTap: () {
|
2021-07-06 23:24:19 +00:00
|
|
|
_toggleFullScreen();
|
2021-07-05 17:34:45 +00:00
|
|
|
},
|
2023-07-31 23:39:14 +00:00
|
|
|
child: FileWidget(
|
|
|
|
file,
|
2023-08-02 06:33:17 +00:00
|
|
|
autoPlay: shouldAutoPlay(),
|
2023-07-31 23:39:14 +00:00
|
|
|
tagPrefix: widget.config.tagPrefix,
|
|
|
|
shouldDisableScroll: (value) {
|
|
|
|
if (_shouldDisableScroll != value) {
|
|
|
|
setState(() {
|
|
|
|
_shouldDisableScroll = value;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
//Noticed that when the video is seeked, the video pops and moves the
|
|
|
|
//seek bar along with it and it happens when bottomPadding is 0. So we
|
|
|
|
//don't toggle full screen for cases where this issue happens.
|
|
|
|
playbackCallback: bottomPadding != 0
|
|
|
|
? (isPlaying) {
|
|
|
|
Future.delayed(Duration.zero, () {
|
|
|
|
_toggleFullScreen();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
: null,
|
|
|
|
backgroundDecoration: const BoxDecoration(color: Colors.black),
|
|
|
|
),
|
2021-07-05 17:34:45 +00:00
|
|
|
);
|
2020-04-25 22:57:43 +00:00
|
|
|
},
|
2020-06-17 15:09:47 +00:00
|
|
|
onPageChanged: (index) {
|
2023-08-02 05:52:38 +00:00
|
|
|
_selectedIndexNotifier.value = index;
|
2021-07-07 01:10:02 +00:00
|
|
|
_preloadEntries();
|
2020-04-25 22:57:43 +00:00
|
|
|
},
|
|
|
|
physics: _shouldDisableScroll
|
2022-07-04 06:02:17 +00:00
|
|
|
? const NeverScrollableScrollPhysics()
|
|
|
|
: const PageScrollPhysics(),
|
2020-06-21 13:16:27 +00:00
|
|
|
controller: _pageController,
|
2022-12-30 12:10:17 +00:00
|
|
|
itemCount: _files!.length,
|
2020-04-25 22:57:43 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2023-08-02 06:33:17 +00:00
|
|
|
bool shouldAutoPlay() {
|
|
|
|
if (_isFirstOpened) {
|
|
|
|
_isFirstOpened = false;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2021-07-06 23:24:19 +00:00
|
|
|
void _toggleFullScreen() {
|
2023-07-03 12:41:44 +00:00
|
|
|
_enableFullScreenNotifier.value = !_enableFullScreenNotifier.value;
|
|
|
|
|
2023-07-04 12:16:56 +00:00
|
|
|
Future.delayed(const Duration(milliseconds: 125), () {
|
2022-07-12 04:01:26 +00:00
|
|
|
SystemChrome.setEnabledSystemUIMode(
|
2022-05-13 08:48:13 +00:00
|
|
|
//to hide status bar?
|
2022-07-12 04:01:26 +00:00
|
|
|
SystemUiMode.manual,
|
2023-07-04 06:09:05 +00:00
|
|
|
overlays: _enableFullScreenNotifier.value ? [] : SystemUiOverlay.values,
|
2021-07-06 23:24:19 +00:00
|
|
|
);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2023-06-07 11:52:23 +00:00
|
|
|
Future<void> _preloadEntries() async {
|
2023-06-07 11:34:43 +00:00
|
|
|
final isSortOrderAsc = widget.config.sortOrderAsc;
|
2023-06-07 11:52:23 +00:00
|
|
|
|
|
|
|
if (widget.config.asyncLoader == null) return;
|
|
|
|
|
2023-08-02 05:52:38 +00:00
|
|
|
if (_selectedIndexNotifier.value == 0 && !_hasLoadedTillStart) {
|
2023-06-07 11:52:23 +00:00
|
|
|
await _loadStartEntries(isSortOrderAsc);
|
2021-05-08 17:49:06 +00:00
|
|
|
}
|
2023-06-07 11:52:23 +00:00
|
|
|
|
2023-08-02 05:52:38 +00:00
|
|
|
if (_selectedIndexNotifier.value == _files!.length - 1 &&
|
|
|
|
!_hasLoadedTillEnd) {
|
2023-06-07 11:52:23 +00:00
|
|
|
await _loadEndEntries(isSortOrderAsc);
|
2021-05-08 17:49:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-06-07 11:52:23 +00:00
|
|
|
Future<void> _loadStartEntries(bool isSortOrderAsc) async {
|
|
|
|
final result = isSortOrderAsc
|
|
|
|
? await widget.config.asyncLoader!(
|
|
|
|
galleryLoadStartTime,
|
2023-08-02 05:52:38 +00:00
|
|
|
_files![_selectedIndexNotifier.value].creationTime! - 1,
|
2023-06-07 11:52:23 +00:00
|
|
|
limit: kLoadLimit,
|
|
|
|
)
|
|
|
|
: await widget.config.asyncLoader!(
|
2023-08-02 05:52:38 +00:00
|
|
|
_files![_selectedIndexNotifier.value].creationTime! + 1,
|
2023-06-07 11:52:23 +00:00
|
|
|
DateTime.now().microsecondsSinceEpoch,
|
|
|
|
limit: kLoadLimit,
|
|
|
|
asc: true,
|
|
|
|
);
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
// Returned result could be a subtype of File
|
|
|
|
// ignore: unnecessary_cast
|
2023-08-24 16:56:24 +00:00
|
|
|
final files = result.files.reversed.map((e) => e as EnteFile).toList();
|
2023-06-07 11:52:23 +00:00
|
|
|
if (!result.hasMore) {
|
|
|
|
_hasLoadedTillStart = true;
|
|
|
|
}
|
|
|
|
final length = files.length;
|
|
|
|
files.addAll(_files!);
|
|
|
|
_files = files;
|
2023-07-03 12:41:44 +00:00
|
|
|
_pageController.jumpToPage(length);
|
2023-08-02 05:52:38 +00:00
|
|
|
_selectedIndexNotifier.value = length;
|
2023-06-07 11:52:23 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<void> _loadEndEntries(bool isSortOrderAsc) async {
|
|
|
|
final result = isSortOrderAsc
|
|
|
|
? await widget.config.asyncLoader!(
|
2023-08-02 05:52:38 +00:00
|
|
|
_files![_selectedIndexNotifier.value].creationTime! + 1,
|
2023-06-07 11:52:23 +00:00
|
|
|
DateTime.now().microsecondsSinceEpoch,
|
|
|
|
limit: kLoadLimit,
|
|
|
|
asc: true,
|
|
|
|
)
|
|
|
|
: await widget.config.asyncLoader!(
|
|
|
|
galleryLoadStartTime,
|
2023-08-02 05:52:38 +00:00
|
|
|
_files![_selectedIndexNotifier.value].creationTime! - 1,
|
2023-06-07 11:52:23 +00:00
|
|
|
limit: kLoadLimit,
|
|
|
|
);
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
if (!result.hasMore) {
|
|
|
|
_hasLoadedTillEnd = true;
|
|
|
|
}
|
|
|
|
_files!.addAll(result.files);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2020-06-19 23:03:26 +00:00
|
|
|
void _preloadFiles(int index) {
|
2020-06-17 15:09:47 +00:00
|
|
|
if (index > 0) {
|
2022-12-30 12:10:17 +00:00
|
|
|
preloadFile(_files![index - 1]);
|
2020-06-17 15:09:47 +00:00
|
|
|
}
|
2022-12-30 12:10:17 +00:00
|
|
|
if (index < _files!.length - 1) {
|
|
|
|
preloadFile(_files![index + 1]);
|
2020-06-17 15:09:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-24 16:56:24 +00:00
|
|
|
Future<void> _onFileRemoved(EnteFile file) async {
|
2022-12-30 12:10:17 +00:00
|
|
|
final totalFiles = _files!.length;
|
2020-11-26 11:23:36 +00:00
|
|
|
if (totalFiles == 1) {
|
|
|
|
// Deleted the only file
|
2021-10-29 22:34:02 +00:00
|
|
|
Navigator.of(context).pop(); // Close pageview
|
2020-11-26 11:23:36 +00:00
|
|
|
return;
|
|
|
|
}
|
2023-08-02 05:52:38 +00:00
|
|
|
if (_selectedIndexNotifier.value == totalFiles - 1) {
|
2020-06-21 13:16:27 +00:00
|
|
|
// Deleted the last file
|
2023-08-19 11:39:56 +00:00
|
|
|
await _pageController.previousPage(
|
2022-07-04 06:02:17 +00:00
|
|
|
duration: const Duration(milliseconds: 200),
|
2022-06-11 08:23:52 +00:00
|
|
|
curve: Curves.easeInOut,
|
|
|
|
);
|
2020-11-26 11:23:36 +00:00
|
|
|
setState(() {
|
2022-12-30 12:10:17 +00:00
|
|
|
_files!.remove(file);
|
2020-11-26 11:23:36 +00:00
|
|
|
});
|
2020-06-21 13:16:27 +00:00
|
|
|
} else {
|
2023-08-19 11:39:56 +00:00
|
|
|
await _pageController.nextPage(
|
2022-07-04 06:02:17 +00:00
|
|
|
duration: const Duration(milliseconds: 200),
|
2022-06-11 08:23:52 +00:00
|
|
|
curve: Curves.easeInOut,
|
|
|
|
);
|
2020-06-21 13:16:27 +00:00
|
|
|
setState(() {
|
2023-08-02 05:52:38 +00:00
|
|
|
_selectedIndexNotifier.value--;
|
2022-12-30 12:10:17 +00:00
|
|
|
_files!.remove(file);
|
2020-06-21 13:16:27 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
2021-06-12 21:29:04 +00:00
|
|
|
|
2023-08-24 16:56:24 +00:00
|
|
|
Future<void> _onEditFileRequested(EnteFile file) async {
|
2021-08-09 13:26:06 +00:00
|
|
|
if (file.uploadedFileID != null &&
|
|
|
|
file.ownerID != Configuration.instance.getUserID()) {
|
2022-06-11 08:23:52 +00:00
|
|
|
_logger.severe(
|
|
|
|
"Attempt to edit unowned file",
|
|
|
|
UnauthorizedEditError(),
|
|
|
|
StackTrace.current,
|
|
|
|
);
|
|
|
|
showErrorDialog(
|
|
|
|
context,
|
2023-04-07 05:41:42 +00:00
|
|
|
S.of(context).sorry,
|
|
|
|
S.of(context).weDontSupportEditingPhotosAndAlbumsThatYouDont,
|
2022-06-11 08:23:52 +00:00
|
|
|
);
|
2021-08-09 13:26:06 +00:00
|
|
|
return;
|
|
|
|
}
|
2023-04-07 05:41:42 +00:00
|
|
|
final dialog = createProgressDialog(context, S.of(context).pleaseWait);
|
2021-06-12 21:29:04 +00:00
|
|
|
await dialog.show();
|
2023-01-05 07:29:47 +00:00
|
|
|
try {
|
|
|
|
final ioFile = await getFile(file);
|
|
|
|
if (ioFile == null) {
|
2023-04-07 05:41:42 +00:00
|
|
|
showShortToast(context, S.of(context).failedToFetchOriginalForEdit);
|
2023-01-05 07:29:47 +00:00
|
|
|
await dialog.hide();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
final imageProvider =
|
2023-01-05 08:42:55 +00:00
|
|
|
ExtendedFileImageProvider(ioFile, cacheRawData: true);
|
2023-01-05 07:29:47 +00:00
|
|
|
await precacheImage(imageProvider, context);
|
|
|
|
await dialog.hide();
|
|
|
|
replacePage(
|
|
|
|
context,
|
|
|
|
ImageEditorPage(
|
|
|
|
imageProvider,
|
|
|
|
file,
|
|
|
|
widget.config.copyWith(
|
|
|
|
files: _files,
|
2023-08-02 05:52:38 +00:00
|
|
|
selectedIndex: _selectedIndexNotifier.value,
|
2023-01-05 07:29:47 +00:00
|
|
|
),
|
2021-07-06 23:21:25 +00:00
|
|
|
),
|
2023-01-05 07:29:47 +00:00
|
|
|
);
|
|
|
|
} catch (e) {
|
|
|
|
await dialog.hide();
|
|
|
|
_logger.warning("Failed to initiate edit", e);
|
|
|
|
}
|
2021-07-06 09:57:30 +00:00
|
|
|
}
|
2020-04-23 20:00:20 +00:00
|
|
|
}
|