基本上,我有一个小部件是padding小部件,此外,在其中我几乎没有其他不同的小部件是可伸缩的,我发现它在不同的行中不是一致的。为了更好的讨论,我在下面有一张图片。 在您看到的问题中
即使尝试了柔韧性的配合类型,我也尝试用扩展不变的柔韧性来改变柔韧性。
外部和内部填充为
static const outerPadding = const EdgeInsets.all(0.0);
static const innerPadding = const EdgeInsets.all(5.0);
并且我试图更改此值,即使我将0设置为外部仍然是相同的>>不更改它仍然具有额外的填充。
return Padding(
padding: outerPadding,
child: Container(
//color: Colors.red,
padding: innerPadding,
child: Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Image.asset("lib/assets/A2B.png"),
Flexible(
fit: FlexFit.tight,
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Padding(
padding: const EdgeInsets.fromLTRB(8, 0, 0, 8),
child: Text(departureTime, style: timeStyle,),
),
Flexible(
fit: FlexFit.loose,
child: Text(
"",
overflow: TextOverflow.ellipsis,
),
)
],
),
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0),
child: Text(arrivalTime, style: timeStyle,),
),
],
)
],
),
),
Container(
padding: EdgeInsets.fromLTRB(0, 0, 20, 0),
height: 38,
child: divider,
),
Flexible(
fit: FlexFit.loose,
child:
Row(
CrossAxisAlignment.start,
children: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Column(children: <Widget>[
Text(hours.toString(), style: timeStyle,),
],),
Column(children: <Widget>[
Text('hrs', style: timeStyle,),
],)
],),
SizedBox(width: 25,),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Column(children: <Widget>[
Text(minutes.toString(), style: timeStyle,),
],),
Column(children: <Widget>[
Text('mins', style: timeStyle,),
],)
],)
],
) ,
),
Container(
padding: EdgeInsets.fromLTRB(0, 0, 10, 0),
height: 38,
child: divider,
),
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Text(dis,style: style1,),
Text(un,style: style1,),
],
),
InkWell(
child: Padding(
padding:EdgeInsets.fromLTRB(5, 0, 0, 0),
child: Icon(
Icons.keyboard_arrow_right,
size: 30.0,
color: Colors.blue,
),
),
)
],
),
),
);