Skip to content

Instantly share code, notes, and snippets.

@vikivyas
Forked from theindianappguy/signin.dart
Created December 11, 2020 14:39
Show Gist options
  • Save vikivyas/47e2b807cefde7d7b22c99f0e7a9c38f to your computer and use it in GitHub Desktop.
Save vikivyas/47e2b807cefde7d7b22c99f0e7a9c38f to your computer and use it in GitHub Desktop.
SignIn Screen UI for ChatApp
import 'package:flutter/material.dart';
class SignIn extends StatefulWidget {
@override
_SignInState createState() => _SignInState();
}
class _SignInState extends State<SignIn> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: appBarMain(context),
body: Container(
padding: EdgeInsets.symmetric(horizontal: 24),
child: Column(
children: [
Spacer(),
Form(
child: Column(
children: [
TextFormField(
style: simpleTextStyle(),
decoration: textFieldInputDecoration("email"),
),
TextFormField(
obscureText: true,
validator: (val) {
return val.length > 6
? null
: "Enter Password 6+ characters";
},
style: simpleTextStyle(),
decoration: textFieldInputDecoration("password"),
),
],
),
),
SizedBox(
height: 16,
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
padding: EdgeInsets.symmetric(
horizontal: 16, vertical: 8),
child: Text(
"Forgot Password?",
style: simpleTextStyle(),
)),
],
),
SizedBox(
height: 16,
),
GestureDetector(
onTap: () {
//TODO
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 16),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30),
gradient: LinearGradient(
colors: [
const Color(0xff007EF4),
const Color(0xff2A75BC)
],
)),
width: MediaQuery.of(context).size.width,
child: Text(
"Sign In",
style: biggerTextStyle(),
textAlign: TextAlign.center,
),
),
),
SizedBox(
height: 16,
),
Container(
padding: EdgeInsets.symmetric(vertical: 16),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30),
color: Colors.white),
width: MediaQuery.of(context).size.width,
child: Text(
"Sign In with Google",
style:
TextStyle(fontSize: 17, color: CustomTheme.textColor),
textAlign: TextAlign.center,
),
),
SizedBox(
height: 16,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"Don't have account? ",
style: simpleTextStyle(),
),
Text(
"Register now",
style: TextStyle(
color: Colors.white,
fontSize: 16,
decoration: TextDecoration.underline),
),
],
),
SizedBox(
height: 50,
)
],
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment