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
b336e561
Commit
b336e561
authored
Jul 14, 2023
by
Dio Maulana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pakai lat long awal
parent
538f8f4f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
api.dart
lib/api/api.dart
+6
-7
No files found.
lib/api/api.dart
View file @
b336e561
...
@@ -10,7 +10,6 @@ import 'package:excelso_attendance/models/profile.dart';
...
@@ -10,7 +10,6 @@ import 'package:excelso_attendance/models/profile.dart';
import
'package:excelso_attendance/models/shift.dart'
;
import
'package:excelso_attendance/models/shift.dart'
;
import
'package:excelso_attendance/resource/constanta_string.dart'
;
import
'package:excelso_attendance/resource/constanta_string.dart'
;
import
'package:excelso_attendance/resource/strings.dart'
;
import
'package:excelso_attendance/resource/strings.dart'
;
import
'package:geolocator/geolocator.dart'
;
import
'package:get_ip_address/get_ip_address.dart'
;
import
'package:get_ip_address/get_ip_address.dart'
;
import
'package:http/http.dart'
as
http
;
import
'package:http/http.dart'
as
http
;
import
'package:flutter/foundation.dart'
show
kIsWeb
;
import
'package:flutter/foundation.dart'
show
kIsWeb
;
...
@@ -151,7 +150,7 @@ class Api {
...
@@ -151,7 +150,7 @@ class Api {
String
branchId
,
String
nik
,
String
shiftId
,
String
photoBase64
,
String
branchId
,
String
nik
,
String
shiftId
,
String
photoBase64
,
{
int
forceSubmit
=
0
})
async
{
{
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
);
dynamic
dataIp
=
await
ipAddress
.
getIpAddress
();
dynamic
dataIp
=
await
ipAddress
.
getIpAddress
();
DeviceInfoPlugin
deviceInfo
=
DeviceInfoPlugin
();
DeviceInfoPlugin
deviceInfo
=
DeviceInfoPlugin
();
...
@@ -166,8 +165,8 @@ class Api {
...
@@ -166,8 +165,8 @@ class Api {
"brand_code"
:
brandCode
,
"brand_code"
:
brandCode
,
"nik"
:
nik
,
"nik"
:
nik
,
"shift_id"
:
shiftId
,
"shift_id"
:
shiftId
,
"user_lat"
:
position
.
latitude
,
"user_lat"
:
getLatitude
()
,
"user_long"
:
position
.
longitude
,
"user_long"
:
getLongitude
()
,
"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
,
...
@@ -218,7 +217,7 @@ class Api {
...
@@ -218,7 +217,7 @@ class Api {
{
int
forceSubmit
=
0
})
async
{
{
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();
IpAddress
ipAddress
=
IpAddress
(
type:
RequestType
.
json
);
IpAddress
ipAddress
=
IpAddress
(
type:
RequestType
.
json
);
dynamic
dataIp
=
await
ipAddress
.
getIpAddress
();
dynamic
dataIp
=
await
ipAddress
.
getIpAddress
();
DeviceInfoPlugin
deviceInfo
=
DeviceInfoPlugin
();
DeviceInfoPlugin
deviceInfo
=
DeviceInfoPlugin
();
...
@@ -232,8 +231,8 @@ class Api {
...
@@ -232,8 +231,8 @@ class Api {
"branch_id"
:
branchId
,
"branch_id"
:
branchId
,
"brand_code"
:
brandCode
,
"brand_code"
:
brandCode
,
"nik"
:
nik
,
"nik"
:
nik
,
"user_lat"
:
position
.
latitude
,
"user_lat"
:
getLatitude
()
,
"user_long"
:
position
.
longitude
,
"user_long"
:
getLongitude
()
,
"photo_base64"
:
photoBase64
,
"photo_base64"
:
photoBase64
,
"ip"
:
dataIp
[
'ip'
],
"ip"
:
dataIp
[
'ip'
],
"user_agent"
:
userAgent
,
"user_agent"
:
userAgent
,
...
...
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