Commit 257cb66a authored by Dio Maulana's avatar Dio Maulana

fixed design

parent 77a3594d
......@@ -8,6 +8,7 @@ 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/strings.dart';
import 'package:geolocator/geolocator.dart';
import 'package:http/http.dart' as http;
class Api {
......@@ -135,14 +136,14 @@ class Api {
static Future<ApiResponse> shiftIn(
String branchId, String nik, String shiftId, String photoBase64) async {
String apiUrl = "$baseUrl${endPoint}clock_in";
Position position = await Geolocator.getCurrentPosition();
try {
Map<String, dynamic> data = {
"branch_id": branchId,
"nik": nik,
"shift_id": shiftId,
"user_lat": getLatitude(),
"user_long": getLongitude(),
"user_lat": position.latitude,
"user_long": position.longitude,
"photo_base64": "data:image/jpeg;base64,$photoBase64",
};
String bodies = jsonEncode(data);
......@@ -183,12 +184,13 @@ class Api {
String branchId, String nik, String photoBase64) async {
String apiUrl = "$baseUrl${endPoint}clock_out";
Position position = await Geolocator.getCurrentPosition();
try {
Map<String, dynamic> data = {
"branch_id": branchId,
"nik": nik,
"user_lat": getLatitude(),
"user_long": getLongitude(),
"user_lat": position.latitude,
"user_long": position.longitude,
"photo_base64": photoBase64,
};
String bodies = jsonEncode(data);
......
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';
class AbsentCameraArguments {
final bool isIn;
final BranchModel branchModel;
final ShiftModel? shiftModel;
final ProfileModel profile;
final String nik;
AbsentCameraArguments({
required this.isIn,
required this.branchModel,
required this.nik,
required this.profile,
this.shiftModel,
});
}
......@@ -28,10 +31,14 @@ class HomeArguments {
class AbsentSuccessArguments {
final AbsentSuccessModel absentSuccess;
final ProfileModel profil;
final String nik;
final bool isIn;
AbsentSuccessArguments({
required this.absentSuccess,
required this.profil,
required this.nik,
required this.isIn,
});
}
......@@ -11,6 +11,7 @@ import 'package:excelso_attendance/helper/widget_responsive.dart';
import 'package:excelso_attendance/main.dart';
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/routes.dart';
import 'package:excelso_attendance/resource/strings.dart';
......@@ -35,12 +36,14 @@ class AbsentCameraView extends StatefulWidget {
required this.isIn,
required this.branchModel,
required this.nik,
required this.profile,
this.shiftModel,
});
final bool isIn;
final BranchModel branchModel;
final ShiftModel? shiftModel;
final ProfileModel profile;
final String nik;
@override
......@@ -91,7 +94,7 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
print("JUMLAH CAMERA TEDETEKSI: ${cameras!.length}");
}
if (cameras!.length > 1) {
_cameraDescription = cameras![1];
_cameraDescription = cameras![0];
} else {
if (cameras!.isNotEmpty) {
_cameraDescription = cameras![0];
......@@ -358,16 +361,18 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
),
WidgetAbsentAndTime(
isIn: widget.isIn,
outletName: widget.branchModel.code,
outletName: widget.branchModel.name,
),
const Spacer(),
(pictureIsTaken)
? Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: 100,
child: CustomButton(
? Container(
margin: EdgeInsets.symmetric(
horizontal: AppMargin.m20,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
CustomButton(
text: "Submit",
onTap: () async {
// startTimer();
......@@ -398,6 +403,8 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
(route) => false,
arguments: AbsentSuccessArguments(
absentSuccess: absentSuccess,
profil: widget.profile,
nik: widget.nik,
isIn: true,
),
);
......@@ -425,6 +432,8 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
(route) => false,
arguments: AbsentSuccessArguments(
absentSuccess: absentSuccess,
profil: widget.profile,
nik: widget.nik,
isIn: false,
),
);
......@@ -432,35 +441,131 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
}
},
),
),
Container(
width: 100,
margin: const EdgeInsets.only(
top: 10,
SizedBox(
height: AppMargin.m8,
),
child: GestureDetector(
CustomButton(
text: "Foto Ulang",
colorButton: Colors.red,
onTap: () {
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!);
_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!);
});
});
},
child: CustomButton(
text: "Foto Ulang",
colorButton: ColorManager.grey,
),
),
),
],
)
// Container(
// width: 100,
// child: CustomButton(
// text: "Submit",
// onTap: () async {
// // startTimer();
// await EasyLoading.show(
// status: Strings.pleaseWait,
// maskType: EasyLoadingMaskType.none,
// );
// if (widget.isIn) {
// Api.shiftIn(
// widget.branchModel.id,
// widget.nik,
// widget.shiftModel!.id,
// imageBase64!,
// ).then((apiResponse) {
// // stopTimer();
// EasyLoading.dismiss();
// if (apiResponse.error) {
// EasyLoading.showToast(
// apiResponse.msg);
// return;
// }
// AbsentSuccessModel absentSuccess =
// apiResponse.data
// as AbsentSuccessModel;
// Navigator.pushNamedAndRemoveUntil(
// context,
// Routes.absentSuccess,
// (route) => false,
// arguments: AbsentSuccessArguments(
// absentSuccess: absentSuccess,
// isIn: true,
// ),
// );
// });
// } else {
// Api.shiftOut(
// widget.branchModel.id,
// widget.nik,
// imageBase64!,
// ).then((apiResponse) {
// // stopTimer();
// EasyLoading.dismiss();
// if (apiResponse.error) {
// EasyLoading.showToast(
// apiResponse.msg,
// );
// return;
// }
// AbsentSuccessModel absentSuccess =
// apiResponse.data
// as AbsentSuccessModel;
// Navigator.pushNamedAndRemoveUntil(
// context,
// Routes.absentSuccess,
// (route) => false,
// arguments: AbsentSuccessArguments(
// absentSuccess: absentSuccess,
// isIn: false,
// ),
// );
// });
// }
// },
// ),
// ),
// Container(
// width: 100,
// margin: const EdgeInsets.only(
// top: 10,
// ),
// child: GestureDetector(
// onTap: () async {
// _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!);
// });
// });
// },
// child: CustomButton(
// text: "Foto Ulang",
// colorButton: ColorManager.grey,
// ),
// ),
// ),
],
),
)
: Stack(
children: [
......@@ -543,29 +648,30 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
width: 60,
),
GestureDetector(
onTap: () {
onTap: () async {
if (cameras!.length > 1) {
setState(() {
isCameraLoading = true;
_controller
?.dispose()
.then((value) {
setState(() {});
CameraDescription? switchTo;
if (_cameraDescription ==
cameras![0]) {
_cameraDescription =
cameras![1];
switchTo = cameras![1];
} else {
_cameraDescription =
cameras![0];
switchTo = cameras![0];
}
_controller = CameraController(
// Get a specific camera from the list of available cameras.
_cameraDescription!,
// Define the resolution to use.
switchTo,
ResolutionPreset.medium,
imageFormatGroup:
ImageFormatGroup.jpeg,
enableAudio: false,
);
initCamera(_controller!);
});
} else {
......@@ -1037,20 +1143,21 @@ class _WidgetAbsentAndTimeState extends State<WidgetAbsentAndTime> {
borderRadius: BorderRadius.circular(12),
color: Colors.white,
),
padding: const EdgeInsets.all(20),
height: 105,
padding: EdgeInsets.symmetric(
horizontal: AppPadding.p20, vertical: AppPadding.p12),
width: double.infinity,
height: 138,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.min,
children: [
Text(
(widget.isIn) ? "Absen Masuk" : "Absen Keluar",
style: getRegularStyle(
color: Colors.black,
fontSize: FontSize.s16,
fontFamily: FontConstants.poppins,
Image(
image: AssetImage(
Assets.excelsoLogoGreen,
),
width: 111,
height: 42,
),
Expanded(
child: Text(
......@@ -1059,10 +1166,19 @@ class _WidgetAbsentAndTimeState extends State<WidgetAbsentAndTime> {
)}",
style: getSemiBoldStyle(
color: Colors.black,
fontSize: FontSize.s24,
fontSize: FontSize.s16,
),
maxLines: 3,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
),
),
Text(
(widget.isIn) ? "Absen Masuk" : "Absen Keluar",
style: getSemiBoldStyle(
color: Colors.black,
fontSize: FontSize.s16,
fontFamily: FontConstants.poppins,
),
),
],
......
import 'package:excelso_attendance/helper/component/button.dart';
import 'package:excelso_attendance/helper/global_function/date_time.dart';
import 'package:excelso_attendance/models/absent.dart';
import 'package:excelso_attendance/models/profile.dart';
import 'package:excelso_attendance/resource/assets.dart';
import 'package:excelso_attendance/resource/colors.dart';
import 'package:excelso_attendance/resource/font.dart';
......@@ -11,9 +12,15 @@ import 'package:flutter/material.dart';
class AbsentSuccessView extends StatelessWidget {
const AbsentSuccessView(
{super.key, required this.absentSuccess, required this.isIn});
{super.key,
required this.absentSuccess,
required this.isIn,
required this.nik,
required this.profil});
final AbsentSuccessModel absentSuccess;
final ProfileModel profil;
final String nik;
final bool isIn;
@override
......@@ -72,7 +79,7 @@ class AbsentSuccessView extends StatelessWidget {
),
),
const SizedBox(
height: 60,
height: 20,
),
Container(
padding: EdgeInsets.symmetric(
......@@ -103,7 +110,7 @@ Sukses''',
horizontal: AppPadding.p20,
),
child: Image(
height: 232,
height: MediaQuery.of(context).size.height * 0.25,
width: double.infinity,
image: AssetImage(
Assets.absentSuccess,
......@@ -140,23 +147,45 @@ Sukses''',
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.start,
children: [
Text(
absentSuccess.branchCode,
style: getSemiBoldStyle(
color: ColorManager.fontBlack,
fontSize: FontSize.s20,
fontFamily: FontConstants.montserrat,
Expanded(
child: Text(
profil.name,
style: getSemiBoldStyle(
color: ColorManager.fontBlack,
fontSize: FontSize.s20,
fontFamily: FontConstants.montserrat,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.start,
),
),
Text(
"${absentSuccess.time} ${absentSuccess.timeZone}",
style: getSemiBoldStyle(
color: ColorManager.fontBlack,
fontSize: FontSize.s20,
fontFamily: FontConstants.montserrat,
Expanded(
child: Text(
nik,
style: getSemiBoldStyle(
color: ColorManager.fontBlack,
fontSize: FontSize.s20,
fontFamily: FontConstants.montserrat,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.end,
),
)
],
......@@ -165,9 +194,49 @@ Sukses''',
margin: EdgeInsets.only(
top: AppMargin.m10,
),
child: Row(
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),
),
borderRadius: BorderRadius.circular(9),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
const Spacer(),
Text(
absentSuccess.branchName,
style: getSemiBoldStyle(
color: ColorManager.fontBlack,
fontSize: FontSize.s16,
),
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,
),
textAlign: TextAlign.center,
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
const SizedBox(
height: 4,
),
Text(
DateFormatCustom.getDateLocal(
fromApi: true,
......@@ -175,32 +244,68 @@ Sukses''',
),
style: getRegularStyle(
color: ColorManager.fontBlack,
fontSize: 16,
fontFamily: FontConstants.montserrat,
fontSize: FontSize.s16,
),
)
textAlign: TextAlign.center,
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
],
),
// 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,
);
},
),
)
// 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,
),
Container(
margin: EdgeInsets.symmetric(
horizontal: AppMargin.m20,
),
child: CustomButton(
text: "Kembali ke Beranda",
onTap: () {
Navigator.pushNamedAndRemoveUntil(
context,
Routes.onBoarding,
(route) => false,
);
},
),
)
],
),
......
import 'dart:async';
import 'package:dropdown_button2/dropdown_button2.dart';
// import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:excelso_attendance/api/api.dart';
import 'package:excelso_attendance/helper/arguments/route_args.dart';
import 'package:excelso_attendance/helper/component/button.dart';
......@@ -394,6 +394,7 @@ class _BodyWidgetState extends State<BodyWidget> {
isIn: false,
branchModel:
widget.nearestBranch[selectedOutlet],
profile: profileUser,
nik: nikUser,
),
);
......@@ -471,177 +472,184 @@ class _SelectOutletState extends State<SelectOutlet> {
const SizedBox(
height: 10,
),
DropdownButtonFormField2(
decoration: InputDecoration(
// hintText: "NIK",
//Add isDense true and zero Padding.
//Add Horizontal padding using buttonPadding and Vertical padding by increasing buttonHeight instead of add Padding here so that The whole TextField Button become clickable, and also the dropdown menu open under The whole TextField Button.
isDense: true,
contentPadding: const EdgeInsets.symmetric(
// horizontal: 18,
vertical: 15,
),
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),
),
//Add more decoration as you want here
//Add label If you want but add hint outside the decoration to be aligned in the button perfectly.
),
isExpanded: true,
// hint: Text(
// "${widget.nearestBranch[0].name} (${widget.nearestBranch[0].code})",
// style: const TextStyle(fontSize: 14),
// ),
hint: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Text(
widget.nearestBranch[0].code,
style: getRegularStyle(
color: Colors.black,
fontSize: 18,
fontFamily: FontConstants.poppins,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
const SizedBox(
width: 10,
),
Text(
"${widget.nearestBranch[0].distance} Km",
style: getRegularStyle(
color: Colors.black,
fontSize: 12,
fontFamily: FontConstants.poppins,
),
)
],
),
iconStyleData: const IconStyleData(
icon: Icon(
Icons.arrow_drop_down,
color: Colors.black45,
),
),
items: widget.nearestBranch
.map((branch) => DropdownMenuItem<String>(
value: branch.id,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Text(
branch.code,
style: getRegularStyle(
color: Colors.black,
fontSize: 18,
fontFamily: FontConstants.poppins,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
),
const SizedBox(
width: 10,
),
Text(
"${branch.distance} Km",
style: getRegularStyle(
color: Colors.black,
fontSize: 12,
fontFamily: FontConstants.poppins,
),
)
],
),
))
.toList(),
onChanged: (value) {
int selectedBranch = widget.nearestBranch
.indexWhere((element) => element.id == value);
setState(() {
widget.onSelected!(selectedBranch);
});
},
)
// GestureDetector(
// onTap: () {
// showModalBottomSheet(
// backgroundColor: ColorManager.backgroundColor,
// isScrollControlled: true,
// context: context,
// builder: (c) {
// return WidgetSelectOutlet(
// nearestBranch: widget.nearestBranch,
// selectedOutlet: selectedBranchFromList,
// onSelected: ((int val) {
// setState(() {
// selectedBranchFromList = val;
// widget.onSelected!(val);
// });
// }),
// );
// });
// },
// child: Container(
// margin: const EdgeInsets.only(
// top: 10,
// DropdownButtonFormField2(
// decoration: InputDecoration(
// // hintText: "NIK",
// //Add isDense true and zero Padding.
// //Add Horizontal padding using buttonPadding and Vertical padding by increasing buttonHeight instead of add Padding here so that The whole TextField Button become clickable, and also the dropdown menu open under The whole TextField Button.
// isDense: true,
// contentPadding: const EdgeInsets.symmetric(
// // horizontal: 18,
// vertical: 15,
// ),
// width: double.infinity,
// decoration: BoxDecoration(
// border: Border.all(width: 0.2, color: Colors.grey),
// enabledBorder: OutlineInputBorder(
// borderSide: BorderSide(width: 0.4, color: ColorManager.grey),
// borderRadius: BorderRadius.circular(5),
// color: ColorManager.backgroundColor,
// ),
// child: Container(
// padding: const EdgeInsets.symmetric(
// horizontal: 10,
// vertical: 15,
// ),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Expanded(
// child: Text(
// "${widget.nearestBranch[selectedBranchFromList].name} (${widget.nearestBranch[selectedBranchFromList].code})",
// style: getRegularStyle(
// color: ColorManager.grey,
// fontSize: 16,
// ),
// maxLines: 2,
// overflow: TextOverflow.ellipsis,
// ),
// ),
// Icon(
// Icons.arrow_drop_down,
// color: ColorManager.grey,
// size: 30,
// 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),
// ),
// //Add more decoration as you want here
// //Add label If you want but add hint outside the decoration to be aligned in the button perfectly.
// ),
// isExpanded: true,
// // hint: Text(
// // "${widget.nearestBranch[0].name} (${widget.nearestBranch[0].code})",
// // style: const TextStyle(fontSize: 14),
// // ),
// hint: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Expanded(
// child: Text(
// widget.nearestBranch[0].code,
// style: getRegularStyle(
// color: Colors.black,
// fontSize: 18,
// fontFamily: FontConstants.poppins,
// ),
// // Text(
// // "Ubah",
// // style: getRegularStyle(
// // color: ColorManager.link,
// // ),
// // )
// ],
// maxLines: 1,
// overflow: TextOverflow.ellipsis,
// ),
// ),
// const SizedBox(
// width: 10,
// ),
// Text(
// "${widget.nearestBranch[0].distance} Km",
// style: getRegularStyle(
// color: Colors.black,
// fontSize: 12,
// fontFamily: FontConstants.poppins,
// ),
// )
// ],
// ),
// iconStyleData: const IconStyleData(
// icon: Icon(
// Icons.arrow_drop_down,
// color: Colors.black45,
// ),
// ),
// ),
// items: widget.nearestBranch
// .map((branch) => DropdownMenuItem<String>(
// value: branch.id,
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Expanded(
// child: Text(
// branch.code,
// style: getRegularStyle(
// color: Colors.black,
// fontSize: 18,
// fontFamily: FontConstants.poppins,
// ),
// maxLines: 2,
// overflow: TextOverflow.ellipsis,
// ),
// ),
// const SizedBox(
// width: 10,
// ),
// Text(
// "${branch.distance} Km",
// style: getRegularStyle(
// color: Colors.black,
// fontSize: 12,
// fontFamily: FontConstants.poppins,
// ),
// )
// ],
// ),
// ))
// .toList(),
// onChanged: (value) {
// int selectedBranch = widget.nearestBranch
// .indexWhere((element) => element.id == value);
// setState(() {
// widget.onSelected!(selectedBranch);
// });
// },
// )
GestureDetector(
onTap: () {
showModalBottomSheet(
backgroundColor: ColorManager.backgroundColor,
isScrollControlled: true,
context: context,
builder: (c) {
return WidgetSelectOutlet(
nearestBranch: widget.nearestBranch,
selectedOutlet: selectedBranchFromList,
onSelected: ((int val) {
setState(() {
selectedBranchFromList = val;
widget.onSelected!(val);
});
}),
);
});
},
child: Container(
margin: const EdgeInsets.only(
top: 10,
),
width: double.infinity,
decoration: BoxDecoration(
border: Border.all(width: 0.2, color: Colors.grey),
borderRadius: BorderRadius.circular(5),
color: ColorManager.backgroundColor,
),
child: Container(
padding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 15,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Text(
"${widget.nearestBranch[selectedBranchFromList].name} (${widget.nearestBranch[selectedBranchFromList].code})",
style: getRegularStyle(
color: ColorManager.grey,
fontSize: 16,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
),
Image(
image: AssetImage(
Assets.arrowUpDown,
),
width: 7,
height: 13,
)
// Icon(
// Icons.arrow_drop_down_sharp,
// color: ColorManager.grey,
// size: 30,
// ),
// Text(
// "Ubah",
// style: getRegularStyle(
// color: ColorManager.link,
// ),
// )
],
),
),
),
),
],
),
),
......@@ -1001,7 +1009,6 @@ class _WidgetSelectShiftState extends State<WidgetSelectShift> {
).then((apiResponse) {
EasyLoading.dismiss();
if (apiResponse.error) {
Navigator.pop(context);
modalDialogGlobal(
context: context,
size: MediaQuery.of(context).size,
......@@ -1010,6 +1017,7 @@ class _WidgetSelectShiftState extends State<WidgetSelectShift> {
buttonText: "Ok",
tapButton: () {
Navigator.pop(context);
Navigator.pop(context);
});
} else {
ProfileModel profileUser = apiResponse.data as ProfileModel;
......@@ -1033,6 +1041,7 @@ class _WidgetSelectShiftState extends State<WidgetSelectShift> {
isIn: true,
branchModel: widget.branchModel,
shiftModel: widget.shiftList[selectedShift!],
profile: profileUser,
nik: widget.nik,
),
);
......
......@@ -5,6 +5,7 @@ class Assets {
// images
static String excelso = "${rootImage}excelso.png";
static String excelsoLogo = "${rootImage}excelso_logo.png";
static String excelsoLogoGreen = "${rootImage}excelso_logo_green.png";
static String onboarding = "${rootImage}onboarding.png";
static String frameOverlay = "${rootImage}frame_overlay.png";
static String frameOverlay2 = "${rootImage}frame_overlay2.png";
......@@ -12,4 +13,5 @@ class Assets {
static String absentSuccess = "${rootImage}absent_success.png";
// icons
static String arrowUpDown = "${rootIcon}arrow_up_down.png";
}
......@@ -42,6 +42,7 @@ class RouteGenerator {
isIn: args.isIn,
branchModel: args.branchModel,
shiftModel: args.shiftModel,
profile: args.profile,
nik: args.nik,
),
nameRoute: Routes.absentCamera,
......@@ -53,6 +54,8 @@ class RouteGenerator {
return pageRouteCustom(
AbsentSuccessView(
absentSuccess: args.absentSuccess,
profil: args.profil,
nik: args.nik,
isIn: args.isIn,
),
nameRoute: Routes.absentSuccess,
......@@ -94,6 +97,7 @@ class RouteGenerator {
isIn: args.isIn,
branchModel: args.branchModel,
shiftModel: args.shiftModel,
profile: args.profile,
nik: args.nik,
),
transitionDuration: Duration.zero,
......@@ -136,6 +140,8 @@ class RouteGenerator {
return PageRouteBuilder(
pageBuilder: (context, a, b) => AbsentSuccessView(
absentSuccess: args.absentSuccess,
profil: args.profil,
nik: args.nik,
isIn: args.isIn,
),
transitionDuration: Duration.zero,
......
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