---register.dard---


import 'package:flutter/material.dart';

class MyRegister extends StatefulWidget {
const MyRegister({Key? key}) : super(key: key);

@override
_MyRegisterState createState() => _MyRegisterState();
}

class _MyRegisterState extends State<MyRegister> {
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('assets/register.png'), fit: BoxFit.cover),
),
child: Scaffold(
backgroundColor: Colors.transparent,
appBar: AppBar(
backgroundColor: Colors.transparent,
elevation: 0,
),
body: Stack(
children: [
Container(
padding: EdgeInsets.only(left: 35, top: 30),
child: Text(
'Create\nAccount',
style: TextStyle(color: Colors.white, fontSize: 33),
),
),
SingleChildScrollView(
child: Container(
padding: EdgeInsets.only(
top: MediaQuery.of(context).size.height * 0.28),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(left: 35, right: 35),
child: Column(
children: [
TextField(
style: TextStyle(color: Colors.white),
decoration: InputDecoration(
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10),
borderSide: BorderSide(
color: Colors.white,
),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10),
borderSide: BorderSide(
color: Colors.black,
),
),
hintText: "Name",
hintStyle: TextStyle(color: Colors.white),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10),
)),
),
SizedBox(
height: 30,
),
TextField(
style: TextStyle(color: Colors.white),
decoration: InputDecoration(
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10),
borderSide: BorderSide(
color: Colors.white,
),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10),
borderSide: BorderSide(
color: Colors.black,
),
),
hintText: "Email",
hintStyle: TextStyle(color: Colors.white),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10),
)),
),
SizedBox(
height: 30,
),
TextField(
style: TextStyle(color: Colors.white),
obscureText: true,
decoration: InputDecoration(
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10),
borderSide: BorderSide(
color: Colors.white,
),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10),
borderSide: BorderSide(
color: Colors.black,
),
),
hintText: "Password",
hintStyle: TextStyle(color: Colors.white),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10),
)),
),
SizedBox(
height: 40,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'Sign Up',
style: TextStyle(
color: Colors.white,
fontSize: 27,
fontWeight: FontWeight.w700),
),
CircleAvatar(
radius: 30,
backgroundColor: Color(0xff4c505b),
child: IconButton(
color: Colors.white,
onPressed: () {},
icon: Icon(
Icons.arrow_forward,
)),
)
],
),
SizedBox(
height: 40,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
TextButton(
onPressed: () {
Navigator.pushNamed(context, 'login');
},
child: Text(
'Sign In',
textAlign: TextAlign.left,
style: TextStyle(
decoration: TextDecoration.underline,
color: Colors.white,
fontSize: 18),
),
style: ButtonStyle(),
),
],
)
],
),
)
],
),
),
),
],
),
),
);
}
}

--- login.dart---

import 'package:flutter/material.dart';

class MyLogin extends StatefulWidget {
const MyLogin({Key? key}) : super(key: key);

@override
_MyLoginState createState() => _MyLoginState();
}

class _MyLoginState extends State<MyLogin> {
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('assets/login.png'), fit: BoxFit.cover),
),
child: Scaffold(
backgroundColor: Colors.transparent,
body: Stack(
children: [
Container(),
Container(
padding: EdgeInsets.only(left: 35, top: 130),
child: Text(
'Welcome\nBack',
style: TextStyle(color: Colors.white, fontSize: 33),
),
),
SingleChildScrollView(
child: Container(
padding: EdgeInsets.only(
top: MediaQuery.of(context).size.height * 0.5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(left: 35, right: 35),
child: Column(
children: [
TextField(
style: TextStyle(color: Colors.black),
decoration: InputDecoration(
fillColor: Colors.grey.shade100,
filled: true,
hintText: "Email",
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10),
)),
),
SizedBox(
height: 30,
),
TextField(
style: TextStyle(),
obscureText: true,
decoration: InputDecoration(
fillColor: Colors.grey.shade100,
filled: true,
hintText: "Password",
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10),
)),
),
SizedBox(
height: 40,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'Sign in',
style: TextStyle(
fontSize: 27, fontWeight: FontWeight.w700),
),
CircleAvatar(
radius: 30,
backgroundColor: Color(0xff4c505b),
child: IconButton(
color: Colors.white,
onPressed: () {},
icon: Icon(
Icons.arrow_forward,
)),
)
],
),
SizedBox(
height: 40,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
TextButton(
onPressed: () {
Navigator.pushNamed(context, 'register');
},
child: Text(
'Sign Up',
textAlign: TextAlign.left,
style: TextStyle(
decoration: TextDecoration.underline,
color: Color(0xff4c505b),
fontSize: 18),
),
style: ButtonStyle(),
),
TextButton(
onPressed: () {},
child: Text(
'Forgot Password',
style: TextStyle(
decoration: TextDecoration.underline,
color: Color(0xff4c505b),
fontSize: 18,
),
)),
],
)
],
),
)
],
),
),
),
],
),
),
);
}
}


 ---Main.dart---

