I am trying to upload documents one by one and display them in a list using ListView but when I click on the 4th step, nothing is happening. The 4th step is not opening.
Here's the image
Here's the code
List<Step> steps = [
Step(
isActive: false,
state: StepState.indexed,
title: const Text('Attach your DOCUMENTS'),
content: Column(
children: <Widget>[
ListView.builder(
itemCount: documents.length,
itemBuilder: (context, index) {
final item = documents[index];
return ListTile(
title: Text("$item"),
);
},
),
Container(
child: MouseRegion(
cursor: SystemMouseCursors.click,
child: GestureDetector(
child: Icon(
Icons.upload_file,
color: Colors.grey,
),
// onTap: () => {}
),
),
)
],
),
),
];
Scaffold(
body: SafeArea(
child: Container(
child: Stepper(
steps: steps,
currentStep: currentStep,
onStepContinue: next,
onStepTapped: (step) => goTo(step),
onStepCancel: cancel,
type: StepperType.vertical,
controlsBuilder: (BuildContext context, {VoidCallback onStepContinue, VoidCallback onStepCancel}) {
return Column(
children: <Widget>[
SizedBox(height: size.width * 0.02),
Row(
mainAxisAlignment: MainAxisAlignment
.start,
crossAxisAlignment: CrossAxisAlignment
.start,
children: <Widget>[
FlatButton(
color: Color(0XFFEFEFEF),
textColor: primaryColor,
disabledColor: Colors.grey,
disabledTextColor: Colors
.black,
padding: EdgeInsets.symmetric(
vertical: 15.0,
horizontal: 10.0),
onPressed: cancel,
child: Text(
"Back",
style: TextStyle(
fontSize: 15.0,
),
),
),
SizedBox(width: size.width * 0.02),
FlatButton(
color: primaryColor,
textColor: Colors.white,
disabledColor: Colors.grey,
disabledTextColor: Colors
.black,
padding: EdgeInsets.symmetric(
vertical: 15.0,
horizontal: 10.0),
onPressed: next,
child: Text(
"Next",
style: TextStyle(
fontSize: 15.0,
),
),
),
],
),
],
);
}
)
I am getting the documents in an API response as :
documents = ["doc1", "doc2"];
I don't know whether we can display a list in a stepper.
Is there any other way to do that?
Thanks in advance!!