copyWith method

UserLoginState copyWith({
  1. Object? userName = _sentinal,
  2. Object? password = _sentinal,
  3. bool? isLoading,
  4. String? errorMessage,
  5. bool? isSuccess,
})

Implementation

UserLoginState copyWith({
  Object? userName = _sentinal,
  Object? password = _sentinal,
  bool? isLoading,
  String? errorMessage,
  bool? isSuccess,
}) {
  return UserLoginState(
    userName: userName == _sentinal ? this.userName : userName as String?,
    password: password == _sentinal ? this.password : password as String?,
    isLoading: isLoading ?? this.isLoading,
    errorMessage: errorMessage,
    isSuccess: isSuccess ?? this.isSuccess,
  );
}