Skip to content

Instantly share code, notes, and snippets.

@manudevcode
Created October 29, 2019 01:17
Show Gist options
  • Save manudevcode/3a9f8d3f73f4dd38861dc433ec24dbc8 to your computer and use it in GitHub Desktop.
Save manudevcode/3a9f8d3f73f4dd38861dc433ec24dbc8 to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
void main() => runApp(App());
class App extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Login Example',
debugShowCheckedModeBanner: false,
home: Login()
);
}
}
class Login extends StatefulWidget {
Login({Key key}) : super(key: key);
@override
_LoginState createState() => _LoginState();
}
class _LoginState extends State<Login> {
@override
Widget build(BuildContext contextre) {
return Scaffold(
backgroundColor: Color(0xff3E3FBA),
body: Column(
children: <Widget>[
Container(
height: MediaQuery.of(context).size.height / 2 - 100.0,
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('assets/mountains.png'),
fit: BoxFit.contain
)
),
),
Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height / 2 + 100.0,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(50.0),
topRight: Radius.circular(50.0)
)
),
child: Padding(
padding: EdgeInsets.all(24.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Text('MY APP', style: TextStyle(
fontSize: 30.0,
fontWeight: FontWeight.bold,
color: Color(0xff2D2F37)
),),
SizedBox(height: 30.0,),
TextField(
keyboardType: TextInputType.text,
decoration: InputDecoration(
contentPadding: EdgeInsets.only(bottom: 20.0),
labelText: 'E-email',
labelStyle: TextStyle(
fontWeight: FontWeight.w400,
letterSpacing: 1.5,
color: Color(0xFFA2A3B1)
),
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(
color: Color(0xff3E3FBA),
width: 3.0
)
),
enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(
color: Color(0xFFF9F8FC),
width: 3.0
)
),
),
),
SizedBox(height: 60.0,),
TextField(
keyboardType: TextInputType.text,
obscureText: true,
decoration: InputDecoration(
contentPadding: EdgeInsets.only(bottom: 20.0),
labelText: 'Password',
labelStyle: TextStyle(
fontWeight: FontWeight.w400,
letterSpacing: 1.5,
color: Color(0xFFA2A3B1)
),
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(
color: Color(0xff3E3FBA),
width: 3.0
)
),
enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(
color: Color(0xFFF9F8FC),
width: 3.0
)
),
),
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
SizedBox(height: 60.0,),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text('Sign In', style: TextStyle(
fontSize: 30.0,
fontWeight: FontWeight.bold,
color: Color(0xff2D2F37)
),),
FloatingActionButton(
onPressed: () {},
backgroundColor: Color(0xFF4E4FE1),
child: Icon(Icons.arrow_forward),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text('Sign Up', style: TextStyle(
fontWeight: FontWeight.bold,
color: Color(0xFFA2A4B1),
decoration: TextDecoration.underline
),),
Text('Forgot Password', style: TextStyle(
fontWeight: FontWeight.bold,
color: Color(0xFFA2A3B1),
decoration: TextDecoration.underline
),),
],
)
],
),
)
],
),
),
),
],
)
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment