fromJson abstract method
void
fromJson(
- dynamic json
Deserializes JSON data into this object instance.
This method should populate the object's properties from the provided JSON data. The implementation should handle type conversion, null values, and nested objects as needed.
Parameters:
json: The JSON data to deserialize. Typically aMap<String, dynamic>or aList, but can be any type depending on the object's structure.
Example:
final model = MyModel();
model.fromJson({'name': 'John', 'age': 30});
Implementation
void fromJson(dynamic json);