I am trying to make all my widgets in a column widget to vertically align at the center of the page but after applying MainAxisAlignment and CrossAxisAlignment it still align top. What could be the reason for this. I expected the mainaxis alignment to fix this.
Here is my code:
body: ListView(
children: [
Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
// Welcome back
const SizedBox(height: 10),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 25.0),
child: Text(
'Welcome back, you've been missed!',
style: TextStyle(
fontSize: 20,
),
),
),
const SizedBox(height: 30),
//email textfield
MyTextField(
controller: emailController,
hintText: 'Email',
obscureText: false,
),
const SizedBox(height: 10),
//Password textfield
MyTextField(
controller: passwordController,
hintText: 'Password',
obscureText: true,
),
const SizedBox(height: 10),
//signin button
MyButton(
onTap: loginUser,
butlabel: 'Log In',
),
const SizedBox(height: 25),
//Not a member register
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text(
'Not a member?',
style: TextStyle(
fontWeight: FontWeight.bold,
),
),
),
]
)
],),
),
],
),