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