toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() {
  return {
    _typeKey: type.name,
    if (data != null) _dataKey: data!,
  };
}