Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug fixes, improvements, and code styling 4.3.1 #25

Merged
merged 56 commits into from
Jan 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
3707e7f
dependencies : install lint and run pub upgrade
ryanaidilp Jan 27, 2021
4555b6a
chore : add analysis_options.yaml
ryanaidilp Jan 27, 2021
23ad14b
fix : fix linting error in main.dart
ryanaidilp Jan 27, 2021
93bc8dc
update : update app_const.dart
ryanaidilp Jan 27, 2021
ab9d54c
update : update all models
ryanaidilp Jan 27, 2021
b4e08c5
update : update all widgets
ryanaidilp Jan 27, 2021
71e9c7b
update : update view_util.dart
ryanaidilp Jan 27, 2021
9981c38
update : implements linting in extensions.dart and file_util.dart
ryanaidilp Jan 27, 2021
f1d1d18
update : implements linting in api.dart
ryanaidilp Jan 27, 2021
9ecbf80
update : implements linting in api_service.dart
ryanaidilp Jan 27, 2021
e39e131
update : implements linting in data_repository.dart
ryanaidilp Jan 27, 2021
bb05762
update : implements linting in application_screen.dart
ryanaidilp Jan 27, 2021
848890d
update : implements linting in bottom_nav_screen.dart
ryanaidilp Jan 27, 2021
4e18b30
update : implements linting in change_absent_permission_photo_screen.…
ryanaidilp Jan 27, 2021
4ad929e
update : implements linting in home_screen.dart
ryanaidilp Jan 27, 2021
c4bc05b
update : implements linting in splash_screen.dart
ryanaidilp Jan 27, 2021
f43bcb4
update : implements linting in regulation_screen.dart
ryanaidilp Jan 27, 2021
d022670
fix : dispose controller while disposing widget
ryanaidilp Jan 27, 2021
262b530
update : implements linting in home_screen.dart
ryanaidilp Jan 27, 2021
a2f39ed
update : implements linting in login_screen.dart
ryanaidilp Jan 27, 2021
b3e12a0
update : implements linting in report_screen.dart
ryanaidilp Jan 27, 2021
1914700
update : implements linting in change_outstation_photo_screen.dart
ryanaidilp Jan 27, 2021
a92781e
update : implements linting in change_paid_leave_photo_screen.dart
ryanaidilp Jan 27, 2021
43eaa97
update : implements linting in change_pass_screen.dart
ryanaidilp Jan 27, 2021
259a9e6
update : implements linting in create_notification_screen.dart
ryanaidilp Jan 27, 2021
e41a81d
update : implements linting in create_outstation_screen.dart
ryanaidilp Jan 27, 2021
cfc5636
update : implements linting in create_paid_leave_screen.dart
ryanaidilp Jan 27, 2021
ec33fb0
update : implements linting in create_permission_screen.dart
ryanaidilp Jan 27, 2021
6c5218e
update : implements linting in employee_attendance_screen.dart
ryanaidilp Jan 27, 2021
f26efa2
update : implements linting in employee_list_screen.dart
ryanaidilp Jan 27, 2021
e08e3e6
update : implements linting in employee_outstation.dart
ryanaidilp Jan 27, 2021
ca79851
update : implements linting in employee_paid_leave_screen.dart
ryanaidilp Jan 27, 2021
5999516
update : implements linting in employee_permission.dart
ryanaidilp Jan 27, 2021
6d78be3
update : implements linting in image_detail_screen.dart
ryanaidilp Jan 27, 2021
952012e
update : implements linting in outstation_list_screen.dart
ryanaidilp Jan 27, 2021
f619427
update : implements linting in paid_leave_list_screen.dart
ryanaidilp Jan 27, 2021
b68a476
update : implements linting in permission_list_screen.dart
ryanaidilp Jan 27, 2021
de6e2d7
update : implements linting in presence_list_screen.dart
ryanaidilp Jan 27, 2021
54e7b5f
update : implements linting in presence_screen.dart
ryanaidilp Jan 27, 2021
1e3e5f7
update : implements linting in employee_permission.dart
ryanaidilp Jan 27, 2021
ec12033
update : implements linting in forgot_pass_screen.dart
ryanaidilp Jan 27, 2021
5a19f0a
update : refactor exception handling in all widgets
ryanaidilp Jan 28, 2021
5b47159
fix : fix timer keep refreshing after finished
ryanaidilp Jan 28, 2021
dca4bb6
update : update permission_list_screen.dart
ryanaidilp Jan 28, 2021
f68cabf
update : fetch outstation data by month and year to optimize memory
ryanaidilp Jan 28, 2021
a2e704e
update : update paid_leave_list_screen.dart to fetch data by month an…
ryanaidilp Jan 28, 2021
b9ae6e3
fix : remove exception dialog in report_screen.dart
ryanaidilp Jan 28, 2021
a3382dd
update : fetch employee permissions data by date to optimize memory u…
ryanaidilp Jan 28, 2021
0eda8b2
update : fetch employee outstations data by date to optimize memory u…
ryanaidilp Jan 28, 2021
5d25e61
update : fetch employee paid leaves by date to optimize memory usage
ryanaidilp Jan 28, 2021
e57f68d
fix : fix wrong percentage count function
ryanaidilp Jan 28, 2021
87806e1
fix : fix progress dialog not hiding after error/success in employee_…
ryanaidilp Jan 28, 2021
091b1bc
update : refresh instead of back to home after approve/reject user's …
ryanaidilp Jan 28, 2021
aeaaec7
update : refresh user's outstation data after approved/rejected inste…
ryanaidilp Jan 28, 2021
0494aee
update : refresh user's permissions data after reject/approve instead…
ryanaidilp Jan 28, 2021
334ba45
update : update version name and version number
ryanaidilp Jan 28, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include: package:lint/analysis_options.yaml
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ android {
applicationId "com.banuacoders.siap"
minSdkVersion 24
targetSdkVersion 30
versionCode 40
versionName '4.3.0'
versionCode 41
versionName '4.3.1'
}

