flutter - 如何使堆栈内的列可滚动?
问题描述
Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: Color(0xff1D1B20),
body: SafeArea(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Image.asset(
"assets/sign_car.png",
height: MediaQuery.of(context).size.height * 0.88,
),
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Spacer(),
SizedBox(
height: 40.0,
),
Text("Welcome",
style: TextStyle(color: Color(0xffD8D8D8), fontSize: 25.0)),
SizedBox(
height: 10.0,
),
Text("Sign In",
style: TextStyle(
fontSize: 15.0,
color: Color(0xffD8D8D8),
)),
SizedBox(
height: 10.0,
),
ConstrainedBox(
constraints: BoxConstraints(
maxWidth: MediaQuery.of(context).size.width * 0.56),
child: Input(
text: "Name",
height: 45.0,
fonttext: 14.0,
),
),
ConstrainedBox(
constraints: BoxConstraints(
maxWidth: MediaQuery.of(context).size.width * 0.56),
child: Input(
text: "Email",
height: 45.0,
fonttext: 14.0,
),
),
ConstrainedBox(
constraints: BoxConstraints(
maxWidth: MediaQuery.of(context).size.width * 0.56),
child: Input(
text: "Password",
height: 45.0,
fonttext: 14.0,
toppadding: 10.0,
suffixIcon: Icon(
Icons.panorama_fish_eye_sharp,
color: Colors.white,
size: 10.0,
),
),
),
SizedBox(
height: 10.0,
),
Container(
width: MediaQuery.of(context).size.width * 0.56,
child: Text("Forget Password ?",
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 13.0,
color: Color(0xffFFD700),
)),
),
SizedBox(
height: 30.0,
),
InkWell(
onTap: () {},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Color(0xffFFD700),
),
width: MediaQuery.of(context).size.width * 0.56,
height: 45,
child: Center(
child: Text(
"Create Account",
style: TextStyle(
color: Colors.black,
fontSize: 18,
),
textAlign: TextAlign.center,
),
)),
),
SizedBox(
height: 60.0,
),
Container(
child: Text("If already have an account",
style: TextStyle(
fontSize: 14.0,
color: Colors.white,
)),
),
SizedBox(
height: 10.0,
),
InkWell(
onTap: () {},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
border:
Border.all(width: 1.0, color: Color(0xffFFD700)),
color: Colors.transparent,
),
width: MediaQuery.of(context).size.width * 0.56,
height: 45,
child: Center(
child: Text(
"Login",
style: TextStyle(
color: Color(0xffFFD700),
fontSize: 18,
),
textAlign: TextAlign.center,
),
)),
),
SizedBox(
height: 30.0,
),
],
),
],
),
),
);
解决方案
您必须阅读SingleChildScrollView。在这里您可以找到所有需要的示例。
推荐阅读
- javascript - 从 GTM 自定义 JS 变量中的 URL 返回文本
- google-sheets - 应用 VlLOOKUP 直到谷歌表格中的最后一个非空行
- c - 在程序中,扩大了形状的大小是成功的,但是改变颜色效果不好
- xampp - xampp 不工作,我几乎尝试了所有事情
- php - 页面在使用 Laravel 5.6 的 cpanel 中不起作用
- php - 在这里使用 Laravel Eloquent 时遇到问题
- android - REST 最佳实践为访客和身份验证获取 /articles?
- python - rect 与 rect 列表的碰撞
- mysql - Airflow 在更改 celery 的配置文件时出现错误 ImportError: No module named MySQLdb
- python - 审计轮修复未按预期工作