fromDatabaseFormat static method Null safety

ContentElementDifficulty? fromDatabaseFormat(
  1. {required int? index}
)

Implementation

static ContentElementDifficulty? fromDatabaseFormat(
    {required final int? index}) {
  switch (index) {
    case 0:
      return ContentElementDifficulty.easy;
    case 1:
      return ContentElementDifficulty.normal;
    case 2:
      return ContentElementDifficulty.hard;
    default:
      return null;
  }
}