Serialize the object into a JSON string.
String serialize(Object? obj) { String serialized = ''; if (obj == null) { serialized = ''; } else { serialized = json.encode(obj); } return serialized; }