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