ImagePreviewer class

原生图片预览组件

Inheritance

Constructors

ImagePreviewer({Key? key, required List images, int initialIndex = 0, bool loop = true, Color backgroundColor = Colors.black, Color closeBtnColor = Colors.white, double minScale = 0.8, double maxScale = 1.5, 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
自定义底部区域内边距
final
customBottomWidgets List<Widget?>?
多页自定义底部组件列表
final
doubleTapDuration Duration
双击间隔
final
hashCode int
The hash code for this object.
no setterinherited
images List
图片列表(支持网络/Asset/Base64/本地文件)
final
initialIndex int
初始显示索引
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
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

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<ImagePreviewer>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited