I have a freezed class and somehow I cannot access copyWith method. What is my mistake?
Class:
@freezed
class LoginState with _$LoginState {
const factory LoginState({
String? username,
String? password,
@Default(false) bool isValid,
String? errorMessage,
}) = _LoginState;
factory LoginState.empty() => LoginState();
factory LoginState.initial() = _Initial;
}
Try to access copyWith like this:
LoginState state = LoginState();
state.copyWith(); //cannot access copyWith