|
|
|
|
@ -15,7 +15,7 @@ import 'package:mohem_flutter_app/widgets/item_detail_view_widget.dart';
|
|
|
|
|
|
|
|
|
|
class LeaveBalance extends StatefulWidget {
|
|
|
|
|
final String selectedEmp;
|
|
|
|
|
LeaveBalance({this.selectedEmp ='', Key? key}) : super(key: key);
|
|
|
|
|
LeaveBalance({this.selectedEmp = '', Key? key}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_LeaveBalanceState createState() {
|
|
|
|
|
@ -28,15 +28,12 @@ class _LeaveBalanceState extends State<LeaveBalance> {
|
|
|
|
|
|
|
|
|
|
DateTime accrualDateTime = DateTime.now();
|
|
|
|
|
dynamic dynamicParams;
|
|
|
|
|
String selectedEmp ="";
|
|
|
|
|
String selectedEmp = "";
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
super.initState();
|
|
|
|
|
// if (selectedEmp.isNotEmpty) {}
|
|
|
|
|
// else {
|
|
|
|
|
// getAbsenceTransactions();
|
|
|
|
|
// }
|
|
|
|
|
absenceTransList = [];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
@ -46,9 +43,9 @@ class _LeaveBalanceState extends State<LeaveBalance> {
|
|
|
|
|
|
|
|
|
|
void getAbsenceTransactions() async {
|
|
|
|
|
try {
|
|
|
|
|
Utils.showLoading(context);
|
|
|
|
|
// Utils.showLoading(context);
|
|
|
|
|
absenceTransList = await LeaveBalanceApiClient().getAbsenceTransactions(-999, empID: selectedEmp);
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
//Utils.hideLoading(context);
|
|
|
|
|
setState(() {});
|
|
|
|
|
} catch (ex) {
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
@ -59,15 +56,12 @@ class _LeaveBalanceState extends State<LeaveBalance> {
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
if (dynamicParams == null) {
|
|
|
|
|
dynamicParams = ModalRoute
|
|
|
|
|
.of(context)!
|
|
|
|
|
.settings
|
|
|
|
|
.arguments;
|
|
|
|
|
dynamicParams = ModalRoute.of(context)!.settings.arguments;
|
|
|
|
|
if (dynamicParams.isNotEmpty) {
|
|
|
|
|
AppState().postParamsJson['P_SELECTED_EMPLOYEE_NUMBER'] = dynamicParams;
|
|
|
|
|
selectedEmp =dynamicParams;
|
|
|
|
|
selectedEmp = dynamicParams;
|
|
|
|
|
getAbsenceTransactions();
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
getAbsenceTransactions();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -130,7 +124,7 @@ class _LeaveBalanceState extends State<LeaveBalance> {
|
|
|
|
|
),
|
|
|
|
|
child: const Icon(Icons.add, color: Colors.white, size: 30),
|
|
|
|
|
).onPress(() {
|
|
|
|
|
Navigator.pushNamed(context, AppRoutes.addLeaveBalance, arguments: selectedEmp ??'');
|
|
|
|
|
Navigator.pushNamed(context, AppRoutes.addLeaveBalance, arguments: selectedEmp ?? '');
|
|
|
|
|
}),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|