toJson static method

String toJson(
  1. List<Map<String, dynamic>> maps, {
  2. bool pretty = true,
})

Converts a list of row maps to a formatted JSON string.

Implementation

static String toJson(List<Map<String, dynamic>> maps, {bool pretty = true}) {
  if (pretty) {
    return const JsonEncoder.withIndent('  ').convert(maps);
  }
  return jsonEncode(maps);
}