我正在尝试使用一种类型Option<Either<T,T>
并希望将其设置为 anone()
但这会导致错误失败Invalid constant value.dart(invalid_constant)
。
如何将选项设置为无或未定义状态。
@freezed
abstract class InvitationsState with _$InvitationsState {
const factory InvitationsState({
@required String email,
@required bool isSubmitting,
@required bool userAlreadyInvited,
Option<Either<IRepositoryFailure, Stream<QuerySnapshot>>> snapshotOrFailure,
}) = _InvitationsState;
factory InvitationsState.initial() => const InvitationsState(
email: "",
isSubmitting: false,
userAlreadyInvited: false,
snapshotOrFailure: none(),
);
}