|
|
|
@ -31,8 +31,9 @@ class BalancesDashboardWidget extends StatefulWidget {
|
|
|
|
final String title;
|
|
|
|
final String title;
|
|
|
|
final List<PieChartModel> chartModelList;
|
|
|
|
final List<PieChartModel> chartModelList;
|
|
|
|
final bool isLeaveBalance;
|
|
|
|
final bool isLeaveBalance;
|
|
|
|
|
|
|
|
final String selectedEmp;
|
|
|
|
|
|
|
|
|
|
|
|
const BalancesDashboardWidget(this.title, this.isLeaveBalance, {Key? key, this.chartModelList = const []}) : super(key: key);
|
|
|
|
const BalancesDashboardWidget(this.title, this.isLeaveBalance, this.selectedEmp, {Key? key, this.chartModelList = const []}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
_BalancesDashboardWidgetState createState() {
|
|
|
|
_BalancesDashboardWidgetState createState() {
|
|
|
|
@ -62,8 +63,8 @@ class _BalancesDashboardWidgetState extends State<BalancesDashboardWidget> {
|
|
|
|
|
|
|
|
|
|
|
|
void changeAccrualDate() async {
|
|
|
|
void changeAccrualDate() async {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
Utils.showLoading(context);
|
|
|
|
// Utils.showLoading(context);
|
|
|
|
List<GetAccrualBalancesList> accrualList = await DashboardApiClient().getAccrualBalances(DateFormat("MM/dd/yyyy").format(accrualDateTime), empID: selectedEmp);
|
|
|
|
List<GetAccrualBalancesList> accrualList = await DashboardApiClient().getAccrualBalances(DateFormat("MM/dd/yyyy").format(accrualDateTime), empID: widget.selectedEmp);
|
|
|
|
if (accrualList.isNotEmpty) {
|
|
|
|
if (accrualList.isNotEmpty) {
|
|
|
|
if (widget.isLeaveBalance) {
|
|
|
|
if (widget.isLeaveBalance) {
|
|
|
|
leaveBalanceAccrual = accrualList[0];
|
|
|
|
leaveBalanceAccrual = accrualList[0];
|
|
|
|
@ -79,7 +80,7 @@ class _BalancesDashboardWidgetState extends State<BalancesDashboardWidget> {
|
|
|
|
];
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
// Utils.hideLoading(context);
|
|
|
|
setState(() {});
|
|
|
|
setState(() {});
|
|
|
|
} catch (ex) {
|
|
|
|
} catch (ex) {
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|