String encodeJson(Object val, { bool pretty: false })

Source

String encodeJson(Object val, {bool pretty: false});