flutter how to turn a string in a map
import 'dart:convert';
...
Map valueMap = json.decode(value);
// or
Map valueMap = jsonDecode(value);
flutter how to turn a string in a map
import 'dart:convert';
...
Map valueMap = json.decode(value);
// or
Map valueMap = jsonDecode(value);
convert map values to string list flutter
~~~ Convert Map values to string list flutter
~~~ Example code below
final Map<dynamic, dynamic> json = {
"name": "alice",
"data": ["foo", "bar", "baz"],
};
// method 1, cast while mapping:
final data1 = (json["data"] as List)?.map((e) => e as String)?.toList();
print("method 1 prints: $data1");
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us