π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Use records for making data compatible for message passing between isolates
ashilknb209779f590d
diff --git a/mobile/apps/photos/lib/models/gallery/gallery_sections.dart b/mobile/apps/photos/lib/models/gallery/gallery_sections.dartindex 3146ebb602..852a50f90c 100644--- a/mobile/apps/photos/lib/models/gallery/gallery_sections.dart+++ b/mobile/apps/photos/lib/models/gallery/gallery_sections.dart@@ -11,7 +11,6 @@ import "package:photos/service_locator.dart";import "package:photos/ui/viewer/gallery/component/gallery_file_widget.dart";import "package:photos/ui/viewer/gallery/component/group/group_header_widget.dart";import "package:photos/ui/viewer/gallery/component/group/type.dart";-import "package:photos/ui/viewer/gallery/scrollbar/custom_scroll_bar.dart";import "package:uuid/uuid.dart";/// In order to make the gallery performant when GroupTypes do not show group@@ -64,7 +63,7 @@ class GalleryGroups {final Map<double, String> _scrollOffsetToGroupIdMap = {};final Map<String, double> _groupIdToScrollOffsetMap = {};final List<double> _groupScrollOffsets = [];- final List<ScrollbarDivision> _scrollbarDivisions = [];+ final List<({String groupID, String title})> _scrollbarDivisions = [];final currentUserID = Configuration.instance.getUserID();final _uuid = const Uuid();@@ -76,7 +75,8 @@ class GalleryGroups {Map<String, double> get groupIdToScrollOffsetMap => _groupIdToScrollOffsetMap;List<FixedExtentSectionLayout> get groupLayouts => _groupLayouts;List<double> get groupScrollOffsets => _groupScrollOffsets;- List<ScrollbarDivision> get scrollbarDivisions => _scrollbarDivisions;+ List<({String groupID, String title})> get scrollbarDivisions =>+ _scrollbarDivisions;void init() {crossAxisCount = localSettings.getPhotoGridSize();@@ -282,10 +282,7 @@ class GalleryGroups {if (!yearsInGroups.contains(yearOfGroup)) {yearsInGroups.add(yearOfGroup);_scrollbarDivisions.add(- ScrollbarDivision(- groupID: uuid,- title: yearOfGroup.toString(),- ),+ (groupID: uuid, title: yearOfGroup.toString()),);}}diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/scrollbar/custom_scroll_bar.dart b/mobile/apps/photos/lib/ui/viewer/gallery/scrollbar/custom_scroll_bar.dartindex fee59b1e25..99ca79b11f 100644--- a/mobile/apps/photos/lib/ui/viewer/gallery/scrollbar/custom_scroll_bar.dart+++ b/mobile/apps/photos/lib/ui/viewer/gallery/scrollbar/custom_scroll_bar.dart@@ -8,16 +8,6 @@ import "package:photos/ui/viewer/gallery/scrollbar/scroll_bar_with_use_notifier.import "package:photos/utils/misc_util.dart";import "package:photos/utils/widget_util.dart";-class ScrollbarDivision {- final String groupID;- final String title;-- ScrollbarDivision({- required this.groupID,- required this.title,- });-}-class CustomScrollBar extends StatefulWidget {final Widget child;final ValueNotifier<double> bottomPadding;@@ -128,8 +118,7 @@ class _CustomScrollBarState extends State<CustomScrollBar> {heightOfScrollTrack = await _getHeightOfScrollTrack();final maxScrollExtent = widget.scrollController.position.maxScrollExtent;- for (ScrollbarDivision scrollbarDivision- in widget.galleryGroups.scrollbarDivisions) {+ for (final scrollbarDivision in widget.galleryGroups.scrollbarDivisions) {final scrollOffsetOfGroup = widget.galleryGroups.groupIdToScrollOffsetMap[scrollbarDivision.groupID]!;