Registration/Login Screen

 import "package:flutter/material.dart";

void main()
{
runApp(MyApp());
}
class MyApp extends StatelessWidget
{
MyApp({super.key});
@override
Widget build(BuildContext context)
{
return MaterialApp(
title: "Login Screen",
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.teal,
),
home: MyDemoApp(),
);
}
}
class MyDemoApp extends StatefulWidget
{
MyDemoApp({super.key});
@override
State<MyDemoApp> createState()
{
return MyDemoAppState();
}
}
class MyDemoAppState extends State<MyDemoApp>
{
TextEditingController controller1 = new TextEditingController();
TextEditingController controller2 = new TextEditingController();

TextEditingController register1 = new TextEditingController();
TextEditingController register2 = new TextEditingController();
TextEditingController register3 = new TextEditingController();

@override
Widget build(BuildContext context)
{
return GestureDetector(
onTap: (){
return FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
title: Text("Login Screen"),
centerTitle: true,
),

/// LOGIN SCREEN
// body: SingleChildScrollView(
// child: Center(
// child: Container(
// width: 300.0,
// child: Column(
// children: <Widget>[
// Image.asset("assets/images/login_screen_image.png"),
// const SizedBox(height: 60.0,),
// TextField(
// controller: controller1,
// decoration: InputDecoration(
// labelText: "Username",
// hintText: "Enter the Username",
// suffixIcon: Icon(Icons.account_box,),
// border: OutlineInputBorder(),
// ),
// ),
// const SizedBox(height: 50.0,),
// TextField(
// controller: controller2,
// decoration: InputDecoration(
// labelText: "Password",
// hintText: "Enter the Password",
// suffixIcon: Icon(Icons.remove_red_eye,),
// border: OutlineInputBorder(),
// ),
// ),
// SizedBox(height: 10.0,),
// Align(
// alignment: Alignment.centerRight,
// child: Text("Forgot Password",
// style: TextStyle(fontWeight: FontWeight.bold,
// color: Colors.blue,
// decoration: TextDecoration.underline,
// ),
// ),
// ),
// const SizedBox(height: 50.0,),
// ElevatedButton(
// onPressed: (){},
// child: Text("Login",
// style: TextStyle(
// fontSize: 25.0,
// fontWeight: FontWeight.bold,
// ),
// ),
// style: ElevatedButton.styleFrom(
// backgroundColor: Colors.black,
// fixedSize: Size(300.0, 50.0,),
// ),
// ),
// const SizedBox(height: 100.0,),
// Text("New User? Create Account",
// style: TextStyle(
// fontWeight: FontWeight.bold,
// decoration: TextDecoration.underline,
// ),
// ),
// ],
// ),
// ),
// ),
// ),

/// REGISTRATION SCREEN
body: SingleChildScrollView(
child: Center(
child: Container(
width: 300.0,
child: Column(
children: <Widget>[
const SizedBox(height: 30.0,),
Image.asset("assets/images/Login_screen_image_3.png"),
const SizedBox(height: 50.0,),
TextField(
controller: register1,
decoration: InputDecoration(
hintText: "Enter the Username",
labelText: "Username",
suffixIcon: Icon(Icons.account_box,),
border: OutlineInputBorder(),
),
),
const SizedBox(height: 30.0,),
TextField(
controller: register2,
keyboardType: TextInputType.emailAddress,
decoration: InputDecoration(
hintText: "Enter the Email",
labelText: "Email",
suffixIcon: Icon(Icons.email,),
border: OutlineInputBorder(),
),
),
const SizedBox(height: 30.0,),
TextField(
controller: register3,
keyboardType: TextInputType.visiblePassword,
decoration: InputDecoration(
hintText: "Enter the Password",
labelText: "Password",
suffixIcon: Icon(Icons.remove_red_eye,),
border: OutlineInputBorder(),
),
),
const SizedBox(height: 10.0,),
Align(
alignment: Alignment.centerRight,
child: Text("Forgot password",
style: TextStyle(
color: Colors.blue,
fontWeight: FontWeight.bold,
decoration: TextDecoration.underline,
),
),
),
const SizedBox(height: 30.0,),
ElevatedButton(
onPressed: (){},
child: const Text("Register",
style: TextStyle(fontSize: 25.0,
fontWeight: FontWeight.bold,
),
),
style: ElevatedButton.styleFrom(
backgroundColor: Colors.blueGrey,
fixedSize: Size(300.0,50.0,),
),
),
const SizedBox(height: 30.0,),
Text("Already registered? Login",
style: TextStyle(
color: Colors.blue,
fontWeight: FontWeight.bold,
decoration: TextDecoration.underline,
),
),
],
),
),
),
),
),
);
}
}

Comments

Popular posts from this blog

Second GET API Calling with Bloc simple Example in Flutter

Stack Container Scrollable Card widget UI with Custom Widget

Pagination with Bloc Pattern in Flutter