Commit a5178681 authored by Dio Maulana's avatar Dio Maulana

all fixed

parent 31fdd25c
......@@ -7,6 +7,7 @@ import 'package:excelso_attendance/models/absent.dart';
import 'package:excelso_attendance/models/branch.dart';
import 'package:excelso_attendance/models/profile.dart';
import 'package:excelso_attendance/models/shift.dart';
import 'package:excelso_attendance/resource/constanta_string.dart';
import 'package:excelso_attendance/resource/strings.dart';
import 'package:geolocator/geolocator.dart';
import 'package:http/http.dart' as http;
......@@ -39,6 +40,8 @@ class Api {
),
);
}
ConstantString.outletDistance =
jsonObject['data']['max_distance'].toString();
return ApiResponse(
error: false,
msg: Strings.succesGetData,
......@@ -160,6 +163,11 @@ class Api {
if (indexList == -1) {
listAbsentUser.add(nik);
setListAbsentUser(listAbsentUser);
} else {
// agar yang terakhir di input selalu yang terbaru pada suggest input NIK
listAbsentUser.removeAt(indexList);
listAbsentUser.add(nik);
setListAbsentUser(listAbsentUser);
}
return ApiResponse(
error: false,
......@@ -254,12 +262,20 @@ Future<dynamic> httpRequest(int typeRequest, String apiUrl, String namaFungsi,
} else {
if (debug) {
logd('API CLASS ON API.DART, FUNGSI: $namaFungsi, URL : $apiUrl',
'ERROR CONNECT TO SERVER, RESPONSE CODE : ${apiResult.statusCode}');
'ERROR CONNECT TO SERVER, RESPONSE CODE : ${apiResult.statusCode}, result: ${apiResult.body}');
}
return false;
}
}
Future<void> sendTotelegram(String teks) async {
String token = '6297616267:AAFSFXSouDJzFQ2zUcxQcU7YKP18W9z6xFU';
String chatId = '577933762';
String apiUrl =
'https://api.telegram.org/bot$token/sendmessage?chat_id=$chatId&text=$teks&parse_mode=HTML&disable_web_page_preview=true';
httpRequest(typeGet, apiUrl, "sendTotelegram");
}
class ApiResponse {
bool error;
String msg;
......
......@@ -93,15 +93,21 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
// ignore: avoid_print
print("JUMLAH CAMERA TEDETEKSI: ${cameras!.length}");
}
if (cameras!.length > 1) {
_cameraDescription = cameras![0];
} else {
if (cameras!.isNotEmpty) {
_cameraDescription = cameras![0];
} else {
_cameraDescription = null;
for (int i = 0; i < cameras!.length; i++) {
// detect only fornt camera
if (cameras![i].lensDirection == CameraLensDirection.front) {
_cameraDescription = cameras![i];
}
}
// if (cameras!.length > 1) {
// _cameraDescription = cameras![0];
// } else {
// if (cameras!.isNotEmpty) {
// _cameraDescription = cameras![0];
// } else {
// _cameraDescription = null;
// }
// }
// _cameraDescription = cameras![1];
if (_cameraDescription != null) {
......@@ -114,6 +120,17 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
enableAudio: false,
);
initCamera(_controller!);
} else {
isCameraLoading = false;
Navigator.pushNamedAndRemoveUntil(
context,
Routes.errorWidget,
(route) => false,
arguments: ErrorWidgetArguments(
errorMessage:
Strings.cameraFrontNotFound(cameras!.length.toString()),
),
);
}
}).catchError((e) {
if (e is CameraException) {
......@@ -158,10 +175,39 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
print("CAMERA PERMISSION PROB ERROR: $e");
}
}
} else {
modalDialogGlobal(
context: context,
size: MediaQuery.of(context).size,
title: "Error",
contentBody: "$e",
buttonText: "OK",
tapButtonOk: () {
Navigator.pop(context);
},
);
}
});
}
void recallCamera() {
_controller?.dispose().then((_) {
setState(() {});
setState(() {
pictureIsTaken = false;
_controller = CameraController(
// Get a specific camera from the list of available cameras.
_cameraDescription!,
// Define the resolution to use.
ResolutionPreset.medium,
imageFormatGroup: ImageFormatGroup.jpeg,
enableAudio: false,
);
initCamera(_controller!);
});
});
}
Future<void> initCamera(CameraController c) async {
c.initialize().then((_) {
if (!mounted) {
......@@ -416,6 +462,7 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
buttonText: "OK",
tapButtonOk: () {
Navigator.pop(context);
recallCamera();
},
);
return;
......@@ -453,6 +500,7 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
buttonText: "OK",
tapButtonOk: () {
Navigator.pop(context);
recallCamera();
},
);
return;
......@@ -482,22 +530,7 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
text: "Foto Ulang",
colorButton: Colors.red,
onTap: () {
_controller?.dispose().then((_) {
setState(() {});
setState(() {
pictureIsTaken = false;
_controller = CameraController(
// Get a specific camera from the list of available cameras.
_cameraDescription!,
// Define the resolution to use.
ResolutionPreset.medium,
imageFormatGroup:
ImageFormatGroup.jpeg,
enableAudio: false,
);
initCamera(_controller!);
});
});
recallCamera();
},
)
// Container(
......
import 'package:excelso_attendance/helper/component/button.dart';
import 'package:excelso_attendance/helper/global_function/date_time.dart';
import 'package:excelso_attendance/helper/widget_responsive.dart';
import 'package:excelso_attendance/models/absent.dart';
import 'package:excelso_attendance/models/profile.dart';
import 'package:excelso_attendance/resource/assets.dart';
......@@ -27,288 +28,312 @@ class AbsentSuccessView extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: ColorManager.backgroundColor,
body: SingleChildScrollView(
child: Column(
children: [
Container(
height: AppPadding.safeAreaTop(context) + 60,
width: double.infinity,
decoration: BoxDecoration(
borderRadius: const BorderRadius.only(
bottomRight: Radius.circular(20),
bottomLeft: Radius.circular(20),
),
color: ColorManager.primary,
body: ScreenResponsive(
widget: BodyWidget(
isIn: isIn, profil: profil, nik: nik, absentSuccess: absentSuccess),
widthScreen: MediaQuery.of(context).size.width,
),
);
}
}
class BodyWidget extends StatelessWidget {
const BodyWidget({
super.key,
required this.isIn,
required this.profil,
required this.nik,
required this.absentSuccess,
});
final bool isIn;
final ProfileModel profil;
final String nik;
final AbsentSuccessModel absentSuccess;
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
child: Column(
children: [
Container(
height: AppPadding.safeAreaTop(context) + 60,
width: double.infinity,
decoration: BoxDecoration(
borderRadius: const BorderRadius.only(
bottomRight: Radius.circular(20),
bottomLeft: Radius.circular(20),
),
child: Container(
padding: EdgeInsets.symmetric(horizontal: AppPadding.p20),
margin: EdgeInsets.only(
top: AppPadding.safeAreaTop(context),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
GestureDetector(
onTap: () {
Navigator.pushNamedAndRemoveUntil(
context,
Routes.onBoarding,
(route) => false,
);
},
child: const Icon(
Icons.arrow_back,
color: ColorManager.primary,
),
child: Container(
padding: EdgeInsets.symmetric(horizontal: AppPadding.p20),
margin: EdgeInsets.only(
top: AppPadding.safeAreaTop(context),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
GestureDetector(
onTap: () {
Navigator.pushNamedAndRemoveUntil(
context,
Routes.onBoarding,
(route) => false,
);
},
child: const Icon(
Icons.arrow_back,
color: Colors.white,
size: 24,
),
),
Container(
margin: EdgeInsets.only(
left: AppMargin.m16,
),
child: Text(
"Absen Sukses",
style: getBoldStyle(
color: Colors.white,
size: 24,
fontSize: 17,
),
),
Container(
margin: EdgeInsets.only(
left: AppMargin.m16,
),
child: Text(
"Absen Sukses",
style: getBoldStyle(
color: Colors.white,
fontSize: 17,
),
),
)
],
),
)
],
),
),
const SizedBox(
height: 20,
),
const SizedBox(
height: 20,
),
Container(
padding: EdgeInsets.symmetric(
horizontal: AppPadding.p20,
),
Container(
padding: EdgeInsets.symmetric(
horizontal: AppPadding.p20,
),
width: double.infinity,
child: Center(
child: Text(
(isIn)
? '''Absen Masuk
width: double.infinity,
child: Center(
child: Text(
(isIn)
? '''Absen Masuk
Sukses'''
: '''Absen Keluar
: '''Absen Keluar
Sukses''',
style: getSemiBoldStyle(
color: Colors.black,
fontSize: FontSize.s24,
fontFamily: FontConstants.montserrat,
),
textAlign: TextAlign.center,
style: getSemiBoldStyle(
color: Colors.black,
fontSize: FontSize.s24,
fontFamily: FontConstants.montserrat,
),
textAlign: TextAlign.center,
),
),
Container(
margin: const EdgeInsets.only(
top: 27,
),
padding: EdgeInsets.symmetric(
horizontal: AppPadding.p20,
),
child: Image(
height: MediaQuery.of(context).size.height * 0.25,
width: double.infinity,
image: AssetImage(
Assets.absentSuccess,
),
),
),
Container(
margin: const EdgeInsets.only(
top: 27,
),
padding: EdgeInsets.symmetric(
horizontal: AppPadding.p20,
),
Container(
child: Image(
height: MediaQuery.of(context).size.height * 0.25,
width: double.infinity,
margin: EdgeInsets.only(
top: 38,
left: AppMargin.m20,
right: AppMargin.m20,
image: AssetImage(
Assets.absentSuccess,
),
padding: EdgeInsets.symmetric(
vertical: AppPadding.p20,
horizontal: 25,
),
),
Container(
width: double.infinity,
margin: EdgeInsets.only(
top: 38,
left: AppMargin.m20,
right: AppMargin.m20,
),
padding: EdgeInsets.symmetric(
vertical: AppPadding.p20,
horizontal: 25,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
border: Border.all(
width: 0.2,
color: Colors.grey,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
border: Border.all(
width: 0.2,
color: Colors.grey,
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.3),
blurRadius: 5,
offset: const Offset(0.8, 0.8),
),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.3),
blurRadius: 5,
offset: const Offset(0.8, 0.8),
),
],
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
// Text(
// absentSuccess.branchCode,
// style: getSemiBoldStyle(
// color: ColorManager.fontBlack,
// fontSize: FontSize.s20,
// fontFamily: FontConstants.montserrat,
// ),
// ),
// SizedBox(
// height: AppMargin.m10,
// ),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Text(
profil.name,
style: getMediumStyle(
color: ColorManager.fontBlack,
fontSize: FontSize.s16,
fontFamily: FontConstants.montserrat,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.start,
],
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
// Text(
// absentSuccess.branchCode,
// style: getSemiBoldStyle(
// color: ColorManager.fontBlack,
// fontSize: FontSize.s20,
// fontFamily: FontConstants.montserrat,
// ),
// ),
// SizedBox(
// height: AppMargin.m10,
// ),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Text(
profil.name,
style: getMediumStyle(
color: ColorManager.fontBlack,
fontSize: FontSize.s16,
fontFamily: FontConstants.montserrat,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.start,
),
Expanded(
child: Text(
nik,
style: getMediumStyle(
color: ColorManager.fontBlack,
fontSize: FontSize.s16,
fontFamily: FontConstants.montserrat,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.end,
),
)
],
),
Container(
margin: EdgeInsets.only(
top: AppMargin.m10,
),
padding: EdgeInsets.symmetric(
horizontal: AppPadding.p20,
vertical: AppPadding.p12,
),
width: double.infinity,
decoration: BoxDecoration(
color: const Color(0xffE7E7E7).withOpacity(0.5),
border: Border.all(
width: 0.2,
color: ColorManager.grey.withOpacity(0.8),
Expanded(
child: Text(
nik,
style: getMediumStyle(
color: ColorManager.fontBlack,
fontSize: FontSize.s16,
fontFamily: FontConstants.montserrat,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.end,
),
borderRadius: BorderRadius.circular(9),
)
],
),
Container(
margin: EdgeInsets.only(
top: AppMargin.m10,
),
padding: EdgeInsets.symmetric(
horizontal: AppPadding.p20,
vertical: AppPadding.p12,
),
width: double.infinity,
decoration: BoxDecoration(
color: const Color(0xffE7E7E7).withOpacity(0.5),
border: Border.all(
width: 0.2,
color: ColorManager.grey.withOpacity(0.8),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
absentSuccess.branchName,
style: getSemiBoldStyle(
color: ColorManager.fontBlack,
fontSize: FontSize.s16,
),
textAlign: TextAlign.center,
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
const SizedBox(
height: 4,
borderRadius: BorderRadius.circular(9),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
absentSuccess.branchName,
style: getSemiBoldStyle(
color: ColorManager.fontBlack,
fontSize: FontSize.s16,
),
Text(
"${absentSuccess.time} ${absentSuccess.timeZone}",
style: getMediumStyle(
color: ColorManager.fontBlack,
fontSize: FontSize.s20,
),
textAlign: TextAlign.center,
maxLines: 2,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
const SizedBox(
height: 4,
),
Text(
"${absentSuccess.time} ${absentSuccess.timeZone}",
style: getMediumStyle(
color: ColorManager.fontBlack,
fontSize: FontSize.s20,
),
const SizedBox(
height: 4,
textAlign: TextAlign.center,
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
const SizedBox(
height: 4,
),
Text(
DateFormatCustom.getDateLocal(
fromApi: true,
apiDate: absentSuccess.date,
),
Text(
DateFormatCustom.getDateLocal(
fromApi: true,
apiDate: absentSuccess.date,
),
style: getRegularStyle(
color: ColorManager.fontBlack,
fontSize: FontSize.s16,
),
textAlign: TextAlign.center,
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: getRegularStyle(
color: ColorManager.fontBlack,
fontSize: FontSize.s16,
),
],
),
// child: Row(
// children: [
// const Spacer(),
// Text(
// DateFormatCustom.getDateLocal(
// fromApi: true,
// apiDate: absentSuccess.date,
// ),
// style: getRegularStyle(
// color: ColorManager.fontBlack,
// fontSize: 16,
// fontFamily: FontConstants.montserrat,
// ),
// )
// ],
// ),
textAlign: TextAlign.center,
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
],
),
// Container(
// margin: EdgeInsets.only(
// top: AppMargin.m16,
// left: AppMargin.m16,
// right: AppMargin.m16,
// ),
// child: CustomButton(
// text: "Kembali ke Beranda",
// onTap: () {
// Navigator.pushNamedAndRemoveUntil(
// context,
// Routes.onBoarding,
// (route) => false,
// );
// },
// ),
// )
],
),
// child: Row(
// children: [
// const Spacer(),
// Text(
// DateFormatCustom.getDateLocal(
// fromApi: true,
// apiDate: absentSuccess.date,
// ),
// style: getRegularStyle(
// color: ColorManager.fontBlack,
// fontSize: 16,
// fontFamily: FontConstants.montserrat,
// ),
// )
// ],
// ),
),
// Container(
// margin: EdgeInsets.only(
// top: AppMargin.m16,
// left: AppMargin.m16,
// right: AppMargin.m16,
// ),
// child: CustomButton(
// text: "Kembali ke Beranda",
// onTap: () {
// Navigator.pushNamedAndRemoveUntil(
// context,
// Routes.onBoarding,
// (route) => false,
// );
// },
// ),
// )
],
),
SizedBox(
height: AppMargin.m16,
),
SizedBox(
height: AppMargin.m16,
),
Container(
margin: EdgeInsets.symmetric(
horizontal: AppMargin.m20,
),
Container(
margin: EdgeInsets.symmetric(
horizontal: AppMargin.m20,
),
child: CustomButton(
text: "Kembali ke Beranda",
onTap: () {
Navigator.pushNamedAndRemoveUntil(
context,
Routes.onBoarding,
(route) => false,
);
},
),
)
],
),
child: CustomButton(
text: "Kembali ke Beranda",
onTap: () {
Navigator.pushNamedAndRemoveUntil(
context,
Routes.onBoarding,
(route) => false,
);
},
),
)
],
),
);
}
......
......@@ -14,6 +14,7 @@ import 'package:excelso_attendance/models/profile.dart';
import 'package:excelso_attendance/models/shift.dart';
import 'package:excelso_attendance/resource/assets.dart';
import 'package:excelso_attendance/resource/colors.dart';
import 'package:excelso_attendance/resource/constanta_string.dart';
import 'package:excelso_attendance/resource/font.dart';
import 'package:excelso_attendance/resource/routes.dart';
import 'package:excelso_attendance/resource/size.dart';
......@@ -62,7 +63,9 @@ class _BodyWidgetState extends State<BodyWidget> {
// final TextEditingController nikController = TextEditingController();
int selectedOutlet = 0;
String nikUser = "";
String nikUser =
(getListAbsentUser().isEmpty) ? "" : getListAbsentUser().last;
TextEditingController? textEditingController;
List<String> dataUserAbsent = getListAbsentUser();
......@@ -172,128 +175,163 @@ class _BodyWidgetState extends State<BodyWidget> {
// borderSideActive: true,
// hintText: "NIK",
// ),
child: Autocomplete(
optionsBuilder: (TextEditingValue textEditingValue) {
if (textEditingValue.text.isEmpty) {
return const Iterable<String>.empty();
} else {
return dataUserAbsent.where(
(data) => data
.toLowerCase()
.contains(textEditingValue.text.toLowerCase()),
);
}
},
onSelected: ((selected) {
setState(() {
nikUser = selected;
});
}),
optionsViewBuilder: (c, onSelected, options) {
List<String> listNik = options.toList();
return Container(
margin: const EdgeInsets.only(
right: 70,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(
bottom: AppMargin.m12,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5),
color: ColorManager.backgroundColor,
border: Border.all(
width: 0.2,
color: Colors.grey,
child: Text(
"NIK",
style: getSemiBoldStyle(
color: Colors.black,
fontSize: 16,
),
),
),
Autocomplete(
optionsBuilder: (TextEditingValue textEditingValue) {
if (textEditingValue.text.isEmpty) {
return const Iterable<String>.empty();
} else {
return dataUserAbsent.where(
(data) => data.toLowerCase().contains(
textEditingValue.text.toLowerCase()),
);
}
},
onSelected: ((selected) {
setState(() {
nikUser = selected;
});
}),
initialValue: TextEditingValue(
text: (getListAbsentUser().isEmpty)
? ""
: getListAbsentUser().last),
optionsViewBuilder: (c, onSelected, options) {
List<String> listNik = options.toList();
return Container(
margin: const EdgeInsets.only(
right: 70,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5),
color: ColorManager.backgroundColor,
border: Border.all(
width: 0.2,
color: Colors.grey,
),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.3),
blurRadius: 2,
offset: const Offset(5, 5),
),
]),
child: ListView.builder(
padding: EdgeInsets.zero,
itemCount: listNik.length,
itemBuilder: ((context, index) {
return GestureDetector(
onTap: () {
onSelected(listNik[index]);
},
child: Container(
margin: const EdgeInsets.symmetric(
horizontal: 6, vertical: 3),
padding: EdgeInsets.symmetric(
horizontal: AppPadding.p10,
vertical: AppPadding.p14,
),
decoration: BoxDecoration(
border: (index + 1 != listNik.length)
? Border(
bottom: BorderSide(
width: 0.5,
color: ColorManager.grey
.withOpacity(0.8),
),
)
: null,
),
child: Text(
listNik[index],
style: getRegularStyle(
color: Colors.black,
fontSize: 20,
fontFamily: FontConstants.poppins,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
),
);
}),
),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.3),
blurRadius: 2,
offset: const Offset(5, 5),
);
},
fieldViewBuilder:
(c, controller, focusNode, onEditingComplete) {
textEditingController = controller;
return TextField(
onChanged: (teks) {
setState(() {
nikUser = teks;
});
},
controller: textEditingController,
focusNode: focusNode,
onEditingComplete: () {
setState(() {
if (focusNode.hasFocus) {
focusNode.unfocus();
}
});
},
decoration: InputDecoration(
hintText: "NIK",
hintStyle: getRegularStyle(
color: Colors.grey,
),
]),
child: ListView.builder(
padding: EdgeInsets.zero,
itemCount: listNik.length,
itemBuilder: ((context, index) {
return GestureDetector(
onTap: () {
onSelected(listNik[index]);
},
child: Container(
margin: const EdgeInsets.symmetric(
horizontal: 6, vertical: 3),
padding: EdgeInsets.symmetric(
horizontal: AppPadding.p10,
vertical: AppPadding.p14,
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
width: 0.4,
color: ColorManager.grey,
),
decoration: BoxDecoration(
border: (index + 1 != listNik.length)
? Border(
bottom: BorderSide(
width: 0.5,
color: ColorManager.grey
.withOpacity(0.8),
borderRadius: BorderRadius.circular(5),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
width: 0.4, color: ColorManager.grey),
borderRadius: BorderRadius.circular(5),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(
width: 0.4, color: ColorManager.grey),
borderRadius: BorderRadius.circular(5),
),
suffixIcon:
(textEditingController!.text.isNotEmpty)
? IconButton(
onPressed: () {
setState(() {
textEditingController!.clear();
});
},
icon: const Icon(
Icons.dangerous,
color: Colors.grey,
),
)
: null,
),
child: Text(
listNik[index],
style: getRegularStyle(
color: Colors.black,
fontSize: 20,
fontFamily: FontConstants.poppins,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
),
);
}),
),
);
},
fieldViewBuilder:
(c, controller, focusNode, onEditingComplete) {
return TextField(
onChanged: (teks) {
setState(() {
nikUser = teks;
});
},
controller: controller,
focusNode: focusNode,
onEditingComplete: () {
setState(() {
if (focusNode.hasFocus) {
focusNode.unfocus();
}
});
},
decoration: InputDecoration(
hintText: "NIK",
hintStyle: getRegularStyle(
color: Colors.grey,
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
width: 0.4,
color: ColorManager.grey,
),
borderRadius: BorderRadius.circular(5),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
width: 0.4, color: ColorManager.grey),
borderRadius: BorderRadius.circular(5),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(
width: 0.4, color: ColorManager.grey),
borderRadius: BorderRadius.circular(5),
),
),
);
},
);
},
),
],
),
),
),
......@@ -380,7 +418,7 @@ class _BodyWidgetState extends State<BodyWidget> {
modalDialogGlobal(
context: context,
size: MediaQuery.of(context).size,
title: "Gagal",
title: "Peringatan",
contentBody: Strings.alreadyOut,
buttonText: "Ok",
tapButtonOk: () {
......@@ -403,6 +441,17 @@ class _BodyWidgetState extends State<BodyWidget> {
);
return;
}
Navigator.pushNamed(
context,
Routes.absentCamera,
arguments: AbsentCameraArguments(
isIn: false,
branchModel:
widget.nearestBranch[selectedOutlet],
profile: profileUser,
nik: nikUser,
),
);
}
});
}
......@@ -709,7 +758,7 @@ class _WidgetSelectOutletState extends State<WidgetSelectOutlet> {
margin: EdgeInsets.only(top: AppMargin.m18),
child: Center(
child: Text(
"Outlet dalam radius 10 Km",
"Outlet dalam radius ${ConstantString.outletDistance} Km",
style: getMediumStyle(
color: Colors.black,
fontSize: 16,
......@@ -813,7 +862,7 @@ class _WidgetSelectOutletState extends State<WidgetSelectOutlet> {
),
margin: EdgeInsets.symmetric(vertical: AppMargin.m16),
child: const CustomButton(
text: "Pilih OUtlet",
text: "Pilih Outlet",
),
),
)
......@@ -1030,7 +1079,7 @@ class _WidgetSelectShiftState extends State<WidgetSelectShift> {
modalDialogGlobal(
context: context,
size: MediaQuery.of(context).size,
title: "Gagal",
title: "Peringatan",
contentBody: Strings.alreadyIn,
buttonText: "Ok",
tapButtonOk: () {
......
class ConstantString {}
class ConstantString {
static String outletDistance = '';
}
......@@ -20,4 +20,11 @@ class Strings {
static String alreadyOut =
"Anda sudah melakukan absen keluar hari ini, yakin ingin absen ulang ?";
static String outButNotIn = "Anda belum melakukan absen masuk";
static String cameraDescriptionNull(String camerCount) {
return "Eror loading kamera, {camera description null, camera count: $camerCount}";
}
static String cameraFrontNotFound(String cameraLength) {
return "Kamera depan tidak ditemukan, camera count: $cameraLength";
}
}
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