将下列内容保存为 hello.dart
import 'dart:convert'; String jsonString = ''' { "name": "John Smith", "email": "john@example.com" } '''; void main() { Mapuser = jsonDecode(jsonString); print('Howdy, ${user['name']}!'); print('We sent the verification link to ${user['email']}.'); }
运行
dart hello.dart