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
1150a8b4
Commit
1150a8b4
authored
Jul 06, 2023
by
Dio Maulana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tambah dialog konfirmasi ketika submit dia out of range
parent
80696031
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
209 additions
and
548 deletions
+209
-548
api.dart
lib/api/api.dart
+10
-2
modal_dialog.dart
lib/helper/modal_dialog.dart
+3
-2
absent_camera.dart
lib/page/absent_camera/absent_camera.dart
+196
-544
No files found.
lib/api/api.dart
View file @
1150a8b4
...
@@ -148,7 +148,8 @@ class Api {
...
@@ -148,7 +148,8 @@ class Api {
}
}
static
Future
<
ApiResponse
>
shiftIn
(
static
Future
<
ApiResponse
>
shiftIn
(
String
branchId
,
String
nik
,
String
shiftId
,
String
photoBase64
)
async
{
String
branchId
,
String
nik
,
String
shiftId
,
String
photoBase64
,
{
int
forceSubmit
=
0
})
async
{
String
apiUrl
=
"
$baseUrl${endPoint}
clock_in"
;
String
apiUrl
=
"
$baseUrl${endPoint}
clock_in"
;
Position
position
=
await
Geolocator
.
getCurrentPosition
();
Position
position
=
await
Geolocator
.
getCurrentPosition
();
IpAddress
ipAddress
=
IpAddress
(
type:
RequestType
.
json
);
IpAddress
ipAddress
=
IpAddress
(
type:
RequestType
.
json
);
...
@@ -170,6 +171,7 @@ class Api {
...
@@ -170,6 +171,7 @@ class Api {
"photo_base64"
:
"data:image/jpeg;base64,
$photoBase64
"
,
"photo_base64"
:
"data:image/jpeg;base64,
$photoBase64
"
,
"ip"
:
dataIp
[
'ip'
],
"ip"
:
dataIp
[
'ip'
],
"user_agent"
:
userAgent
,
"user_agent"
:
userAgent
,
"forced_submit"
:
forceSubmit
,
};
};
String
bodies
=
jsonEncode
(
data
);
String
bodies
=
jsonEncode
(
data
);
dynamic
jsonObject
=
dynamic
jsonObject
=
...
@@ -202,6 +204,7 @@ class Api {
...
@@ -202,6 +204,7 @@ class Api {
return
ApiResponse
(
return
ApiResponse
(
error:
true
,
error:
true
,
msg:
jsonObject
[
'msg'
],
msg:
jsonObject
[
'msg'
],
code:
jsonObject
[
'code'
],
);
);
}
}
}
}
...
@@ -211,7 +214,8 @@ class Api {
...
@@ -211,7 +214,8 @@ class Api {
}
}
static
Future
<
ApiResponse
>
shiftOut
(
static
Future
<
ApiResponse
>
shiftOut
(
String
branchId
,
String
nik
,
String
photoBase64
)
async
{
String
branchId
,
String
nik
,
String
photoBase64
,
{
int
forceSubmit
=
0
})
async
{
String
apiUrl
=
"
$baseUrl${endPoint}
clock_out"
;
String
apiUrl
=
"
$baseUrl${endPoint}
clock_out"
;
Position
position
=
await
Geolocator
.
getCurrentPosition
();
Position
position
=
await
Geolocator
.
getCurrentPosition
();
...
@@ -233,6 +237,7 @@ class Api {
...
@@ -233,6 +237,7 @@ class Api {
"photo_base64"
:
photoBase64
,
"photo_base64"
:
photoBase64
,
"ip"
:
dataIp
[
'ip'
],
"ip"
:
dataIp
[
'ip'
],
"user_agent"
:
userAgent
,
"user_agent"
:
userAgent
,
"forced_submit"
:
forceSubmit
,
};
};
String
bodies
=
jsonEncode
(
data
);
String
bodies
=
jsonEncode
(
data
);
dynamic
jsonObject
=
dynamic
jsonObject
=
...
@@ -260,6 +265,7 @@ class Api {
...
@@ -260,6 +265,7 @@ class Api {
return
ApiResponse
(
return
ApiResponse
(
error:
true
,
error:
true
,
msg:
jsonObject
[
'msg'
],
msg:
jsonObject
[
'msg'
],
code:
jsonObject
[
'code'
],
);
);
}
}
}
}
...
@@ -316,10 +322,12 @@ class ApiResponse {
...
@@ -316,10 +322,12 @@ class ApiResponse {
bool
error
;
bool
error
;
String
msg
;
String
msg
;
dynamic
data
;
dynamic
data
;
String
code
;
ApiResponse
({
ApiResponse
({
required
this
.
error
,
required
this
.
error
,
required
this
.
msg
,
required
this
.
msg
,
this
.
data
,
this
.
data
,
this
.
code
=
""
,
});
});
}
}
lib/helper/modal_dialog.dart
View file @
1150a8b4
...
@@ -14,6 +14,7 @@ Future<dynamic> modalDialogGlobal({
...
@@ -14,6 +14,7 @@ Future<dynamic> modalDialogGlobal({
bool
isActiveCancelButton
=
false
,
bool
isActiveCancelButton
=
false
,
bool
isCustomSecondButton
=
false
,
bool
isCustomSecondButton
=
false
,
String
customSecondButtonText
=
''
,
String
customSecondButtonText
=
''
,
String
cancelButtonText
=
"Batal"
,
Widget
?
navigateToCustomButton
,
Widget
?
navigateToCustomButton
,
})
async
{
})
async
{
return
showDialog
(
return
showDialog
(
...
@@ -61,8 +62,8 @@ Future<dynamic> modalDialogGlobal({
...
@@ -61,8 +62,8 @@ Future<dynamic> modalDialogGlobal({
onTap:
()
{
onTap:
()
{
tapButtonCancel
!();
tapButtonCancel
!();
},
},
child:
const
CustomButton
(
child:
CustomButton
(
text:
"Batal"
,
text:
cancelButtonText
,
colorButton:
Colors
.
transparent
,
colorButton:
Colors
.
transparent
,
colorText:
Colors
.
black
,
colorText:
Colors
.
black
,
),
),
...
...
lib/page/absent_camera/absent_camera.dart
View file @
1150a8b4
This diff is collapsed.
Click to expand it.
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