[mob][photos] Stop passing sort order to DetailPage since DetailPage uses files in GalleryFilesState which updates when sort order changes in gallery

This commit is contained in:
ashilkn
2024-09-27 17:27:15 +05:30
parent 0dcc840179
commit fa3a9f4f52
2 changed files with 1 additions and 5 deletions

View File

@@ -40,14 +40,12 @@ class DetailPageConfiguration {
final int selectedIndex;
final String tagPrefix;
final DetailPageMode mode;
final bool sortOrderAsc;
DetailPageConfiguration(
this.files,
this.selectedIndex,
this.tagPrefix, {
this.mode = DetailPageMode.full,
this.sortOrderAsc = false,
});
DetailPageConfiguration copyWith({
@@ -55,13 +53,11 @@ class DetailPageConfiguration {
GalleryLoader? asyncLoader,
int? selectedIndex,
String? tagPrefix,
bool? sortOrderAsc,
}) {
return DetailPageConfiguration(
files ?? this.files,
selectedIndex ?? this.selectedIndex,
tagPrefix ?? this.tagPrefix,
sortOrderAsc: sortOrderAsc ?? this.sortOrderAsc,
);
}
}
@@ -91,6 +87,7 @@ class _DetailPageState extends State<DetailPage> {
void initState() {
super.initState();
_files = widget.config.files;
_selectedIndexNotifier.value = widget.config.selectedIndex;
_pageController = PageController(initialPage: _selectedIndexNotifier.value);
_guestViewEventSubscription =

View File

@@ -172,7 +172,6 @@ class GalleryFileWidget extends StatelessWidget {
galleryFiles,
galleryFiles.indexOf(file),
tag,
sortOrderAsc: GalleryContextState.of(context)!.sortOrderAsc,
),
);
routeToPage(context, page, forceCustomPageRoute: true);