📅  最后修改于: 2022-03-11 14:55:57.460000             🧑  作者: Mango
void main() {
var jsonString = '{"abc';
var decodeSucceeded = false;
try {
var decodedJSON = json.decode(jsonString) as Map;
decodeSucceeded = true;
} on FormatException catch (e) {
print('The provided string is not valid JSON');
}
print('Decoding succeeded: $decodeSucceeded');
}