import 'package:making_school_asignment_app/common/job/enum_subject.dart';
import 'package:making_school_asignment_app/common/store/user_store.dart';

class EnumUtils {
  static String formatSubject(int id) {
    if (UserStore.to.subjectList.isEmpty || id == null) {
      return '';
    }
    EnumSubject item = UserStore.to.subjectList.firstWhere((element) => element.id == id);
    return item.name ?? '';
  }

  static String formatGrade(int id) {
    if (UserStore.to.gradeList.isEmpty || id == null) {
      return '';
    }
    EnumSubject item = UserStore.to.gradeList.firstWhere((element) => element.id == id);
    return item.name ?? '';
  }
}
