Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login Page #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/Images/Artboard 1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/Images/Artboard 2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/Images/Artboard 3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/Images/Doctor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/Images/Doctor1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:hospital_management/pages/home_page.dart';
import 'package:hospital_management/widget/drawer.dart';
import 'package:flutter/material.dart';
import './pages/Login_page/login_page.dart';

void main() {
runApp(const MyApp());
Expand All @@ -12,7 +13,7 @@ class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Home(),
home: Login_Page(),
);
drawer:
NavDrawer();
Expand Down
100 changes: 100 additions & 0 deletions lib/pages/Login_page/Body.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
import 'package:flutter/material.dart';
import './background.dart';
import './textFieldContainer.dart';

class Body extends StatelessWidget {
const Body({
Key? key,
}) : super(key: key);

@override
Widget build(BuildContext context) {
Size size = MediaQuery.of(context).size;
return Background(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
// ignore: prefer_const_literals_to_create_immutables
children: <Widget>[
const Text(
'LOGIN',
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
),
Positioned(
child: Image.asset(
'assets/Images/Doctor1.png',
width: size.width * 2,
height: size.height * 0.35,
),
),
const TextFieldContainer(
child: TextField(
decoration: InputDecoration(
icon: Icon(
Icons.person,
color: Colors.pink,
),
hintText: 'Email',
border: InputBorder.none,
),
),
),
const SizedBox(
height: 10,
),
const TextFieldContainer(
child: TextField(
obscureText: true,
decoration: InputDecoration(
hintText: 'Password',
icon: Icon(
Icons.lock,
color: Colors.pink,
),
border: InputBorder.none,
suffixIcon: Icon(
Icons.visibility,
color: Colors.pink,
),
),
),
),
SizedBox(
height: size.height * 0.05,
),
ButtonTheme(
minWidth: 400,
child: ElevatedButton(
onPressed: () {},
child: const Text('LOGIN'),
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(
Colors.red,
),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
),
),
),
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'Don\'t have an account? ',
style: TextStyle(
color: Colors.pink.shade200,
),
),
const Text(
'Sign Up!',
style: TextStyle(color: Colors.blue),
)
],
)
],
),
);
}
}
38 changes: 38 additions & 0 deletions lib/pages/Login_page/background.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import 'package:flutter/material.dart';

class Background extends StatelessWidget {
final Widget child;
const Background({
Key? key,
required this.child,
}) : super(key: key);

@override
Widget build(BuildContext context) {
Size size = MediaQuery.of(context).size;
return Container(
width: double.infinity,
height: size.height,
child: Stack(
alignment: Alignment.center,
children: <Widget>[
Positioned(
top: 0,
left: 0,
child: Image.asset(
"assets/Images/Artboard 1.png",
width: size.width * 1.6,
)),
Positioned(
bottom: 0,
right: 0,
child: Image.asset(
"assets/Images/Artboard 2.png",
width: size.width * 1,
)),
child,
],
),
);
}
}
11 changes: 11 additions & 0 deletions lib/pages/Login_page/login_page.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import 'package:flutter/material.dart';
import './Body.dart';

class Login_Page extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Body(),
);
}
}
23 changes: 23 additions & 0 deletions lib/pages/Login_page/textFieldContainer.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import 'package:flutter/material.dart';
import './Body.dart';

class TextFieldContainer extends StatelessWidget {
final Widget child;
const TextFieldContainer({
Key? key,
required this.child,
}) : super(key: key);

@override
Widget build(BuildContext context) {
Size size = MediaQuery.of(context).size;
return Container(
height: size.height * 0.05,
width: size.width * 0.8,
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 5),
decoration: BoxDecoration(
color: Colors.pink.shade100, borderRadius: BorderRadius.circular(30)),
child: child,
);
}
}
Empty file removed lib/pages/login_page.dart
Empty file.
3 changes: 2 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ flutter:
uses-material-design: true

# To add assets to your application, add an assets section, like this:
# assets:
assets:
- assets/Images/
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg

Expand Down