Commit 1150a8b4 authored by Dio Maulana's avatar Dio Maulana

tambah dialog konfirmasi ketika submit dia out of range

parent 80696031
......@@ -148,7 +148,8 @@ class Api {
}
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";
Position position = await Geolocator.getCurrentPosition();
IpAddress ipAddress = IpAddress(type: RequestType.json);
......@@ -170,6 +171,7 @@ class Api {
"photo_base64": "data:image/jpeg;base64,$photoBase64",
"ip": dataIp['ip'],
"user_agent": userAgent,
"forced_submit": forceSubmit,
};
String bodies = jsonEncode(data);
dynamic jsonObject =
......@@ -202,6 +204,7 @@ class Api {
return ApiResponse(
error: true,
msg: jsonObject['msg'],
code: jsonObject['code'],
);
}
}
......@@ -211,7 +214,8 @@ class Api {
}
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";
Position position = await Geolocator.getCurrentPosition();
......@@ -233,6 +237,7 @@ class Api {
"photo_base64": photoBase64,
"ip": dataIp['ip'],
"user_agent": userAgent,
"forced_submit": forceSubmit,
};
String bodies = jsonEncode(data);
dynamic jsonObject =
......@@ -260,6 +265,7 @@ class Api {
return ApiResponse(
error: true,
msg: jsonObject['msg'],
code: jsonObject['code'],
);
}
}
......@@ -316,10 +322,12 @@ class ApiResponse {
bool error;
String msg;
dynamic data;
String code;
ApiResponse({
required this.error,
required this.msg,
this.data,
this.code = "",
});
}
......@@ -14,6 +14,7 @@ Future<dynamic> modalDialogGlobal({
bool isActiveCancelButton = false,
bool isCustomSecondButton = false,
String customSecondButtonText = '',
String cancelButtonText = "Batal",
Widget? navigateToCustomButton,
}) async {
return showDialog(
......@@ -61,8 +62,8 @@ Future<dynamic> modalDialogGlobal({
onTap: () {
tapButtonCancel!();
},
child: const CustomButton(
text: "Batal",
child: CustomButton(
text: cancelButtonText,
colorButton: Colors.transparent,
colorText: Colors.black,
),
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment