'How to make model from two requests Flutter

How to make model to post Json made from two Json files?

I make first request and get this Json

{
  "id": 123123,
  "materials" : {      
        "meta" : {
          "href" : "https://products-link.com/materials",          
          "size" : 1,        
      },
  }
}

Then using link "href" : "https://products-link.com/materials" from first Json i'm making second request and get second Json

{
  "name": "assembling",
  "product" : "product name"
}

Then i need to replace data in "materials" in first Json with second Json and get this

{
  "id": 123123,
  "materials" : {      
       "name": "assembling",
       "product" : "product name"
  }
}


Solution 1:[1]

Hello ,multi-way to create JSON to dart model

1: Using this https://jsontodart.com/ converter, this converter converts JSON to dart model file with the class

2: Using this package https://pub.dev/packages/json_to_model

Thank you

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Anmol Mishra