148 lines
3.8 KiB
Dart
148 lines
3.8 KiB
Dart
|
|
import 'dart:io';
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_icons/flutter_icons.dart';
|
|
|
|
import 'MyAppBar.dart';
|
|
|
|
class Mylogin extends StatefulWidget {
|
|
@override
|
|
_MyloginState createState() => _MyloginState();
|
|
}
|
|
|
|
class _MyloginState extends State<Mylogin> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
body:
|
|
buildBody,
|
|
);
|
|
}
|
|
get buildBody {
|
|
|
|
return Container(
|
|
margin: EdgeInsets.all(10),
|
|
child: SingleChildScrollView(
|
|
child: Stack(
|
|
children: [
|
|
Column(
|
|
children: [
|
|
buildImage,
|
|
buildTitle,
|
|
buildTextField,
|
|
buildPassword,
|
|
buildButton,
|
|
],
|
|
),
|
|
],
|
|
)
|
|
),
|
|
);
|
|
|
|
}
|
|
get buildImage {
|
|
String img = "https://www.pngkey.com/png/full/251-2511135_logo-chief-cook-clipart-png.png";
|
|
return Container(
|
|
width: 400,
|
|
height: 300,
|
|
margin: EdgeInsets.all(30),
|
|
alignment: Alignment.center,
|
|
// color: Color.fromRGBO(244, 147, 242,0.3),
|
|
child: Image.network(img),
|
|
);
|
|
}
|
|
get buildTitle{
|
|
return Container(
|
|
child: Text("Simon's BBQ Restaurant",style:
|
|
TextStyle(
|
|
color: Color.fromRGBO(58, 47, 214, 1),
|
|
fontSize: 40,
|
|
fontFamily: "Instagramf" ,
|
|
|
|
),),
|
|
);
|
|
}
|
|
get buildTextField {
|
|
return Container(
|
|
margin: EdgeInsets.all(10),
|
|
padding: EdgeInsets.all(5),
|
|
decoration: BoxDecoration(
|
|
borderRadius: BorderRadius.circular(20),
|
|
color: Color.fromRGBO(244, 147, 242,0.3),
|
|
),
|
|
child: TextField(
|
|
style: TextStyle(
|
|
color: Color.fromRGBO(64, 70, 22,1),fontSize: 25
|
|
),
|
|
//keyboardType: TextInputType.emailAddress,
|
|
decoration: InputDecoration(
|
|
hintText: "Enter Name",
|
|
hintStyle: TextStyle( color: Color.fromRGBO(64, 70, 22,1).withOpacity(0.4),fontSize: 20),
|
|
// labelText: "Enter Name"
|
|
suffixIcon: Icon(FontAwesome.user),
|
|
border: InputBorder.none
|
|
),
|
|
),
|
|
);
|
|
}
|
|
get buildPassword {
|
|
return Container(
|
|
margin: EdgeInsets.all(10),
|
|
padding: EdgeInsets.all(5),
|
|
decoration: BoxDecoration(
|
|
borderRadius: BorderRadius.circular(20),
|
|
color: Color.fromRGBO(244, 147, 242,0.3),
|
|
),
|
|
child: TextField(
|
|
style: TextStyle(
|
|
color: Color.fromRGBO(64, 70, 22,1),fontSize: 25
|
|
),
|
|
keyboardType: TextInputType.phone,
|
|
decoration: InputDecoration(
|
|
|
|
hintText: "Phone Number",
|
|
hintStyle: TextStyle( color: Color.fromRGBO(64, 70, 22,1).withOpacity(0.4),fontSize: 20),
|
|
// labelText: "Enter Name"
|
|
suffixIcon: Icon(Icons.call_end_outlined),
|
|
border: InputBorder.none
|
|
),
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
get buildButton{
|
|
return Container(
|
|
|
|
child: Row(
|
|
children: [
|
|
Container(
|
|
margin: EdgeInsets.only(right :50,left: 25),
|
|
child: RaisedButton(
|
|
color: Color.fromRGBO(112, 149,225,1),
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
|
|
child: Text("Login"),
|
|
onPressed: (){
|
|
Navigator.push(context,MaterialPageRoute(builder: (context){
|
|
return MyAppBar();
|
|
}));
|
|
},
|
|
),
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.only(left :120),
|
|
child: RaisedButton(
|
|
color: Color.fromRGBO(78, 105, 26, 0.5),
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
|
|
child: Text("Exit"),onPressed: (){
|
|
exit(0);
|
|
},
|
|
),
|
|
),
|
|
],
|
|
)
|
|
);
|
|
}
|
|
}
|