Skip to content
On this page

ImageViewer

An image viewing surface with navigation and zoom interactions.

ImageViewer in FluttyUIImageViewer in FluttyUI dark theme

Import

import 'package:flutter/widgets.dart';
import 'package:fluttyui/fluttyui.dart' as ui;

API Reference

The declarations below match the current FluttyUI source. Types are shown without the optional ui. import prefix.

ImageViewer

const ImageViewer({
  super.key,
  required this.images,
  this.initialIndex = 0,
  this.captions,
  this.onPageChanged,
  this.onClose,
  this.maxScale = 5,
  this.showThumbnails = true,
  this.dismissOnSwipe = true,
  this.backgroundColor = const Color(0xff000000),
  this.motion,
});
ParameterTypeRequiredDefault
keyKey?Nonull
imagesList<ImageProvider<Object>>Yes—
initialIndexintNo0
captionsList<String>?Nonull
onPageChangedValueChanged<int>?Nonull
onCloseVoidCallback?Nonull
maxScaledoubleNo5
showThumbnailsboolNotrue
dismissOnSwipeboolNotrue
backgroundColorColorNoconst Color(0xff000000)
motionComponentMotion?Nonull

Future<void> show

static Future<void> show({
  required BuildContext context,
  required List<ImageProvider<Object>> images,
  int initialIndex = 0,
  List<String>? captions,
  BuildContext? originContext,
  double originRadius = 20,
  double maxScale = 5,
  bool showThumbnails = true,
  ValueChanged<int>? onPageChanged,
  ComponentMotion? motion,
});

Application Setup

Place components under FluttyApp to provide theme, navigation, localization, and overlay defaults. Use theme tokens for shared appearance settings.

Source

lib/src/widgets/media/image_viewer/image_viewer.dart

This reference is generated from the ImageViewer declaration in the FluttyUI core checkout. The component catalog lists the other available building blocks.

DartFlutter

Get started with FluttyUI