是否可以在Flutter中将String转换为Map
String myString = "mytexthere";
Map<dynamic, dynamic> fieldData = jsonDecode(myString);
Map<dynamic, dynamic> fieldData = new Map<dynamic, dynamic>.from(myString);
Map<dynamic, dynamic> fieldData = myString.cast<dynamic, dynamic>();
Map<dynamic, dynamic> fieldData = Map<dynamic, dynamic>.from(myString);
似乎以上都不起作用?有正确的方法吗?
编辑3: 这是有效的方法:
Map<dynamic, dynamic> fieldData = {"body": myString};