【发布时间】:2022-11-25 22:13:26
【问题描述】:
我正在尝试将白色容器放在页面底部我该怎么做,我不想给顶部填充,因为这会影响其他屏幕的尺寸。有没有办法将整个白色容器放在页面底部或屏幕底部?
这是我的代码: `
class SignIn extends StatelessWidget {
const SignIn({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
double width = MediaQuery.of(context).size.width;
double height = MediaQuery.of(context).size.height;
return Scaffold(
backgroundColor: Colors.green,
body: SafeArea(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(top: 20),
child: Stack(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"Text",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 20),
),
],
),
],
),
),
Stack(
children: [
Container(
margin: EdgeInsets.only(top: 50),
padding: EdgeInsets.only(
top: height * 0.05,
left: 10,
right: 20,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(30),
topRight: Radius.circular(30),
),
),
child: Column(
children: [
Row(
children: [
Padding(
padding: const EdgeInsets.only(left: 20),
child: Text(
"Sign In",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 25,
),
),
),
],
),
SizedBox(
height: 25,
),
SizedBox(
height: 20,
),
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text("End"),
],
),
),
],
),
),
Padding(
padding: const EdgeInsets.only(top: 20),
child: Align(
alignment: Alignment.center,
child: Padding(
padding: const EdgeInsets.only(right: 50),
child: Container(
height: 60,
width: 60,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30),
color: Colors.green,
),
),
),
),
),
],
),
],
),
),
),
);
}
}
`
【问题讨论】:
标签: flutter