How to decode JSON in Flutter?

后端 未结 5 2014
独厮守ぢ
独厮守ぢ 2020-12-05 09:52

How to decode JSON in Flutter?

The question is simple, but the answer isn\'t, at least for me.

I have a project that uses a lot of JSON Strings. Basically, t

5条回答
  •  旧巷少年郎
    2020-12-05 10:17

    You need to use import 'dart:convert';

    Decode : JsonDecoder().convert("$response");

    Encode : JsonEncoder().convert(object)

提交回复
热议问题