import 'package:flutter/material.dart';
import 'package:loginuicolors/login.dart';
import 'package:loginuicolors/register.dart';

void main() {
runApp(MaterialApp(
debugShowCheckedModeBanner: false,
home: MyLogin(),
routes: {
'register': (context) => MyRegister(),
'login': (context) => MyLogin(),
},
));
}


---------------------------------------------------------------------------------------------------------------------

 Q1 simple intrest Calculator 

import 'package:flutter/material.dart';
void main() {
runApp(const MaterialApp(
title: "app",
home: application(),
));
}
class application extends StatefulWidget {
const application({Key? key}) : super(key: key);
@override
State<application> createState() => _applicationState();
}
class _applicationState extends State<application> {
TextEditingController t1=TextEditingController();
TextEditingController t2=TextEditingController();
TextEditingController t3=TextEditingController();
TextEditingController t4=TextEditingController();
double progress=50;
String result="250";
double ans=0;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text("flutter app"),),
body: Column(
children: [
Padding(
padding: const EdgeInsets.all(20.0),
child: Container(
child: TextField(
controller: t1,
decoration: InputDecoration(
labelText: "principle amount",
hintText: "enter principle amuont",
border: OutlineInputBorder(),
),
),
),
),
Padding(
padding: const EdgeInsets.all(20.0),
child: Slider(
value: progress,
min: 0,
max: 100,
divisions: 20,
label: progress.toString(),
onChanged:(double value){
setState(() {
progress=value;
});
},
semanticFormatterCallback: (value) {
return "${value.round()} dollars";
},
),
),
Padding(
padding: const EdgeInsets.all(20.0),
child: Container(
child: TextField(
controller: t3,
decoration: InputDecoration(
labelText: "Number of year",
hintText: "Enter number of years",
border: OutlineInputBorder(
),
),
),
),
),
Padding(
padding: const EdgeInsets.all(10.0),
child: Container(
child: ElevatedButton(
child:Text("calculate"),
onPressed: () {
setState(() {
int no1 = int.parse(t1.text);
int no2 = progress as int;
int no3 = int.parse(t3.text);
ans=(no1*no2*no3)/100;
});
},
),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: Text(ans.toString()),
),
)
],
),
);
}
}


 Q2 find largest no from three no 


import 'package:flutter/material.dart';
void main() {
runApp(const MaterialApp(
title: "largest number",
home: application(),
));
}
class application extends StatefulWidget {
const application({Key? key}) : super(key: key);
@override
State<application> createState() => _applicationState();
}
class _applicationState extends State<application> {
TextEditingController t1 = TextEditingController();
TextEditingController t2 = TextEditingController();
TextEditingController t3 = TextEditingController();
int ans=0;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("largest number"),
),
body: Column(
children: [
Padding(
padding: const EdgeInsets.all(20.0),
child: Container(
child:TextField(
controller:t1,
decoration: InputDecoration(
labelText: "1st number",
hintText: "enter your first",
border: OutlineInputBorder(),
),
),
),
),
Padding(
padding: const EdgeInsets.all(20.0),
child: Container(
child:TextField(
controller: t2,
decoration: InputDecoration(
labelText: "1st number",
hintText: "enter your first",
border: OutlineInputBorder(),
),
),
),
),
Padding(
padding: const EdgeInsets.all(20.0),
child: Container(
child:TextField(
controller: t3,
decoration: InputDecoration(
labelText: "1st number",
hintText: "enter your first",
border: OutlineInputBorder(),
),
),
),
),
Container(
child: ElevatedButton(
child:Text("find"),
onPressed: () {
setState(() {
int no1 = int.parse(t1.text);
int no2 = int.parse(t2.text);
int no3 = int.parse(t3.text);
if((no1>no2)&&(no1>no2))
{
ans=no1;
}
else
{
if(no2>no3)
{
ans=no2;
}
else
{
ans=no3;
}
}
});
},
),
),
Padding(
padding: const EdgeInsets.all(20.0),
child: Container(
child: Text(ans.toString()),
),
),
],
),
);
}

} 

 Q3 calculator with radio button

