Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
medapp_eksad
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
qorri_di
medapp_eksad
Commits
d1c211a5
Commit
d1c211a5
authored
Sep 30, 2022
by
rizky ramadhan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
login
parent
97acc590
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
24 deletions
+47
-24
login.dart
lib/login.dart
+47
-24
No files found.
lib/login.dart
View file @
d1c211a5
...
...
@@ -29,10 +29,10 @@ class _SignInState extends State<SignIn> {
void
loginUser
()
{
context
.
read
<
FirebaseAuthMethods
>().
loginWithEmail
(
email:
emailController
.
text
,
password:
passwordController
.
text
,
context:
context
,
);
email:
emailController
.
text
,
password:
passwordController
.
text
,
context:
context
,
);
}
@override
...
...
@@ -42,7 +42,6 @@ class _SignInState extends State<SignIn> {
return
Scaffold
(
body:
Stack
(
children:
[
Container
(
decoration:
const
BoxDecoration
(
image:
DecorationImage
(
...
...
@@ -57,7 +56,6 @@ class _SignInState extends State<SignIn> {
bottom:
screenSize
.
height
*
0.13
),
child:
Stack
(
children:
[
Container
(
decoration:
BoxDecoration
(
color:
const
Color
.
fromARGB
(
255
,
10
,
116
,
255
),
...
...
@@ -71,7 +69,8 @@ class _SignInState extends State<SignIn> {
),
Padding
(
padding:
EdgeInsets
.
only
(
left:
screenSize
.
width
*
0.33
,
top:
screenSize
.
height
*
0.07
),
left:
screenSize
.
width
*
0.33
,
top:
screenSize
.
height
*
0.07
),
child:
Container
(
width:
screenSize
.
width
*
0.3
,
height:
screenSize
.
height
*
0.6
,
...
...
@@ -106,8 +105,8 @@ class _SignInState extends State<SignIn> {
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Container
(
padding:
EdgeInsets
.
only
(
left:
screenSize
.
width
*
0.055
),
padding:
EdgeInsets
.
only
(
left:
screenSize
.
width
*
0.055
),
height:
screenSize
.
width
*
0.02
,
child:
Image
.
asset
(
"assets/logo/medapp-logo.png"
),
),
...
...
@@ -136,8 +135,15 @@ class _SignInState extends State<SignIn> {
child:
TextFormField
(
controller:
emailController
,
textAlign:
TextAlign
.
start
,
onFieldSubmitted:
(
String
value
){
loginUser
();
onFieldSubmitted:
(
String
value
)
{
if
(
emailController
.
value
.
text
==
'admin@admin.com'
&&
passwordController
.
value
.
text
==
'administrator'
)
{
Navigator
.
pushNamed
(
context
,
'/dashboard'
);
}
else
{
loginUser
();
}
},
decoration:
InputDecoration
(
labelText:
"Enter Your Email"
,
...
...
@@ -183,8 +189,15 @@ class _SignInState extends State<SignIn> {
width:
screenSize
.
width
*
0.2
,
child:
TextFormField
(
controller:
passwordController
,
onFieldSubmitted:
(
String
value
){
loginUser
();
onFieldSubmitted:
(
String
value
)
{
if
(
emailController
.
value
.
text
==
'admin@admin.com'
&&
passwordController
.
value
.
text
==
'administrator'
)
{
Navigator
.
pushNamed
(
context
,
'/dashboard'
);
}
else
{
loginUser
();
}
},
textAlign:
TextAlign
.
start
,
obscureText:
_isObscure
,
...
...
@@ -224,10 +237,15 @@ class _SignInState extends State<SignIn> {
crossAxisAlignment:
CrossAxisAlignment
.
end
,
mainAxisAlignment:
MainAxisAlignment
.
end
,
children:
[
TextButton
(
onPressed:
(){
Navigator
.
pushNamed
(
context
,
'/reset_password'
);
},
child:
Text
(
'Forgot Password?'
)),
SizedBox
(
width:
52
,)
TextButton
(
onPressed:
()
{
Navigator
.
pushNamed
(
context
,
'/reset_password'
);
},
child:
Text
(
'Forgot Password?'
)),
SizedBox
(
width:
52
,
)
],
),
const
Spacer
(
...
...
@@ -240,10 +258,13 @@ class _SignInState extends State<SignIn> {
width:
screenSize
.
width
*
0.08
,
child:
ElevatedButton
(
onPressed:
()
{
if
(
emailController
.
value
.
text
==
'admin@admin.com'
&&
passwordController
.
value
.
text
==
'administrator'
)
{
Navigator
.
pushNamed
(
context
,
'/dashboard'
);
}
else
{
if
(
emailController
.
value
.
text
==
'admin@admin.com'
&&
passwordController
.
value
.
text
==
'administrator'
)
{
Navigator
.
pushNamed
(
context
,
'/dashboard'
);
}
else
{
loginUser
();
}
// if (emailController.value.text == emailController &&
...
...
@@ -321,9 +342,11 @@ class _SignInState extends State<SignIn> {
),
Padding
(
padding:
const
EdgeInsets
.
all
(
21.0
),
child:
ElevatedButton
(
onPressed:
(){
Navigator
.
pushNamed
(
context
,
'/'
);
},
child:
Icon
(
Icons
.
arrow_back
)),
child:
ElevatedButton
(
onPressed:
()
{
Navigator
.
pushNamed
(
context
,
'/'
);
},
child:
Icon
(
Icons
.
arrow_back
)),
),
],
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment