Files
GitJournal/lib/screens/signup_screen.dart
2020-11-19 12:20:47 +01:00

113 lines
3.2 KiB
Dart

import 'package:flutter/material.dart';
import 'package:gitjournal/screens/login_screen.dart';
class SignUpScreen extends StatefulWidget {
SignUpScreen({Key key}) : super(key: key);
@override
_SignUpScreenState createState() => _SignUpScreenState();
}
class _SignUpScreenState extends State<SignUpScreen> {
Widget _submitButton() {
return Container(
width: MediaQuery.of(context).size.width,
padding: const EdgeInsets.symmetric(vertical: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: const BorderRadius.all(Radius.circular(5)),
boxShadow: <BoxShadow>[
BoxShadow(
color: Colors.grey.shade200,
offset: const Offset(2, 4),
blurRadius: 5,
spreadRadius: 2)
],
gradient: const LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [Color(0xfffbb448), Color(0xfff7892b)])),
child: const Text(
'Register Now',
style: TextStyle(fontSize: 20, color: Colors.white),
),
);
}
Widget _loginAccountLabel() {
return InkWell(
onTap: () {
Navigator.pop(context);
},
child: Container(
margin: const EdgeInsets.symmetric(vertical: 20),
padding: const EdgeInsets.all(15),
alignment: Alignment.bottomCenter,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text(
'Already have an account ?',
style: TextStyle(fontSize: 13, fontWeight: FontWeight.w600),
),
const SizedBox(width: 10),
const Text(
'Login',
style: TextStyle(
color: Color(0xfff79c4f),
fontSize: 13,
fontWeight: FontWeight.w600,
),
),
],
),
),
);
}
Widget _emailPasswordWidget() {
return Column(
children: <Widget>[
EntryField("Email"),
EntryField("Password", isPassword: true),
],
);
}
@override
Widget build(BuildContext context) {
final height = MediaQuery.of(context).size.height;
return Scaffold(
body: Container(
height: height,
child: Stack(
children: <Widget>[
Container(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SizedBox(height: height * .12),
FormTitle(),
const SizedBox(height: 50),
_emailPasswordWidget(),
const SizedBox(height: 20),
_submitButton(),
SizedBox(height: height * .14),
_loginAccountLabel(),
],
),
),
),
Positioned(
top: 15, left: 0, child: SafeArea(child: FormBackButton())),
],
),
),
);
}
}