【发布时间】:2021-08-12 15:00:39
【问题描述】:
Widget stack(BuildContext context, image, title, subtitle, height) {
return Stack(
clipBehavior: Clip.none,
children: [
Positioned(
top: createSize(57, context, fromHeight: true),
child: Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
IconButton(
icon: Icon(Icons.arrow_back),
onPressed:(){},
),SizedBox(width: createSize(300, context),),
Text('Skip'),
],
),
),
),
Positioned(
left: createSize(16, context),
top: createSize(109, context, fromHeight: true),
// height: createSize(height, context),
// width: createSize(width, context),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: TextStyle(
fontSize: createSize(22, context),
color: Colors.black,
fontWeight: FontWeight.w600),
),
Text(
subtitle,
style: TextStyle(
color: Color.fromRGBO(159, 159, 159, 1),
fontSize: createSize(12, context)),
),
],
),
),
Container(
height: height,
width: createSize(375, context),
decoration: BoxDecoration(
image: DecorationImage(image: AssetImage(image), fit: BoxFit.cover),
),
),
],
);
}
主轴alignment.spacebetween 不起作用。 我正在创建一个页面,但 mainaxisAlignment.spaceBetween 不起作用。如果该行不在堆栈内,它就可以正常工作。两个按钮在行的开头都相互粘着。我该如何解决这个问题?
【问题讨论】: