|
|
|
|
@ -21,6 +21,7 @@ import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/widgets/circular_step_progress_bar.dart';
|
|
|
|
|
import 'package:month_picker_dialog_2/month_picker_dialog_2.dart';
|
|
|
|
|
import 'package:pie_chart/pie_chart.dart';
|
|
|
|
|
import 'package:sizer/sizer.dart';
|
|
|
|
|
import 'package:syncfusion_flutter_calendar/calendar.dart';
|
|
|
|
|
|
|
|
|
|
enum LeaveType { ABSENCE, BUSINESS_TRIP, HOLIDAY, NORMAL }
|
|
|
|
|
@ -104,6 +105,18 @@ class _MoeMonthlyAttendanceScreenState extends State<MoeMonthlyAttendanceScreen>
|
|
|
|
|
}),
|
|
|
|
|
18.height,
|
|
|
|
|
AspectRatio(aspectRatio: 304 / 244, child: calendarWidget()),
|
|
|
|
|
12.height,
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
|
|
children: [
|
|
|
|
|
showColorItem("Absence", MyColors.pinkDarkColor),
|
|
|
|
|
showColorItem("Business Trip", MyColors.gradiantStartColor),
|
|
|
|
|
showColorItem("Holiday", MyColors.gradiantEndColor),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
).paddingOnly(left: 21, right: 21, top: 21),
|
|
|
|
|
],
|
|
|
|
|
@ -113,6 +126,20 @@ class _MoeMonthlyAttendanceScreenState extends State<MoeMonthlyAttendanceScreen>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget showColorItem(String title, Color color) {
|
|
|
|
|
return Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
width: 20,
|
|
|
|
|
height: 20,
|
|
|
|
|
color: color,
|
|
|
|
|
).circle(2000),
|
|
|
|
|
8.width,
|
|
|
|
|
title.toText12()
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget calendarWidget() {
|
|
|
|
|
return SfCalendar(
|
|
|
|
|
view: CalendarView.month,
|
|
|
|
|
@ -180,11 +207,11 @@ class _MoeMonthlyAttendanceScreenState extends State<MoeMonthlyAttendanceScreen>
|
|
|
|
|
),
|
|
|
|
|
6.height,
|
|
|
|
|
showText(LocaleKeys.leaveType.tr(), leaves.leaveType.toString()),
|
|
|
|
|
if (leaves.absenceAttendanceTypeName.toString().isNotEmpty)
|
|
|
|
|
const Divider(
|
|
|
|
|
color: MyColors.borderCEColor,
|
|
|
|
|
),
|
|
|
|
|
if (leaves.absenceAttendanceTypeName.toString().isNotEmpty) showText(LocaleKeys.attendanceType.tr(), leaves.absenceAttendanceTypeName.toString()),
|
|
|
|
|
// if (leaves.absenceAttendanceTypeName.toString().isNotEmpty)
|
|
|
|
|
// const Divider(
|
|
|
|
|
// color: MyColors.borderCEColor,
|
|
|
|
|
// ),
|
|
|
|
|
// if (leaves.absenceAttendanceTypeName.toString().isNotEmpty) showText(LocaleKeys.attendanceType.tr(), leaves.absenceAttendanceTypeName.toString()),
|
|
|
|
|
const Divider(
|
|
|
|
|
color: MyColors.borderCEColor,
|
|
|
|
|
),
|
|
|
|
|
@ -232,7 +259,7 @@ class _MoeMonthlyAttendanceScreenState extends State<MoeMonthlyAttendanceScreen>
|
|
|
|
|
margin: const EdgeInsets.all(4),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: leaveType == LeaveType.ABSENCE
|
|
|
|
|
? MyColors.redColor
|
|
|
|
|
? MyColors.pinkDarkColor
|
|
|
|
|
: leaveType == LeaveType.BUSINESS_TRIP
|
|
|
|
|
? MyColors.gradiantStartColor
|
|
|
|
|
: leaveType == LeaveType.HOLIDAY
|
|
|
|
|
@ -241,7 +268,7 @@ class _MoeMonthlyAttendanceScreenState extends State<MoeMonthlyAttendanceScreen>
|
|
|
|
|
shape: BoxShape.circle,
|
|
|
|
|
border: Border.all(
|
|
|
|
|
color: leaveType == LeaveType.ABSENCE
|
|
|
|
|
? MyColors.redColor
|
|
|
|
|
? MyColors.pinkDarkColor
|
|
|
|
|
: leaveType == LeaveType.BUSINESS_TRIP
|
|
|
|
|
? MyColors.gradiantStartColor
|
|
|
|
|
: leaveType == LeaveType.HOLIDAY
|
|
|
|
|
|