Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
Crm Attendance
Project
Project
Details
Activity
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
Dio Maulana
Crm Attendance
Commits
31fdd25c
Commit
31fdd25c
authored
Jun 12, 2023
by
Dio Maulana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perbaikan dialog absen home
parent
8434da32
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
50 deletions
+73
-50
modal_dialog.dart
lib/helper/modal_dialog.dart
+5
-4
absent_camera.dart
lib/page/absent_camera/absent_camera.dart
+4
-4
home.dart
lib/page/home/home.dart
+59
-39
strings.dart
lib/resource/strings.dart
+5
-3
No files found.
lib/helper/modal_dialog.dart
View file @
31fdd25c
...
@@ -9,7 +9,8 @@ Future<dynamic> modalDialogGlobal({
...
@@ -9,7 +9,8 @@ Future<dynamic> modalDialogGlobal({
required
String
title
,
required
String
title
,
required
String
contentBody
,
required
String
contentBody
,
required
String
buttonText
,
required
String
buttonText
,
required
void
Function
()
tapButton
,
required
void
Function
()
tapButtonOk
,
void
Function
()?
tapButtonCancel
,
bool
isActiveCancelButton
=
false
,
bool
isActiveCancelButton
=
false
,
bool
isCustomSecondButton
=
false
,
bool
isCustomSecondButton
=
false
,
String
customSecondButtonText
=
''
,
String
customSecondButtonText
=
''
,
...
@@ -49,7 +50,7 @@ Future<dynamic> modalDialogGlobal({
...
@@ -49,7 +50,7 @@ Future<dynamic> modalDialogGlobal({
),
),
InkWell
(
InkWell
(
onTap:
()
{
onTap:
()
{
tapButton
();
tapButton
Ok
();
},
},
child:
CustomButton
(
child:
CustomButton
(
text:
buttonText
,
text:
buttonText
,
...
@@ -58,10 +59,10 @@ Future<dynamic> modalDialogGlobal({
...
@@ -58,10 +59,10 @@ Future<dynamic> modalDialogGlobal({
(
isActiveCancelButton
)
(
isActiveCancelButton
)
?
InkWell
(
?
InkWell
(
onTap:
()
{
onTap:
()
{
Navigator
.
pop
(
context
);
tapButtonCancel
!(
);
},
},
child:
const
CustomButton
(
child:
const
CustomButton
(
text:
"
Cance
l"
,
text:
"
Bata
l"
,
colorButton:
Colors
.
transparent
,
colorButton:
Colors
.
transparent
,
colorText:
Colors
.
black
,
colorText:
Colors
.
black
,
),
),
...
...
lib/page/absent_camera/absent_camera.dart
View file @
31fdd25c
...
@@ -149,7 +149,7 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
...
@@ -149,7 +149,7 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
title:
"Error"
,
title:
"Error"
,
contentBody:
"
$e
"
,
contentBody:
"
$e
"
,
buttonText:
"OK"
,
buttonText:
"OK"
,
tapButton:
()
{
tapButton
Ok
:
()
{
Navigator
.
pop
(
context
);
Navigator
.
pop
(
context
);
},
},
);
);
...
@@ -216,7 +216,7 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
...
@@ -216,7 +216,7 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
title:
"Error"
,
title:
"Error"
,
contentBody:
"
$e
"
,
contentBody:
"
$e
"
,
buttonText:
"OK"
,
buttonText:
"OK"
,
tapButton:
()
{
tapButton
Ok
:
()
{
Navigator
.
pop
(
context
);
Navigator
.
pop
(
context
);
},
},
);
);
...
@@ -414,7 +414,7 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
...
@@ -414,7 +414,7 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
title:
"Gagal"
,
title:
"Gagal"
,
contentBody:
apiResponse
.
msg
,
contentBody:
apiResponse
.
msg
,
buttonText:
"OK"
,
buttonText:
"OK"
,
tapButton:
()
{
tapButton
Ok
:
()
{
Navigator
.
pop
(
context
);
Navigator
.
pop
(
context
);
},
},
);
);
...
@@ -451,7 +451,7 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
...
@@ -451,7 +451,7 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
title:
"Gagal"
,
title:
"Gagal"
,
contentBody:
apiResponse
.
msg
,
contentBody:
apiResponse
.
msg
,
buttonText:
"OK"
,
buttonText:
"OK"
,
tapButton:
()
{
tapButton
Ok
:
()
{
Navigator
.
pop
(
context
);
Navigator
.
pop
(
context
);
},
},
);
);
...
...
lib/page/home/home.dart
View file @
31fdd25c
...
@@ -357,24 +357,13 @@ class _BodyWidgetState extends State<BodyWidget> {
...
@@ -357,24 +357,13 @@ class _BodyWidgetState extends State<BodyWidget> {
title:
"Gagal"
,
title:
"Gagal"
,
contentBody:
apiResponse
.
msg
,
contentBody:
apiResponse
.
msg
,
buttonText:
"Ok"
,
buttonText:
"Ok"
,
tapButton:
()
{
tapButton
Ok
:
()
{
Navigator
.
pop
(
context
);
Navigator
.
pop
(
context
);
});
});
}
else
{
}
else
{
ProfileModel
profileUser
=
ProfileModel
profileUser
=
apiResponse
.
data
as
ProfileModel
;
apiResponse
.
data
as
ProfileModel
;
// if (profileUser.attendanceOut) {
// modalDialogGlobal(
// context: context,
// size: MediaQuery.of(context).size,
// title: "Gagal",
// contentBody: Strings.alreadyOut,
// buttonText: "Ok",
// tapButton: () {
// Navigator.pop(context);
// });
// return;
// }
if
(
profileUser
.
attendanceIn
==
false
)
{
if
(
profileUser
.
attendanceIn
==
false
)
{
modalDialogGlobal
(
modalDialogGlobal
(
context:
context
,
context:
context
,
...
@@ -382,22 +371,38 @@ class _BodyWidgetState extends State<BodyWidget> {
...
@@ -382,22 +371,38 @@ class _BodyWidgetState extends State<BodyWidget> {
title:
"Gagal"
,
title:
"Gagal"
,
contentBody:
Strings
.
outButNotIn
,
contentBody:
Strings
.
outButNotIn
,
buttonText:
"Ok"
,
buttonText:
"Ok"
,
tapButton:
()
{
tapButton
Ok
:
()
{
Navigator
.
pop
(
context
);
Navigator
.
pop
(
context
);
});
});
return
;
return
;
}
}
if
(
profileUser
.
attendanceOut
)
{
modalDialogGlobal
(
context:
context
,
size:
MediaQuery
.
of
(
context
).
size
,
title:
"Gagal"
,
contentBody:
Strings
.
alreadyOut
,
buttonText:
"Ok"
,
tapButtonOk:
()
{
Navigator
.
pushNamed
(
Navigator
.
pushNamed
(
context
,
context
,
Routes
.
absentCamera
,
Routes
.
absentCamera
,
arguments:
AbsentCameraArguments
(
arguments:
AbsentCameraArguments
(
isIn:
false
,
isIn:
false
,
branchModel:
branchModel:
widget
widget
.
nearestBranch
[
selectedOutlet
],
.
nearestBranch
[
selectedOutlet
],
profile:
profileUser
,
profile:
profileUser
,
nik:
nikUser
,
nik:
nikUser
,
),
),
);
);
},
isActiveCancelButton:
true
,
tapButtonCancel:
()
{
Navigator
.
pop
(
context
);
},
);
return
;
}
}
}
});
});
}
}
...
@@ -1015,25 +1020,40 @@ class _WidgetSelectShiftState extends State<WidgetSelectShift> {
...
@@ -1015,25 +1020,40 @@ class _WidgetSelectShiftState extends State<WidgetSelectShift> {
title:
"Gagal"
,
title:
"Gagal"
,
contentBody:
apiResponse
.
msg
,
contentBody:
apiResponse
.
msg
,
buttonText:
"Ok"
,
buttonText:
"Ok"
,
tapButton:
()
{
tapButton
Ok
:
()
{
Navigator
.
pop
(
context
);
Navigator
.
pop
(
context
);
Navigator
.
pop
(
context
);
Navigator
.
pop
(
context
);
});
});
}
else
{
}
else
{
ProfileModel
profileUser
=
apiResponse
.
data
as
ProfileModel
;
ProfileModel
profileUser
=
apiResponse
.
data
as
ProfileModel
;
// if (profileUser.attendanceIn) {
if
(
profileUser
.
attendanceIn
)
{
// modalDialogGlobal(
modalDialogGlobal
(
// context: context,
context:
context
,
// size: MediaQuery.of(context).size,
size:
MediaQuery
.
of
(
context
).
size
,
// title: "Gagal",
title:
"Gagal"
,
// contentBody: Strings.alreadyIn,
contentBody:
Strings
.
alreadyIn
,
// buttonText: "Ok",
buttonText:
"Ok"
,
// tapButton: () {
tapButtonOk:
()
{
// Navigator.pop(context);
Navigator
.
popAndPushNamed
(
// Navigator.pop(context);
context
,
// });
Routes
.
absentCamera
,
// return;
arguments:
AbsentCameraArguments
(
// }
isIn:
true
,
branchModel:
widget
.
branchModel
,
shiftModel:
widget
.
shiftList
[
selectedShift
!],
profile:
profileUser
,
nik:
widget
.
nik
,
),
);
},
tapButtonCancel:
()
{
Navigator
.
pop
(
context
);
Navigator
.
pop
(
context
);
},
isActiveCancelButton:
true
,
);
return
;
}
Navigator
.
popAndPushNamed
(
Navigator
.
popAndPushNamed
(
context
,
context
,
Routes
.
absentCamera
,
Routes
.
absentCamera
,
...
...
lib/resource/strings.dart
View file @
31fdd25c
...
@@ -15,7 +15,9 @@ class Strings {
...
@@ -15,7 +15,9 @@ class Strings {
static
String
pleaseWait
=
"Please wait..."
;
static
String
pleaseWait
=
"Please wait..."
;
static
String
cameraNotMounted
=
"Kamera tidak berhasil di load"
;
static
String
cameraNotMounted
=
"Kamera tidak berhasil di load"
;
static
String
alreadyIn
=
"Anda sudah melakukan absen masuk hari ini"
;
static
String
alreadyIn
=
static
String
alreadyOut
=
"Anda sudah melakukan absen keluar hari ini"
;
"Anda sudah melakukan absen masuk hari ini, yakin ingin absen ulang ?"
;
static
String
outButNotIn
=
"Anda belum melaukan absen masuk"
;
static
String
alreadyOut
=
"Anda sudah melakukan absen keluar hari ini, yakin ingin absen ulang ?"
;
static
String
outButNotIn
=
"Anda belum melakukan absen masuk"
;
}
}
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