我正在为我的APP(交付应用程序)构建一个登录页面 我收到“底部溢出89像素”的信息,无法修复。 我到处看。 我发现的唯一方法是添加
resizeToAvoidBottomPadding:false
在脚手架上,但是没有用。 如何解决? 我需要包裹东西吗? 如果是,该怎么办? 最后,“底部溢出89个像素”是什么意思?
class LoginPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
//
// Captura o tema do titulo
TextStyle titleTheme = Theme.of(context).textTheme.headline6.copyWith(
color: Layout.light(),
);
return Scaffold(
backgroundColor: Layout.primaryDark(),
body: Column(
children: <Widget>[
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SizedBox(height: 20),
ClipRRect(
child: Container(
decoration: BoxDecoration(
border: Border.all(
color: Layout.light(),
width: 0,
),
borderRadius: BorderRadius.circular(160),
color: Layout.dark(.8),
),
child: Image.asset('assets/foto_app.png'),
),
borderRadius: BorderRadius.circular(170),
),
SizedBox(height: 20),
Text('Distribuidora Ilha Grande', style: titleTheme),
],
),
),
Stack(
children: <Widget>[
Positioned(
top: 10,
left: 0,
right: 0,
child: Container(
height: 50,
decoration: BoxDecoration(
color: Colors.transparent,
boxShadow: [
BoxShadow(
color: Layout.dark(),
offset: const Offset(0, 0),
spreadRadius: 8,
blurRadius: 15,
),
],
),
),
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(25),
topRight: Radius.circular(25),
),
color: Layout.light(),
),
height: MediaQuery.of(context).size.height * .5,
child: Padding(
padding: EdgeInsets.all(20),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
TextFormField(
decoration: InputDecoration(
border: OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(50),
),
),
),
initialValue: 'Email',
),
SizedBox(height: 15),
TextFormField(
decoration: InputDecoration(
border: OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(50),
),
),
),
initialValue: 'Senha',
),
SizedBox(height: 15),
SizedBox(
width: double.infinity,
height: 50,
child: RaisedButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(50),
),
),
onPressed: () {},
child: Text(
'ENTRAR',
style: titleTheme,
),
),
)
],
),
),
)
],
)
],
),
);
}
}
答案 0 :(得分:0)
将顶部的Column
替换为Flex
,然后使用“扩展”。
Flex(
direction:Axis.Vertical,
child: Expanded(...)
)