Answers for "dart map list to json"

5

dart list to json

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
1

convert a list to string in flutter

List<String> list =["one", "Two", "Thee"];
 print(list.join(","));  // Output will be like this : one,Two,Thee
Posted by: Guest on December-10-2020

Code answers related to "Dart"

Browse Popular Code Answers by Language