Interview frequency: …
Short answer
A typed model sets a contract for the data and isolates parsing from the UI, revealing missing or changed fields before they spread through the app.
Explanation
Check nullability and types at the network boundary, and keep the JSON conversion in the data layer. A generator or manual parsing are both options; the decision depends on the size of the schema and how often it changes, not on a single package.
Code example
factory User.fromJson(Map<String, Object?> json) => User(
id: json["id"]! as String,
name: json["name"]! as String,
);Common mistakes
- Passing Map<String, dynamic> to every layer of the app.
- Assuming the API schema is fixed without versioning or validation.