signingConfigs {
Expand Down
23 changes: 11 additions & 12 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,17 @@ Future<void> main() async {
Intl.defaultLocale = 'id_ID';
OneSignal.shared.setLogLevel(OSLogLevel.verbose, OSLogLevel.none);
OneSignal.shared.setLocationShared(true);
OneSignal.shared.init(FlutterConfig.get("ONE_SIGNAL_APP_ID"), iOSSettings: {
OSiOSSettings.autoPrompt: false,
OSiOSSettings.inAppLaunchUrl: false
});
OneSignal.shared.init(FlutterConfig.get("ONE_SIGNAL_APP_ID").toString(),
iOSSettings: {
OSiOSSettings.autoPrompt: false,
OSiOSSettings.inAppLaunchUrl: false
});
OneSignal.shared
.setInFocusDisplayType(OSNotificationDisplayType.notification);

var initializedSettingsAndroid =
const initializedSettingsAndroid =
AndroidInitializationSettings('ic_stat_onesignal_default');
var initializationSettings =
const initializationSettings =
InitializationSettings(android: initializedSettingsAndroid);
await flutterLocalNotificationsPlugin.initialize(initializationSettings);

Expand Down Expand Up @@ -71,27 +72,25 @@ class _MyAppState extends State<MyApp> {

Future<void> scheduleAlarm(
DateTime scheduledNotificationDateTime, String body) async {
var androidPlatformChannelSpecifics = AndroidNotificationDetails(
final androidPlatformChannelSpecifics = AndroidNotificationDetails(
'alarm_id', 'alarm_id', 'Channel alarm',
icon: 'ic_stat_onesignal_default',
enableVibration: true,
enableLights: true,
playSound: true,
priority: Priority.high,
importance: Importance.max,
vibrationPattern: Int64List.fromList([0, 1000, 5000, 2000]));

tz.initializeTimeZones();
tz.setLocalLocation(tz.getLocation('Asia/Makassar'));

var scheduleTime = tz.TZDateTime.from(
final scheduleTime = tz.TZDateTime.from(
scheduledNotificationDateTime, tz.getLocation('Asia/Makassar'));

var platformChannelSpecifics =
final platformChannelSpecifics =
NotificationDetails(android: androidPlatformChannelSpecifics);

await flutterLocalNotificationsPlugin.zonedSchedule(
Random().nextInt(pow(2, 31)),
Random().nextInt(int.parse(pow(2, 31).toString())),
'Pengingat',
body,
scheduleTime,
Expand Down
22 changes: 12 additions & 10 deletions lib/models/absent_permission.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,18 @@ class AbsentPermission {

factory AbsentPermission.fromJson(Map<String, dynamic> json) {
return AbsentPermission(
id: json[ABSENT_PERMISSION_ID_FIELD] as int,
title: json[ABSENT_PERMISSION_TITLE_FIELD] as String,
description: json[ABSENT_PERMISSION_DESCRIPTION_FIELD] as String,
isApproved: json[ABSENT_PERMISSION_IS_APPROVED_FIELD] as bool,
photo: json[ABSENT_PERMISSION_PHOTO_FIELD] as String,
approvalStatus: json[APPROVAL_STATUS_FIELD] as String,
dueDate: DateTime.parse(json[ABSENT_PERMISSION_DUE_DATE_FIELD]),
startDate: DateTime.parse(json[ABSENT_PERMISSION_START_DATE_FIELD]),
user: json[ABSENT_PERMISSION_USER_FIELD] != null
? User.fromJson(json[ABSENT_PERMISSION_USER_FIELD])
id: json[absentPermissionIdField] as int,
title: json[absentPermissionTitleField] as String,
description: json[absentPermissionDescriptionField] as String,
isApproved: json[absentPermissionIsApprovedField] as bool,
photo: json[absentPermissionPhotoField] as String,
approvalStatus: json[approvalStatusField] as String,
dueDate: DateTime.parse(json[absentPermissionDueDateField].toString()),
startDate:
DateTime.parse(json[absentPermissionStartDateField].toString()),
user: json[absentPermissionUserField] != null
? User.fromJson(
json[absentPermissionUserField] as Map<String, dynamic>)
: null);
}
}
24 changes: 12 additions & 12 deletions lib/models/employee.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ class Employee {

factory Employee.fromJson(Map<String, dynamic> json) {
return Employee(
nip: json[USER_NIP_FIELD] as String,
name: json[USER_NAME_FIELD] as String,
phone: json[USER_PHONE_FIELD] as String,
gender: json[USER_GENDER_FIELD] as String,
department: json[USER_DEPARTMENT_FIELD] as String,
rank: json[USER_RANK_FIELD] as String,
group: json[USER_GROUP_FIELD] as String,
status: json[USER_STATUS_FIELD] as String,
position: json[USER_POSITION_FIELD] as String,
presences: json[USER_PRESENCES_FIELD] != null
? (json[USER_PRESENCES_FIELD] as List<dynamic>)
.map((json) => Presence.fromJson(json))
nip: json[userNipField] as String,
name: json[userNameField] as String,
phone: json[userPhoneField] as String,
gender: json[userGenderField] as String,
department: json[userDepartmentField] as String,
rank: json[userRankField] as String,
group: json[userGroupField] as String,
status: json[userStatusField] as String,
position: json[userPositionField] as String,
presences: json[userPresencesField] != null
? (json[userPresencesField] as List<dynamic>)
.map((json) => Presence.fromJson(json as Map<String, dynamic>))
.toList()
: null);
}
Expand Down
6 changes: 3 additions & 3 deletions lib/models/holiday.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Holiday {
factory Holiday.fromJson(Map<String, dynamic> json) => Holiday(
date: json == null
? DateTime.now()
: DateTime.parse(json[HOLIDAY_DATE_FIELD].toString()),
name: json[HOLIDAY_NAME_FIELD] as String,
description: json[HOLIDAY_DESCRIPTION_FIELD] as String);
: DateTime.parse(json[holidayDateField].toString()),
name: json[holidayNameField] as String,
description: json[holidayDescriptionField] as String);
}
6 changes: 3 additions & 3 deletions lib/models/location.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ class Location {

factory Location.fromJson(Map<String, dynamic> json) {
return Location(
latitude: double.parse(json[LOCATION_LATITUDE_FIELD].toString()),
longitude: double.parse(json[LOCATION_LONGITUDE_FIELD].toString()),
address: json[LOCATION_ADDRESS_FIELD] as String);
latitude: double.parse(json[locationLatitudeField].toString()),
longitude: double.parse(json[locationLongitudeField].toString()),
address: json[locationAddressField] as String);
}
}
10 changes: 5 additions & 5 deletions lib/models/notification.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ class UserNotification {

factory UserNotification.fromJson(Map<String, dynamic> json) {
return UserNotification(
id: json[NOTIFICATION_ID_FIELD] as String,
notifiableId: json[NOTIFICATION_NOTIFIABLE_ID_FIELD] as int,
notifiableType: json[NOTIFICATION_NOTIFIABLE_TYPE_FIELD] as String,
data: json[JSON_DATA_FIELD] as Map<String, dynamic>,
isRead: json[NOTIFICATION_IS_READ_FIELD] as bool);
id: json[notificationIdField] as String,
notifiableId: json[notificationNotifiableIdField] as int,
notifiableType: json[notificationNotifiableTypeField] as String,
data: json[jsonDataField] as Map<String, dynamic>,
isRead: json[notificationIsReadField] as bool);
}
}
20 changes: 10 additions & 10 deletions lib/models/outstation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ class Outstation {

factory Outstation.fromJson(Map<String, dynamic> json) {
return Outstation(
id: json[OUTSTATION_ID_FIELD] as int,
title: json[OUTSTATION_TITLE_FIELD] as String,
description: json[OUTSTATION_DESCRIPTION_FIELD] as String,
isApproved: json[OUTSTATION_IS_APPROVED_FIELD] as bool,
photo: json[OUTSTATION_PHOTO_FIELD] as String,
approvalStatus: json[APPROVAL_STATUS_FIELD] as String,
dueDate: DateTime.parse(json[OUTSTATION_DUE_DATE_FIELD]),
startDate: DateTime.parse(json[OUTSTATION_START_DATE_FIELD]),
user: json[OUTSTATION_USER_FIELD] != null
? User.fromJson(json[OUTSTATION_USER_FIELD])
id: json[outstationIdField] as int,
title: json[outstationTitleField] as String,
description: json[outstationDescriptionField] as String,
isApproved: json[outstationIsApprovedField] as bool,
photo: json[outstationPhotoField] as String,
approvalStatus: json[approvalStatusField] as String,
dueDate: DateTime.parse(json[outstationDueDateField].toString()),
startDate: DateTime.parse(json[outstationStartDateField].toString()),
user: json[outstationUserField] != null
? User.fromJson(json[outstationUserField] as Map<String, dynamic>)
: null);
}
}
22 changes: 11 additions & 11 deletions lib/models/paid_leave.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ class PaidLeave {
final User user;

factory PaidLeave.fromJson(Map<String, dynamic> json) => PaidLeave(
id: json[PAID_LEAVE_ID_FIELD] as int,
title: json[PAID_LEAVE_TITLE_FIELD] as String,
category: json[PAID_LEAVE_CATEGORY_FIELD] as String,
description: json[PAID_LEAVE_DESCRIPTION_FIELD] as String,
isApproved: json[PAID_LEAVE_IS_APPROVED_FIELD] as bool,
approvalStatus: json[APPROVAL_STATUS_FIELD] as String,
startDate: DateTime.parse(json[PAID_LEAVE_START_DATE_FIELD]),
dueDate: DateTime.parse(json[PAID_LEAVE_DUE_DATE_FIELD]),
photo: json[PAID_LEAVE_PHOTO_FIELD] as String,
user: json[PAID_LEAVE_USER_FIELD] != null
? User.fromJson(json[PAID_LEAVE_USER_FIELD])
id: json[paidLeaveIdField] as int,
title: json[paidLeaveTitleField] as String,
category: json[paidLeaveCategoryField] as String,
description: json[paidLeaveDescriptionField] as String,
isApproved: json[paidLeaveIsApprovedField] as bool,
approvalStatus: json[approvalStatusField] as String,
startDate: DateTime.parse(json[paidLeaveStartDateField].toString()),
dueDate: DateTime.parse(json[paidLeaveDueDateField].toString()),
photo: json[paidLeavePhotoField] as String,
user: json[paidLeaveUserField] != null
? User.fromJson(json[paidLeaveUserField] as Map<String, dynamic>)
: null);
}
18 changes: 9 additions & 9 deletions lib/models/presence.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ class Presence {

factory Presence.fromJson(Map<String, dynamic> json) {
return Presence(
id: json[USER_ID_FIELD] as int,
date: DateTime.parse(json[PRESENCE_DATE_FIELD].toString()),
codeType: json[PRESENCE_CODE_TYPE_FIELD] as String,
status: json[PRESENCE_STATUS_FIELD] as String,
attendTime: json[PRESENCE_ATTEND_TIME_FIELD] as String,
id: json[userIdField] as int,
date: DateTime.parse(json[presenceDateField].toString()),
codeType: json[presenceCodeTypeField] as String,
status: json[presenceStatusField] as String,
attendTime: json[presenceAttendTimeField] as String,
location: Location.fromJson(
json[PRESENCE_LOCATION_FIELD] as Map<String, dynamic>),
photo: json[PRESENCE_PHOTO_FIELD] as String,
startTime: DateTime.parse(json[PRESENCE_START_TIME_FIELD].toString()),
endTime: DateTime.parse(json[PRESENCE_END_TIME_FIELD].toString()),
json[presenceLocationField] as Map<String, dynamic>),
photo: json[presencePhotoField] as String,
startTime: DateTime.parse(json[presenceStartTimeField].toString()),
endTime: DateTime.parse(json[presenceEndTimeField].toString()),
);
}
}
16 changes: 9 additions & 7 deletions lib/models/report/absent_report.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ class AbsentReport {
final int totalWorkDay;

factory AbsentReport.fromJson(Map<String, dynamic> json) => AbsentReport(
daily: (json[ABSENT_REPORT_DAILY_FIELD] as List<dynamic>)
.map((item) => Daily.fromJson(item))
daily: (json[absentReportDailyField] as List<dynamic>)
.map((item) => Daily.fromJson(item as Map<String, dynamic>))
.toList(),
monthly: Monthly.fromJson(json[ABSENT_REPORT_MONTHLY_FIELD]),
yearly: Yearly.fromJson(json[ABSENT_REPORT_YEARLY_FIELD]),
holidays: (json[ABSENT_REPORT_HOLIDAYS_FIELD] as List<dynamic>)
.map((item) => Holiday.fromJson(item))
monthly: Monthly.fromJson(
json[absentReportMonthlyField] as Map<String, dynamic>),
yearly: Yearly.fromJson(
json[absentReportYearlyField] as Map<String, dynamic>),
holidays: (json[absentReportHolidaysField] as List<dynamic>)
.map((item) => Holiday.fromJson(item as Map<String, dynamic>))
.toList(),
totalWorkDay: json[REPORT_TOTAL_WORK_DAY_FIELD] as int);
totalWorkDay: json[reportTotalWorkDayField] as int);
}
34 changes: 18 additions & 16 deletions lib/models/report/daily.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ class Daily {
final List<DailyData> attendances;

factory Daily.fromJson(Map<String, dynamic> json) {
List<dynamic> _presences = json[DAILY_PRESENCES_FIELD] as List<dynamic>;
final List<dynamic> _presences = json[dailyPresencesField] as List<dynamic>;

return Daily(
date: DateTime.parse(json[DAILY_DATE_FIELD].toString()),
date: DateTime.parse(json[dailyDateField].toString()),
attendancePercentage:
double.parse(json[REPORT_ATTENDANCE_PERCENTAGE_FIELD].toString()),
attendances: _presences.map((json) => DailyData.fromJson(json)).toList(),
double.parse(json[reportAttendancePercentageFieldField].toString()),
attendances: _presences
.map((json) => DailyData.fromJson(json as Map<String, dynamic>))
.toList(),
);
}
}
Expand All @@ -36,19 +38,19 @@ class DailyData {
final String photo;

factory DailyData.fromJson(Map<String, dynamic> json) => DailyData(
attendTime: json[DAILY_DATA_ATTEND_TIME_FIELD],
attendType: json[DAILY_DATA_ATTEND_TYPE_FIELD],
attendStatus: json[DAILY_DATA_ATTEND_STATUS_FIELD],
startTime: DateTime.parse(json[PRESENCE_START_TIME_FIELD]),
address: json[LOCATION_ADDRESS_FIELD] as String,
photo: json[PRESENCE_PHOTO_FIELD] as String);
attendTime: json[dailyDataAttendTimeField].toString(),
attendType: json[dailyDataAttendTypeField].toString(),
attendStatus: json[dailyDataAttendStatusField].toString(),
startTime: DateTime.parse(json[presenceStartTimeField].toString()),
address: json[locationAddressField] as String,
photo: json[presencePhotoField] as String);

Map<String, dynamic> toMap() => <String, dynamic>{
DAILY_DATA_ATTEND_TYPE_FIELD: this.attendType,
DAILY_DATA_ATTEND_TIME_FIELD: this.attendTime,
DAILY_DATA_ATTEND_STATUS_FIELD: this.attendStatus,
PRESENCE_START_TIME_FIELD: this.startTime.toString(),
LOCATION_ADDRESS_FIELD: this.address,
PRESENCE_PHOTO_FIELD: this.photo
dailyDataAttendTypeField: attendType,
dailyDataAttendTimeField: attendTime,
dailyDataAttendStatusField: attendStatus,
presenceStartTimeField: startTime.toString(),
locationAddressField: address,
presencePhotoField: photo
};
}
12 changes: 6 additions & 6 deletions lib/models/report/monthly.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ class Monthly {

factory Monthly.fromJson(Map<String, dynamic> json) => Monthly(
attendancePercentage:
double.parse(json[REPORT_ATTENDANCE_PERCENTAGE_FIELD].toString()),
lateCount: json[REPORT_LATE_COUNT_FIELD] as int,
leaveEarlyCount: json[REPORT_LEAVE_EARLY_COUNT_FIELD] as int,
notMorningParadeCount: json[REPORT_NOT_MORNING_PARADE_COUNT_FIELD] as int,
earlyLunchBreakCount: json[REPORT_EARLY_LUNCH_BREAK_COUNT_FIELD] as int,
double.parse(json[reportAttendancePercentageFieldField].toString()),
lateCount: json[reportLateCountField] as int,
leaveEarlyCount: json[reportLeaveEarlyFieldCountField] as int,
notMorningParadeCount: json[reportNotMorningParadeCountField] as int,
earlyLunchBreakCount: json[reportEarlyLunchBreakCountField] as int,
notComeAfterLunchBreakCount:
json[REPORT_NOT_COME_AFTER_LUNCH_BREAK_COUNT_FIELD] as int);
json[reportNotComeAfterLunchBreakCountField] as int);
}
30 changes: 14 additions & 16 deletions lib/models/report/yearly.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,24 @@ class Yearly {

factory Yearly.fromJson(Map<String, dynamic> json) {
return Yearly(
lateCount: json[REPORT_LATE_COUNT_FIELD],
lateCount: json[reportLateCountField] as int,
attendancePercentage:
double.parse(json[REPORT_ATTENDANCE_PERCENTAGE_FIELD].toString()),
absent: json[YEARLY_ABSENT_FIELD] as Map<String, dynamic>,
double.parse(json[reportAttendancePercentageFieldField].toString()),
absent: json[yearlyAbsentField] as Map<String, dynamic>,
absentPermission:
json[YEARLY_ABSENT_PERMISSION_FIELD] as Map<String, dynamic>,
outstation: json[YEARLY_OUTSTATION_FIELD] as Map<String, dynamic>,
leaveEarlyCount: json[REPORT_LEAVE_EARLY_COUNT_FIELD] as int,
notMorningParadeCount:
json[REPORT_NOT_MORNING_PARADE_COUNT_FIELD] as int,
earlyLunchBreakCount: json[REPORT_EARLY_LUNCH_BREAK_COUNT_FIELD] as int,
json[yearlyAbsentPermissionField] as Map<String, dynamic>,
outstation: json[yearlyOutstationField] as Map<String, dynamic>,
leaveEarlyCount: json[reportLeaveEarlyFieldCountField] as int,
notMorningParadeCount: json[reportNotMorningParadeCountField] as int,
earlyLunchBreakCount: json[reportEarlyLunchBreakCountField] as int,
notComeAfterLunchBreakCount:
json[REPORT_NOT_COME_AFTER_LUNCH_BREAK_COUNT_FIELD] as int,
annualLeave: json[REPORT_ANNUAL_LEAVE_FIELD] as Map<String, dynamic>,
json[reportNotComeAfterLunchBreakCountField] as int,
annualLeave: json[reportAnnualLeaveField] as Map<String, dynamic>,
importantReasonLeave:
json[REPORT_IMPORTANT_REASON_LEAVE_FIELD] as Map<String, dynamic>,
sickLeave: json[REPORT_SICK_LEAVE_FIELD] as Map<String, dynamic>,
maternityLeave:
json[REPORT_MATERNITY_LEAVE_FIELD] as Map<String, dynamic>,
json[reportImportantReasonLeaveField] as Map<String, dynamic>,
sickLeave: json[reportSickLeaveField] as Map<String, dynamic>,
maternityLeave: json[reportMaternityLeaveField] as Map<String, dynamic>,
outOfLiabilityLeave:
json[REPORT_OUT_OF_LIABILITY_LEAVE_FIELD] as Map<String, dynamic>);
json[reportOutOfLiabilityLeaveField] as Map<String, dynamic>);
}
}
Loading