Assignment#1
Name:
Sidra Saleem
Reg#
SP17-BCS-108
Submitted to:
Sir Muhammad Abdullah
Subject:
MAD
COMSATS UNIVERSITY ISLAMABAD (VEHARI)
Sign in Code:
import 'package:day14/Animation/FadeAnimation.dart';
import 'package:flutter/material.dart';
void main() => runApp(
MaterialApp(
debugShowCheckedModeBanner: false,
home: HomePage(),
);
class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
width: double.infinity,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
colors: [
Colors.orange[900],
Colors.orange[800],
Colors.orange[400]
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(height: 80,),
Padding(
padding: EdgeInsets.all(20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
FadeAnimation(1, Text("Login", style: TextStyle(color: Colors.white, fontSize: 40),)),
SizedBox(height: 10,),
FadeAnimation(1.3, Text("Welcome Back", style: TextStyle(color: Colors.white, fontSize:
18),)),
],
),
),
SizedBox(height: 20),
Expanded(
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(topLeft: Radius.circular(60), topRight: Radius.circular(60))
),
child: SingleChildScrollView(
child: Padding(
padding: EdgeInsets.all(30),
child: Column(
children: <Widget>[
SizedBox(height: 60,),
FadeAnimation(1.4, Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10),
boxShadow: [BoxShadow(
color: Color.fromRGBO(225, 95, 27, .3),
blurRadius: 20,
offset: Offset(0, 10)
)]
),
child: Column(
children: <Widget>[
Container(
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
border: Border(bottom: BorderSide(color: Colors.grey[200]))
),
child: TextField(
decoration: InputDecoration(
hintText: "Email or Phone number",
hintStyle: TextStyle(color: Colors.grey),
border: InputBorder.none
),
),
),
Container(
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
border: Border(bottom: BorderSide(color: Colors.grey[200]))
),
child: TextField(
decoration: InputDecoration(
hintText: "Password",
hintStyle: TextStyle(color: Colors.grey),
border: InputBorder.none
),
),
),
],
),
)),
SizedBox(height: 40,),
FadeAnimation(1.5, Text("Forgot Password?", style: TextStyle(color: Colors.grey),)),
SizedBox(height: 40,),
FadeAnimation(1.6, Container(
height: 50,
margin: EdgeInsets.symmetric(horizontal: 50),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(50),
color: Colors.orange[900]
),
child: Center(
child: Text("Login", style: TextStyle(color: Colors.white, fontWeight:
FontWeight.bold),),
),
)),
SizedBox(height: 50,),
FadeAnimation(1.7, Text("Continue with social media", style: TextStyle(color:
Colors.grey),)),
SizedBox(height: 30,),
Row(
children: <Widget>[
Expanded(
child: FadeAnimation(1.8, Container(
height: 50,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(50),
color: Colors.blue
),
child: Center(
child: Text("Facebook", style: TextStyle(color: Colors.white, fontWeight:
FontWeight.bold),),
),
)),
),
SizedBox(width: 30,),
Expanded(
child: FadeAnimation(1.9, Container(
height: 50,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(50),
color: Colors.black
),
child: Center(
child: Text("Github", style: TextStyle(color: Colors.white, fontWeight:
FontWeight.bold),),
),
)),
)
],
],
),
),
),
),
],
),
),
);
}
Sign Up code:
import 'package:flutter/material.dart';
void main() {
runApp(MaterialApp(
home: MyApp(),
));
}
class MyApp extends StatefulWidget {
@override
_State createState() => _State();
}
class _State extends State<MyApp> {
TextEditingController nameController = TextEditingController();
TextEditingController passwordController = TextEditingController();
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('My App'),
),
body: Padding(
padding: EdgeInsets.all(10),
child: ListView(
children: <Widget>[
Container(
alignment: Alignment.center,
padding: EdgeInsets.all(10),
child: Text(
'Please enter your data',
style: TextStyle(
color: Colors.redAccent,
fontWeight: FontWeight.w500,
fontSize: 30),
)),
Container(
alignment: Alignment.center,
padding: EdgeInsets.all(10),
child: Text(
'Sign Up',
style: TextStyle(fontSize: 20),
)),
Container(
padding: EdgeInsets.all(10),
child: TextField(
controller: nameController,
decoration: InputDecoration(
border: OutlineInputBorder(),
labelText: 'First Name',
),
),
),
Container(
padding: EdgeInsets.fromLTRB(10, 10, 10, 0),
child: TextField(
obscureText: true,
controller: passwordController,
decoration: InputDecoration(
border: OutlineInputBorder(),
labelText: 'Last Name',
),
),
),
FlatButton(
onPressed: (){
//forgot password screen
},
textColor: Colors.black54,
child: Text('Login with google'),
),
Container(
height: 50,
padding:
EdgeInsets.fromLTRB(10, 0,
10, 0),
child:
RaisedButton(
textColor: Colors.white,
color:
Colors.redAccent,
child:
Text('Signup'),
onPressed: () {
print(nameController.text);
print(passwordController.te
xt);
},
)),
Container(
child:
Row(
children: <Widget>[
Text('Does not have
account?'),
FlatButton(
textColor:
Colors.redAccent,
child: Text(
'Sign in',
style: TextStyle(fontSize:
20),
),
onPressed: () {
//signup screen
},
)
],
mainAxisAlignment:
MainAxisAlignment.center,
))
],
)));
}
}