【发布时间】:2022-11-06 02:56:03
【问题描述】:
我想在“anotherstepper”栏中的每个步骤中添加步骤图像怎么做?
例如:在第 1 步圈我想添加第 1 步图像,在第 2 步第 2 圈我想像我的意思一样添加第 2 步图像。我希望你能理解我的意思。
代码
Container(
width: 500,
height: 500,
child: AnotherStepper(
stepperList: stepperData,
stepperDirection: Axis.horizontal,
horizontalStepperHeight: 100,
dotWidget: Container(
padding: const EdgeInsets.all(8),
decoration: const BoxDecoration(
color: Colors.green,
borderRadius: BorderRadius.all(Radius.circular(30))),
child: Column(
children: <Widget>[
Row(children: const <Widget>[
Image(
image: AssetImage('assets/step1.png'),
height: 20,
width: 20,
),
]),
Row(children: const <Widget>[
Image(
image: AssetImage('assets/step2.png'),
height: 20,
width: 20,
),
]),
],
),
),
activeBarColor: Colors.green,
inActiveBarColor: Colors.grey,
activeIndex: 2,
barThickness: 8.5,
gap: 30,
),
),
);
}
}
late double activeIndex;
List<StepperData> stepperData = [
StepperData(
title: "",
subtitle: "",
),
StepperData(
title: "",
subtitle: "",
),
StepperData(
title: "",
subtitle: "",
),
StepperData(
title: "",
subtitle: "",
),
];
@override
void initState() {
super.initState();
}
我想要这样
但我的输出
【问题讨论】:
-
您使用什么库?
-
@fairycatto “另一个 stepperbar” 库
-
我建议 Aviraj Patel 提到的同一件事,该软件包不支持将多个图像添加到步进器中
标签: flutter