WOIStepper.icons constructor
WOIStepper.icons({
- Key? key,
- Widget? activeSeparatorWidget,
- Widget? inactiveSeparatorWidget,
- required int activeStateIndex,
- required List<
IconData> iconData, - IconStepperItemStyle? activeIconTheme,
- IconStepperItemStyle? inactiveIconTheme,
- IconStepperItemStyle? completedIconTheme,
- EdgeInsets? itemsPadding,
- EdgeInsets? saperatorsPadding,
- EdgeInsets? backgroundPadding,
- BoxDecoration? backgroundDecorator,
- Axis axis = Axis.horizontal,
- EdgeInsets? itemsMargin,
- double? height,
- double? width,
Creates an instance of WOIStepper as icons as their items.
The activeIconTheme
, inactiveIconTheme
and completedIconTheme
will be responsible for
defining the themes of icons in those states.
Here is the small example for this:
Padding(
padding: const EdgeInsets.all(10),
child: WOIStepper.icons(
activeStateIndex: currentStepperIndex,
activeSeparatorWidget: Container(
height: 2,
color: Colors.black,
),
iconData: const [
Icons.home,
Icons.person,
Icons.check,
],
completedIconTheme: IconStepperItemStyle(
boxDecoration: const BoxDecoration(
color: Colors.black,
shape: BoxShape.circle,
),
iconThemeData: const IconThemeData(
color: Colors.white,
),
),
),
),
Implementation
WOIStepper.icons({
super.key,
this.activeSeparatorWidget,
this.inactiveSeparatorWidget,
required this.activeStateIndex,
required List<IconData> iconData,
IconStepperItemStyle? activeIconTheme,
IconStepperItemStyle? inactiveIconTheme,
IconStepperItemStyle? completedIconTheme,
this.itemsPadding,
this.saperatorsPadding,
this.backgroundPadding,
this.backgroundDecorator,
this.axis = Axis.horizontal,
this.itemsMargin,
this.height,
this.width,
}) : assert(
iconData.length > 1, '[iconData] length should be greater then 1'),
textPadding = null,
suffixWidgetItemsList = List.generate(
iconData.length,
(index) => SuffixWidgetStepper(
widget: Icon(iconData[index]),
activeState: (activeIconTheme?.iconThemeData != null)
? (IconTheme(
data: activeIconTheme!.iconThemeData!,
child: Icon(iconData[index]),
))
: null,
inactiveState: (inactiveIconTheme?.iconThemeData != null)
? (IconTheme(
data: inactiveIconTheme!.iconThemeData!,
child: Icon(iconData[index]),
))
: null,
completedState: (completedIconTheme?.iconThemeData != null)
? (IconTheme(
data: completedIconTheme!.iconThemeData!,
child: Icon(iconData[index]),
))
: null,
),
),
itemActiveDecorator = activeIconTheme?.boxDecoration ??
BoxDecoration(
shape: BoxShape.circle,
color: Colors.white,
border: Border.all(
color: Colors.black,
),
),
itemInactiveDecorator = inactiveIconTheme?.boxDecoration ??
BoxDecoration(
shape: BoxShape.circle,
color: Colors.white,
border: Border.all(
color: Colors.white,
),
),
itemCompletedDecorator = completedIconTheme?.boxDecoration ??
BoxDecoration(
shape: BoxShape.circle,
border: Border.all(
color: Colors.black,
),
),
inactiveState = null,
activeState = null,
textItemsList = List.generate(
iconData.length,
(index) => '',
),
completedState = null,
subtextList = null,
subtextStyle = null;