import 'package:flutter/material.dart';
enum opp { pluse, minus, multiple, divide }
void main() {
runApp(const MaterialApp(
title: "radio",
home: HomePage(),
));
}
class HomePage extends StatefulWidget {
const HomePage({Key? key}) : super(key: key);
@override
State<HomePage> createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
int a=1;
opp _value=opp.pluse;
double ans=0;
TextEditingController t1=TextEditingController();
TextEditingController t2=TextEditingController();
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("calculater"),
),
body: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.all(10.0),
child: TextFormField(
controller: t1,
decoration: InputDecoration(
labelText: "no1",
hintText: "enter 1st no",
border: OutlineInputBorder(),
),
),
),
Padding(
padding: const EdgeInsets.all(10.0),
child: TextFormField(
controller: t2,
decoration: InputDecoration(
labelText: "no2",
hintText: "enter 2st no",
border: OutlineInputBorder(),
),
),
),
Row(children: [
Padding(
padding: const EdgeInsets.all(2.0),
child: Radio(value: opp.pluse, groupValue: _value, onChanged:
(opp? b){
setState(() {
_value=b!;
});
}),
),
Text("+"),
],
),
Row(children: [
Radio(value: opp.minus, groupValue: _value, onChanged: (opp? b){
setState(() {
_value=b!;
});
}),
Text("-")
],
),
Row(children: [
Radio(value: opp.multiple, groupValue: _value, onChanged: (opp?
b){
setState(() {
_value=b!;
});
}),
Text("*")
],
),
Row(children: [
Radio(value: opp.divide, groupValue: _value, onChanged: (opp?b){
setState(() {
_value=b!;
});
}),
Text("/"),
],
),
Padding(
padding: const EdgeInsets.all(10.0),
child: ElevatedButton(onPressed: (){
setState(() {
double no1=double.parse(t1.text);
double no2=double.parse(t2.text);
switch(_value)
{
case opp.pluse :
ans=no1+no2;
break;
case opp.minus:
ans=no1-no2;
break;
case opp.multiple:
ans=no1*no2;
break;
case opp.divide:
ans=no1/no2;
break;
default:ans=0;
}
});
},
child: Text("calculate"),),
),
Padding(
padding: const EdgeInsets.all(10.0),
child: Center(child: Text(ans.toString())),
)
],
),
);
}
}


Q4 login page 

import 'package:flutter/material.dart';
void main() {
runApp(const MaterialApp(
title: "form",
home: Homepage(),
));
}
class Homepage extends StatefulWidget {
const Homepage({Key? key}) : super(key: key);
@override
State<Homepage> createState() => _HomepageState();
}
class _HomepageState extends State<Homepage> {
GlobalKey<FormState> key=GlobalKey<FormState>();
TextEditingController t1=TextEditingController();
TextEditingController t2=TextEditingController();
void validate()
{
if(key.currentState!.validate())
{
t1.text="";
t2.text="";
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("form"),
),
body: Column(
children: [
Form(
key: key,
child:
Column(
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: TextFormField(
controller: t1,
decoration: InputDecoration(
labelText: "user name",
hintText: "Enter user name",
border: OutlineInputBorder(),
),
validator: (val){
if(val!.isEmpty){
return "reqired";
}
else {
return null;
}
},
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: TextFormField(
controller: t2,
decoration: InputDecoration(
labelText: "password",
hintText: "Enter your password",
border: OutlineInputBorder(),
),
obscureText: true,
validator: (val){
if(val!.isEmpty){
return "reqired";
}
else {
return null;
}
},
),
),
ElevatedButton(
onPressed: validate,
child:Text("log in"))
],
),
),
],
),
);
}
}


 Q5 kg to g convertor 

import 'package:flutter/material.dart';

void main() {
runApp(const MaterialApp(
title: "kg to g",
home: Homepage(),
));
}
class Homepage extends StatefulWidget {
const Homepage({Key? key}) : super(key: key);
@override
State<Homepage> createState() => _HomepageState();
}
class _HomepageState extends State<Homepage> {
TextEditingController t1 = TextEditingController();
double ans = 0;

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("kg to gram"),
),
body: Column(
children: [
Padding(
padding: const EdgeInsets.all(20.0),
child: Container(
child: TextField(
controller: t1,
decoration: InputDecoration(
labelText: "kg value",
hintText: "enter value to convert in gram"
),
),
),
),
Padding(
padding: const EdgeInsets.all(20.0),
child: Container(
child: ElevatedButton(
child: Text("convert"),
onPressed: () {
setState(() {
double no1 = double.parse(t1.text);
ans = no1 * 1000;
});
},
),
),
),
Padding(
padding: const EdgeInsets.all(20.0),
child: Container(
child: Text("Gram :"+ans.toString()),

),
)
],
),
);
}
}