tryEncodeJson static method

Future<String?> tryEncodeJson(
  1. Map<String, dynamic> map
)

Implementation

static Future<String?> tryEncodeJson(Map<String, dynamic> map) {
  try {
    var encoded = json.encode(map);
    return Future.value(encoded);
  } catch (e) {
    throw Exception(e);
  }
}