I have a screen where the user has to put some credentials and either choose to sign up or to login. ” I added alignment top center but still doesn’t help.
class _LoginPageState extends State<LoginScreen> {
final _formKey = GlobalKey<FormState>();
@override
Widget build(BuildContext context) {
return Scaffold(
body: Padding(
padding: const EdgeInsets.all(40.0),
child: Column(
children: [
Expanded(child: Logo()),
// SignUpButton(),
SizedBox(
height: 20,
),
LoginButton(),
],
)),
);
}
}
class UserProfile extends StatefulWidget {
@override
UserProfileState createState() => UserProfileState();
}
class UserProfileState extends State<UserProfile> {
// Map<String, dynamic> _profile;
bool _loading = false;
@override
initState() {
super.initState();
// Subscriptions are created here
// authService.profile.listen((state) => setState(() => _profile = state));
//authService.loading.listen((state) => setState(() => _loading = state));
}
@override
Widget build(BuildContext context) {
return Column(children: <Widget>[
// Container(padding: EdgeInsets.all(20), child: Text(_profile.toString())),
Text(_loading.toString())
]);
}
}
class LoginButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
child: Form(
child: Column(children: <Widget>[
Padding(
padding: const EdgeInsets.only(left: 10.0, right: 10.0, top: 10.0),
child: TextFormField(
style: TextStyle(color: Colors.black),
decoration: InputDecoration(
hintText: 'Nume si Prenume',
hintStyle: TextStyle(
fontFamily: 'Antra', fontSize: 12.0, color: Colors.black)),
),
),
Padding(
padding: const EdgeInsets.only(left: 10.0, right: 10.0, top: 10.0),
child: TextFormField(
style: TextStyle(color: Colors.black),
decoration: InputDecoration(
hintText: 'Email',
hintStyle: TextStyle(
fontFamily: 'Antra', fontSize: 12.0, color: Colors.black)),
),
),
SizedBox(
height: 30,
),
Container(
height: 62,
width: 300,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: Colors.black,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(32),
)),
onPressed: () {},
child: Text(
'Login',
style: TextStyle(color: Colors.white),
),
),
),
Row(mainAxisAlignment: MainAxisAlignment.start, children: <Widget>[
Icon(
Icons.email,
color: Colors.white,
),
SizedBox(
height: 40,
),
Container(
height: 62,
width: 300,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: Colors.black,
padding: const EdgeInsets.symmetric(vertical: 16),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(32),
),
),
child: Text(
' I already have account',
style: TextStyle(color: Colors.white),
),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => LoginPage()),
);
// )
// // Navigate to second route when tapped.
},
),
)
])
])));
}
}
Added alignment , trying scaffold with scroll view , still nothing works. Should I add instead of a scaffold something else? sized box doesnt work either.