String? tryEncode(Map<String, dynamic> data) { try { return jsonEncode(data); } catch (e) { return null; } }