widgets library
Optional UI widgets for flutter_paste_input.
This library provides ready-to-use widgets for common use cases like displaying pasted images with previews, lists, and fullscreen viewing.
Usage
import 'package:flutter_paste_input/flutter_paste_input.dart';
import 'package:flutter_paste_input/widgets.dart';
// Display a list of pasted images with animations
PastedImageList(
imagePaths: imagePaths,
onRemoveImage: (index) => removeImage(index),
)
// Or use individual image previews
ImagePreview(
imagePath: '/path/to/image.png',
onRemove: () => removeImage(),
)
// Show image in fullscreen
showImageViewer(
context: context,
imageFile: File('/path/to/image.png'),
);
Classes
- ImagePreview
- A thumbnail preview of an image with a remove button.
- ImageViewer
- A fullscreen image viewer widget with zoom and pan support.
- PastedImageList
- A horizontal scrollable list of pasted images with smooth animations.
Functions
-
showImageViewer(
{required BuildContext context, required File imageFile, String? heroTag, Color backgroundColor = Colors.black87, Color closeButtonColor = Colors.black54, Color closeIconColor = Colors.white, double minScale = 0.5, double maxScale = 4.0}) → Future< void> - Shows a fullscreen image viewer.