Encodes the concrete union member.
@override Object? toJson() => <Object?>[for (final item in value) item];