I am trying to use a type of Option<Either<T,T>
and want to set this to a none()
but this fails the error Invalid constant value.dart(invalid_constant)
.
How can I set a Option to a none or undefined state.
@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(),
);
}