07.Positioned与Container嵌套无法充满容器
问题
@override
Widget build(BuildContext context) {
return Container(
color: Colors.white,
height: 44,
child: Stack(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
padding: const EdgeInsets.all(10),
color: Colors.green,
child: Row(
children: [
Image(image: AssetImage(imageName)),
const SizedBox(
width: 8,
),
Text(title),
],
),
),
Container(
color: Colors.yellow,
child: Row(
children: [
subTitle != null ? Text(subTitle!) : Container(),
subImageName != null
? Image.asset(subImageName!)
: Container(),
Image.asset(
'images/icon_right.png',
width: 15,
)
],
))
],
),
Positioned(
left: 48,
bottom: 0,
child: Container(
height: 0.5,
color: Colors.red,
),
),
],
)
);
}
Align

参考
Last updated