ImagePreviewConfig class
图片预览配置类
Constructors
-
ImagePreviewConfig({bool enable = true, List? images, int initialIndex = 0, bool loop = true, double minScale = 0.8, double maxScale = 3.0, Color backgroundColor = Colors.black, Color closeBtnColor = Colors.white, double slideThreshold = 10.0, Duration doubleTapDuration = const Duration(milliseconds: 300), List<
Widget?> ? customBottomWidgets, EdgeInsetsGeometry customBottomPadding = EdgeInsets.zero, double bottomMargin = 20.0, double bottomToImageSpacing = 16.0}) -
构造函数
const
Properties
- backgroundColor → Color
-
预览页面背景色
final
- bottomMargin → double
-
底部区域与屏幕底部的间距(默认20px)
final
- bottomToImageSpacing → double
-
底部区域与图片底部的间距(默认16px)
final
- closeBtnColor → Color
-
关闭按钮颜色
final
- customBottomPadding → EdgeInsetsGeometry
-
自定义底部区域内边距(默认:上下12px,左右16px)
final
-
customBottomWidgets
→ List<
Widget?> ? -
多页自定义底部组件列表(与 images 一一对应)
长度需与 images 一致,若某一页无需自定义组件可传 null
final
- doubleTapDuration → Duration
-
双击间隔
final
- enable → bool
-
是否启用点击放大预览
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- images → List?
-
多图预览时的图片列表(单图时可不传,默认使用当前图片)
final
- initialIndex → int
-
多图预览的初始显示索引
final
- loop → bool
-
是否支持循环滑动(多图时)
final
- maxScale → double
-
预览时最大缩放比例
final
- minScale → double
-
预览时最小缩放比例
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- slideThreshold → double
-
滑动阈值(超过该距离视为滑动,不触发关闭)
final
Methods
-
copyWith(
{bool? enable, List? images, int? initialIndex, bool? loop, double? minScale, double? maxScale, Color? backgroundColor, Color? closeBtnColor, double? slideThreshold, Duration? doubleTapDuration, List< Widget?> ? customBottomWidgets, EdgeInsetsGeometry? customBottomPadding, double? bottomMargin, double? bottomToImageSpacing}) → ImagePreviewConfig -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- defaultConfig → const ImagePreviewConfig
- 默认配置
- disabled → const ImagePreviewConfig
- 禁用预览的配置