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
297a0bd5
Commit
297a0bd5
authored
Sep 05, 2022
by
qorri_di
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing login
- delete variabel yang tidak digunain.
parent
163106e3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
23 deletions
+19
-23
login.dart
lib/login.dart
+18
-22
main.dart
lib/main.dart
+1
-1
No files found.
lib/login.dart
View file @
297a0bd5
...
...
@@ -8,21 +8,19 @@ void setPageTitle(String title, BuildContext context) {
));
}
class
logi
n
extends
StatefulWidget
{
const
logi
n
({
Key
?
key
})
:
super
(
key:
key
);
class
SignI
n
extends
StatefulWidget
{
const
SignI
n
({
Key
?
key
})
:
super
(
key:
key
);
@override
State
<
login
>
createState
()
=>
_logi
nState
();
State
<
SignIn
>
createState
()
=>
_SignI
nState
();
}
class
_
loginState
extends
State
<
logi
n
>
{
class
_
SignInState
extends
State
<
SignI
n
>
{
bool
_isObscure
=
true
;
final
formKey
=
GlobalKey
<
FormState
>();
String
_usmail
=
''
;
String
_uspswd
=
''
;
final
TextEditingController
_editingController
=
TextEditingController
();
final
TextEditingController
_editingController2
=
TextEditingController
();
final
TextEditingController
_usernamecontroller
=
TextEditingController
();
final
TextEditingController
_passwordcontroller
=
TextEditingController
();
@override
Widget
build
(
BuildContext
context
)
{
...
...
@@ -123,7 +121,7 @@ class _loginState extends State<login> {
height:
40
,
width:
screenSize
.
width
*
0.2
,
child:
TextFormField
(
controller:
_
editingC
ontroller
,
controller:
_
usernamec
ontroller
,
textAlign:
TextAlign
.
start
,
decoration:
InputDecoration
(
labelText:
"Enter Your Email"
,
...
...
@@ -134,7 +132,7 @@ class _loginState extends State<login> {
),
validator:
(
value
)
{
if
(
value
==
null
||
value
.
trim
().
isEmpty
)
{
_
editingC
ontroller
.
clear
();
_
usernamec
ontroller
.
clear
();
return
"please enter your email address"
;
}
else
if
(!
RegExp
(
r'\S+@\S+\.\S+'
)
.
hasMatch
(
value
))
{
...
...
@@ -143,7 +141,6 @@ class _loginState extends State<login> {
return
null
;
}
},
onChanged:
(
value
)
=>
_usmail
=
value
,
),
),
const
Spacer
(
...
...
@@ -169,7 +166,7 @@ class _loginState extends State<login> {
height:
40
,
width:
screenSize
.
width
*
0.2
,
child:
TextFormField
(
controller:
_
editingController2
,
controller:
_
passwordcontroller
,
textAlign:
TextAlign
.
start
,
obscureText:
_isObscure
,
decoration:
InputDecoration
(
...
...
@@ -192,14 +189,13 @@ class _loginState extends State<login> {
),
validator:
(
value
)
{
if
(
value
==
null
||
value
.
trim
().
isEmpty
)
{
_
editingController2
.
clear
();
_
passwordcontroller
.
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
(
...
...
@@ -225,8 +221,8 @@ class _loginState extends State<login> {
width:
screenSize
.
width
*
0.08
,
child:
ElevatedButton
(
onPressed:
()
{
if
(
_us
mail
==
'admin@admin.com'
&&
_
uspswd
!=
'administrator'
)
{
if
(
_us
ernamecontroller
.
value
.
text
==
'admin@admin.com'
&&
_
passwordcontroller
.
value
.
text
!=
'administrator'
)
{
showDialog
<
String
>(
context:
context
,
builder:
(
BuildContext
context
)
=>
...
...
@@ -243,8 +239,8 @@ class _loginState extends State<login> {
],
),
);
}
else
if
(
_us
mail
==
'client@client.com'
&&
_
uspswd
!=
'clientpage'
)
{
}
else
if
(
_us
ernamecontroller
.
value
.
text
==
'client@client.com'
&&
_
passwordcontroller
.
value
.
text
!=
'clientpage'
)
{
showDialog
<
String
>(
context:
context
,
builder:
(
BuildContext
context
)
=>
...
...
@@ -261,11 +257,11 @@ class _loginState extends State<login> {
],
),
);
}
else
if
(
_us
mail
==
'admin@admin.com'
&&
_
uspswd
==
'administrator'
)
{
}
else
if
(
_us
ernamecontroller
.
value
.
text
==
'admin@admin.com'
&&
_
passwordcontroller
.
value
.
text
==
'administrator'
)
{
Navigator
.
pushNamed
(
context
,
'/admin'
);
}
else
if
(
_us
mail
==
'client@client.com'
&&
_
uspswd
==
'clientpage'
)
{
}
else
if
(
_us
ernamecontroller
.
value
.
text
==
'client@client.com'
&&
_
passwordcontroller
.
value
.
text
==
'clientpage'
)
{
Navigator
.
pushNamed
(
context
,
'/client'
);
}
else
{
showDialog
<
String
>(
...
...
lib/main.dart
View file @
297a0bd5
...
...
@@ -25,7 +25,7 @@ class MyApp extends StatelessWidget {
'/about'
:
(
context
)
=>
const
HomePage
(),
'/solutions'
:
(
context
)
=>
const
Solutions
(),
'/contact'
:
(
context
)
=>
const
ContactUs
(),
'/login'
:
(
context
)
=>
const
logi
n
(),
'/login'
:
(
context
)
=>
const
SignI
n
(),
'/register'
:
(
context
)
=>
const
Register
(),
'/dashboard'
:
(
context
)
=>
const
DashboardAdmin
(),
'/reset_password'
:
(
context
)
=>
const
ForgotPassword
(),
...
...
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