setFromJson method
Convert any given json to correspondig types and store it. If fails, it returns false.
Implementation
@override
bool setFromJson(json) {
if (json == null) {
current = null;
return true;
}
if (json is T) {
current = json;
return true;
}
final child = childCreator();
final result = child.setFromJson(json);
if (result) {
current = child;
}
return result;
}