BasicModel.fromJson constructor

  1. @mustCallSuper
BasicModel.fromJson(
  1. dynamic json
)

Generate the class based on a Map (JSON).

Implementation

@mustCallSuper
BasicModel.fromJson(dynamic json) {
  if (json == null) {
    _originalMap = {};
  } else if (json is String) {
    _originalMap = jsonDecode(json);
  } else {
    _originalMap = Map.from(json);
  }

  updateValues(_originalMap);
}