AssetImgCarousel class
用于本地图片的轮播,是基于 Carousel 组件的包装
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- AssetImgCarousel
Constructors
-
AssetImgCarousel(List<
String> assetImagePaths, {Key? key, double height = 400.0, double width = 0.0, FunctionWithAInt? onUnitTapped, FunctionWithAInt? onIndicatorTapped, bool useindicator = true, Color indicatorColor = Colors.white, Color currentIndicatorColor = Colors.blue, double indicatorWidth = 40.0, double indicatorHeight = 26.0, double indicatorMargin = 3.0, double indicatorToBottom = 10.0, BoxShape indicatorShape = BoxShape.rectangle, FunctionIndicatorBuilder? indicatorBuilder, bool pageSnapping = true, bool padEnds = true, Clip clipBehavior = Clip.hardEdge, bool reverse = false, Axis scrollDirection = Axis.horizontal, CarouselController? controller, bool disableIndicatorDefaultCallbacks = false, double imgScale = 1.0, ImageFrameBuilder? imgFrameBuilder, bool imgExcludeFromSemantics = false, AlignmentGeometry imgAlignment = Alignment.center, ImageRepeat imgRepeat = ImageRepeat.noRepeat, bool imgMatchTextDirection = false, bool imgGaplessPlayback = false, FilterQuality imgFilterQuality = FilterQuality.low, bool imgIsAntiAlias = false, ImageErrorWidgetBuilder? imgErrorBuilder, String? imgSemanticLabel, double? imgWidth, double? imgHeight, Color? imgColor, Animation<double> ? imgOpacity, BlendMode? imgColorBlendMode, BoxFit? imgFit, Rect? imgCenterSlice, Map<String, String> ? imgHeaders, int? imgCacheWidth, int? imgCacheHeight, String? imgPackage}) -
const
Properties
-
assetImagePaths
→ List<
String> -
A list of asset image file paths to be displayed in the carousel.
用于在轮播中显示的 asset 图片文件路径列表
final
- clipBehavior → Clip
-
The behavior for clipping. Defaults to Clip.hardEdge.
剪裁的行为,默认为 Clip.hardEdge
final
- controller → CarouselController?
-
Carousel controller, optional.
轮播控制器,可选
final
- currentIndicatorColor → Color
-
Color of the currently selected indicator.
当前选中指示器的颜色
final
- disableIndicatorDefaultCallbacks → bool
-
Whether to disable default indicator callback functions.
是否禁用默认指示器回调函数
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double
-
The height of the carousel component.
轮播组件的高度
final
- imgAlignment → AlignmentGeometry
-
Alignment of the image within its box.
图像在其框内的对齐方式
final
- imgCacheHeight → int?
-
Maximum height for decoding the image cache, optional.
图像缓存的最大高度,可选
final
- imgCacheWidth → int?
-
Maximum width for decoding the image cache, optional.
图像缓存的最大宽度,可选
final
- imgCenterSlice → Rect?
-
Center slice of the image, optional.
图像的中心切片,可选
final
- imgColor → Color?
-
Color applied to the image, optional.
应用于图像的颜色,可选
final
- imgColorBlendMode → BlendMode?
-
Blend mode applied to the image, optional.
应用于图像的混合模式,可选
final
- imgErrorBuilder → ImageErrorWidgetBuilder?
-
Custom image error widget builder, optional.
自定义图像错误小部件构建器,可选
final
- imgExcludeFromSemantics → bool
-
Whether the image should be excluded from semantics. Defaults to false.
图像是否应排除在语义中,默认为false
final
- imgFilterQuality → FilterQuality
-
Filter quality of the image. Defaults to FilterQuality.low.
图像的滤镜质量,默认为 FilterQuality.low
final
- imgFit → BoxFit?
-
Fit of the image within its box, optional.
图像在其框内的适应方式,可选
final
- imgFrameBuilder → ImageFrameBuilder?
-
Custom image frame builder, optional.
自定义图像帧构建器,可选
final
- imgGaplessPlayback → bool
-
Whether to enable gapless playback of the image. Defaults to false.
是否启用无间隙播放图像,默认为false
final
-
imgHeaders
→ Map<
String, String> ? -
Headers for network image requests, optional.
用于网络图像请求的标头,可选
final
- imgHeight → double?
-
Height of the image, optional.
图像的高度,可选
final
- imgIsAntiAlias → bool
-
Whether the image should be anti-aliased.
图像是否应抗锯齿
final
- imgMatchTextDirection → bool
-
Whether the image should match the text direction.
图像是否应与文本方向匹配
final
-
imgOpacity
→ Animation<
double> ? -
Opacity of the image, optional.
图像的不透明度,可选
final
- imgPackage → String?
-
Package name for the image, optional.
图像的包名称,可选
final
- imgRepeat → ImageRepeat
-
How the image should repeat.
图像如何重复
final
- imgScale → double
-
Image scale factor.
图像缩放因子
final
- imgSemanticLabel → String?
-
Semantic label for the image, optional.
图像的语义标签,可选
final
- imgWidth → double?
-
Width of the image, optional.
图像的宽度,可选
final
- indicatorBuilder → FunctionIndicatorBuilder?
-
Custom indicator builder function, optional.
自定义指示器构建函数,可选
final
- indicatorColor → Color
-
Default indicator color.
默认指示器颜色
final
- indicatorHeight → double
-
Indicator height.
指示器高度
final
- indicatorMargin → double
-
Spacing between indicators.
指示器之间的间距
final
- indicatorShape → BoxShape
-
Default indicator shape, defaults to a rectangle.
默认指示器形状,默认为矩形
final
- indicatorToBottom → double
-
Distance of indicators from the bottom.
指示器距离底部的距离
final
- indicatorWidth → double
-
Indicator width.
指示器宽度
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onIndicatorTapped → FunctionWithAInt?
-
Callback function when an indicator is clicked, optional.
当指示器被点击时的回调函数,可选
final
- onUnitTapped → FunctionWithAInt?
-
Callback function when a unit in the carousel is clicked, optional.
当轮播单元被点击时的回调函数,可选
final
- padEnds → bool
-
Whether to add extra pages at the beginning and end of the carousel. Default is true.
是否在轮播首尾添加额外的页面,默认为true
final
- pageSnapping → bool
-
Whether to enable page snapping, defaults to true.
是否启用页面快速吸附,默认为true
final
- reverse → bool
-
Whether to reverse the order of items.
是否倒序项目的顺序
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollDirection → Axis
-
The axis along which the page view scrolls. Defaults to Axis.horizontal.
页面视图滚动的轴,默认为 Axis.horizontal
final
- useindicator → bool
-
Whether to use indicators. Defaults to true.
是否使用指示器,默认为true
final
- width → double
-
The width of the carousel component.
轮播组件的宽度
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< AssetImgCarousel> -
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}) → 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