Вы не можете использовать Row
, потому что конструктор не является постоянным конструктором. Свойству title
виджета step
требуется конструктор const
.
Я сделал то, что вы хотите, проверьте код ниже и результат.
Попробуйте код ниже, он отлично работает:
Stepper(
currentStep: 3,
controlsBuilder: (BuildContext context,
{VoidCallback onStepContinue, VoidCallback onStepCancel}) {
return Row(
children: <Widget>[
Container(
child: null,
),
Container(
child: null,
),
],
);
},
steps: const <Step>[
Step(
title: SizedBox(
width: 50,
child: ListTile(
contentPadding: EdgeInsets.zero,
leading: Text('Step 1'),
title: Padding(
padding: const EdgeInsets.only(bottom: 8.0),
child: Icon(
Icons.person,
size: 18,
),
),
),
),
content: SizedBox(
width: 0.0,
height: 0.0,
),
),
Step(
title: SizedBox(
width: 50,
child: ListTile(
contentPadding: EdgeInsets.zero,
leading: Text('Step 2'),
title: Padding(
padding: const EdgeInsets.only(bottom: 8.0),
child: Icon(
Icons.person,
size: 18,
),
),
),
),
content: SizedBox(
width: 0.0,
height: 0.0,
),
),
Step(
title: SizedBox(
width: 50,
child: ListTile(
contentPadding: EdgeInsets.zero,
leading: Text('Step 3'),
title: Padding(
padding: const EdgeInsets.only(bottom: 8.0),
child: Icon(
Icons.person,
size: 18,
),
),
),
),
content: SizedBox(
width: 0.0,
height: 0.0,
),
),
Step(
title: SizedBox(
width: 50,
child: ListTile(
contentPadding: EdgeInsets.zero,
leading: Text('Step 4'),
title: Padding(
padding: const EdgeInsets.only(bottom: 8.0),
child: Icon(
Icons.person,
size: 18,
),
),
),
),
content: SizedBox(
width: 0.0,
height: 0.0,
),
),
],
);
ВЫХОД:
![enter image description here](https://i.stack.imgur.com/5vLTv.png)