Answers for "how to json encode string in flutter"

5

dart json encode example

import 'dart:convert';

main() {
  List<String> tags = ['tagA', 'tagB', 'tagC'];
  String jsonTags = jsonEncode(tags);
  print(jsonTags);      // ["tagA","tagB","tagC"]
}
Posted by: Guest on May-19-2021
2

flutter convert json string to json

flutter convert json string to json
----------------------
var x1 = '[{"id": "1"}]';
List<dynamic> x2 = jsonDecode(x1);
print(x2[0]);
Posted by: Guest on May-13-2021

Code answers related to "how to json encode string in flutter"

Code answers related to "Dart"

Browse Popular Code Answers by Language