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
1a8fc67b
Commit
1a8fc67b
authored
Sep 02, 2022
by
Budi Prasetyo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nambah back
parent
ed9c4abe
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
272 additions
and
257 deletions
+272
-257
medapp_image2.jpg
assets/images/medapp_image2.jpg
+0
-0
forget_password.dart
lib/auth/forget_password.dart
+4
-1
login.dart
lib/login.dart
+268
-256
No files found.
assets/images/medapp_image2.jpg
0 → 100644
View file @
1a8fc67b
16.7 KB
lib/auth/forget_password.dart
View file @
1a8fc67b
...
...
@@ -17,7 +17,10 @@ class _ForgotPasswordState extends State<ForgotPassword> {
return
Stack
(
children:
[
Container
(
decoration:
BoxDecoration
(
image:
DecorationImage
(
image:
AssetImage
(
'assets/images/medapp_image1.png'
),
fit:
BoxFit
.
fill
)),
decoration:
BoxDecoration
(
image:
DecorationImage
(
image:
AssetImage
(
'assets/images/medapp_image2.jpg'
),
fit:
BoxFit
.
fill
)),
),
Padding
(
padding:
const
EdgeInsets
.
all
(
21.0
),
...
...
lib/login.dart
View file @
1a8fc67b
...
...
@@ -29,288 +29,300 @@ class _loginState extends State<login> {
setPageTitle
(
'Login MedApps'
,
context
);
var
screenSize
=
MediaQuery
.
of
(
context
).
size
;
return
Scaffold
(
body:
Container
(
decoration:
const
BoxDecoration
(
image:
DecorationImage
(
image:
AssetImage
(
"assets/images/bg-medapp.png"
),
fit:
BoxFit
.
fill
,
)),
height:
screenSize
.
height
,
width:
screenSize
.
width
,
padding:
EdgeInsets
.
only
(
left:
screenSize
.
width
*
0.15
,
top:
screenSize
.
height
*
0.13
,
bottom:
screenSize
.
height
*
0.13
),
child:
Stack
(
children:
[
Container
(
decoration:
BoxDecoration
(
color:
const
Color
.
fromARGB
(
255
,
10
,
116
,
255
),
borderRadius:
BorderRadius
.
circular
(
20
),
),
width:
screenSize
.
width
*
0.36
,
height:
screenSize
.
height
*
0.9
,
child:
Image
.
asset
(
"assets/logo/eksad.jpg"
,
),
),
Padding
(
padding:
EdgeInsets
.
only
(
left:
screenSize
.
width
*
0.33
,
top:
screenSize
.
height
*
0.07
),
child:
Container
(
width:
screenSize
.
width
*
0.3
,
height:
screenSize
.
height
*
0.6
,
decoration:
BoxDecoration
(
color:
Colors
.
white
,
body:
Stack
(
children:
[
Container
(
decoration:
const
BoxDecoration
(
image:
DecorationImage
(
image:
AssetImage
(
"assets/images/bg-medapp.png"
),
fit:
BoxFit
.
fill
,
)),
height:
screenSize
.
height
,
width:
screenSize
.
width
,
padding:
EdgeInsets
.
only
(
left:
screenSize
.
width
*
0.15
,
top:
screenSize
.
height
*
0.13
,
bottom:
screenSize
.
height
*
0.13
),
child:
Stack
(
children:
[
Container
(
decoration:
BoxDecoration
(
color:
const
Color
.
fromARGB
(
255
,
10
,
116
,
255
),
borderRadius:
BorderRadius
.
circular
(
20
),
border:
Border
.
all
(
width:
5
,
color:
const
Color
.
fromARGB
(
255
,
10
,
116
,
255
),
),
boxShadow:
[
BoxShadow
(
color:
const
Color
.
fromARGB
(
255
,
10
,
116
,
255
)
.
withAlpha
(
60
),
blurRadius:
15.0
,
spreadRadius:
20.0
,
offset:
const
Offset
(
0.0
,
3.0
,
),
),
]),
child:
Form
(
key:
formKey
,
),
width:
screenSize
.
width
*
0.36
,
height:
screenSize
.
height
*
0.9
,
child:
Image
.
asset
(
"assets/logo/eksad.jpg"
,
),
),
Padding
(
padding:
EdgeInsets
.
only
(
left:
screenSize
.
width
*
0.33
,
top:
screenSize
.
height
*
0.07
),
child:
Container
(
padding:
EdgeInsets
.
only
(
left:
screenSize
.
width
*
0.045
,
top:
screenSize
.
height
*
0.05
),
width:
screenSize
.
width
*
0.36
,
height:
screenSize
.
height
*
0.9
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Container
(
padding:
EdgeInsets
.
only
(
left:
screenSize
.
width
*
0.055
),
height:
screenSize
.
width
*
0.02
,
child:
Image
.
asset
(
"assets/logo/medapp-logo.png"
),
width:
screenSize
.
width
*
0.3
,
height:
screenSize
.
height
*
0.6
,
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
border:
Border
.
all
(
width:
5
,
color:
const
Color
.
fromARGB
(
255
,
10
,
116
,
255
),
),
const
Spacer
(
flex:
1
,
),
Row
(
children:
[
Icon
(
Icons
.
email_outlined
,
color:
Colors
.
grey
[
500
]
,
size:
screenSize
.
width
*
0.01
,
boxShadow:
[
BoxShadow
(
color:
const
Color
.
fromARGB
(
255
,
10
,
116
,
255
)
.
withAlpha
(
60
),
blurRadius:
15.0
,
spreadRadius:
20.0
,
offset:
const
Offset
(
0.0
,
3.0
,
),
const
SizedBox
(
width:
10
,
),
const
Text
(
"Email"
),
],
),
const
Spacer
(
flex:
1
,
),
Container
(
height:
40
,
width:
screenSize
.
width
*
0.2
,
child:
TextFormField
(
controller:
_editingController
,
textAlign:
TextAlign
.
start
,
decoration:
InputDecoration
(
labelText:
"Enter Your Email"
,
hintStyle:
const
TextStyle
(),
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
5.0
),
),
),
validator:
(
value
)
{
if
(
value
==
null
||
value
.
trim
().
isEmpty
)
{
_editingController
.
clear
();
return
"please enter your email address"
;
}
else
if
(!
RegExp
(
r'\S+@\S+\.\S+'
)
.
hasMatch
(
value
))
{
return
'Please enter a valid email address'
;
}
else
{
return
null
;
}
},
onChanged:
(
value
)
=>
_usmail
=
value
,
),
),
const
Spacer
(
flex:
2
,
),
Row
(
]),
child:
Form
(
key:
formKey
,
child:
Container
(
padding:
EdgeInsets
.
only
(
left:
screenSize
.
width
*
0.045
,
top:
screenSize
.
height
*
0.05
),
width:
screenSize
.
width
*
0.36
,
height:
screenSize
.
height
*
0.9
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Icon
(
Icons
.
vpn_key_outlined
,
color:
Colors
.
grey
[
500
],
size:
screenSize
.
width
*
0.01
,
Container
(
padding:
EdgeInsets
.
only
(
left:
screenSize
.
width
*
0.055
),
height:
screenSize
.
width
*
0.02
,
child:
Image
.
asset
(
"assets/logo/medapp-logo.png"
),
),
const
S
izedBox
(
width:
10
,
const
S
pacer
(
flex:
1
,
),
const
Text
(
"Password"
),
],
),
const
Spacer
(
flex:
1
,
),
Container
(
height:
40
,
width:
screenSize
.
width
*
0.2
,
child:
TextFormField
(
controller:
_editingController2
,
textAlign:
TextAlign
.
start
,
obscureText:
_isObscure
,
decoration:
InputDecoration
(
labelText:
"Password"
,
suffixIcon:
IconButton
(
icon:
Icon
(
_isObscure
?
Icons
.
visibility
:
Icons
.
visibility_off
),
onPressed:
()
{
setState
(
()
{
_isObscure
=
!
_isObscure
;
},
);
},
),
hintStyle:
const
TextStyle
(),
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
5.0
)),
Row
(
children:
[
Icon
(
Icons
.
email_outlined
,
color:
Colors
.
grey
[
500
],
size:
screenSize
.
width
*
0.01
,
),
const
SizedBox
(
width:
10
,
),
const
Text
(
"Email"
),
],
),
const
Spacer
(
flex:
1
,
),
validator:
(
value
)
{
if
(
value
==
null
||
value
.
trim
().
isEmpty
)
{
_editingController2
.
clear
();
return
'This field is required'
;
}
else
if
(
value
.
trim
().
length
<
8
)
{
return
'Password must be at least 8 characters in length'
;
}
return
null
;
},
onChanged:
(
value
)
=>
_uspswd
=
value
,
),
),
const
Spacer
(
flex:
2
,
),
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
end
,
mainAxisAlignment:
MainAxisAlignment
.
end
,
children:
[
TextButton
(
onPressed:
(){
Navigator
.
pushNamed
(
context
,
'/reset_password'
);
},
child:
Text
(
'Forgot Password?'
)),
SizedBox
(
width:
52
,)
],
),
const
Spacer
(
flex:
2
,
),
Row
(
children:
[
Container
(
height:
30
,
width:
screenSize
.
width
*
0.08
,
child:
ElevatedButton
(
onPressed:
()
{
if
(
_usmail
==
'admin@admin.com'
&&
_uspswd
!=
'administrator'
)
{
showDialog
<
String
>(
context:
context
,
builder:
(
BuildContext
context
)
=>
AlertDialog
(
title:
const
Text
(
'Gagal login'
),
content:
const
Text
(
'Password anda salah!!!'
),
actions:
<
Widget
>[
TextButton
(
onPressed:
()
=>
Navigator
.
pop
(
context
,
'OK'
),
child:
const
Text
(
'OK'
),
),
],
),
);
}
else
if
(
_usmail
==
'client@client.com'
&&
_uspswd
!=
'clientpage'
)
{
showDialog
<
String
>(
context:
context
,
builder:
(
BuildContext
context
)
=>
AlertDialog
(
title:
const
Text
(
'Gagal login'
),
content:
const
Text
(
'Password anda salah!!!'
),
actions:
<
Widget
>[
TextButton
(
onPressed:
()
=>
Navigator
.
pop
(
context
,
'OK'
),
child:
const
Text
(
'OK'
),
),
],
),
);
}
else
if
(
_usmail
==
'admin@admin.com'
&&
_uspswd
==
'administrator'
)
{
Navigator
.
pushNamed
(
context
,
'/admin'
);
}
else
if
(
_usmail
==
'client@client.com'
&&
_uspswd
==
'clientpage'
)
{
Navigator
.
pushNamed
(
context
,
'/client'
);
height:
40
,
width:
screenSize
.
width
*
0.2
,
child:
TextFormField
(
controller:
_editingController
,
textAlign:
TextAlign
.
start
,
decoration:
InputDecoration
(
labelText:
"Enter Your Email"
,
hintStyle:
const
TextStyle
(),
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
5.0
),
),
),
validator:
(
value
)
{
if
(
value
==
null
||
value
.
trim
().
isEmpty
)
{
_editingController
.
clear
();
return
"please enter your email address"
;
}
else
if
(!
RegExp
(
r'\S+@\S+\.\S+'
)
.
hasMatch
(
value
))
{
return
'Please enter a valid email address'
;
}
else
{
showDialog
<
String
>(
context:
context
,
builder:
(
BuildContext
context
)
=>
AlertDialog
(
title:
const
Text
(
'Gagal login'
),
content:
const
Text
(
'Akun Belum terdaftar, Silahkan Registrasi'
),
actions:
<
Widget
>[
TextButton
(
onPressed:
()
=>
Navigator
.
pop
(
context
,
'OK'
),
child:
const
Text
(
'OK'
),
),
],
),
);
return
null
;
}
},
child:
const
Text
(
"LOGIN"
)
,
onChanged:
(
value
)
=>
_usmail
=
value
,
),
),
SizedBox
(
width:
screenSize
.
width
*
0.04
,
const
Spacer
(
flex:
2
,
),
Row
(
children:
[
Icon
(
Icons
.
vpn_key_outlined
,
color:
Colors
.
grey
[
500
],
size:
screenSize
.
width
*
0.01
,
),
const
SizedBox
(
width:
10
,
),
const
Text
(
"Password"
),
],
),
const
Spacer
(
flex:
1
,
),
Container
(
height:
30
,
width:
screenSize
.
width
*
0.08
,
child:
ElevatedButton
(
onPressed:
()
{
Navigator
.
pushNamed
(
context
,
'/register'
);
height:
40
,
width:
screenSize
.
width
*
0.2
,
child:
TextFormField
(
controller:
_editingController2
,
textAlign:
TextAlign
.
start
,
obscureText:
_isObscure
,
decoration:
InputDecoration
(
labelText:
"Password"
,
suffixIcon:
IconButton
(
icon:
Icon
(
_isObscure
?
Icons
.
visibility
:
Icons
.
visibility_off
),
onPressed:
()
{
setState
(
()
{
_isObscure
=
!
_isObscure
;
},
);
},
),
hintStyle:
const
TextStyle
(),
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
5.0
)),
),
validator:
(
value
)
{
if
(
value
==
null
||
value
.
trim
().
isEmpty
)
{
_editingController2
.
clear
();
return
'This field is required'
;
}
else
if
(
value
.
trim
().
length
<
8
)
{
return
'Password must be at least 8 characters in length'
;
}
return
null
;
},
child:
const
Text
(
"REGISTER"
)
,
onChanged:
(
value
)
=>
_uspswd
=
value
,
),
),
const
Spacer
(
flex:
2
,
),
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
end
,
mainAxisAlignment:
MainAxisAlignment
.
end
,
children:
[
TextButton
(
onPressed:
(){
Navigator
.
pushNamed
(
context
,
'/reset_password'
);
},
child:
Text
(
'Forgot Password?'
)),
SizedBox
(
width:
52
,)
],
),
const
Spacer
(
flex:
2
,
),
Row
(
children:
[
Container
(
height:
30
,
width:
screenSize
.
width
*
0.08
,
child:
ElevatedButton
(
onPressed:
()
{
if
(
_usmail
==
'admin@admin.com'
&&
_uspswd
!=
'administrator'
)
{
showDialog
<
String
>(
context:
context
,
builder:
(
BuildContext
context
)
=>
AlertDialog
(
title:
const
Text
(
'Gagal login'
),
content:
const
Text
(
'Password anda salah!!!'
),
actions:
<
Widget
>[
TextButton
(
onPressed:
()
=>
Navigator
.
pop
(
context
,
'OK'
),
child:
const
Text
(
'OK'
),
),
],
),
);
}
else
if
(
_usmail
==
'client@client.com'
&&
_uspswd
!=
'clientpage'
)
{
showDialog
<
String
>(
context:
context
,
builder:
(
BuildContext
context
)
=>
AlertDialog
(
title:
const
Text
(
'Gagal login'
),
content:
const
Text
(
'Password anda salah!!!'
),
actions:
<
Widget
>[
TextButton
(
onPressed:
()
=>
Navigator
.
pop
(
context
,
'OK'
),
child:
const
Text
(
'OK'
),
),
],
),
);
}
else
if
(
_usmail
==
'admin@admin.com'
&&
_uspswd
==
'administrator'
)
{
Navigator
.
pushNamed
(
context
,
'/admin'
);
}
else
if
(
_usmail
==
'client@client.com'
&&
_uspswd
==
'clientpage'
)
{
Navigator
.
pushNamed
(
context
,
'/client'
);
}
else
{
showDialog
<
String
>(
context:
context
,
builder:
(
BuildContext
context
)
=>
AlertDialog
(
title:
const
Text
(
'Gagal login'
),
content:
const
Text
(
'Akun Belum terdaftar, Silahkan Registrasi'
),
actions:
<
Widget
>[
TextButton
(
onPressed:
()
=>
Navigator
.
pop
(
context
,
'OK'
),
child:
const
Text
(
'OK'
),
),
],
),
);
}
},
child:
const
Text
(
"LOGIN"
),
),
),
SizedBox
(
width:
screenSize
.
width
*
0.04
,
),
Container
(
height:
30
,
width:
screenSize
.
width
*
0.08
,
child:
ElevatedButton
(
onPressed:
()
{
Navigator
.
pushNamed
(
context
,
'/register'
);
},
child:
const
Text
(
"REGISTER"
),
),
),
],
),
const
Spacer
(
flex:
7
,
),
],
),
const
Spacer
(
flex:
7
,
),
],
),
),
),
),
)
,
]
,
),
],
),
),
Padding
(
padding:
const
EdgeInsets
.
all
(
21.0
),
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