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:
shenlong
2025-07-04 21:00:34 +05:30
committed by GitHub
parent b00d44a00c
commit 181efb9010
29 changed files with 557 additions and 233 deletions

View File

@@ -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;