Want to center ListView in Flutter Use SingleChildScrollView instead of ListView. Try this example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | @override Widget build(BuildContext context) { return Scaffold( body: Center( child: SingleChildScrollView( child: Column( children: <Widget>[ Image.asset('assets/images/logo.png', scale: 3.0,), InputField('enter email address', Icons.email, TextInputType.emailAddress), PasswordInputField('enter password', Icons.lock, TextInputType.text), RoundBtn('SIGN IN', signIn), RoundBtn('SIGN UP', () => {}), OutlineBtn('FORGOT PASSWORD?', () => {}) ], ), ),) ); } |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.