PinIndicator constructor
PinIndicator({
- required int length,
- required int currentLength,
- required bool isError,
- required bool isSuccess,
- PinIndicatorAnimationController? controller,
- BoxDecoration? errorDecoration,
- BoxDecoration? successDecoration,
- BoxDecoration? inputDecoration,
- BoxDecoration? defaultDecoration,
- double spacing = 24.0,
- double itemSize = 14.0,
- Widget? loadingCollapseAnimationChild,
- Widget? successCollapseAnimationChild,
- Key? key,
Simple decorated Pin Indicator widget.
Implementation
PinIndicator({
required this.length,
required this.currentLength,
required this.isError,
required this.isSuccess,
this.controller,
BoxDecoration? errorDecoration,
BoxDecoration? successDecoration,
BoxDecoration? inputDecoration,
BoxDecoration? defaultDecoration,
this.spacing = 24.0,
this.itemSize = 14.0,
this.loadingCollapseAnimationChild,
this.successCollapseAnimationChild,
super.key,
}) : assert(length >= currentLength),
assert(length > 3),
assert(spacing > 0),
assert(itemSize > 0),
assert(!isError || !isSuccess),
defaultItemBuilder = ((_) => PinIndicatorItem(
size: itemSize,
decoration: defaultDecoration ??
const BoxDecoration(
shape: BoxShape.circle, color: Colors.black26),
)),
errorItemBuilder = ((_) => PinIndicatorItem(
size: itemSize,
decoration: errorDecoration ??
const BoxDecoration(
shape: BoxShape.circle, color: Colors.red),
)),
successItemBuilder = ((_) => PinIndicatorItem(
size: itemSize,
decoration: successDecoration ??
const BoxDecoration(
shape: BoxShape.circle, color: Colors.green),
)),
inputItemBuilder = ((_) => PinIndicatorItem(
size: itemSize,
decoration: inputDecoration ??
const BoxDecoration(
shape: BoxShape.circle, color: Colors.blue)));