setFromJson method
Convert and set any json to T
It doesn't crash if passed incorrect data type value
If it fails to put value it returns false
Implementation
@override
bool setFromJson(json) {
_loaded = false;
if (json is int) set(json);
if (json is double) set(json.toInt());
if (json is String && int.tryParse(json) != null) set(int.parse(json));
if (json is bool) set(json ? 1 : 0);
return isLoaded;
}