To run the example:

Tap on one of the three circular thumbnails to animate the image
to a larger square positioned in the middle of a new route that
obscures the original route.

Return to the previous route by tapping the image, or by using the
device’s back-to-the-previous-route gesture.

You can slow the transition further using the timeDilation
property.

Photo class

The Photo class builds the widget tree that holds the image:

Material(
      // Slightly opaque color appears where the image has transparency.

color: Theme.of(context).primaryColor.withOpacity(0.25),
      child:

InkWell(
        onTap:

onTap,
        child:

Image.asset(
            photo,
            fit: BoxFit.contain,
          )
      ),
    );
  }
}