CourseNotifyData.loadCurrent constructor
CourseNotifyData.loadCurrent()
Implementation
factory CourseNotifyData.loadCurrent() {
final String semester = Preferences.getString(
ApConstants.currentSemesterCode,
ApConstants.semesterLatest,
);
final String rawString = Preferences.getString(
'${ApConstants.packageName}.'
'course_notify_data_$semester',
'',
);
debugPrint(rawString);
if (rawString == '') {
return CourseNotifyData(data: <CourseNotify>[])..tag = semester;
} else {
return CourseNotifyData.fromRawJson(rawString)..tag = semester;
}
}