Skip to content

Hero animation doesn't perform as expected first time #305

Description

@agordeev

I'm transitioning from

Hero(
  tag: imageModel.url,
  child: CachedNetworkImage(
    imageUrl: imageModel.url,
    fit: BoxFit.cover,
  ),
)

to

final item = widget.galleryItems[index];
PhotoViewGalleryPageOptions(
  imageProvider: CachedNetworkImageProvider(
     item.url,
  ),
  initialScale: PhotoViewComputedScale.contained,
  minScale: PhotoViewComputedScale.contained,
  maxScale: PhotoViewComputedScale.covered * 1.2,
  heroAttributes: PhotoViewHeroAttributes(tag: item.url),
);

The first transition doesn't use hero animation. When I navigate back it starts working. All the subsequent transitions use hero animation.

The issue doesn't happen when I use plain NetworkImage/Image.network provider/widget

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: triageIndicates that this issue needs to be analyzed and decorated with the appropriate labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions