在flutter中编写一个带有built_value和built_collection的模型

时间:2019-06-15 06:38:52

标签: flutter built-value

如何使用built_value和built_collection来为以下JSON响应编写模型。

"totals": {
      "2019-06-09": {
        "sales": "6505.00",
        "orders": 19,
        "items": 55,
        "tax": "0.00",
        "shipping": "400.00",
        "discount": "0.00",
        "customers": 12
      },
      "2019-06-10": {
        "sales": "13335.00",
        "orders": 29,
        "items": 79,
        "tax": "0.00",
        "shipping": "390.00",
        "discount": "0.00",
        "customers": 11
      },
      "2019-06-11": {
        "sales": "6395.00",
        "orders": 20,
        "items": 45,
        "tax": "0.00",
        "shipping": "250.00",
        "discount": "0.00",
        "customers": 10
      },
      "2019-06-12": {
        "sales": "8125.00",
        "orders": 17,
        "items": 59,
        "tax": "0.00",
        "shipping": "340.00",
        "discount": "0.00",
        "customers": 9
      },
      "2019-06-13": {
        "sales": "12205.00",
        "orders": 30,
        "items": 86,
        "tax": "0.00",
        "shipping": "370.00",
        "discount": "0.00",
        "customers": 18
      },
      "2019-06-14": {
        "sales": "4970.00",
        "orders": 17,
        "items": 36,
        "tax": "0.00",
        "shipping": "310.00",
        "discount": "0.00",
        "customers": 16
      },
      "2019-06-15": {
        "sales": "0.00",
        "orders": 0,
        "items": 0,
        "tax": "0.00",
        "shipping": "0.00",
        "discount": "0.00",
        "customers": 0
      }
    }

0 个答案:

没有答案