show static method

Future<void> show(
  1. BuildContext context, {
  2. required ImageProvider<Object> image,
  3. String? title,
  4. Object? heroTag,
  5. Color backgroundColor = Colors.black,
})

Shows the image viewer in a fullscreen dialog route.

Implementation

static Future<void> show(
  BuildContext context, {
  required ImageProvider image,
  String? title,
  Object? heroTag,
  Color backgroundColor = Colors.black,
}) =>
    Navigator.of(context).push(
      PageRouteBuilder(
        opaque: false,
        barrierColor: Colors.black.withAlpha(200),
        pageBuilder: (_, __, ___) => ImageViewer(
          imageProvider: image,
          title: title,
          heroTag: heroTag,
          backgroundColor: backgroundColor,
        ),
        transitionsBuilder: (_, animation, __, child) => FadeTransition(
          opacity: animation,
          child: child,
        ),
      ),
    );