{
  "id": 16879466,
  "title": "Why your Flutter JSON model crashes at runtime (and how to generate one that doesn't)",
  "url": "https://urgent.news/2026/10/28/why-your-flutter-json-model-crashes-at-runtime-and-how-to-generate",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-28T09:37:50.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/chanpenh/why-your-flutter-json-model-crashes-at-runtime-and-how-to-generate-one-that-doesnt-hf6"
  },
  "original_language": "en",
  "account": "When writing a JSON model for a Flutter application, there are three common type errors that can cause crashes at runtime. These errors occur when the data received from the API changes unexpectedly, leading to mismatches between the expected data types and the actual data. By understanding these issues and implementing appropriate fixes, developers can create robust models that handle real-world responses.",
  "summary": "You write a model, the first API response parses fine, and a week later a crash report says: type 'int' is not a subtype of type 'double' in type cast Nothing in your code changed. The data did. Here are the three type errors I see most often with jsonDecode , why they happen, and how to write (or generate) models that survive real responses. 1. int vs double Dart's jsonDecode reads the number…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}