我不知道如何将图标按钮连续垂直对齐。这是我的代码:
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
IconButton(
icon: Icon(Icons.fast_rewind, size: 30),
alignment: Alignment.center,
onPressed: workoutBloc.player.hasPrevExercise ? workoutBloc.player.previousExercise : null,
),
IconButton(
icon: Icon(Icons.skip_previous, size: 30),
onPressed: workoutBloc.player.hasPrevSet ? workoutBloc.player.previousSet : null
),
IconButton(
icon: workoutBloc.player.isPlaying ? Icon(Icons.pause, size: 45) : Icon(Icons.play_arrow, size: 45),
onPressed: workoutBloc.player.hasEnded ? null : () {
setState(() {});
workoutBloc.playPause();
},
),
IconButton(
icon: Icon(Icons.stop, size: 45,),
onPressed: workoutBloc.player.state != 'REST' ? () {
workoutBloc.stopSet();
} : null
),
IconButton(
icon: Icon(Icons.skip_next, size: 30),
onPressed: workoutBloc.player.hasNextSet ? workoutBloc.player.nextSet : null,
),
IconButton(
icon: Icon(Icons.fast_forward, size: 30),
onPressed: workoutBloc.player.hasNextExercise ? workoutBloc.player.nextExercise : null
)
],
)
我已经将crossAxisAlignemnt设置为居中,但是那没用。我也为alignment: Alignment.center
的图标按钮感到疲倦,但是它也不起作用。看起来像这样: