parseModel method

void parseModel(
  1. Map data
)

Implementation

void parseModel(Map data) {
  JSnail js = const JSnail();
  age = js.readInt(data, 'age'); // 30
  name = js.readString(data, 'name'); // 'John'
  role = js.readEnum(data, 'role', Role.values, Role.unknown); // admin,
  isStudent = js.readBool(data, 'isStudent'); // true
  grades = js.readList(data, 'grades'); // [95, 88]
}