beforeSerialize method

  1. @override
Object? beforeSerialize(
  1. Object? object,
  2. FullType specifiedType
)
override

Implementation

@override
Object? beforeSerialize(Object? object, FullType specifiedType) {
  if (_unsupportedTypes.contains(specifiedType.root)) {
    throw ArgumentError(
        'Standard JSON cannot serialize type ${specifiedType.root}.');
  }
  return object;
}