我正在尝试扩展单个子滚动视图,但没有任何运气。我尝试过扩展单个子滚动视图、包装在容器中和/或扩展子小部件,但我得到一个错误或者它没有扩展。我不确定我做错了什么,或者如何扩展单个子滚动视图。
理想的结果是显示白色容器扩展到设备底部的图像,但我目前得到的结果是留下一个间隙并显示紫色背景。
代码:
class Login extends StatefulWidget {
const Login({Key? key}) : super(key: key);
@override
_LoginState createState() => _LoginState();
}
class _LoginState extends State<Login> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: cPrimaryColor,
body: SafeArea(
child: Container(
height: double.infinity,
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
VerticalWidetSpacer(height: 40.0),
Padding(
padding: kLoginMargin,
child: Text('Create Better',
style: TextStyle(
color: Colors.white,
fontSize: tHeader,
fontWeight: FontWeight.bold
),),
),
VerticalWidetSpacer(height: 20.0),
Padding(
padding: kLoginMargin,
child: Text('Duis aute irure dolor in reprehenderit in voluptate velit esse cillum',
style: TextStyle(
fontSize: tBody,
color: Colors.white
),),
),
VerticalWidetSpacer(height: 60.0),
Column(
children: [
Container(
width: double.infinity,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(20.0),
topRight: Radius.circular(20.0)
),
),
child: Column(
children: [
VerticalWidetSpacer(height: 30.0),
Text('Sign in',
style: TextStyle(
fontSize: tBodyHeader,
color: Colors.black,
fontWeight: FontWeight.bold
),),
VerticalWidetSpacer(height: 40.0,),
LoginTextField(
fieldLabel: 'Email',
prefixIcon: Icon(FontAwesomeIcons.envelope),
hintText: 'example@gmail.com',
),
VerticalWidetSpacer(height: 20.0),
LoginTextField(
fieldLabel: 'Password',
suffixIcon: Icon(FontAwesomeIcons.eyeSlash),
hintText: '●●●●●●●●',
),
VerticalWidetSpacer(height: 20.0),
LoginButton(),
NewTextButton(
buttonText: 'Forgot Password',
onPressed: () {
},
textColor: Color(0xFF6E6E6E),
textFontSize: 18.0,
),
VerticalWidetSpacer(height: 40.0),
Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
NewTextButton(
buttonText: 'Create a new account',
onPressed: () {
},
textColor: cButtonColor,
textFontSize: 18.0,
useFontWeight: true,
fontWeight: FontWeight.bold,
)
],
)
],
),
),
],
)
],
),
),
),
),
);
}
}