step 17 : proteksi presensi selfie button clock in & clock out
This commit is contained in:
@@ -66,6 +66,7 @@ class CheckPresensiJamNotifier extends StateNotifier<CheckPresensiJamState> {
|
||||
state = CheckPresensiJamStateDone(model: resp);
|
||||
} catch (e) {
|
||||
if (e is BaseRepositoryException) {
|
||||
print(e.message);
|
||||
state = CheckPresensiJamStateError(message: e.message ?? "");
|
||||
} else {
|
||||
state = CheckPresensiJamStateError(message: e.toString());
|
||||
|
||||
@@ -290,13 +290,14 @@ class PresensiSelfieScreen extends HookConsumerWidget {
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return CustomDialogPresensiSukses(
|
||||
isLoadingAddressUserLocation: isLoadingAddressUserLocation,
|
||||
isiPesan:
|
||||
'Pengajuan presensi telah diajukan, mohon menunggu approval team leader! ',
|
||||
messageStatus: 'Clock In Berhasil',
|
||||
);
|
||||
},
|
||||
);
|
||||
requestLocationPermission();
|
||||
// requestLocationPermission();
|
||||
}
|
||||
// else{
|
||||
// if(next.model == "WARNING"){
|
||||
@@ -323,13 +324,14 @@ class PresensiSelfieScreen extends HookConsumerWidget {
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return CustomDialogPresensiSukses(
|
||||
isLoadingAddressUserLocation: isLoadingAddressUserLocation,
|
||||
isiPesan:
|
||||
'Pengajuan presensi telah diajukan, mohon menunggu approval team leader! ',
|
||||
messageStatus: 'Clock Out Berhasil',
|
||||
);
|
||||
},
|
||||
);
|
||||
requestLocationPermission();
|
||||
// requestLocationPermission();
|
||||
}
|
||||
// else{
|
||||
// if(next.model == "WARNING"){
|
||||
@@ -796,42 +798,48 @@ class PresensiSelfieScreen extends HookConsumerWidget {
|
||||
// onPressed: () {
|
||||
// Navigator.of(context).pushNamed(homeRoute);
|
||||
// },
|
||||
onPressed: () {
|
||||
final T_TransactionM_StaffID =
|
||||
selectedUser?.model.staffId ?? "";
|
||||
final T_TransactionM_CompanyID =
|
||||
selectedUser?.model.companyId ?? "";
|
||||
final T_TransactionCurrentLatitude =
|
||||
positionLatitude.value;
|
||||
final T_TransactionCurrentLongitude =
|
||||
positionLongitude.value;
|
||||
final T_TransactionCurrentDistance =
|
||||
varCurrentDistanceProvider
|
||||
?.currentDistance ??
|
||||
"";
|
||||
final T_TransactionSelfiePhoto =
|
||||
fileDataBase64.value;
|
||||
final token = selectedUser?.token ?? "";
|
||||
onPressed: (fileDataBase64.value.isEmpty)
|
||||
? () {}
|
||||
: () {
|
||||
final T_TransactionM_StaffID =
|
||||
selectedUser?.model.staffId ?? "";
|
||||
final T_TransactionM_CompanyID =
|
||||
selectedUser?.model.companyId ??
|
||||
"";
|
||||
final T_TransactionCurrentLatitude =
|
||||
positionLatitude.value;
|
||||
final T_TransactionCurrentLongitude =
|
||||
positionLongitude.value;
|
||||
final T_TransactionCurrentDistance =
|
||||
varCurrentDistanceProvider
|
||||
?.currentDistance ??
|
||||
"";
|
||||
final T_TransactionSelfiePhoto =
|
||||
fileDataBase64.value;
|
||||
final token =
|
||||
selectedUser?.token ?? "";
|
||||
|
||||
showConfirmationDialog(
|
||||
context,
|
||||
T_TransactionM_StaffID,
|
||||
T_TransactionM_CompanyID,
|
||||
T_TransactionCurrentLatitude,
|
||||
T_TransactionCurrentLongitude,
|
||||
T_TransactionCurrentDistance,
|
||||
T_TransactionSelfiePhoto,
|
||||
token,
|
||||
"Clock In");
|
||||
showConfirmationDialog(
|
||||
context,
|
||||
T_TransactionM_StaffID,
|
||||
T_TransactionM_CompanyID,
|
||||
T_TransactionCurrentLatitude,
|
||||
T_TransactionCurrentLongitude,
|
||||
T_TransactionCurrentDistance,
|
||||
T_TransactionSelfiePhoto,
|
||||
token,
|
||||
"Clock In");
|
||||
|
||||
// print(
|
||||
// fileDataBase64.value,
|
||||
// );
|
||||
},
|
||||
// print(
|
||||
// fileDataBase64.value,
|
||||
// );
|
||||
},
|
||||
style: ButtonStyle(
|
||||
backgroundColor:
|
||||
MaterialStateColor.resolveWith(
|
||||
(st) => Constant.textOrange),
|
||||
MaterialStateColor.resolveWith((st) =>
|
||||
(fileDataBase64.value.isEmpty)
|
||||
? Constant.textDarkGrey
|
||||
: Constant.textOrange),
|
||||
shape: MaterialStateProperty.all<
|
||||
RoundedRectangleBorder>(
|
||||
RoundedRectangleBorder(
|
||||
@@ -917,41 +925,48 @@ class PresensiSelfieScreen extends HookConsumerWidget {
|
||||
// onPressed: () {
|
||||
// Navigator.of(context).pushNamed(homeRoute);
|
||||
// },
|
||||
onPressed: () {
|
||||
final T_TransactionM_StaffID =
|
||||
selectedUser?.model.staffId ?? "";
|
||||
final T_TransactionM_CompanyID =
|
||||
selectedUser?.model.companyId ?? "";
|
||||
final T_TransactionCurrentLatitude =
|
||||
positionLatitude.value;
|
||||
final T_TransactionCurrentLongitude =
|
||||
positionLongitude.value;
|
||||
final T_TransactionCurrentDistance =
|
||||
varCurrentDistanceProvider
|
||||
?.currentDistance ??
|
||||
"";
|
||||
final T_TransactionSelfiePhoto =
|
||||
fileDataBase64.value;
|
||||
final token = selectedUser?.token ?? "";
|
||||
onPressed: (fileDataBase64.value.isEmpty)
|
||||
? () {}
|
||||
: () {
|
||||
final T_TransactionM_StaffID =
|
||||
selectedUser?.model.staffId ??
|
||||
"";
|
||||
final T_TransactionM_CompanyID =
|
||||
selectedUser?.model.companyId ??
|
||||
"";
|
||||
final T_TransactionCurrentLatitude =
|
||||
positionLatitude.value;
|
||||
final T_TransactionCurrentLongitude =
|
||||
positionLongitude.value;
|
||||
final T_TransactionCurrentDistance =
|
||||
varCurrentDistanceProvider
|
||||
?.currentDistance ??
|
||||
"";
|
||||
final T_TransactionSelfiePhoto =
|
||||
fileDataBase64.value;
|
||||
final token =
|
||||
selectedUser?.token ?? "";
|
||||
|
||||
showConfirmationDialog(
|
||||
context,
|
||||
T_TransactionM_StaffID,
|
||||
T_TransactionM_CompanyID,
|
||||
T_TransactionCurrentLatitude,
|
||||
T_TransactionCurrentLongitude,
|
||||
T_TransactionCurrentDistance,
|
||||
T_TransactionSelfiePhoto,
|
||||
token,
|
||||
"Clock Out");
|
||||
// print(
|
||||
// fileDataBase64.value,
|
||||
// );
|
||||
},
|
||||
showConfirmationDialog(
|
||||
context,
|
||||
T_TransactionM_StaffID,
|
||||
T_TransactionM_CompanyID,
|
||||
T_TransactionCurrentLatitude,
|
||||
T_TransactionCurrentLongitude,
|
||||
T_TransactionCurrentDistance,
|
||||
T_TransactionSelfiePhoto,
|
||||
token,
|
||||
"Clock Out");
|
||||
// print(
|
||||
// fileDataBase64.value,
|
||||
// );
|
||||
},
|
||||
style: ButtonStyle(
|
||||
backgroundColor:
|
||||
MaterialStateColor.resolveWith(
|
||||
(st) => Constant.textOrange),
|
||||
MaterialStateColor.resolveWith((st) =>
|
||||
(fileDataBase64.value.isEmpty)
|
||||
? Constant.textDarkGrey
|
||||
: Constant.textOrange),
|
||||
shape: MaterialStateProperty.all<
|
||||
RoundedRectangleBorder>(
|
||||
RoundedRectangleBorder(
|
||||
|
||||
Reference in New Issue
Block a user