mirror of
https://github.com/immich-app/immich.git
synced 2026-03-06 18:17:27 +03:00
refactor: reduce timeline rebuilds (#19704)
* reduce timeline rebuilds * feat: adds bottom sheet map and actions (#19692) * adds bottom sheet map and actions * PR feedbacks * only reload the asset viewer if asset is changed * styling tweak --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> Co-authored-by: Alex <alex.tran1502@gmail.com> * rename singleton and remove event prefix --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
@@ -271,7 +271,7 @@ class _PhotoViewGalleryState extends State<PhotoViewGallery> {
|
||||
|
||||
final PhotoView photoView = isCustomChild
|
||||
? PhotoView.customChild(
|
||||
key: ObjectKey(index),
|
||||
key: pageOption.key ?? ObjectKey(index),
|
||||
childSize: pageOption.childSize,
|
||||
backgroundDecoration: widget.backgroundDecoration,
|
||||
wantKeepAlive: widget.wantKeepAlive,
|
||||
@@ -304,7 +304,7 @@ class _PhotoViewGalleryState extends State<PhotoViewGallery> {
|
||||
child: pageOption.child,
|
||||
)
|
||||
: PhotoView(
|
||||
key: ObjectKey(index),
|
||||
key: pageOption.key ?? ObjectKey(index),
|
||||
index: index,
|
||||
imageProvider: pageOption.imageProvider,
|
||||
loadingBuilder: widget.loadingBuilder,
|
||||
@@ -363,7 +363,7 @@ class _PhotoViewGalleryState extends State<PhotoViewGallery> {
|
||||
///
|
||||
class PhotoViewGalleryPageOptions {
|
||||
PhotoViewGalleryPageOptions({
|
||||
Key? key,
|
||||
this.key,
|
||||
required this.imageProvider,
|
||||
this.heroAttributes,
|
||||
this.semanticLabel,
|
||||
@@ -392,6 +392,7 @@ class PhotoViewGalleryPageOptions {
|
||||
assert(imageProvider != null);
|
||||
|
||||
const PhotoViewGalleryPageOptions.customChild({
|
||||
this.key,
|
||||
required this.child,
|
||||
this.childSize,
|
||||
this.semanticLabel,
|
||||
@@ -418,6 +419,8 @@ class PhotoViewGalleryPageOptions {
|
||||
}) : errorBuilder = null,
|
||||
imageProvider = null;
|
||||
|
||||
final Key? key;
|
||||
|
||||
/// Mirror to [PhotoView.imageProvider]
|
||||
final ImageProvider? imageProvider;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user