From a829d2ac61418700ccab8f181c086c2a640459fc Mon Sep 17 00:00:00 2001 From: Hieu <hieugaomoc@gmail.com> Date: Wed, 23 Feb 2022 20:26:17 +0700 Subject: [PATCH 1/9] refactor: remove `freezed` files --- .../application/sign_in_bloc.freezed.dart | 771 ---------- .../application/sign_up_bloc.freezed.dart | 1007 ------------- .../user/application/splash_bloc.freezed.dart | 312 ---- .../lib/user/domain/auth_state.freezed.dart | 487 ------- .../application/app/app_bloc.freezed.dart | 1273 ----------------- .../application/doc/doc_bloc.freezed.dart | 1214 ---------------- .../application/doc/share_bloc.freezed.dart | 867 ----------- .../edit_pannel/edit_pannel_bloc.freezed.dart | 541 ------- .../application/home/home_bloc.freezed.dart | 851 ----------- .../home/home_listen_bloc.freezed.dart | 767 ---------- .../application/menu/menu_bloc.freezed.dart | 1061 -------------- .../menu/menu_user_bloc.freezed.dart | 481 ------- .../application/trash/trash_bloc.freezed.dart | 1131 --------------- .../application/view/view_bloc.freezed.dart | 1166 --------------- .../workspace/welcome_bloc.freezed.dart | 891 ------------ 15 files changed, 12820 deletions(-) delete mode 100644 frontend/app_flowy/lib/user/application/sign_in_bloc.freezed.dart delete mode 100644 frontend/app_flowy/lib/user/application/sign_up_bloc.freezed.dart delete mode 100644 frontend/app_flowy/lib/user/application/splash_bloc.freezed.dart delete mode 100644 frontend/app_flowy/lib/user/domain/auth_state.freezed.dart delete mode 100644 frontend/app_flowy/lib/workspace/application/app/app_bloc.freezed.dart delete mode 100644 frontend/app_flowy/lib/workspace/application/doc/doc_bloc.freezed.dart delete mode 100644 frontend/app_flowy/lib/workspace/application/doc/share_bloc.freezed.dart delete mode 100644 frontend/app_flowy/lib/workspace/application/edit_pannel/edit_pannel_bloc.freezed.dart delete mode 100644 frontend/app_flowy/lib/workspace/application/home/home_bloc.freezed.dart delete mode 100644 frontend/app_flowy/lib/workspace/application/home/home_listen_bloc.freezed.dart delete mode 100644 frontend/app_flowy/lib/workspace/application/menu/menu_bloc.freezed.dart delete mode 100644 frontend/app_flowy/lib/workspace/application/menu/menu_user_bloc.freezed.dart delete mode 100644 frontend/app_flowy/lib/workspace/application/trash/trash_bloc.freezed.dart delete mode 100644 frontend/app_flowy/lib/workspace/application/view/view_bloc.freezed.dart delete mode 100644 frontend/app_flowy/lib/workspace/application/workspace/welcome_bloc.freezed.dart diff --git a/frontend/app_flowy/lib/user/application/sign_in_bloc.freezed.dart b/frontend/app_flowy/lib/user/application/sign_in_bloc.freezed.dart deleted file mode 100644 index 29b67d3fa7..0000000000 --- a/frontend/app_flowy/lib/user/application/sign_in_bloc.freezed.dart +++ /dev/null @@ -1,771 +0,0 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target - -part of 'sign_in_bloc.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity<T>(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); - -/// @nodoc -class _$SignInEventTearOff { - const _$SignInEventTearOff(); - - SignedInWithUserEmailAndPassword signedInWithUserEmailAndPassword() { - return const SignedInWithUserEmailAndPassword(); - } - - EmailChanged emailChanged(String email) { - return EmailChanged( - email, - ); - } - - PasswordChanged passwordChanged(String password) { - return PasswordChanged( - password, - ); - } -} - -/// @nodoc -const $SignInEvent = _$SignInEventTearOff(); - -/// @nodoc -mixin _$SignInEvent { - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() signedInWithUserEmailAndPassword, - required TResult Function(String email) emailChanged, - required TResult Function(String password) passwordChanged, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? signedInWithUserEmailAndPassword, - TResult Function(String email)? emailChanged, - TResult Function(String password)? passwordChanged, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? signedInWithUserEmailAndPassword, - TResult Function(String email)? emailChanged, - TResult Function(String password)? passwordChanged, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(SignedInWithUserEmailAndPassword value) - signedInWithUserEmailAndPassword, - required TResult Function(EmailChanged value) emailChanged, - required TResult Function(PasswordChanged value) passwordChanged, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(SignedInWithUserEmailAndPassword value)? - signedInWithUserEmailAndPassword, - TResult Function(EmailChanged value)? emailChanged, - TResult Function(PasswordChanged value)? passwordChanged, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(SignedInWithUserEmailAndPassword value)? - signedInWithUserEmailAndPassword, - TResult Function(EmailChanged value)? emailChanged, - TResult Function(PasswordChanged value)? passwordChanged, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $SignInEventCopyWith<$Res> { - factory $SignInEventCopyWith( - SignInEvent value, $Res Function(SignInEvent) then) = - _$SignInEventCopyWithImpl<$Res>; -} - -/// @nodoc -class _$SignInEventCopyWithImpl<$Res> implements $SignInEventCopyWith<$Res> { - _$SignInEventCopyWithImpl(this._value, this._then); - - final SignInEvent _value; - // ignore: unused_field - final $Res Function(SignInEvent) _then; -} - -/// @nodoc -abstract class $SignedInWithUserEmailAndPasswordCopyWith<$Res> { - factory $SignedInWithUserEmailAndPasswordCopyWith( - SignedInWithUserEmailAndPassword value, - $Res Function(SignedInWithUserEmailAndPassword) then) = - _$SignedInWithUserEmailAndPasswordCopyWithImpl<$Res>; -} - -/// @nodoc -class _$SignedInWithUserEmailAndPasswordCopyWithImpl<$Res> - extends _$SignInEventCopyWithImpl<$Res> - implements $SignedInWithUserEmailAndPasswordCopyWith<$Res> { - _$SignedInWithUserEmailAndPasswordCopyWithImpl( - SignedInWithUserEmailAndPassword _value, - $Res Function(SignedInWithUserEmailAndPassword) _then) - : super(_value, (v) => _then(v as SignedInWithUserEmailAndPassword)); - - @override - SignedInWithUserEmailAndPassword get _value => - super._value as SignedInWithUserEmailAndPassword; -} - -/// @nodoc - -class _$SignedInWithUserEmailAndPassword - implements SignedInWithUserEmailAndPassword { - const _$SignedInWithUserEmailAndPassword(); - - @override - String toString() { - return 'SignInEvent.signedInWithUserEmailAndPassword()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is SignedInWithUserEmailAndPassword); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() signedInWithUserEmailAndPassword, - required TResult Function(String email) emailChanged, - required TResult Function(String password) passwordChanged, - }) { - return signedInWithUserEmailAndPassword(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? signedInWithUserEmailAndPassword, - TResult Function(String email)? emailChanged, - TResult Function(String password)? passwordChanged, - }) { - return signedInWithUserEmailAndPassword?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? signedInWithUserEmailAndPassword, - TResult Function(String email)? emailChanged, - TResult Function(String password)? passwordChanged, - required TResult orElse(), - }) { - if (signedInWithUserEmailAndPassword != null) { - return signedInWithUserEmailAndPassword(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(SignedInWithUserEmailAndPassword value) - signedInWithUserEmailAndPassword, - required TResult Function(EmailChanged value) emailChanged, - required TResult Function(PasswordChanged value) passwordChanged, - }) { - return signedInWithUserEmailAndPassword(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(SignedInWithUserEmailAndPassword value)? - signedInWithUserEmailAndPassword, - TResult Function(EmailChanged value)? emailChanged, - TResult Function(PasswordChanged value)? passwordChanged, - }) { - return signedInWithUserEmailAndPassword?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(SignedInWithUserEmailAndPassword value)? - signedInWithUserEmailAndPassword, - TResult Function(EmailChanged value)? emailChanged, - TResult Function(PasswordChanged value)? passwordChanged, - required TResult orElse(), - }) { - if (signedInWithUserEmailAndPassword != null) { - return signedInWithUserEmailAndPassword(this); - } - return orElse(); - } -} - -abstract class SignedInWithUserEmailAndPassword implements SignInEvent { - const factory SignedInWithUserEmailAndPassword() = - _$SignedInWithUserEmailAndPassword; -} - -/// @nodoc -abstract class $EmailChangedCopyWith<$Res> { - factory $EmailChangedCopyWith( - EmailChanged value, $Res Function(EmailChanged) then) = - _$EmailChangedCopyWithImpl<$Res>; - $Res call({String email}); -} - -/// @nodoc -class _$EmailChangedCopyWithImpl<$Res> extends _$SignInEventCopyWithImpl<$Res> - implements $EmailChangedCopyWith<$Res> { - _$EmailChangedCopyWithImpl( - EmailChanged _value, $Res Function(EmailChanged) _then) - : super(_value, (v) => _then(v as EmailChanged)); - - @override - EmailChanged get _value => super._value as EmailChanged; - - @override - $Res call({ - Object? email = freezed, - }) { - return _then(EmailChanged( - email == freezed - ? _value.email - : email // ignore: cast_nullable_to_non_nullable - as String, - )); - } -} - -/// @nodoc - -class _$EmailChanged implements EmailChanged { - const _$EmailChanged(this.email); - - @override - final String email; - - @override - String toString() { - return 'SignInEvent.emailChanged(email: $email)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is EmailChanged && - (identical(other.email, email) || - const DeepCollectionEquality().equals(other.email, email))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ const DeepCollectionEquality().hash(email); - - @JsonKey(ignore: true) - @override - $EmailChangedCopyWith<EmailChanged> get copyWith => - _$EmailChangedCopyWithImpl<EmailChanged>(this, _$identity); - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() signedInWithUserEmailAndPassword, - required TResult Function(String email) emailChanged, - required TResult Function(String password) passwordChanged, - }) { - return emailChanged(email); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? signedInWithUserEmailAndPassword, - TResult Function(String email)? emailChanged, - TResult Function(String password)? passwordChanged, - }) { - return emailChanged?.call(email); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? signedInWithUserEmailAndPassword, - TResult Function(String email)? emailChanged, - TResult Function(String password)? passwordChanged, - required TResult orElse(), - }) { - if (emailChanged != null) { - return emailChanged(email); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(SignedInWithUserEmailAndPassword value) - signedInWithUserEmailAndPassword, - required TResult Function(EmailChanged value) emailChanged, - required TResult Function(PasswordChanged value) passwordChanged, - }) { - return emailChanged(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(SignedInWithUserEmailAndPassword value)? - signedInWithUserEmailAndPassword, - TResult Function(EmailChanged value)? emailChanged, - TResult Function(PasswordChanged value)? passwordChanged, - }) { - return emailChanged?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(SignedInWithUserEmailAndPassword value)? - signedInWithUserEmailAndPassword, - TResult Function(EmailChanged value)? emailChanged, - TResult Function(PasswordChanged value)? passwordChanged, - required TResult orElse(), - }) { - if (emailChanged != null) { - return emailChanged(this); - } - return orElse(); - } -} - -abstract class EmailChanged implements SignInEvent { - const factory EmailChanged(String email) = _$EmailChanged; - - String get email => throw _privateConstructorUsedError; - @JsonKey(ignore: true) - $EmailChangedCopyWith<EmailChanged> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $PasswordChangedCopyWith<$Res> { - factory $PasswordChangedCopyWith( - PasswordChanged value, $Res Function(PasswordChanged) then) = - _$PasswordChangedCopyWithImpl<$Res>; - $Res call({String password}); -} - -/// @nodoc -class _$PasswordChangedCopyWithImpl<$Res> - extends _$SignInEventCopyWithImpl<$Res> - implements $PasswordChangedCopyWith<$Res> { - _$PasswordChangedCopyWithImpl( - PasswordChanged _value, $Res Function(PasswordChanged) _then) - : super(_value, (v) => _then(v as PasswordChanged)); - - @override - PasswordChanged get _value => super._value as PasswordChanged; - - @override - $Res call({ - Object? password = freezed, - }) { - return _then(PasswordChanged( - password == freezed - ? _value.password - : password // ignore: cast_nullable_to_non_nullable - as String, - )); - } -} - -/// @nodoc - -class _$PasswordChanged implements PasswordChanged { - const _$PasswordChanged(this.password); - - @override - final String password; - - @override - String toString() { - return 'SignInEvent.passwordChanged(password: $password)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is PasswordChanged && - (identical(other.password, password) || - const DeepCollectionEquality() - .equals(other.password, password))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ const DeepCollectionEquality().hash(password); - - @JsonKey(ignore: true) - @override - $PasswordChangedCopyWith<PasswordChanged> get copyWith => - _$PasswordChangedCopyWithImpl<PasswordChanged>(this, _$identity); - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() signedInWithUserEmailAndPassword, - required TResult Function(String email) emailChanged, - required TResult Function(String password) passwordChanged, - }) { - return passwordChanged(password); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? signedInWithUserEmailAndPassword, - TResult Function(String email)? emailChanged, - TResult Function(String password)? passwordChanged, - }) { - return passwordChanged?.call(password); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? signedInWithUserEmailAndPassword, - TResult Function(String email)? emailChanged, - TResult Function(String password)? passwordChanged, - required TResult orElse(), - }) { - if (passwordChanged != null) { - return passwordChanged(password); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(SignedInWithUserEmailAndPassword value) - signedInWithUserEmailAndPassword, - required TResult Function(EmailChanged value) emailChanged, - required TResult Function(PasswordChanged value) passwordChanged, - }) { - return passwordChanged(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(SignedInWithUserEmailAndPassword value)? - signedInWithUserEmailAndPassword, - TResult Function(EmailChanged value)? emailChanged, - TResult Function(PasswordChanged value)? passwordChanged, - }) { - return passwordChanged?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(SignedInWithUserEmailAndPassword value)? - signedInWithUserEmailAndPassword, - TResult Function(EmailChanged value)? emailChanged, - TResult Function(PasswordChanged value)? passwordChanged, - required TResult orElse(), - }) { - if (passwordChanged != null) { - return passwordChanged(this); - } - return orElse(); - } -} - -abstract class PasswordChanged implements SignInEvent { - const factory PasswordChanged(String password) = _$PasswordChanged; - - String get password => throw _privateConstructorUsedError; - @JsonKey(ignore: true) - $PasswordChangedCopyWith<PasswordChanged> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -class _$SignInStateTearOff { - const _$SignInStateTearOff(); - - _SignInState call( - {String? email, - String? password, - required bool isSubmitting, - required Option<String> passwordError, - required Option<String> emailError, - required Option<Either<UserProfile, FlowyError>> successOrFail}) { - return _SignInState( - email: email, - password: password, - isSubmitting: isSubmitting, - passwordError: passwordError, - emailError: emailError, - successOrFail: successOrFail, - ); - } -} - -/// @nodoc -const $SignInState = _$SignInStateTearOff(); - -/// @nodoc -mixin _$SignInState { - String? get email => throw _privateConstructorUsedError; - String? get password => throw _privateConstructorUsedError; - bool get isSubmitting => throw _privateConstructorUsedError; - Option<String> get passwordError => throw _privateConstructorUsedError; - Option<String> get emailError => throw _privateConstructorUsedError; - Option<Either<UserProfile, FlowyError>> get successOrFail => - throw _privateConstructorUsedError; - - @JsonKey(ignore: true) - $SignInStateCopyWith<SignInState> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $SignInStateCopyWith<$Res> { - factory $SignInStateCopyWith( - SignInState value, $Res Function(SignInState) then) = - _$SignInStateCopyWithImpl<$Res>; - $Res call( - {String? email, - String? password, - bool isSubmitting, - Option<String> passwordError, - Option<String> emailError, - Option<Either<UserProfile, FlowyError>> successOrFail}); -} - -/// @nodoc -class _$SignInStateCopyWithImpl<$Res> implements $SignInStateCopyWith<$Res> { - _$SignInStateCopyWithImpl(this._value, this._then); - - final SignInState _value; - // ignore: unused_field - final $Res Function(SignInState) _then; - - @override - $Res call({ - Object? email = freezed, - Object? password = freezed, - Object? isSubmitting = freezed, - Object? passwordError = freezed, - Object? emailError = freezed, - Object? successOrFail = freezed, - }) { - return _then(_value.copyWith( - email: email == freezed - ? _value.email - : email // ignore: cast_nullable_to_non_nullable - as String?, - password: password == freezed - ? _value.password - : password // ignore: cast_nullable_to_non_nullable - as String?, - isSubmitting: isSubmitting == freezed - ? _value.isSubmitting - : isSubmitting // ignore: cast_nullable_to_non_nullable - as bool, - passwordError: passwordError == freezed - ? _value.passwordError - : passwordError // ignore: cast_nullable_to_non_nullable - as Option<String>, - emailError: emailError == freezed - ? _value.emailError - : emailError // ignore: cast_nullable_to_non_nullable - as Option<String>, - successOrFail: successOrFail == freezed - ? _value.successOrFail - : successOrFail // ignore: cast_nullable_to_non_nullable - as Option<Either<UserProfile, FlowyError>>, - )); - } -} - -/// @nodoc -abstract class _$SignInStateCopyWith<$Res> - implements $SignInStateCopyWith<$Res> { - factory _$SignInStateCopyWith( - _SignInState value, $Res Function(_SignInState) then) = - __$SignInStateCopyWithImpl<$Res>; - @override - $Res call( - {String? email, - String? password, - bool isSubmitting, - Option<String> passwordError, - Option<String> emailError, - Option<Either<UserProfile, FlowyError>> successOrFail}); -} - -/// @nodoc -class __$SignInStateCopyWithImpl<$Res> extends _$SignInStateCopyWithImpl<$Res> - implements _$SignInStateCopyWith<$Res> { - __$SignInStateCopyWithImpl( - _SignInState _value, $Res Function(_SignInState) _then) - : super(_value, (v) => _then(v as _SignInState)); - - @override - _SignInState get _value => super._value as _SignInState; - - @override - $Res call({ - Object? email = freezed, - Object? password = freezed, - Object? isSubmitting = freezed, - Object? passwordError = freezed, - Object? emailError = freezed, - Object? successOrFail = freezed, - }) { - return _then(_SignInState( - email: email == freezed - ? _value.email - : email // ignore: cast_nullable_to_non_nullable - as String?, - password: password == freezed - ? _value.password - : password // ignore: cast_nullable_to_non_nullable - as String?, - isSubmitting: isSubmitting == freezed - ? _value.isSubmitting - : isSubmitting // ignore: cast_nullable_to_non_nullable - as bool, - passwordError: passwordError == freezed - ? _value.passwordError - : passwordError // ignore: cast_nullable_to_non_nullable - as Option<String>, - emailError: emailError == freezed - ? _value.emailError - : emailError // ignore: cast_nullable_to_non_nullable - as Option<String>, - successOrFail: successOrFail == freezed - ? _value.successOrFail - : successOrFail // ignore: cast_nullable_to_non_nullable - as Option<Either<UserProfile, FlowyError>>, - )); - } -} - -/// @nodoc - -class _$_SignInState implements _SignInState { - const _$_SignInState( - {this.email, - this.password, - required this.isSubmitting, - required this.passwordError, - required this.emailError, - required this.successOrFail}); - - @override - final String? email; - @override - final String? password; - @override - final bool isSubmitting; - @override - final Option<String> passwordError; - @override - final Option<String> emailError; - @override - final Option<Either<UserProfile, FlowyError>> successOrFail; - - @override - String toString() { - return 'SignInState(email: $email, password: $password, isSubmitting: $isSubmitting, passwordError: $passwordError, emailError: $emailError, successOrFail: $successOrFail)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is _SignInState && - (identical(other.email, email) || - const DeepCollectionEquality().equals(other.email, email)) && - (identical(other.password, password) || - const DeepCollectionEquality() - .equals(other.password, password)) && - (identical(other.isSubmitting, isSubmitting) || - const DeepCollectionEquality() - .equals(other.isSubmitting, isSubmitting)) && - (identical(other.passwordError, passwordError) || - const DeepCollectionEquality() - .equals(other.passwordError, passwordError)) && - (identical(other.emailError, emailError) || - const DeepCollectionEquality() - .equals(other.emailError, emailError)) && - (identical(other.successOrFail, successOrFail) || - const DeepCollectionEquality() - .equals(other.successOrFail, successOrFail))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ - const DeepCollectionEquality().hash(email) ^ - const DeepCollectionEquality().hash(password) ^ - const DeepCollectionEquality().hash(isSubmitting) ^ - const DeepCollectionEquality().hash(passwordError) ^ - const DeepCollectionEquality().hash(emailError) ^ - const DeepCollectionEquality().hash(successOrFail); - - @JsonKey(ignore: true) - @override - _$SignInStateCopyWith<_SignInState> get copyWith => - __$SignInStateCopyWithImpl<_SignInState>(this, _$identity); -} - -abstract class _SignInState implements SignInState { - const factory _SignInState( - {String? email, - String? password, - required bool isSubmitting, - required Option<String> passwordError, - required Option<String> emailError, - required Option<Either<UserProfile, FlowyError>> successOrFail}) = - _$_SignInState; - - @override - String? get email => throw _privateConstructorUsedError; - @override - String? get password => throw _privateConstructorUsedError; - @override - bool get isSubmitting => throw _privateConstructorUsedError; - @override - Option<String> get passwordError => throw _privateConstructorUsedError; - @override - Option<String> get emailError => throw _privateConstructorUsedError; - @override - Option<Either<UserProfile, FlowyError>> get successOrFail => - throw _privateConstructorUsedError; - @override - @JsonKey(ignore: true) - _$SignInStateCopyWith<_SignInState> get copyWith => - throw _privateConstructorUsedError; -} diff --git a/frontend/app_flowy/lib/user/application/sign_up_bloc.freezed.dart b/frontend/app_flowy/lib/user/application/sign_up_bloc.freezed.dart deleted file mode 100644 index ec6c377fd1..0000000000 --- a/frontend/app_flowy/lib/user/application/sign_up_bloc.freezed.dart +++ /dev/null @@ -1,1007 +0,0 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target - -part of 'sign_up_bloc.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity<T>(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); - -/// @nodoc -class _$SignUpEventTearOff { - const _$SignUpEventTearOff(); - - SignUpWithUserEmailAndPassword signUpWithUserEmailAndPassword() { - return const SignUpWithUserEmailAndPassword(); - } - - EmailChanged emailChanged(String email) { - return EmailChanged( - email, - ); - } - - PasswordChanged passwordChanged(String password) { - return PasswordChanged( - password, - ); - } - - RepeatPasswordChanged repeatPasswordChanged(String password) { - return RepeatPasswordChanged( - password, - ); - } -} - -/// @nodoc -const $SignUpEvent = _$SignUpEventTearOff(); - -/// @nodoc -mixin _$SignUpEvent { - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() signUpWithUserEmailAndPassword, - required TResult Function(String email) emailChanged, - required TResult Function(String password) passwordChanged, - required TResult Function(String password) repeatPasswordChanged, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? signUpWithUserEmailAndPassword, - TResult Function(String email)? emailChanged, - TResult Function(String password)? passwordChanged, - TResult Function(String password)? repeatPasswordChanged, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? signUpWithUserEmailAndPassword, - TResult Function(String email)? emailChanged, - TResult Function(String password)? passwordChanged, - TResult Function(String password)? repeatPasswordChanged, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(SignUpWithUserEmailAndPassword value) - signUpWithUserEmailAndPassword, - required TResult Function(EmailChanged value) emailChanged, - required TResult Function(PasswordChanged value) passwordChanged, - required TResult Function(RepeatPasswordChanged value) - repeatPasswordChanged, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(SignUpWithUserEmailAndPassword value)? - signUpWithUserEmailAndPassword, - TResult Function(EmailChanged value)? emailChanged, - TResult Function(PasswordChanged value)? passwordChanged, - TResult Function(RepeatPasswordChanged value)? repeatPasswordChanged, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(SignUpWithUserEmailAndPassword value)? - signUpWithUserEmailAndPassword, - TResult Function(EmailChanged value)? emailChanged, - TResult Function(PasswordChanged value)? passwordChanged, - TResult Function(RepeatPasswordChanged value)? repeatPasswordChanged, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $SignUpEventCopyWith<$Res> { - factory $SignUpEventCopyWith( - SignUpEvent value, $Res Function(SignUpEvent) then) = - _$SignUpEventCopyWithImpl<$Res>; -} - -/// @nodoc -class _$SignUpEventCopyWithImpl<$Res> implements $SignUpEventCopyWith<$Res> { - _$SignUpEventCopyWithImpl(this._value, this._then); - - final SignUpEvent _value; - // ignore: unused_field - final $Res Function(SignUpEvent) _then; -} - -/// @nodoc -abstract class $SignUpWithUserEmailAndPasswordCopyWith<$Res> { - factory $SignUpWithUserEmailAndPasswordCopyWith( - SignUpWithUserEmailAndPassword value, - $Res Function(SignUpWithUserEmailAndPassword) then) = - _$SignUpWithUserEmailAndPasswordCopyWithImpl<$Res>; -} - -/// @nodoc -class _$SignUpWithUserEmailAndPasswordCopyWithImpl<$Res> - extends _$SignUpEventCopyWithImpl<$Res> - implements $SignUpWithUserEmailAndPasswordCopyWith<$Res> { - _$SignUpWithUserEmailAndPasswordCopyWithImpl( - SignUpWithUserEmailAndPassword _value, - $Res Function(SignUpWithUserEmailAndPassword) _then) - : super(_value, (v) => _then(v as SignUpWithUserEmailAndPassword)); - - @override - SignUpWithUserEmailAndPassword get _value => - super._value as SignUpWithUserEmailAndPassword; -} - -/// @nodoc - -class _$SignUpWithUserEmailAndPassword - implements SignUpWithUserEmailAndPassword { - const _$SignUpWithUserEmailAndPassword(); - - @override - String toString() { - return 'SignUpEvent.signUpWithUserEmailAndPassword()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || (other is SignUpWithUserEmailAndPassword); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() signUpWithUserEmailAndPassword, - required TResult Function(String email) emailChanged, - required TResult Function(String password) passwordChanged, - required TResult Function(String password) repeatPasswordChanged, - }) { - return signUpWithUserEmailAndPassword(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? signUpWithUserEmailAndPassword, - TResult Function(String email)? emailChanged, - TResult Function(String password)? passwordChanged, - TResult Function(String password)? repeatPasswordChanged, - }) { - return signUpWithUserEmailAndPassword?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? signUpWithUserEmailAndPassword, - TResult Function(String email)? emailChanged, - TResult Function(String password)? passwordChanged, - TResult Function(String password)? repeatPasswordChanged, - required TResult orElse(), - }) { - if (signUpWithUserEmailAndPassword != null) { - return signUpWithUserEmailAndPassword(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(SignUpWithUserEmailAndPassword value) - signUpWithUserEmailAndPassword, - required TResult Function(EmailChanged value) emailChanged, - required TResult Function(PasswordChanged value) passwordChanged, - required TResult Function(RepeatPasswordChanged value) - repeatPasswordChanged, - }) { - return signUpWithUserEmailAndPassword(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(SignUpWithUserEmailAndPassword value)? - signUpWithUserEmailAndPassword, - TResult Function(EmailChanged value)? emailChanged, - TResult Function(PasswordChanged value)? passwordChanged, - TResult Function(RepeatPasswordChanged value)? repeatPasswordChanged, - }) { - return signUpWithUserEmailAndPassword?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(SignUpWithUserEmailAndPassword value)? - signUpWithUserEmailAndPassword, - TResult Function(EmailChanged value)? emailChanged, - TResult Function(PasswordChanged value)? passwordChanged, - TResult Function(RepeatPasswordChanged value)? repeatPasswordChanged, - required TResult orElse(), - }) { - if (signUpWithUserEmailAndPassword != null) { - return signUpWithUserEmailAndPassword(this); - } - return orElse(); - } -} - -abstract class SignUpWithUserEmailAndPassword implements SignUpEvent { - const factory SignUpWithUserEmailAndPassword() = - _$SignUpWithUserEmailAndPassword; -} - -/// @nodoc -abstract class $EmailChangedCopyWith<$Res> { - factory $EmailChangedCopyWith( - EmailChanged value, $Res Function(EmailChanged) then) = - _$EmailChangedCopyWithImpl<$Res>; - $Res call({String email}); -} - -/// @nodoc -class _$EmailChangedCopyWithImpl<$Res> extends _$SignUpEventCopyWithImpl<$Res> - implements $EmailChangedCopyWith<$Res> { - _$EmailChangedCopyWithImpl( - EmailChanged _value, $Res Function(EmailChanged) _then) - : super(_value, (v) => _then(v as EmailChanged)); - - @override - EmailChanged get _value => super._value as EmailChanged; - - @override - $Res call({ - Object? email = freezed, - }) { - return _then(EmailChanged( - email == freezed - ? _value.email - : email // ignore: cast_nullable_to_non_nullable - as String, - )); - } -} - -/// @nodoc - -class _$EmailChanged implements EmailChanged { - const _$EmailChanged(this.email); - - @override - final String email; - - @override - String toString() { - return 'SignUpEvent.emailChanged(email: $email)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is EmailChanged && - (identical(other.email, email) || - const DeepCollectionEquality().equals(other.email, email))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ const DeepCollectionEquality().hash(email); - - @JsonKey(ignore: true) - @override - $EmailChangedCopyWith<EmailChanged> get copyWith => - _$EmailChangedCopyWithImpl<EmailChanged>(this, _$identity); - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() signUpWithUserEmailAndPassword, - required TResult Function(String email) emailChanged, - required TResult Function(String password) passwordChanged, - required TResult Function(String password) repeatPasswordChanged, - }) { - return emailChanged(email); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? signUpWithUserEmailAndPassword, - TResult Function(String email)? emailChanged, - TResult Function(String password)? passwordChanged, - TResult Function(String password)? repeatPasswordChanged, - }) { - return emailChanged?.call(email); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? signUpWithUserEmailAndPassword, - TResult Function(String email)? emailChanged, - TResult Function(String password)? passwordChanged, - TResult Function(String password)? repeatPasswordChanged, - required TResult orElse(), - }) { - if (emailChanged != null) { - return emailChanged(email); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(SignUpWithUserEmailAndPassword value) - signUpWithUserEmailAndPassword, - required TResult Function(EmailChanged value) emailChanged, - required TResult Function(PasswordChanged value) passwordChanged, - required TResult Function(RepeatPasswordChanged value) - repeatPasswordChanged, - }) { - return emailChanged(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(SignUpWithUserEmailAndPassword value)? - signUpWithUserEmailAndPassword, - TResult Function(EmailChanged value)? emailChanged, - TResult Function(PasswordChanged value)? passwordChanged, - TResult Function(RepeatPasswordChanged value)? repeatPasswordChanged, - }) { - return emailChanged?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(SignUpWithUserEmailAndPassword value)? - signUpWithUserEmailAndPassword, - TResult Function(EmailChanged value)? emailChanged, - TResult Function(PasswordChanged value)? passwordChanged, - TResult Function(RepeatPasswordChanged value)? repeatPasswordChanged, - required TResult orElse(), - }) { - if (emailChanged != null) { - return emailChanged(this); - } - return orElse(); - } -} - -abstract class EmailChanged implements SignUpEvent { - const factory EmailChanged(String email) = _$EmailChanged; - - String get email => throw _privateConstructorUsedError; - @JsonKey(ignore: true) - $EmailChangedCopyWith<EmailChanged> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $PasswordChangedCopyWith<$Res> { - factory $PasswordChangedCopyWith( - PasswordChanged value, $Res Function(PasswordChanged) then) = - _$PasswordChangedCopyWithImpl<$Res>; - $Res call({String password}); -} - -/// @nodoc -class _$PasswordChangedCopyWithImpl<$Res> - extends _$SignUpEventCopyWithImpl<$Res> - implements $PasswordChangedCopyWith<$Res> { - _$PasswordChangedCopyWithImpl( - PasswordChanged _value, $Res Function(PasswordChanged) _then) - : super(_value, (v) => _then(v as PasswordChanged)); - - @override - PasswordChanged get _value => super._value as PasswordChanged; - - @override - $Res call({ - Object? password = freezed, - }) { - return _then(PasswordChanged( - password == freezed - ? _value.password - : password // ignore: cast_nullable_to_non_nullable - as String, - )); - } -} - -/// @nodoc - -class _$PasswordChanged implements PasswordChanged { - const _$PasswordChanged(this.password); - - @override - final String password; - - @override - String toString() { - return 'SignUpEvent.passwordChanged(password: $password)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is PasswordChanged && - (identical(other.password, password) || - const DeepCollectionEquality() - .equals(other.password, password))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ const DeepCollectionEquality().hash(password); - - @JsonKey(ignore: true) - @override - $PasswordChangedCopyWith<PasswordChanged> get copyWith => - _$PasswordChangedCopyWithImpl<PasswordChanged>(this, _$identity); - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() signUpWithUserEmailAndPassword, - required TResult Function(String email) emailChanged, - required TResult Function(String password) passwordChanged, - required TResult Function(String password) repeatPasswordChanged, - }) { - return passwordChanged(password); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? signUpWithUserEmailAndPassword, - TResult Function(String email)? emailChanged, - TResult Function(String password)? passwordChanged, - TResult Function(String password)? repeatPasswordChanged, - }) { - return passwordChanged?.call(password); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? signUpWithUserEmailAndPassword, - TResult Function(String email)? emailChanged, - TResult Function(String password)? passwordChanged, - TResult Function(String password)? repeatPasswordChanged, - required TResult orElse(), - }) { - if (passwordChanged != null) { - return passwordChanged(password); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(SignUpWithUserEmailAndPassword value) - signUpWithUserEmailAndPassword, - required TResult Function(EmailChanged value) emailChanged, - required TResult Function(PasswordChanged value) passwordChanged, - required TResult Function(RepeatPasswordChanged value) - repeatPasswordChanged, - }) { - return passwordChanged(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(SignUpWithUserEmailAndPassword value)? - signUpWithUserEmailAndPassword, - TResult Function(EmailChanged value)? emailChanged, - TResult Function(PasswordChanged value)? passwordChanged, - TResult Function(RepeatPasswordChanged value)? repeatPasswordChanged, - }) { - return passwordChanged?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(SignUpWithUserEmailAndPassword value)? - signUpWithUserEmailAndPassword, - TResult Function(EmailChanged value)? emailChanged, - TResult Function(PasswordChanged value)? passwordChanged, - TResult Function(RepeatPasswordChanged value)? repeatPasswordChanged, - required TResult orElse(), - }) { - if (passwordChanged != null) { - return passwordChanged(this); - } - return orElse(); - } -} - -abstract class PasswordChanged implements SignUpEvent { - const factory PasswordChanged(String password) = _$PasswordChanged; - - String get password => throw _privateConstructorUsedError; - @JsonKey(ignore: true) - $PasswordChangedCopyWith<PasswordChanged> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $RepeatPasswordChangedCopyWith<$Res> { - factory $RepeatPasswordChangedCopyWith(RepeatPasswordChanged value, - $Res Function(RepeatPasswordChanged) then) = - _$RepeatPasswordChangedCopyWithImpl<$Res>; - $Res call({String password}); -} - -/// @nodoc -class _$RepeatPasswordChangedCopyWithImpl<$Res> - extends _$SignUpEventCopyWithImpl<$Res> - implements $RepeatPasswordChangedCopyWith<$Res> { - _$RepeatPasswordChangedCopyWithImpl( - RepeatPasswordChanged _value, $Res Function(RepeatPasswordChanged) _then) - : super(_value, (v) => _then(v as RepeatPasswordChanged)); - - @override - RepeatPasswordChanged get _value => super._value as RepeatPasswordChanged; - - @override - $Res call({ - Object? password = freezed, - }) { - return _then(RepeatPasswordChanged( - password == freezed - ? _value.password - : password // ignore: cast_nullable_to_non_nullable - as String, - )); - } -} - -/// @nodoc - -class _$RepeatPasswordChanged implements RepeatPasswordChanged { - const _$RepeatPasswordChanged(this.password); - - @override - final String password; - - @override - String toString() { - return 'SignUpEvent.repeatPasswordChanged(password: $password)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is RepeatPasswordChanged && - (identical(other.password, password) || - const DeepCollectionEquality() - .equals(other.password, password))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ const DeepCollectionEquality().hash(password); - - @JsonKey(ignore: true) - @override - $RepeatPasswordChangedCopyWith<RepeatPasswordChanged> get copyWith => - _$RepeatPasswordChangedCopyWithImpl<RepeatPasswordChanged>( - this, _$identity); - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() signUpWithUserEmailAndPassword, - required TResult Function(String email) emailChanged, - required TResult Function(String password) passwordChanged, - required TResult Function(String password) repeatPasswordChanged, - }) { - return repeatPasswordChanged(password); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? signUpWithUserEmailAndPassword, - TResult Function(String email)? emailChanged, - TResult Function(String password)? passwordChanged, - TResult Function(String password)? repeatPasswordChanged, - }) { - return repeatPasswordChanged?.call(password); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? signUpWithUserEmailAndPassword, - TResult Function(String email)? emailChanged, - TResult Function(String password)? passwordChanged, - TResult Function(String password)? repeatPasswordChanged, - required TResult orElse(), - }) { - if (repeatPasswordChanged != null) { - return repeatPasswordChanged(password); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(SignUpWithUserEmailAndPassword value) - signUpWithUserEmailAndPassword, - required TResult Function(EmailChanged value) emailChanged, - required TResult Function(PasswordChanged value) passwordChanged, - required TResult Function(RepeatPasswordChanged value) - repeatPasswordChanged, - }) { - return repeatPasswordChanged(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(SignUpWithUserEmailAndPassword value)? - signUpWithUserEmailAndPassword, - TResult Function(EmailChanged value)? emailChanged, - TResult Function(PasswordChanged value)? passwordChanged, - TResult Function(RepeatPasswordChanged value)? repeatPasswordChanged, - }) { - return repeatPasswordChanged?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(SignUpWithUserEmailAndPassword value)? - signUpWithUserEmailAndPassword, - TResult Function(EmailChanged value)? emailChanged, - TResult Function(PasswordChanged value)? passwordChanged, - TResult Function(RepeatPasswordChanged value)? repeatPasswordChanged, - required TResult orElse(), - }) { - if (repeatPasswordChanged != null) { - return repeatPasswordChanged(this); - } - return orElse(); - } -} - -abstract class RepeatPasswordChanged implements SignUpEvent { - const factory RepeatPasswordChanged(String password) = - _$RepeatPasswordChanged; - - String get password => throw _privateConstructorUsedError; - @JsonKey(ignore: true) - $RepeatPasswordChangedCopyWith<RepeatPasswordChanged> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -class _$SignUpStateTearOff { - const _$SignUpStateTearOff(); - - _SignUpState call( - {String? email, - String? password, - String? repeatedPassword, - required bool isSubmitting, - required Option<String> passwordError, - required Option<String> repeatPasswordError, - required Option<String> emailError, - required Option<Either<UserProfile, FlowyError>> successOrFail}) { - return _SignUpState( - email: email, - password: password, - repeatedPassword: repeatedPassword, - isSubmitting: isSubmitting, - passwordError: passwordError, - repeatPasswordError: repeatPasswordError, - emailError: emailError, - successOrFail: successOrFail, - ); - } -} - -/// @nodoc -const $SignUpState = _$SignUpStateTearOff(); - -/// @nodoc -mixin _$SignUpState { - String? get email => throw _privateConstructorUsedError; - String? get password => throw _privateConstructorUsedError; - String? get repeatedPassword => throw _privateConstructorUsedError; - bool get isSubmitting => throw _privateConstructorUsedError; - Option<String> get passwordError => throw _privateConstructorUsedError; - Option<String> get repeatPasswordError => throw _privateConstructorUsedError; - Option<String> get emailError => throw _privateConstructorUsedError; - Option<Either<UserProfile, FlowyError>> get successOrFail => - throw _privateConstructorUsedError; - - @JsonKey(ignore: true) - $SignUpStateCopyWith<SignUpState> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $SignUpStateCopyWith<$Res> { - factory $SignUpStateCopyWith( - SignUpState value, $Res Function(SignUpState) then) = - _$SignUpStateCopyWithImpl<$Res>; - $Res call( - {String? email, - String? password, - String? repeatedPassword, - bool isSubmitting, - Option<String> passwordError, - Option<String> repeatPasswordError, - Option<String> emailError, - Option<Either<UserProfile, FlowyError>> successOrFail}); -} - -/// @nodoc -class _$SignUpStateCopyWithImpl<$Res> implements $SignUpStateCopyWith<$Res> { - _$SignUpStateCopyWithImpl(this._value, this._then); - - final SignUpState _value; - // ignore: unused_field - final $Res Function(SignUpState) _then; - - @override - $Res call({ - Object? email = freezed, - Object? password = freezed, - Object? repeatedPassword = freezed, - Object? isSubmitting = freezed, - Object? passwordError = freezed, - Object? repeatPasswordError = freezed, - Object? emailError = freezed, - Object? successOrFail = freezed, - }) { - return _then(_value.copyWith( - email: email == freezed - ? _value.email - : email // ignore: cast_nullable_to_non_nullable - as String?, - password: password == freezed - ? _value.password - : password // ignore: cast_nullable_to_non_nullable - as String?, - repeatedPassword: repeatedPassword == freezed - ? _value.repeatedPassword - : repeatedPassword // ignore: cast_nullable_to_non_nullable - as String?, - isSubmitting: isSubmitting == freezed - ? _value.isSubmitting - : isSubmitting // ignore: cast_nullable_to_non_nullable - as bool, - passwordError: passwordError == freezed - ? _value.passwordError - : passwordError // ignore: cast_nullable_to_non_nullable - as Option<String>, - repeatPasswordError: repeatPasswordError == freezed - ? _value.repeatPasswordError - : repeatPasswordError // ignore: cast_nullable_to_non_nullable - as Option<String>, - emailError: emailError == freezed - ? _value.emailError - : emailError // ignore: cast_nullable_to_non_nullable - as Option<String>, - successOrFail: successOrFail == freezed - ? _value.successOrFail - : successOrFail // ignore: cast_nullable_to_non_nullable - as Option<Either<UserProfile, FlowyError>>, - )); - } -} - -/// @nodoc -abstract class _$SignUpStateCopyWith<$Res> - implements $SignUpStateCopyWith<$Res> { - factory _$SignUpStateCopyWith( - _SignUpState value, $Res Function(_SignUpState) then) = - __$SignUpStateCopyWithImpl<$Res>; - @override - $Res call( - {String? email, - String? password, - String? repeatedPassword, - bool isSubmitting, - Option<String> passwordError, - Option<String> repeatPasswordError, - Option<String> emailError, - Option<Either<UserProfile, FlowyError>> successOrFail}); -} - -/// @nodoc -class __$SignUpStateCopyWithImpl<$Res> extends _$SignUpStateCopyWithImpl<$Res> - implements _$SignUpStateCopyWith<$Res> { - __$SignUpStateCopyWithImpl( - _SignUpState _value, $Res Function(_SignUpState) _then) - : super(_value, (v) => _then(v as _SignUpState)); - - @override - _SignUpState get _value => super._value as _SignUpState; - - @override - $Res call({ - Object? email = freezed, - Object? password = freezed, - Object? repeatedPassword = freezed, - Object? isSubmitting = freezed, - Object? passwordError = freezed, - Object? repeatPasswordError = freezed, - Object? emailError = freezed, - Object? successOrFail = freezed, - }) { - return _then(_SignUpState( - email: email == freezed - ? _value.email - : email // ignore: cast_nullable_to_non_nullable - as String?, - password: password == freezed - ? _value.password - : password // ignore: cast_nullable_to_non_nullable - as String?, - repeatedPassword: repeatedPassword == freezed - ? _value.repeatedPassword - : repeatedPassword // ignore: cast_nullable_to_non_nullable - as String?, - isSubmitting: isSubmitting == freezed - ? _value.isSubmitting - : isSubmitting // ignore: cast_nullable_to_non_nullable - as bool, - passwordError: passwordError == freezed - ? _value.passwordError - : passwordError // ignore: cast_nullable_to_non_nullable - as Option<String>, - repeatPasswordError: repeatPasswordError == freezed - ? _value.repeatPasswordError - : repeatPasswordError // ignore: cast_nullable_to_non_nullable - as Option<String>, - emailError: emailError == freezed - ? _value.emailError - : emailError // ignore: cast_nullable_to_non_nullable - as Option<String>, - successOrFail: successOrFail == freezed - ? _value.successOrFail - : successOrFail // ignore: cast_nullable_to_non_nullable - as Option<Either<UserProfile, FlowyError>>, - )); - } -} - -/// @nodoc - -class _$_SignUpState implements _SignUpState { - const _$_SignUpState( - {this.email, - this.password, - this.repeatedPassword, - required this.isSubmitting, - required this.passwordError, - required this.repeatPasswordError, - required this.emailError, - required this.successOrFail}); - - @override - final String? email; - @override - final String? password; - @override - final String? repeatedPassword; - @override - final bool isSubmitting; - @override - final Option<String> passwordError; - @override - final Option<String> repeatPasswordError; - @override - final Option<String> emailError; - @override - final Option<Either<UserProfile, FlowyError>> successOrFail; - - @override - String toString() { - return 'SignUpState(email: $email, password: $password, repeatedPassword: $repeatedPassword, isSubmitting: $isSubmitting, passwordError: $passwordError, repeatPasswordError: $repeatPasswordError, emailError: $emailError, successOrFail: $successOrFail)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is _SignUpState && - (identical(other.email, email) || - const DeepCollectionEquality().equals(other.email, email)) && - (identical(other.password, password) || - const DeepCollectionEquality() - .equals(other.password, password)) && - (identical(other.repeatedPassword, repeatedPassword) || - const DeepCollectionEquality() - .equals(other.repeatedPassword, repeatedPassword)) && - (identical(other.isSubmitting, isSubmitting) || - const DeepCollectionEquality() - .equals(other.isSubmitting, isSubmitting)) && - (identical(other.passwordError, passwordError) || - const DeepCollectionEquality() - .equals(other.passwordError, passwordError)) && - (identical(other.repeatPasswordError, repeatPasswordError) || - const DeepCollectionEquality() - .equals(other.repeatPasswordError, repeatPasswordError)) && - (identical(other.emailError, emailError) || - const DeepCollectionEquality() - .equals(other.emailError, emailError)) && - (identical(other.successOrFail, successOrFail) || - const DeepCollectionEquality() - .equals(other.successOrFail, successOrFail))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ - const DeepCollectionEquality().hash(email) ^ - const DeepCollectionEquality().hash(password) ^ - const DeepCollectionEquality().hash(repeatedPassword) ^ - const DeepCollectionEquality().hash(isSubmitting) ^ - const DeepCollectionEquality().hash(passwordError) ^ - const DeepCollectionEquality().hash(repeatPasswordError) ^ - const DeepCollectionEquality().hash(emailError) ^ - const DeepCollectionEquality().hash(successOrFail); - - @JsonKey(ignore: true) - @override - _$SignUpStateCopyWith<_SignUpState> get copyWith => - __$SignUpStateCopyWithImpl<_SignUpState>(this, _$identity); -} - -abstract class _SignUpState implements SignUpState { - const factory _SignUpState( - {String? email, - String? password, - String? repeatedPassword, - required bool isSubmitting, - required Option<String> passwordError, - required Option<String> repeatPasswordError, - required Option<String> emailError, - required Option<Either<UserProfile, FlowyError>> successOrFail}) = - _$_SignUpState; - - @override - String? get email => throw _privateConstructorUsedError; - @override - String? get password => throw _privateConstructorUsedError; - @override - String? get repeatedPassword => throw _privateConstructorUsedError; - @override - bool get isSubmitting => throw _privateConstructorUsedError; - @override - Option<String> get passwordError => throw _privateConstructorUsedError; - @override - Option<String> get repeatPasswordError => throw _privateConstructorUsedError; - @override - Option<String> get emailError => throw _privateConstructorUsedError; - @override - Option<Either<UserProfile, FlowyError>> get successOrFail => - throw _privateConstructorUsedError; - @override - @JsonKey(ignore: true) - _$SignUpStateCopyWith<_SignUpState> get copyWith => - throw _privateConstructorUsedError; -} diff --git a/frontend/app_flowy/lib/user/application/splash_bloc.freezed.dart b/frontend/app_flowy/lib/user/application/splash_bloc.freezed.dart deleted file mode 100644 index 51e8a7fe3a..0000000000 --- a/frontend/app_flowy/lib/user/application/splash_bloc.freezed.dart +++ /dev/null @@ -1,312 +0,0 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target - -part of 'splash_bloc.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity<T>(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); - -/// @nodoc -class _$SplashEventTearOff { - const _$SplashEventTearOff(); - - _GetUser getUser() { - return const _GetUser(); - } -} - -/// @nodoc -const $SplashEvent = _$SplashEventTearOff(); - -/// @nodoc -mixin _$SplashEvent { - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() getUser, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? getUser, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? getUser, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(_GetUser value) getUser, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(_GetUser value)? getUser, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(_GetUser value)? getUser, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $SplashEventCopyWith<$Res> { - factory $SplashEventCopyWith( - SplashEvent value, $Res Function(SplashEvent) then) = - _$SplashEventCopyWithImpl<$Res>; -} - -/// @nodoc -class _$SplashEventCopyWithImpl<$Res> implements $SplashEventCopyWith<$Res> { - _$SplashEventCopyWithImpl(this._value, this._then); - - final SplashEvent _value; - // ignore: unused_field - final $Res Function(SplashEvent) _then; -} - -/// @nodoc -abstract class _$GetUserCopyWith<$Res> { - factory _$GetUserCopyWith(_GetUser value, $Res Function(_GetUser) then) = - __$GetUserCopyWithImpl<$Res>; -} - -/// @nodoc -class __$GetUserCopyWithImpl<$Res> extends _$SplashEventCopyWithImpl<$Res> - implements _$GetUserCopyWith<$Res> { - __$GetUserCopyWithImpl(_GetUser _value, $Res Function(_GetUser) _then) - : super(_value, (v) => _then(v as _GetUser)); - - @override - _GetUser get _value => super._value as _GetUser; -} - -/// @nodoc - -class _$_GetUser implements _GetUser { - const _$_GetUser(); - - @override - String toString() { - return 'SplashEvent.getUser()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || (other is _GetUser); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() getUser, - }) { - return getUser(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? getUser, - }) { - return getUser?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? getUser, - required TResult orElse(), - }) { - if (getUser != null) { - return getUser(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(_GetUser value) getUser, - }) { - return getUser(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(_GetUser value)? getUser, - }) { - return getUser?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(_GetUser value)? getUser, - required TResult orElse(), - }) { - if (getUser != null) { - return getUser(this); - } - return orElse(); - } -} - -abstract class _GetUser implements SplashEvent { - const factory _GetUser() = _$_GetUser; -} - -/// @nodoc -class _$SplashStateTearOff { - const _$SplashStateTearOff(); - - _SplashState call({required AuthState auth}) { - return _SplashState( - auth: auth, - ); - } -} - -/// @nodoc -const $SplashState = _$SplashStateTearOff(); - -/// @nodoc -mixin _$SplashState { - AuthState get auth => throw _privateConstructorUsedError; - - @JsonKey(ignore: true) - $SplashStateCopyWith<SplashState> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $SplashStateCopyWith<$Res> { - factory $SplashStateCopyWith( - SplashState value, $Res Function(SplashState) then) = - _$SplashStateCopyWithImpl<$Res>; - $Res call({AuthState auth}); - - $AuthStateCopyWith<$Res> get auth; -} - -/// @nodoc -class _$SplashStateCopyWithImpl<$Res> implements $SplashStateCopyWith<$Res> { - _$SplashStateCopyWithImpl(this._value, this._then); - - final SplashState _value; - // ignore: unused_field - final $Res Function(SplashState) _then; - - @override - $Res call({ - Object? auth = freezed, - }) { - return _then(_value.copyWith( - auth: auth == freezed - ? _value.auth - : auth // ignore: cast_nullable_to_non_nullable - as AuthState, - )); - } - - @override - $AuthStateCopyWith<$Res> get auth { - return $AuthStateCopyWith<$Res>(_value.auth, (value) { - return _then(_value.copyWith(auth: value)); - }); - } -} - -/// @nodoc -abstract class _$SplashStateCopyWith<$Res> - implements $SplashStateCopyWith<$Res> { - factory _$SplashStateCopyWith( - _SplashState value, $Res Function(_SplashState) then) = - __$SplashStateCopyWithImpl<$Res>; - @override - $Res call({AuthState auth}); - - @override - $AuthStateCopyWith<$Res> get auth; -} - -/// @nodoc -class __$SplashStateCopyWithImpl<$Res> extends _$SplashStateCopyWithImpl<$Res> - implements _$SplashStateCopyWith<$Res> { - __$SplashStateCopyWithImpl( - _SplashState _value, $Res Function(_SplashState) _then) - : super(_value, (v) => _then(v as _SplashState)); - - @override - _SplashState get _value => super._value as _SplashState; - - @override - $Res call({ - Object? auth = freezed, - }) { - return _then(_SplashState( - auth: auth == freezed - ? _value.auth - : auth // ignore: cast_nullable_to_non_nullable - as AuthState, - )); - } -} - -/// @nodoc - -class _$_SplashState implements _SplashState { - const _$_SplashState({required this.auth}); - - @override - final AuthState auth; - - @override - String toString() { - return 'SplashState(auth: $auth)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is _SplashState && - (identical(other.auth, auth) || - const DeepCollectionEquality().equals(other.auth, auth))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ const DeepCollectionEquality().hash(auth); - - @JsonKey(ignore: true) - @override - _$SplashStateCopyWith<_SplashState> get copyWith => - __$SplashStateCopyWithImpl<_SplashState>(this, _$identity); -} - -abstract class _SplashState implements SplashState { - const factory _SplashState({required AuthState auth}) = _$_SplashState; - - @override - AuthState get auth => throw _privateConstructorUsedError; - @override - @JsonKey(ignore: true) - _$SplashStateCopyWith<_SplashState> get copyWith => - throw _privateConstructorUsedError; -} diff --git a/frontend/app_flowy/lib/user/domain/auth_state.freezed.dart b/frontend/app_flowy/lib/user/domain/auth_state.freezed.dart deleted file mode 100644 index cf5aaa25c7..0000000000 --- a/frontend/app_flowy/lib/user/domain/auth_state.freezed.dart +++ /dev/null @@ -1,487 +0,0 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target - -part of 'auth_state.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity<T>(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); - -/// @nodoc -class _$AuthStateTearOff { - const _$AuthStateTearOff(); - - Authenticated authenticated(UserProfile userProfile) { - return Authenticated( - userProfile, - ); - } - - Unauthenticated unauthenticated(FlowyError error) { - return Unauthenticated( - error, - ); - } - - _Initial initial() { - return const _Initial(); - } -} - -/// @nodoc -const $AuthState = _$AuthStateTearOff(); - -/// @nodoc -mixin _$AuthState { - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function(UserProfile userProfile) authenticated, - required TResult Function(FlowyError error) unauthenticated, - required TResult Function() initial, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function(UserProfile userProfile)? authenticated, - TResult Function(FlowyError error)? unauthenticated, - TResult Function()? initial, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function(UserProfile userProfile)? authenticated, - TResult Function(FlowyError error)? unauthenticated, - TResult Function()? initial, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Authenticated value) authenticated, - required TResult Function(Unauthenticated value) unauthenticated, - required TResult Function(_Initial value) initial, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Authenticated value)? authenticated, - TResult Function(Unauthenticated value)? unauthenticated, - TResult Function(_Initial value)? initial, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Authenticated value)? authenticated, - TResult Function(Unauthenticated value)? unauthenticated, - TResult Function(_Initial value)? initial, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $AuthStateCopyWith<$Res> { - factory $AuthStateCopyWith(AuthState value, $Res Function(AuthState) then) = - _$AuthStateCopyWithImpl<$Res>; -} - -/// @nodoc -class _$AuthStateCopyWithImpl<$Res> implements $AuthStateCopyWith<$Res> { - _$AuthStateCopyWithImpl(this._value, this._then); - - final AuthState _value; - // ignore: unused_field - final $Res Function(AuthState) _then; -} - -/// @nodoc -abstract class $AuthenticatedCopyWith<$Res> { - factory $AuthenticatedCopyWith( - Authenticated value, $Res Function(Authenticated) then) = - _$AuthenticatedCopyWithImpl<$Res>; - $Res call({UserProfile userProfile}); -} - -/// @nodoc -class _$AuthenticatedCopyWithImpl<$Res> extends _$AuthStateCopyWithImpl<$Res> - implements $AuthenticatedCopyWith<$Res> { - _$AuthenticatedCopyWithImpl( - Authenticated _value, $Res Function(Authenticated) _then) - : super(_value, (v) => _then(v as Authenticated)); - - @override - Authenticated get _value => super._value as Authenticated; - - @override - $Res call({ - Object? userProfile = freezed, - }) { - return _then(Authenticated( - userProfile == freezed - ? _value.userProfile - : userProfile // ignore: cast_nullable_to_non_nullable - as UserProfile, - )); - } -} - -/// @nodoc - -class _$Authenticated implements Authenticated { - const _$Authenticated(this.userProfile); - - @override - final UserProfile userProfile; - - @override - String toString() { - return 'AuthState.authenticated(userProfile: $userProfile)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is Authenticated && - (identical(other.userProfile, userProfile) || - const DeepCollectionEquality() - .equals(other.userProfile, userProfile))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ const DeepCollectionEquality().hash(userProfile); - - @JsonKey(ignore: true) - @override - $AuthenticatedCopyWith<Authenticated> get copyWith => - _$AuthenticatedCopyWithImpl<Authenticated>(this, _$identity); - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function(UserProfile userProfile) authenticated, - required TResult Function(FlowyError error) unauthenticated, - required TResult Function() initial, - }) { - return authenticated(userProfile); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function(UserProfile userProfile)? authenticated, - TResult Function(FlowyError error)? unauthenticated, - TResult Function()? initial, - }) { - return authenticated?.call(userProfile); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function(UserProfile userProfile)? authenticated, - TResult Function(FlowyError error)? unauthenticated, - TResult Function()? initial, - required TResult orElse(), - }) { - if (authenticated != null) { - return authenticated(userProfile); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Authenticated value) authenticated, - required TResult Function(Unauthenticated value) unauthenticated, - required TResult Function(_Initial value) initial, - }) { - return authenticated(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Authenticated value)? authenticated, - TResult Function(Unauthenticated value)? unauthenticated, - TResult Function(_Initial value)? initial, - }) { - return authenticated?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Authenticated value)? authenticated, - TResult Function(Unauthenticated value)? unauthenticated, - TResult Function(_Initial value)? initial, - required TResult orElse(), - }) { - if (authenticated != null) { - return authenticated(this); - } - return orElse(); - } -} - -abstract class Authenticated implements AuthState { - const factory Authenticated(UserProfile userProfile) = _$Authenticated; - - UserProfile get userProfile => throw _privateConstructorUsedError; - @JsonKey(ignore: true) - $AuthenticatedCopyWith<Authenticated> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $UnauthenticatedCopyWith<$Res> { - factory $UnauthenticatedCopyWith( - Unauthenticated value, $Res Function(Unauthenticated) then) = - _$UnauthenticatedCopyWithImpl<$Res>; - $Res call({FlowyError error}); -} - -/// @nodoc -class _$UnauthenticatedCopyWithImpl<$Res> extends _$AuthStateCopyWithImpl<$Res> - implements $UnauthenticatedCopyWith<$Res> { - _$UnauthenticatedCopyWithImpl( - Unauthenticated _value, $Res Function(Unauthenticated) _then) - : super(_value, (v) => _then(v as Unauthenticated)); - - @override - Unauthenticated get _value => super._value as Unauthenticated; - - @override - $Res call({ - Object? error = freezed, - }) { - return _then(Unauthenticated( - error == freezed - ? _value.error - : error // ignore: cast_nullable_to_non_nullable - as FlowyError, - )); - } -} - -/// @nodoc - -class _$Unauthenticated implements Unauthenticated { - const _$Unauthenticated(this.error); - - @override - final FlowyError error; - - @override - String toString() { - return 'AuthState.unauthenticated(error: $error)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is Unauthenticated && - (identical(other.error, error) || - const DeepCollectionEquality().equals(other.error, error))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ const DeepCollectionEquality().hash(error); - - @JsonKey(ignore: true) - @override - $UnauthenticatedCopyWith<Unauthenticated> get copyWith => - _$UnauthenticatedCopyWithImpl<Unauthenticated>(this, _$identity); - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function(UserProfile userProfile) authenticated, - required TResult Function(FlowyError error) unauthenticated, - required TResult Function() initial, - }) { - return unauthenticated(error); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function(UserProfile userProfile)? authenticated, - TResult Function(FlowyError error)? unauthenticated, - TResult Function()? initial, - }) { - return unauthenticated?.call(error); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function(UserProfile userProfile)? authenticated, - TResult Function(FlowyError error)? unauthenticated, - TResult Function()? initial, - required TResult orElse(), - }) { - if (unauthenticated != null) { - return unauthenticated(error); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Authenticated value) authenticated, - required TResult Function(Unauthenticated value) unauthenticated, - required TResult Function(_Initial value) initial, - }) { - return unauthenticated(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Authenticated value)? authenticated, - TResult Function(Unauthenticated value)? unauthenticated, - TResult Function(_Initial value)? initial, - }) { - return unauthenticated?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Authenticated value)? authenticated, - TResult Function(Unauthenticated value)? unauthenticated, - TResult Function(_Initial value)? initial, - required TResult orElse(), - }) { - if (unauthenticated != null) { - return unauthenticated(this); - } - return orElse(); - } -} - -abstract class Unauthenticated implements AuthState { - const factory Unauthenticated(FlowyError error) = _$Unauthenticated; - - FlowyError get error => throw _privateConstructorUsedError; - @JsonKey(ignore: true) - $UnauthenticatedCopyWith<Unauthenticated> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$InitialCopyWith<$Res> { - factory _$InitialCopyWith(_Initial value, $Res Function(_Initial) then) = - __$InitialCopyWithImpl<$Res>; -} - -/// @nodoc -class __$InitialCopyWithImpl<$Res> extends _$AuthStateCopyWithImpl<$Res> - implements _$InitialCopyWith<$Res> { - __$InitialCopyWithImpl(_Initial _value, $Res Function(_Initial) _then) - : super(_value, (v) => _then(v as _Initial)); - - @override - _Initial get _value => super._value as _Initial; -} - -/// @nodoc - -class _$_Initial implements _Initial { - const _$_Initial(); - - @override - String toString() { - return 'AuthState.initial()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || (other is _Initial); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function(UserProfile userProfile) authenticated, - required TResult Function(FlowyError error) unauthenticated, - required TResult Function() initial, - }) { - return initial(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function(UserProfile userProfile)? authenticated, - TResult Function(FlowyError error)? unauthenticated, - TResult Function()? initial, - }) { - return initial?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function(UserProfile userProfile)? authenticated, - TResult Function(FlowyError error)? unauthenticated, - TResult Function()? initial, - required TResult orElse(), - }) { - if (initial != null) { - return initial(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Authenticated value) authenticated, - required TResult Function(Unauthenticated value) unauthenticated, - required TResult Function(_Initial value) initial, - }) { - return initial(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Authenticated value)? authenticated, - TResult Function(Unauthenticated value)? unauthenticated, - TResult Function(_Initial value)? initial, - }) { - return initial?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Authenticated value)? authenticated, - TResult Function(Unauthenticated value)? unauthenticated, - TResult Function(_Initial value)? initial, - required TResult orElse(), - }) { - if (initial != null) { - return initial(this); - } - return orElse(); - } -} - -abstract class _Initial implements AuthState { - const factory _Initial() = _$_Initial; -} diff --git a/frontend/app_flowy/lib/workspace/application/app/app_bloc.freezed.dart b/frontend/app_flowy/lib/workspace/application/app/app_bloc.freezed.dart deleted file mode 100644 index 97c6987f07..0000000000 --- a/frontend/app_flowy/lib/workspace/application/app/app_bloc.freezed.dart +++ /dev/null @@ -1,1273 +0,0 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target - -part of 'app_bloc.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity<T>(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); - -/// @nodoc -class _$AppEventTearOff { - const _$AppEventTearOff(); - - Initial initial() { - return const Initial(); - } - - CreateView createView(String name, String desc, ViewType viewType) { - return CreateView( - name, - desc, - viewType, - ); - } - - Delete delete() { - return const Delete(); - } - - Rename rename(String newName) { - return Rename( - newName, - ); - } - - ReceiveViews didReceiveViews(List<View> views) { - return ReceiveViews( - views, - ); - } - - AppDidUpdate appDidUpdate(App app) { - return AppDidUpdate( - app, - ); - } -} - -/// @nodoc -const $AppEvent = _$AppEventTearOff(); - -/// @nodoc -mixin _$AppEvent { - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function(String name, String desc, ViewType viewType) - createView, - required TResult Function() delete, - required TResult Function(String newName) rename, - required TResult Function(List<View> views) didReceiveViews, - required TResult Function(App app) appDidUpdate, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(String name, String desc, ViewType viewType)? createView, - TResult Function()? delete, - TResult Function(String newName)? rename, - TResult Function(List<View> views)? didReceiveViews, - TResult Function(App app)? appDidUpdate, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(String name, String desc, ViewType viewType)? createView, - TResult Function()? delete, - TResult Function(String newName)? rename, - TResult Function(List<View> views)? didReceiveViews, - TResult Function(App app)? appDidUpdate, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Initial value) initial, - required TResult Function(CreateView value) createView, - required TResult Function(Delete value) delete, - required TResult Function(Rename value) rename, - required TResult Function(ReceiveViews value) didReceiveViews, - required TResult Function(AppDidUpdate value) appDidUpdate, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(CreateView value)? createView, - TResult Function(Delete value)? delete, - TResult Function(Rename value)? rename, - TResult Function(ReceiveViews value)? didReceiveViews, - TResult Function(AppDidUpdate value)? appDidUpdate, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(CreateView value)? createView, - TResult Function(Delete value)? delete, - TResult Function(Rename value)? rename, - TResult Function(ReceiveViews value)? didReceiveViews, - TResult Function(AppDidUpdate value)? appDidUpdate, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $AppEventCopyWith<$Res> { - factory $AppEventCopyWith(AppEvent value, $Res Function(AppEvent) then) = - _$AppEventCopyWithImpl<$Res>; -} - -/// @nodoc -class _$AppEventCopyWithImpl<$Res> implements $AppEventCopyWith<$Res> { - _$AppEventCopyWithImpl(this._value, this._then); - - final AppEvent _value; - // ignore: unused_field - final $Res Function(AppEvent) _then; -} - -/// @nodoc -abstract class $InitialCopyWith<$Res> { - factory $InitialCopyWith(Initial value, $Res Function(Initial) then) = - _$InitialCopyWithImpl<$Res>; -} - -/// @nodoc -class _$InitialCopyWithImpl<$Res> extends _$AppEventCopyWithImpl<$Res> - implements $InitialCopyWith<$Res> { - _$InitialCopyWithImpl(Initial _value, $Res Function(Initial) _then) - : super(_value, (v) => _then(v as Initial)); - - @override - Initial get _value => super._value as Initial; -} - -/// @nodoc - -class _$Initial implements Initial { - const _$Initial(); - - @override - String toString() { - return 'AppEvent.initial()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || (other is Initial); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function(String name, String desc, ViewType viewType) - createView, - required TResult Function() delete, - required TResult Function(String newName) rename, - required TResult Function(List<View> views) didReceiveViews, - required TResult Function(App app) appDidUpdate, - }) { - return initial(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(String name, String desc, ViewType viewType)? createView, - TResult Function()? delete, - TResult Function(String newName)? rename, - TResult Function(List<View> views)? didReceiveViews, - TResult Function(App app)? appDidUpdate, - }) { - return initial?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(String name, String desc, ViewType viewType)? createView, - TResult Function()? delete, - TResult Function(String newName)? rename, - TResult Function(List<View> views)? didReceiveViews, - TResult Function(App app)? appDidUpdate, - required TResult orElse(), - }) { - if (initial != null) { - return initial(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Initial value) initial, - required TResult Function(CreateView value) createView, - required TResult Function(Delete value) delete, - required TResult Function(Rename value) rename, - required TResult Function(ReceiveViews value) didReceiveViews, - required TResult Function(AppDidUpdate value) appDidUpdate, - }) { - return initial(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(CreateView value)? createView, - TResult Function(Delete value)? delete, - TResult Function(Rename value)? rename, - TResult Function(ReceiveViews value)? didReceiveViews, - TResult Function(AppDidUpdate value)? appDidUpdate, - }) { - return initial?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(CreateView value)? createView, - TResult Function(Delete value)? delete, - TResult Function(Rename value)? rename, - TResult Function(ReceiveViews value)? didReceiveViews, - TResult Function(AppDidUpdate value)? appDidUpdate, - required TResult orElse(), - }) { - if (initial != null) { - return initial(this); - } - return orElse(); - } -} - -abstract class Initial implements AppEvent { - const factory Initial() = _$Initial; -} - -/// @nodoc -abstract class $CreateViewCopyWith<$Res> { - factory $CreateViewCopyWith( - CreateView value, $Res Function(CreateView) then) = - _$CreateViewCopyWithImpl<$Res>; - $Res call({String name, String desc, ViewType viewType}); -} - -/// @nodoc -class _$CreateViewCopyWithImpl<$Res> extends _$AppEventCopyWithImpl<$Res> - implements $CreateViewCopyWith<$Res> { - _$CreateViewCopyWithImpl(CreateView _value, $Res Function(CreateView) _then) - : super(_value, (v) => _then(v as CreateView)); - - @override - CreateView get _value => super._value as CreateView; - - @override - $Res call({ - Object? name = freezed, - Object? desc = freezed, - Object? viewType = freezed, - }) { - return _then(CreateView( - name == freezed - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - desc == freezed - ? _value.desc - : desc // ignore: cast_nullable_to_non_nullable - as String, - viewType == freezed - ? _value.viewType - : viewType // ignore: cast_nullable_to_non_nullable - as ViewType, - )); - } -} - -/// @nodoc - -class _$CreateView implements CreateView { - const _$CreateView(this.name, this.desc, this.viewType); - - @override - final String name; - @override - final String desc; - @override - final ViewType viewType; - - @override - String toString() { - return 'AppEvent.createView(name: $name, desc: $desc, viewType: $viewType)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is CreateView && - (identical(other.name, name) || - const DeepCollectionEquality().equals(other.name, name)) && - (identical(other.desc, desc) || - const DeepCollectionEquality().equals(other.desc, desc)) && - (identical(other.viewType, viewType) || - const DeepCollectionEquality() - .equals(other.viewType, viewType))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ - const DeepCollectionEquality().hash(name) ^ - const DeepCollectionEquality().hash(desc) ^ - const DeepCollectionEquality().hash(viewType); - - @JsonKey(ignore: true) - @override - $CreateViewCopyWith<CreateView> get copyWith => - _$CreateViewCopyWithImpl<CreateView>(this, _$identity); - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function(String name, String desc, ViewType viewType) - createView, - required TResult Function() delete, - required TResult Function(String newName) rename, - required TResult Function(List<View> views) didReceiveViews, - required TResult Function(App app) appDidUpdate, - }) { - return createView(name, desc, viewType); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(String name, String desc, ViewType viewType)? createView, - TResult Function()? delete, - TResult Function(String newName)? rename, - TResult Function(List<View> views)? didReceiveViews, - TResult Function(App app)? appDidUpdate, - }) { - return createView?.call(name, desc, viewType); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(String name, String desc, ViewType viewType)? createView, - TResult Function()? delete, - TResult Function(String newName)? rename, - TResult Function(List<View> views)? didReceiveViews, - TResult Function(App app)? appDidUpdate, - required TResult orElse(), - }) { - if (createView != null) { - return createView(name, desc, viewType); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Initial value) initial, - required TResult Function(CreateView value) createView, - required TResult Function(Delete value) delete, - required TResult Function(Rename value) rename, - required TResult Function(ReceiveViews value) didReceiveViews, - required TResult Function(AppDidUpdate value) appDidUpdate, - }) { - return createView(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(CreateView value)? createView, - TResult Function(Delete value)? delete, - TResult Function(Rename value)? rename, - TResult Function(ReceiveViews value)? didReceiveViews, - TResult Function(AppDidUpdate value)? appDidUpdate, - }) { - return createView?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(CreateView value)? createView, - TResult Function(Delete value)? delete, - TResult Function(Rename value)? rename, - TResult Function(ReceiveViews value)? didReceiveViews, - TResult Function(AppDidUpdate value)? appDidUpdate, - required TResult orElse(), - }) { - if (createView != null) { - return createView(this); - } - return orElse(); - } -} - -abstract class CreateView implements AppEvent { - const factory CreateView(String name, String desc, ViewType viewType) = - _$CreateView; - - String get name => throw _privateConstructorUsedError; - String get desc => throw _privateConstructorUsedError; - ViewType get viewType => throw _privateConstructorUsedError; - @JsonKey(ignore: true) - $CreateViewCopyWith<CreateView> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $DeleteCopyWith<$Res> { - factory $DeleteCopyWith(Delete value, $Res Function(Delete) then) = - _$DeleteCopyWithImpl<$Res>; -} - -/// @nodoc -class _$DeleteCopyWithImpl<$Res> extends _$AppEventCopyWithImpl<$Res> - implements $DeleteCopyWith<$Res> { - _$DeleteCopyWithImpl(Delete _value, $Res Function(Delete) _then) - : super(_value, (v) => _then(v as Delete)); - - @override - Delete get _value => super._value as Delete; -} - -/// @nodoc - -class _$Delete implements Delete { - const _$Delete(); - - @override - String toString() { - return 'AppEvent.delete()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || (other is Delete); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function(String name, String desc, ViewType viewType) - createView, - required TResult Function() delete, - required TResult Function(String newName) rename, - required TResult Function(List<View> views) didReceiveViews, - required TResult Function(App app) appDidUpdate, - }) { - return delete(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(String name, String desc, ViewType viewType)? createView, - TResult Function()? delete, - TResult Function(String newName)? rename, - TResult Function(List<View> views)? didReceiveViews, - TResult Function(App app)? appDidUpdate, - }) { - return delete?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(String name, String desc, ViewType viewType)? createView, - TResult Function()? delete, - TResult Function(String newName)? rename, - TResult Function(List<View> views)? didReceiveViews, - TResult Function(App app)? appDidUpdate, - required TResult orElse(), - }) { - if (delete != null) { - return delete(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Initial value) initial, - required TResult Function(CreateView value) createView, - required TResult Function(Delete value) delete, - required TResult Function(Rename value) rename, - required TResult Function(ReceiveViews value) didReceiveViews, - required TResult Function(AppDidUpdate value) appDidUpdate, - }) { - return delete(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(CreateView value)? createView, - TResult Function(Delete value)? delete, - TResult Function(Rename value)? rename, - TResult Function(ReceiveViews value)? didReceiveViews, - TResult Function(AppDidUpdate value)? appDidUpdate, - }) { - return delete?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(CreateView value)? createView, - TResult Function(Delete value)? delete, - TResult Function(Rename value)? rename, - TResult Function(ReceiveViews value)? didReceiveViews, - TResult Function(AppDidUpdate value)? appDidUpdate, - required TResult orElse(), - }) { - if (delete != null) { - return delete(this); - } - return orElse(); - } -} - -abstract class Delete implements AppEvent { - const factory Delete() = _$Delete; -} - -/// @nodoc -abstract class $RenameCopyWith<$Res> { - factory $RenameCopyWith(Rename value, $Res Function(Rename) then) = - _$RenameCopyWithImpl<$Res>; - $Res call({String newName}); -} - -/// @nodoc -class _$RenameCopyWithImpl<$Res> extends _$AppEventCopyWithImpl<$Res> - implements $RenameCopyWith<$Res> { - _$RenameCopyWithImpl(Rename _value, $Res Function(Rename) _then) - : super(_value, (v) => _then(v as Rename)); - - @override - Rename get _value => super._value as Rename; - - @override - $Res call({ - Object? newName = freezed, - }) { - return _then(Rename( - newName == freezed - ? _value.newName - : newName // ignore: cast_nullable_to_non_nullable - as String, - )); - } -} - -/// @nodoc - -class _$Rename implements Rename { - const _$Rename(this.newName); - - @override - final String newName; - - @override - String toString() { - return 'AppEvent.rename(newName: $newName)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is Rename && - (identical(other.newName, newName) || - const DeepCollectionEquality().equals(other.newName, newName))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ const DeepCollectionEquality().hash(newName); - - @JsonKey(ignore: true) - @override - $RenameCopyWith<Rename> get copyWith => - _$RenameCopyWithImpl<Rename>(this, _$identity); - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function(String name, String desc, ViewType viewType) - createView, - required TResult Function() delete, - required TResult Function(String newName) rename, - required TResult Function(List<View> views) didReceiveViews, - required TResult Function(App app) appDidUpdate, - }) { - return rename(newName); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(String name, String desc, ViewType viewType)? createView, - TResult Function()? delete, - TResult Function(String newName)? rename, - TResult Function(List<View> views)? didReceiveViews, - TResult Function(App app)? appDidUpdate, - }) { - return rename?.call(newName); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(String name, String desc, ViewType viewType)? createView, - TResult Function()? delete, - TResult Function(String newName)? rename, - TResult Function(List<View> views)? didReceiveViews, - TResult Function(App app)? appDidUpdate, - required TResult orElse(), - }) { - if (rename != null) { - return rename(newName); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Initial value) initial, - required TResult Function(CreateView value) createView, - required TResult Function(Delete value) delete, - required TResult Function(Rename value) rename, - required TResult Function(ReceiveViews value) didReceiveViews, - required TResult Function(AppDidUpdate value) appDidUpdate, - }) { - return rename(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(CreateView value)? createView, - TResult Function(Delete value)? delete, - TResult Function(Rename value)? rename, - TResult Function(ReceiveViews value)? didReceiveViews, - TResult Function(AppDidUpdate value)? appDidUpdate, - }) { - return rename?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(CreateView value)? createView, - TResult Function(Delete value)? delete, - TResult Function(Rename value)? rename, - TResult Function(ReceiveViews value)? didReceiveViews, - TResult Function(AppDidUpdate value)? appDidUpdate, - required TResult orElse(), - }) { - if (rename != null) { - return rename(this); - } - return orElse(); - } -} - -abstract class Rename implements AppEvent { - const factory Rename(String newName) = _$Rename; - - String get newName => throw _privateConstructorUsedError; - @JsonKey(ignore: true) - $RenameCopyWith<Rename> get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $ReceiveViewsCopyWith<$Res> { - factory $ReceiveViewsCopyWith( - ReceiveViews value, $Res Function(ReceiveViews) then) = - _$ReceiveViewsCopyWithImpl<$Res>; - $Res call({List<View> views}); -} - -/// @nodoc -class _$ReceiveViewsCopyWithImpl<$Res> extends _$AppEventCopyWithImpl<$Res> - implements $ReceiveViewsCopyWith<$Res> { - _$ReceiveViewsCopyWithImpl( - ReceiveViews _value, $Res Function(ReceiveViews) _then) - : super(_value, (v) => _then(v as ReceiveViews)); - - @override - ReceiveViews get _value => super._value as ReceiveViews; - - @override - $Res call({ - Object? views = freezed, - }) { - return _then(ReceiveViews( - views == freezed - ? _value.views - : views // ignore: cast_nullable_to_non_nullable - as List<View>, - )); - } -} - -/// @nodoc - -class _$ReceiveViews implements ReceiveViews { - const _$ReceiveViews(this.views); - - @override - final List<View> views; - - @override - String toString() { - return 'AppEvent.didReceiveViews(views: $views)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is ReceiveViews && - (identical(other.views, views) || - const DeepCollectionEquality().equals(other.views, views))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ const DeepCollectionEquality().hash(views); - - @JsonKey(ignore: true) - @override - $ReceiveViewsCopyWith<ReceiveViews> get copyWith => - _$ReceiveViewsCopyWithImpl<ReceiveViews>(this, _$identity); - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function(String name, String desc, ViewType viewType) - createView, - required TResult Function() delete, - required TResult Function(String newName) rename, - required TResult Function(List<View> views) didReceiveViews, - required TResult Function(App app) appDidUpdate, - }) { - return didReceiveViews(views); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(String name, String desc, ViewType viewType)? createView, - TResult Function()? delete, - TResult Function(String newName)? rename, - TResult Function(List<View> views)? didReceiveViews, - TResult Function(App app)? appDidUpdate, - }) { - return didReceiveViews?.call(views); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(String name, String desc, ViewType viewType)? createView, - TResult Function()? delete, - TResult Function(String newName)? rename, - TResult Function(List<View> views)? didReceiveViews, - TResult Function(App app)? appDidUpdate, - required TResult orElse(), - }) { - if (didReceiveViews != null) { - return didReceiveViews(views); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Initial value) initial, - required TResult Function(CreateView value) createView, - required TResult Function(Delete value) delete, - required TResult Function(Rename value) rename, - required TResult Function(ReceiveViews value) didReceiveViews, - required TResult Function(AppDidUpdate value) appDidUpdate, - }) { - return didReceiveViews(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(CreateView value)? createView, - TResult Function(Delete value)? delete, - TResult Function(Rename value)? rename, - TResult Function(ReceiveViews value)? didReceiveViews, - TResult Function(AppDidUpdate value)? appDidUpdate, - }) { - return didReceiveViews?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(CreateView value)? createView, - TResult Function(Delete value)? delete, - TResult Function(Rename value)? rename, - TResult Function(ReceiveViews value)? didReceiveViews, - TResult Function(AppDidUpdate value)? appDidUpdate, - required TResult orElse(), - }) { - if (didReceiveViews != null) { - return didReceiveViews(this); - } - return orElse(); - } -} - -abstract class ReceiveViews implements AppEvent { - const factory ReceiveViews(List<View> views) = _$ReceiveViews; - - List<View> get views => throw _privateConstructorUsedError; - @JsonKey(ignore: true) - $ReceiveViewsCopyWith<ReceiveViews> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $AppDidUpdateCopyWith<$Res> { - factory $AppDidUpdateCopyWith( - AppDidUpdate value, $Res Function(AppDidUpdate) then) = - _$AppDidUpdateCopyWithImpl<$Res>; - $Res call({App app}); -} - -/// @nodoc -class _$AppDidUpdateCopyWithImpl<$Res> extends _$AppEventCopyWithImpl<$Res> - implements $AppDidUpdateCopyWith<$Res> { - _$AppDidUpdateCopyWithImpl( - AppDidUpdate _value, $Res Function(AppDidUpdate) _then) - : super(_value, (v) => _then(v as AppDidUpdate)); - - @override - AppDidUpdate get _value => super._value as AppDidUpdate; - - @override - $Res call({ - Object? app = freezed, - }) { - return _then(AppDidUpdate( - app == freezed - ? _value.app - : app // ignore: cast_nullable_to_non_nullable - as App, - )); - } -} - -/// @nodoc - -class _$AppDidUpdate implements AppDidUpdate { - const _$AppDidUpdate(this.app); - - @override - final App app; - - @override - String toString() { - return 'AppEvent.appDidUpdate(app: $app)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is AppDidUpdate && - (identical(other.app, app) || - const DeepCollectionEquality().equals(other.app, app))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ const DeepCollectionEquality().hash(app); - - @JsonKey(ignore: true) - @override - $AppDidUpdateCopyWith<AppDidUpdate> get copyWith => - _$AppDidUpdateCopyWithImpl<AppDidUpdate>(this, _$identity); - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function(String name, String desc, ViewType viewType) - createView, - required TResult Function() delete, - required TResult Function(String newName) rename, - required TResult Function(List<View> views) didReceiveViews, - required TResult Function(App app) appDidUpdate, - }) { - return appDidUpdate(app); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(String name, String desc, ViewType viewType)? createView, - TResult Function()? delete, - TResult Function(String newName)? rename, - TResult Function(List<View> views)? didReceiveViews, - TResult Function(App app)? appDidUpdate, - }) { - return appDidUpdate?.call(app); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(String name, String desc, ViewType viewType)? createView, - TResult Function()? delete, - TResult Function(String newName)? rename, - TResult Function(List<View> views)? didReceiveViews, - TResult Function(App app)? appDidUpdate, - required TResult orElse(), - }) { - if (appDidUpdate != null) { - return appDidUpdate(app); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Initial value) initial, - required TResult Function(CreateView value) createView, - required TResult Function(Delete value) delete, - required TResult Function(Rename value) rename, - required TResult Function(ReceiveViews value) didReceiveViews, - required TResult Function(AppDidUpdate value) appDidUpdate, - }) { - return appDidUpdate(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(CreateView value)? createView, - TResult Function(Delete value)? delete, - TResult Function(Rename value)? rename, - TResult Function(ReceiveViews value)? didReceiveViews, - TResult Function(AppDidUpdate value)? appDidUpdate, - }) { - return appDidUpdate?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(CreateView value)? createView, - TResult Function(Delete value)? delete, - TResult Function(Rename value)? rename, - TResult Function(ReceiveViews value)? didReceiveViews, - TResult Function(AppDidUpdate value)? appDidUpdate, - required TResult orElse(), - }) { - if (appDidUpdate != null) { - return appDidUpdate(this); - } - return orElse(); - } -} - -abstract class AppDidUpdate implements AppEvent { - const factory AppDidUpdate(App app) = _$AppDidUpdate; - - App get app => throw _privateConstructorUsedError; - @JsonKey(ignore: true) - $AppDidUpdateCopyWith<AppDidUpdate> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -class _$AppStateTearOff { - const _$AppStateTearOff(); - - _AppState call( - {required App app, - required bool isLoading, - required List<View>? views, - View? latestCreatedView, - required Either<Unit, FlowyError> successOrFailure}) { - return _AppState( - app: app, - isLoading: isLoading, - views: views, - latestCreatedView: latestCreatedView, - successOrFailure: successOrFailure, - ); - } -} - -/// @nodoc -const $AppState = _$AppStateTearOff(); - -/// @nodoc -mixin _$AppState { - App get app => throw _privateConstructorUsedError; - bool get isLoading => throw _privateConstructorUsedError; - List<View>? get views => throw _privateConstructorUsedError; - View? get latestCreatedView => throw _privateConstructorUsedError; - Either<Unit, FlowyError> get successOrFailure => - throw _privateConstructorUsedError; - - @JsonKey(ignore: true) - $AppStateCopyWith<AppState> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $AppStateCopyWith<$Res> { - factory $AppStateCopyWith(AppState value, $Res Function(AppState) then) = - _$AppStateCopyWithImpl<$Res>; - $Res call( - {App app, - bool isLoading, - List<View>? views, - View? latestCreatedView, - Either<Unit, FlowyError> successOrFailure}); -} - -/// @nodoc -class _$AppStateCopyWithImpl<$Res> implements $AppStateCopyWith<$Res> { - _$AppStateCopyWithImpl(this._value, this._then); - - final AppState _value; - // ignore: unused_field - final $Res Function(AppState) _then; - - @override - $Res call({ - Object? app = freezed, - Object? isLoading = freezed, - Object? views = freezed, - Object? latestCreatedView = freezed, - Object? successOrFailure = freezed, - }) { - return _then(_value.copyWith( - app: app == freezed - ? _value.app - : app // ignore: cast_nullable_to_non_nullable - as App, - isLoading: isLoading == freezed - ? _value.isLoading - : isLoading // ignore: cast_nullable_to_non_nullable - as bool, - views: views == freezed - ? _value.views - : views // ignore: cast_nullable_to_non_nullable - as List<View>?, - latestCreatedView: latestCreatedView == freezed - ? _value.latestCreatedView - : latestCreatedView // ignore: cast_nullable_to_non_nullable - as View?, - successOrFailure: successOrFailure == freezed - ? _value.successOrFailure - : successOrFailure // ignore: cast_nullable_to_non_nullable - as Either<Unit, FlowyError>, - )); - } -} - -/// @nodoc -abstract class _$AppStateCopyWith<$Res> implements $AppStateCopyWith<$Res> { - factory _$AppStateCopyWith(_AppState value, $Res Function(_AppState) then) = - __$AppStateCopyWithImpl<$Res>; - @override - $Res call( - {App app, - bool isLoading, - List<View>? views, - View? latestCreatedView, - Either<Unit, FlowyError> successOrFailure}); -} - -/// @nodoc -class __$AppStateCopyWithImpl<$Res> extends _$AppStateCopyWithImpl<$Res> - implements _$AppStateCopyWith<$Res> { - __$AppStateCopyWithImpl(_AppState _value, $Res Function(_AppState) _then) - : super(_value, (v) => _then(v as _AppState)); - - @override - _AppState get _value => super._value as _AppState; - - @override - $Res call({ - Object? app = freezed, - Object? isLoading = freezed, - Object? views = freezed, - Object? latestCreatedView = freezed, - Object? successOrFailure = freezed, - }) { - return _then(_AppState( - app: app == freezed - ? _value.app - : app // ignore: cast_nullable_to_non_nullable - as App, - isLoading: isLoading == freezed - ? _value.isLoading - : isLoading // ignore: cast_nullable_to_non_nullable - as bool, - views: views == freezed - ? _value.views - : views // ignore: cast_nullable_to_non_nullable - as List<View>?, - latestCreatedView: latestCreatedView == freezed - ? _value.latestCreatedView - : latestCreatedView // ignore: cast_nullable_to_non_nullable - as View?, - successOrFailure: successOrFailure == freezed - ? _value.successOrFailure - : successOrFailure // ignore: cast_nullable_to_non_nullable - as Either<Unit, FlowyError>, - )); - } -} - -/// @nodoc - -class _$_AppState implements _AppState { - const _$_AppState( - {required this.app, - required this.isLoading, - required this.views, - this.latestCreatedView, - required this.successOrFailure}); - - @override - final App app; - @override - final bool isLoading; - @override - final List<View>? views; - @override - final View? latestCreatedView; - @override - final Either<Unit, FlowyError> successOrFailure; - - @override - String toString() { - return 'AppState(app: $app, isLoading: $isLoading, views: $views, latestCreatedView: $latestCreatedView, successOrFailure: $successOrFailure)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is _AppState && - (identical(other.app, app) || - const DeepCollectionEquality().equals(other.app, app)) && - (identical(other.isLoading, isLoading) || - const DeepCollectionEquality() - .equals(other.isLoading, isLoading)) && - (identical(other.views, views) || - const DeepCollectionEquality().equals(other.views, views)) && - (identical(other.latestCreatedView, latestCreatedView) || - const DeepCollectionEquality() - .equals(other.latestCreatedView, latestCreatedView)) && - (identical(other.successOrFailure, successOrFailure) || - const DeepCollectionEquality() - .equals(other.successOrFailure, successOrFailure))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ - const DeepCollectionEquality().hash(app) ^ - const DeepCollectionEquality().hash(isLoading) ^ - const DeepCollectionEquality().hash(views) ^ - const DeepCollectionEquality().hash(latestCreatedView) ^ - const DeepCollectionEquality().hash(successOrFailure); - - @JsonKey(ignore: true) - @override - _$AppStateCopyWith<_AppState> get copyWith => - __$AppStateCopyWithImpl<_AppState>(this, _$identity); -} - -abstract class _AppState implements AppState { - const factory _AppState( - {required App app, - required bool isLoading, - required List<View>? views, - View? latestCreatedView, - required Either<Unit, FlowyError> successOrFailure}) = _$_AppState; - - @override - App get app => throw _privateConstructorUsedError; - @override - bool get isLoading => throw _privateConstructorUsedError; - @override - List<View>? get views => throw _privateConstructorUsedError; - @override - View? get latestCreatedView => throw _privateConstructorUsedError; - @override - Either<Unit, FlowyError> get successOrFailure => - throw _privateConstructorUsedError; - @override - @JsonKey(ignore: true) - _$AppStateCopyWith<_AppState> get copyWith => - throw _privateConstructorUsedError; -} diff --git a/frontend/app_flowy/lib/workspace/application/doc/doc_bloc.freezed.dart b/frontend/app_flowy/lib/workspace/application/doc/doc_bloc.freezed.dart deleted file mode 100644 index 4b6f63f3d6..0000000000 --- a/frontend/app_flowy/lib/workspace/application/doc/doc_bloc.freezed.dart +++ /dev/null @@ -1,1214 +0,0 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target - -part of 'doc_bloc.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity<T>(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); - -/// @nodoc -class _$DocEventTearOff { - const _$DocEventTearOff(); - - Initial initial() { - return const Initial(); - } - - Deleted deleted() { - return const Deleted(); - } - - Restore restore() { - return const Restore(); - } - - RestorePage restorePage() { - return const RestorePage(); - } - - DeletePermanently deletePermanently() { - return const DeletePermanently(); - } -} - -/// @nodoc -const $DocEvent = _$DocEventTearOff(); - -/// @nodoc -mixin _$DocEvent { - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function() deleted, - required TResult Function() restore, - required TResult Function() restorePage, - required TResult Function() deletePermanently, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? deleted, - TResult Function()? restore, - TResult Function()? restorePage, - TResult Function()? deletePermanently, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? deleted, - TResult Function()? restore, - TResult Function()? restorePage, - TResult Function()? deletePermanently, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Initial value) initial, - required TResult Function(Deleted value) deleted, - required TResult Function(Restore value) restore, - required TResult Function(RestorePage value) restorePage, - required TResult Function(DeletePermanently value) deletePermanently, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(Deleted value)? deleted, - TResult Function(Restore value)? restore, - TResult Function(RestorePage value)? restorePage, - TResult Function(DeletePermanently value)? deletePermanently, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(Deleted value)? deleted, - TResult Function(Restore value)? restore, - TResult Function(RestorePage value)? restorePage, - TResult Function(DeletePermanently value)? deletePermanently, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $DocEventCopyWith<$Res> { - factory $DocEventCopyWith(DocEvent value, $Res Function(DocEvent) then) = - _$DocEventCopyWithImpl<$Res>; -} - -/// @nodoc -class _$DocEventCopyWithImpl<$Res> implements $DocEventCopyWith<$Res> { - _$DocEventCopyWithImpl(this._value, this._then); - - final DocEvent _value; - // ignore: unused_field - final $Res Function(DocEvent) _then; -} - -/// @nodoc -abstract class $InitialCopyWith<$Res> { - factory $InitialCopyWith(Initial value, $Res Function(Initial) then) = - _$InitialCopyWithImpl<$Res>; -} - -/// @nodoc -class _$InitialCopyWithImpl<$Res> extends _$DocEventCopyWithImpl<$Res> - implements $InitialCopyWith<$Res> { - _$InitialCopyWithImpl(Initial _value, $Res Function(Initial) _then) - : super(_value, (v) => _then(v as Initial)); - - @override - Initial get _value => super._value as Initial; -} - -/// @nodoc - -class _$Initial implements Initial { - const _$Initial(); - - @override - String toString() { - return 'DocEvent.initial()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || (other is Initial); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function() deleted, - required TResult Function() restore, - required TResult Function() restorePage, - required TResult Function() deletePermanently, - }) { - return initial(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? deleted, - TResult Function()? restore, - TResult Function()? restorePage, - TResult Function()? deletePermanently, - }) { - return initial?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? deleted, - TResult Function()? restore, - TResult Function()? restorePage, - TResult Function()? deletePermanently, - required TResult orElse(), - }) { - if (initial != null) { - return initial(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Initial value) initial, - required TResult Function(Deleted value) deleted, - required TResult Function(Restore value) restore, - required TResult Function(RestorePage value) restorePage, - required TResult Function(DeletePermanently value) deletePermanently, - }) { - return initial(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(Deleted value)? deleted, - TResult Function(Restore value)? restore, - TResult Function(RestorePage value)? restorePage, - TResult Function(DeletePermanently value)? deletePermanently, - }) { - return initial?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(Deleted value)? deleted, - TResult Function(Restore value)? restore, - TResult Function(RestorePage value)? restorePage, - TResult Function(DeletePermanently value)? deletePermanently, - required TResult orElse(), - }) { - if (initial != null) { - return initial(this); - } - return orElse(); - } -} - -abstract class Initial implements DocEvent { - const factory Initial() = _$Initial; -} - -/// @nodoc -abstract class $DeletedCopyWith<$Res> { - factory $DeletedCopyWith(Deleted value, $Res Function(Deleted) then) = - _$DeletedCopyWithImpl<$Res>; -} - -/// @nodoc -class _$DeletedCopyWithImpl<$Res> extends _$DocEventCopyWithImpl<$Res> - implements $DeletedCopyWith<$Res> { - _$DeletedCopyWithImpl(Deleted _value, $Res Function(Deleted) _then) - : super(_value, (v) => _then(v as Deleted)); - - @override - Deleted get _value => super._value as Deleted; -} - -/// @nodoc - -class _$Deleted implements Deleted { - const _$Deleted(); - - @override - String toString() { - return 'DocEvent.deleted()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || (other is Deleted); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function() deleted, - required TResult Function() restore, - required TResult Function() restorePage, - required TResult Function() deletePermanently, - }) { - return deleted(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? deleted, - TResult Function()? restore, - TResult Function()? restorePage, - TResult Function()? deletePermanently, - }) { - return deleted?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? deleted, - TResult Function()? restore, - TResult Function()? restorePage, - TResult Function()? deletePermanently, - required TResult orElse(), - }) { - if (deleted != null) { - return deleted(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Initial value) initial, - required TResult Function(Deleted value) deleted, - required TResult Function(Restore value) restore, - required TResult Function(RestorePage value) restorePage, - required TResult Function(DeletePermanently value) deletePermanently, - }) { - return deleted(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(Deleted value)? deleted, - TResult Function(Restore value)? restore, - TResult Function(RestorePage value)? restorePage, - TResult Function(DeletePermanently value)? deletePermanently, - }) { - return deleted?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(Deleted value)? deleted, - TResult Function(Restore value)? restore, - TResult Function(RestorePage value)? restorePage, - TResult Function(DeletePermanently value)? deletePermanently, - required TResult orElse(), - }) { - if (deleted != null) { - return deleted(this); - } - return orElse(); - } -} - -abstract class Deleted implements DocEvent { - const factory Deleted() = _$Deleted; -} - -/// @nodoc -abstract class $RestoreCopyWith<$Res> { - factory $RestoreCopyWith(Restore value, $Res Function(Restore) then) = - _$RestoreCopyWithImpl<$Res>; -} - -/// @nodoc -class _$RestoreCopyWithImpl<$Res> extends _$DocEventCopyWithImpl<$Res> - implements $RestoreCopyWith<$Res> { - _$RestoreCopyWithImpl(Restore _value, $Res Function(Restore) _then) - : super(_value, (v) => _then(v as Restore)); - - @override - Restore get _value => super._value as Restore; -} - -/// @nodoc - -class _$Restore implements Restore { - const _$Restore(); - - @override - String toString() { - return 'DocEvent.restore()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || (other is Restore); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function() deleted, - required TResult Function() restore, - required TResult Function() restorePage, - required TResult Function() deletePermanently, - }) { - return restore(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? deleted, - TResult Function()? restore, - TResult Function()? restorePage, - TResult Function()? deletePermanently, - }) { - return restore?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? deleted, - TResult Function()? restore, - TResult Function()? restorePage, - TResult Function()? deletePermanently, - required TResult orElse(), - }) { - if (restore != null) { - return restore(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Initial value) initial, - required TResult Function(Deleted value) deleted, - required TResult Function(Restore value) restore, - required TResult Function(RestorePage value) restorePage, - required TResult Function(DeletePermanently value) deletePermanently, - }) { - return restore(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(Deleted value)? deleted, - TResult Function(Restore value)? restore, - TResult Function(RestorePage value)? restorePage, - TResult Function(DeletePermanently value)? deletePermanently, - }) { - return restore?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(Deleted value)? deleted, - TResult Function(Restore value)? restore, - TResult Function(RestorePage value)? restorePage, - TResult Function(DeletePermanently value)? deletePermanently, - required TResult orElse(), - }) { - if (restore != null) { - return restore(this); - } - return orElse(); - } -} - -abstract class Restore implements DocEvent { - const factory Restore() = _$Restore; -} - -/// @nodoc -abstract class $RestorePageCopyWith<$Res> { - factory $RestorePageCopyWith( - RestorePage value, $Res Function(RestorePage) then) = - _$RestorePageCopyWithImpl<$Res>; -} - -/// @nodoc -class _$RestorePageCopyWithImpl<$Res> extends _$DocEventCopyWithImpl<$Res> - implements $RestorePageCopyWith<$Res> { - _$RestorePageCopyWithImpl( - RestorePage _value, $Res Function(RestorePage) _then) - : super(_value, (v) => _then(v as RestorePage)); - - @override - RestorePage get _value => super._value as RestorePage; -} - -/// @nodoc - -class _$RestorePage implements RestorePage { - const _$RestorePage(); - - @override - String toString() { - return 'DocEvent.restorePage()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || (other is RestorePage); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function() deleted, - required TResult Function() restore, - required TResult Function() restorePage, - required TResult Function() deletePermanently, - }) { - return restorePage(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? deleted, - TResult Function()? restore, - TResult Function()? restorePage, - TResult Function()? deletePermanently, - }) { - return restorePage?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? deleted, - TResult Function()? restore, - TResult Function()? restorePage, - TResult Function()? deletePermanently, - required TResult orElse(), - }) { - if (restorePage != null) { - return restorePage(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Initial value) initial, - required TResult Function(Deleted value) deleted, - required TResult Function(Restore value) restore, - required TResult Function(RestorePage value) restorePage, - required TResult Function(DeletePermanently value) deletePermanently, - }) { - return restorePage(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(Deleted value)? deleted, - TResult Function(Restore value)? restore, - TResult Function(RestorePage value)? restorePage, - TResult Function(DeletePermanently value)? deletePermanently, - }) { - return restorePage?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(Deleted value)? deleted, - TResult Function(Restore value)? restore, - TResult Function(RestorePage value)? restorePage, - TResult Function(DeletePermanently value)? deletePermanently, - required TResult orElse(), - }) { - if (restorePage != null) { - return restorePage(this); - } - return orElse(); - } -} - -abstract class RestorePage implements DocEvent { - const factory RestorePage() = _$RestorePage; -} - -/// @nodoc -abstract class $DeletePermanentlyCopyWith<$Res> { - factory $DeletePermanentlyCopyWith( - DeletePermanently value, $Res Function(DeletePermanently) then) = - _$DeletePermanentlyCopyWithImpl<$Res>; -} - -/// @nodoc -class _$DeletePermanentlyCopyWithImpl<$Res> extends _$DocEventCopyWithImpl<$Res> - implements $DeletePermanentlyCopyWith<$Res> { - _$DeletePermanentlyCopyWithImpl( - DeletePermanently _value, $Res Function(DeletePermanently) _then) - : super(_value, (v) => _then(v as DeletePermanently)); - - @override - DeletePermanently get _value => super._value as DeletePermanently; -} - -/// @nodoc - -class _$DeletePermanently implements DeletePermanently { - const _$DeletePermanently(); - - @override - String toString() { - return 'DocEvent.deletePermanently()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || (other is DeletePermanently); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function() deleted, - required TResult Function() restore, - required TResult Function() restorePage, - required TResult Function() deletePermanently, - }) { - return deletePermanently(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? deleted, - TResult Function()? restore, - TResult Function()? restorePage, - TResult Function()? deletePermanently, - }) { - return deletePermanently?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? deleted, - TResult Function()? restore, - TResult Function()? restorePage, - TResult Function()? deletePermanently, - required TResult orElse(), - }) { - if (deletePermanently != null) { - return deletePermanently(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Initial value) initial, - required TResult Function(Deleted value) deleted, - required TResult Function(Restore value) restore, - required TResult Function(RestorePage value) restorePage, - required TResult Function(DeletePermanently value) deletePermanently, - }) { - return deletePermanently(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(Deleted value)? deleted, - TResult Function(Restore value)? restore, - TResult Function(RestorePage value)? restorePage, - TResult Function(DeletePermanently value)? deletePermanently, - }) { - return deletePermanently?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(Deleted value)? deleted, - TResult Function(Restore value)? restore, - TResult Function(RestorePage value)? restorePage, - TResult Function(DeletePermanently value)? deletePermanently, - required TResult orElse(), - }) { - if (deletePermanently != null) { - return deletePermanently(this); - } - return orElse(); - } -} - -abstract class DeletePermanently implements DocEvent { - const factory DeletePermanently() = _$DeletePermanently; -} - -/// @nodoc -class _$DocStateTearOff { - const _$DocStateTearOff(); - - _DocState call( - {required DocLoadState loadState, - required bool isDeleted, - required bool forceClose}) { - return _DocState( - loadState: loadState, - isDeleted: isDeleted, - forceClose: forceClose, - ); - } -} - -/// @nodoc -const $DocState = _$DocStateTearOff(); - -/// @nodoc -mixin _$DocState { - DocLoadState get loadState => throw _privateConstructorUsedError; - bool get isDeleted => throw _privateConstructorUsedError; - bool get forceClose => throw _privateConstructorUsedError; - - @JsonKey(ignore: true) - $DocStateCopyWith<DocState> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $DocStateCopyWith<$Res> { - factory $DocStateCopyWith(DocState value, $Res Function(DocState) then) = - _$DocStateCopyWithImpl<$Res>; - $Res call({DocLoadState loadState, bool isDeleted, bool forceClose}); - - $DocLoadStateCopyWith<$Res> get loadState; -} - -/// @nodoc -class _$DocStateCopyWithImpl<$Res> implements $DocStateCopyWith<$Res> { - _$DocStateCopyWithImpl(this._value, this._then); - - final DocState _value; - // ignore: unused_field - final $Res Function(DocState) _then; - - @override - $Res call({ - Object? loadState = freezed, - Object? isDeleted = freezed, - Object? forceClose = freezed, - }) { - return _then(_value.copyWith( - loadState: loadState == freezed - ? _value.loadState - : loadState // ignore: cast_nullable_to_non_nullable - as DocLoadState, - isDeleted: isDeleted == freezed - ? _value.isDeleted - : isDeleted // ignore: cast_nullable_to_non_nullable - as bool, - forceClose: forceClose == freezed - ? _value.forceClose - : forceClose // ignore: cast_nullable_to_non_nullable - as bool, - )); - } - - @override - $DocLoadStateCopyWith<$Res> get loadState { - return $DocLoadStateCopyWith<$Res>(_value.loadState, (value) { - return _then(_value.copyWith(loadState: value)); - }); - } -} - -/// @nodoc -abstract class _$DocStateCopyWith<$Res> implements $DocStateCopyWith<$Res> { - factory _$DocStateCopyWith(_DocState value, $Res Function(_DocState) then) = - __$DocStateCopyWithImpl<$Res>; - @override - $Res call({DocLoadState loadState, bool isDeleted, bool forceClose}); - - @override - $DocLoadStateCopyWith<$Res> get loadState; -} - -/// @nodoc -class __$DocStateCopyWithImpl<$Res> extends _$DocStateCopyWithImpl<$Res> - implements _$DocStateCopyWith<$Res> { - __$DocStateCopyWithImpl(_DocState _value, $Res Function(_DocState) _then) - : super(_value, (v) => _then(v as _DocState)); - - @override - _DocState get _value => super._value as _DocState; - - @override - $Res call({ - Object? loadState = freezed, - Object? isDeleted = freezed, - Object? forceClose = freezed, - }) { - return _then(_DocState( - loadState: loadState == freezed - ? _value.loadState - : loadState // ignore: cast_nullable_to_non_nullable - as DocLoadState, - isDeleted: isDeleted == freezed - ? _value.isDeleted - : isDeleted // ignore: cast_nullable_to_non_nullable - as bool, - forceClose: forceClose == freezed - ? _value.forceClose - : forceClose // ignore: cast_nullable_to_non_nullable - as bool, - )); - } -} - -/// @nodoc - -class _$_DocState implements _DocState { - const _$_DocState( - {required this.loadState, - required this.isDeleted, - required this.forceClose}); - - @override - final DocLoadState loadState; - @override - final bool isDeleted; - @override - final bool forceClose; - - @override - String toString() { - return 'DocState(loadState: $loadState, isDeleted: $isDeleted, forceClose: $forceClose)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is _DocState && - (identical(other.loadState, loadState) || - const DeepCollectionEquality() - .equals(other.loadState, loadState)) && - (identical(other.isDeleted, isDeleted) || - const DeepCollectionEquality() - .equals(other.isDeleted, isDeleted)) && - (identical(other.forceClose, forceClose) || - const DeepCollectionEquality() - .equals(other.forceClose, forceClose))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ - const DeepCollectionEquality().hash(loadState) ^ - const DeepCollectionEquality().hash(isDeleted) ^ - const DeepCollectionEquality().hash(forceClose); - - @JsonKey(ignore: true) - @override - _$DocStateCopyWith<_DocState> get copyWith => - __$DocStateCopyWithImpl<_DocState>(this, _$identity); -} - -abstract class _DocState implements DocState { - const factory _DocState( - {required DocLoadState loadState, - required bool isDeleted, - required bool forceClose}) = _$_DocState; - - @override - DocLoadState get loadState => throw _privateConstructorUsedError; - @override - bool get isDeleted => throw _privateConstructorUsedError; - @override - bool get forceClose => throw _privateConstructorUsedError; - @override - @JsonKey(ignore: true) - _$DocStateCopyWith<_DocState> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -class _$DocLoadStateTearOff { - const _$DocLoadStateTearOff(); - - _Loading loading() { - return const _Loading(); - } - - _Finish finish(Either<Unit, FlowyError> successOrFail) { - return _Finish( - successOrFail, - ); - } -} - -/// @nodoc -const $DocLoadState = _$DocLoadStateTearOff(); - -/// @nodoc -mixin _$DocLoadState { - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() loading, - required TResult Function(Either<Unit, FlowyError> successOrFail) - finish, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? loading, - TResult Function(Either<Unit, FlowyError> successOrFail)? finish, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? loading, - TResult Function(Either<Unit, FlowyError> successOrFail)? finish, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(_Loading value) loading, - required TResult Function(_Finish value) finish, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(_Loading value)? loading, - TResult Function(_Finish value)? finish, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(_Loading value)? loading, - TResult Function(_Finish value)? finish, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $DocLoadStateCopyWith<$Res> { - factory $DocLoadStateCopyWith( - DocLoadState value, $Res Function(DocLoadState) then) = - _$DocLoadStateCopyWithImpl<$Res>; -} - -/// @nodoc -class _$DocLoadStateCopyWithImpl<$Res> implements $DocLoadStateCopyWith<$Res> { - _$DocLoadStateCopyWithImpl(this._value, this._then); - - final DocLoadState _value; - // ignore: unused_field - final $Res Function(DocLoadState) _then; -} - -/// @nodoc -abstract class _$LoadingCopyWith<$Res> { - factory _$LoadingCopyWith(_Loading value, $Res Function(_Loading) then) = - __$LoadingCopyWithImpl<$Res>; -} - -/// @nodoc -class __$LoadingCopyWithImpl<$Res> extends _$DocLoadStateCopyWithImpl<$Res> - implements _$LoadingCopyWith<$Res> { - __$LoadingCopyWithImpl(_Loading _value, $Res Function(_Loading) _then) - : super(_value, (v) => _then(v as _Loading)); - - @override - _Loading get _value => super._value as _Loading; -} - -/// @nodoc - -class _$_Loading implements _Loading { - const _$_Loading(); - - @override - String toString() { - return 'DocLoadState.loading()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || (other is _Loading); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() loading, - required TResult Function(Either<Unit, FlowyError> successOrFail) - finish, - }) { - return loading(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? loading, - TResult Function(Either<Unit, FlowyError> successOrFail)? finish, - }) { - return loading?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? loading, - TResult Function(Either<Unit, FlowyError> successOrFail)? finish, - required TResult orElse(), - }) { - if (loading != null) { - return loading(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(_Loading value) loading, - required TResult Function(_Finish value) finish, - }) { - return loading(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(_Loading value)? loading, - TResult Function(_Finish value)? finish, - }) { - return loading?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(_Loading value)? loading, - TResult Function(_Finish value)? finish, - required TResult orElse(), - }) { - if (loading != null) { - return loading(this); - } - return orElse(); - } -} - -abstract class _Loading implements DocLoadState { - const factory _Loading() = _$_Loading; -} - -/// @nodoc -abstract class _$FinishCopyWith<$Res> { - factory _$FinishCopyWith(_Finish value, $Res Function(_Finish) then) = - __$FinishCopyWithImpl<$Res>; - $Res call({Either<Unit, FlowyError> successOrFail}); -} - -/// @nodoc -class __$FinishCopyWithImpl<$Res> extends _$DocLoadStateCopyWithImpl<$Res> - implements _$FinishCopyWith<$Res> { - __$FinishCopyWithImpl(_Finish _value, $Res Function(_Finish) _then) - : super(_value, (v) => _then(v as _Finish)); - - @override - _Finish get _value => super._value as _Finish; - - @override - $Res call({ - Object? successOrFail = freezed, - }) { - return _then(_Finish( - successOrFail == freezed - ? _value.successOrFail - : successOrFail // ignore: cast_nullable_to_non_nullable - as Either<Unit, FlowyError>, - )); - } -} - -/// @nodoc - -class _$_Finish implements _Finish { - const _$_Finish(this.successOrFail); - - @override - final Either<Unit, FlowyError> successOrFail; - - @override - String toString() { - return 'DocLoadState.finish(successOrFail: $successOrFail)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is _Finish && - (identical(other.successOrFail, successOrFail) || - const DeepCollectionEquality() - .equals(other.successOrFail, successOrFail))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ const DeepCollectionEquality().hash(successOrFail); - - @JsonKey(ignore: true) - @override - _$FinishCopyWith<_Finish> get copyWith => - __$FinishCopyWithImpl<_Finish>(this, _$identity); - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() loading, - required TResult Function(Either<Unit, FlowyError> successOrFail) - finish, - }) { - return finish(successOrFail); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? loading, - TResult Function(Either<Unit, FlowyError> successOrFail)? finish, - }) { - return finish?.call(successOrFail); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? loading, - TResult Function(Either<Unit, FlowyError> successOrFail)? finish, - required TResult orElse(), - }) { - if (finish != null) { - return finish(successOrFail); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(_Loading value) loading, - required TResult Function(_Finish value) finish, - }) { - return finish(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(_Loading value)? loading, - TResult Function(_Finish value)? finish, - }) { - return finish?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(_Loading value)? loading, - TResult Function(_Finish value)? finish, - required TResult orElse(), - }) { - if (finish != null) { - return finish(this); - } - return orElse(); - } -} - -abstract class _Finish implements DocLoadState { - const factory _Finish(Either<Unit, FlowyError> successOrFail) = _$_Finish; - - Either<Unit, FlowyError> get successOrFail => - throw _privateConstructorUsedError; - @JsonKey(ignore: true) - _$FinishCopyWith<_Finish> get copyWith => throw _privateConstructorUsedError; -} diff --git a/frontend/app_flowy/lib/workspace/application/doc/share_bloc.freezed.dart b/frontend/app_flowy/lib/workspace/application/doc/share_bloc.freezed.dart deleted file mode 100644 index 2df633c426..0000000000 --- a/frontend/app_flowy/lib/workspace/application/doc/share_bloc.freezed.dart +++ /dev/null @@ -1,867 +0,0 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target - -part of 'share_bloc.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity<T>(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); - -/// @nodoc -class _$DocShareEventTearOff { - const _$DocShareEventTearOff(); - - ShareMarkdown shareMarkdown() { - return const ShareMarkdown(); - } - - ShareText shareText() { - return const ShareText(); - } - - ShareLink shareLink() { - return const ShareLink(); - } -} - -/// @nodoc -const $DocShareEvent = _$DocShareEventTearOff(); - -/// @nodoc -mixin _$DocShareEvent { - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() shareMarkdown, - required TResult Function() shareText, - required TResult Function() shareLink, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? shareMarkdown, - TResult Function()? shareText, - TResult Function()? shareLink, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? shareMarkdown, - TResult Function()? shareText, - TResult Function()? shareLink, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(ShareMarkdown value) shareMarkdown, - required TResult Function(ShareText value) shareText, - required TResult Function(ShareLink value) shareLink, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(ShareMarkdown value)? shareMarkdown, - TResult Function(ShareText value)? shareText, - TResult Function(ShareLink value)? shareLink, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(ShareMarkdown value)? shareMarkdown, - TResult Function(ShareText value)? shareText, - TResult Function(ShareLink value)? shareLink, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $DocShareEventCopyWith<$Res> { - factory $DocShareEventCopyWith( - DocShareEvent value, $Res Function(DocShareEvent) then) = - _$DocShareEventCopyWithImpl<$Res>; -} - -/// @nodoc -class _$DocShareEventCopyWithImpl<$Res> - implements $DocShareEventCopyWith<$Res> { - _$DocShareEventCopyWithImpl(this._value, this._then); - - final DocShareEvent _value; - // ignore: unused_field - final $Res Function(DocShareEvent) _then; -} - -/// @nodoc -abstract class $ShareMarkdownCopyWith<$Res> { - factory $ShareMarkdownCopyWith( - ShareMarkdown value, $Res Function(ShareMarkdown) then) = - _$ShareMarkdownCopyWithImpl<$Res>; -} - -/// @nodoc -class _$ShareMarkdownCopyWithImpl<$Res> - extends _$DocShareEventCopyWithImpl<$Res> - implements $ShareMarkdownCopyWith<$Res> { - _$ShareMarkdownCopyWithImpl( - ShareMarkdown _value, $Res Function(ShareMarkdown) _then) - : super(_value, (v) => _then(v as ShareMarkdown)); - - @override - ShareMarkdown get _value => super._value as ShareMarkdown; -} - -/// @nodoc - -class _$ShareMarkdown implements ShareMarkdown { - const _$ShareMarkdown(); - - @override - String toString() { - return 'DocShareEvent.shareMarkdown()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || (other is ShareMarkdown); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() shareMarkdown, - required TResult Function() shareText, - required TResult Function() shareLink, - }) { - return shareMarkdown(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? shareMarkdown, - TResult Function()? shareText, - TResult Function()? shareLink, - }) { - return shareMarkdown?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? shareMarkdown, - TResult Function()? shareText, - TResult Function()? shareLink, - required TResult orElse(), - }) { - if (shareMarkdown != null) { - return shareMarkdown(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(ShareMarkdown value) shareMarkdown, - required TResult Function(ShareText value) shareText, - required TResult Function(ShareLink value) shareLink, - }) { - return shareMarkdown(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(ShareMarkdown value)? shareMarkdown, - TResult Function(ShareText value)? shareText, - TResult Function(ShareLink value)? shareLink, - }) { - return shareMarkdown?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(ShareMarkdown value)? shareMarkdown, - TResult Function(ShareText value)? shareText, - TResult Function(ShareLink value)? shareLink, - required TResult orElse(), - }) { - if (shareMarkdown != null) { - return shareMarkdown(this); - } - return orElse(); - } -} - -abstract class ShareMarkdown implements DocShareEvent { - const factory ShareMarkdown() = _$ShareMarkdown; -} - -/// @nodoc -abstract class $ShareTextCopyWith<$Res> { - factory $ShareTextCopyWith(ShareText value, $Res Function(ShareText) then) = - _$ShareTextCopyWithImpl<$Res>; -} - -/// @nodoc -class _$ShareTextCopyWithImpl<$Res> extends _$DocShareEventCopyWithImpl<$Res> - implements $ShareTextCopyWith<$Res> { - _$ShareTextCopyWithImpl(ShareText _value, $Res Function(ShareText) _then) - : super(_value, (v) => _then(v as ShareText)); - - @override - ShareText get _value => super._value as ShareText; -} - -/// @nodoc - -class _$ShareText implements ShareText { - const _$ShareText(); - - @override - String toString() { - return 'DocShareEvent.shareText()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || (other is ShareText); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() shareMarkdown, - required TResult Function() shareText, - required TResult Function() shareLink, - }) { - return shareText(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? shareMarkdown, - TResult Function()? shareText, - TResult Function()? shareLink, - }) { - return shareText?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? shareMarkdown, - TResult Function()? shareText, - TResult Function()? shareLink, - required TResult orElse(), - }) { - if (shareText != null) { - return shareText(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(ShareMarkdown value) shareMarkdown, - required TResult Function(ShareText value) shareText, - required TResult Function(ShareLink value) shareLink, - }) { - return shareText(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(ShareMarkdown value)? shareMarkdown, - TResult Function(ShareText value)? shareText, - TResult Function(ShareLink value)? shareLink, - }) { - return shareText?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(ShareMarkdown value)? shareMarkdown, - TResult Function(ShareText value)? shareText, - TResult Function(ShareLink value)? shareLink, - required TResult orElse(), - }) { - if (shareText != null) { - return shareText(this); - } - return orElse(); - } -} - -abstract class ShareText implements DocShareEvent { - const factory ShareText() = _$ShareText; -} - -/// @nodoc -abstract class $ShareLinkCopyWith<$Res> { - factory $ShareLinkCopyWith(ShareLink value, $Res Function(ShareLink) then) = - _$ShareLinkCopyWithImpl<$Res>; -} - -/// @nodoc -class _$ShareLinkCopyWithImpl<$Res> extends _$DocShareEventCopyWithImpl<$Res> - implements $ShareLinkCopyWith<$Res> { - _$ShareLinkCopyWithImpl(ShareLink _value, $Res Function(ShareLink) _then) - : super(_value, (v) => _then(v as ShareLink)); - - @override - ShareLink get _value => super._value as ShareLink; -} - -/// @nodoc - -class _$ShareLink implements ShareLink { - const _$ShareLink(); - - @override - String toString() { - return 'DocShareEvent.shareLink()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || (other is ShareLink); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() shareMarkdown, - required TResult Function() shareText, - required TResult Function() shareLink, - }) { - return shareLink(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? shareMarkdown, - TResult Function()? shareText, - TResult Function()? shareLink, - }) { - return shareLink?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? shareMarkdown, - TResult Function()? shareText, - TResult Function()? shareLink, - required TResult orElse(), - }) { - if (shareLink != null) { - return shareLink(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(ShareMarkdown value) shareMarkdown, - required TResult Function(ShareText value) shareText, - required TResult Function(ShareLink value) shareLink, - }) { - return shareLink(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(ShareMarkdown value)? shareMarkdown, - TResult Function(ShareText value)? shareText, - TResult Function(ShareLink value)? shareLink, - }) { - return shareLink?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(ShareMarkdown value)? shareMarkdown, - TResult Function(ShareText value)? shareText, - TResult Function(ShareLink value)? shareLink, - required TResult orElse(), - }) { - if (shareLink != null) { - return shareLink(this); - } - return orElse(); - } -} - -abstract class ShareLink implements DocShareEvent { - const factory ShareLink() = _$ShareLink; -} - -/// @nodoc -class _$DocShareStateTearOff { - const _$DocShareStateTearOff(); - - _Initial initial() { - return const _Initial(); - } - - _Loading loading() { - return const _Loading(); - } - - _Finish finish(Either<ExportData, FlowyError> successOrFail) { - return _Finish( - successOrFail, - ); - } -} - -/// @nodoc -const $DocShareState = _$DocShareStateTearOff(); - -/// @nodoc -mixin _$DocShareState { - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function() loading, - required TResult Function(Either<ExportData, FlowyError> successOrFail) - finish, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? loading, - TResult Function(Either<ExportData, FlowyError> successOrFail)? finish, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? loading, - TResult Function(Either<ExportData, FlowyError> successOrFail)? finish, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(_Initial value) initial, - required TResult Function(_Loading value) loading, - required TResult Function(_Finish value) finish, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(_Initial value)? initial, - TResult Function(_Loading value)? loading, - TResult Function(_Finish value)? finish, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(_Initial value)? initial, - TResult Function(_Loading value)? loading, - TResult Function(_Finish value)? finish, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $DocShareStateCopyWith<$Res> { - factory $DocShareStateCopyWith( - DocShareState value, $Res Function(DocShareState) then) = - _$DocShareStateCopyWithImpl<$Res>; -} - -/// @nodoc -class _$DocShareStateCopyWithImpl<$Res> - implements $DocShareStateCopyWith<$Res> { - _$DocShareStateCopyWithImpl(this._value, this._then); - - final DocShareState _value; - // ignore: unused_field - final $Res Function(DocShareState) _then; -} - -/// @nodoc -abstract class _$InitialCopyWith<$Res> { - factory _$InitialCopyWith(_Initial value, $Res Function(_Initial) then) = - __$InitialCopyWithImpl<$Res>; -} - -/// @nodoc -class __$InitialCopyWithImpl<$Res> extends _$DocShareStateCopyWithImpl<$Res> - implements _$InitialCopyWith<$Res> { - __$InitialCopyWithImpl(_Initial _value, $Res Function(_Initial) _then) - : super(_value, (v) => _then(v as _Initial)); - - @override - _Initial get _value => super._value as _Initial; -} - -/// @nodoc - -class _$_Initial implements _Initial { - const _$_Initial(); - - @override - String toString() { - return 'DocShareState.initial()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || (other is _Initial); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function() loading, - required TResult Function(Either<ExportData, FlowyError> successOrFail) - finish, - }) { - return initial(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? loading, - TResult Function(Either<ExportData, FlowyError> successOrFail)? finish, - }) { - return initial?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? loading, - TResult Function(Either<ExportData, FlowyError> successOrFail)? finish, - required TResult orElse(), - }) { - if (initial != null) { - return initial(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(_Initial value) initial, - required TResult Function(_Loading value) loading, - required TResult Function(_Finish value) finish, - }) { - return initial(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(_Initial value)? initial, - TResult Function(_Loading value)? loading, - TResult Function(_Finish value)? finish, - }) { - return initial?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(_Initial value)? initial, - TResult Function(_Loading value)? loading, - TResult Function(_Finish value)? finish, - required TResult orElse(), - }) { - if (initial != null) { - return initial(this); - } - return orElse(); - } -} - -abstract class _Initial implements DocShareState { - const factory _Initial() = _$_Initial; -} - -/// @nodoc -abstract class _$LoadingCopyWith<$Res> { - factory _$LoadingCopyWith(_Loading value, $Res Function(_Loading) then) = - __$LoadingCopyWithImpl<$Res>; -} - -/// @nodoc -class __$LoadingCopyWithImpl<$Res> extends _$DocShareStateCopyWithImpl<$Res> - implements _$LoadingCopyWith<$Res> { - __$LoadingCopyWithImpl(_Loading _value, $Res Function(_Loading) _then) - : super(_value, (v) => _then(v as _Loading)); - - @override - _Loading get _value => super._value as _Loading; -} - -/// @nodoc - -class _$_Loading implements _Loading { - const _$_Loading(); - - @override - String toString() { - return 'DocShareState.loading()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || (other is _Loading); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function() loading, - required TResult Function(Either<ExportData, FlowyError> successOrFail) - finish, - }) { - return loading(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? loading, - TResult Function(Either<ExportData, FlowyError> successOrFail)? finish, - }) { - return loading?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? loading, - TResult Function(Either<ExportData, FlowyError> successOrFail)? finish, - required TResult orElse(), - }) { - if (loading != null) { - return loading(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(_Initial value) initial, - required TResult Function(_Loading value) loading, - required TResult Function(_Finish value) finish, - }) { - return loading(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(_Initial value)? initial, - TResult Function(_Loading value)? loading, - TResult Function(_Finish value)? finish, - }) { - return loading?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(_Initial value)? initial, - TResult Function(_Loading value)? loading, - TResult Function(_Finish value)? finish, - required TResult orElse(), - }) { - if (loading != null) { - return loading(this); - } - return orElse(); - } -} - -abstract class _Loading implements DocShareState { - const factory _Loading() = _$_Loading; -} - -/// @nodoc -abstract class _$FinishCopyWith<$Res> { - factory _$FinishCopyWith(_Finish value, $Res Function(_Finish) then) = - __$FinishCopyWithImpl<$Res>; - $Res call({Either<ExportData, FlowyError> successOrFail}); -} - -/// @nodoc -class __$FinishCopyWithImpl<$Res> extends _$DocShareStateCopyWithImpl<$Res> - implements _$FinishCopyWith<$Res> { - __$FinishCopyWithImpl(_Finish _value, $Res Function(_Finish) _then) - : super(_value, (v) => _then(v as _Finish)); - - @override - _Finish get _value => super._value as _Finish; - - @override - $Res call({ - Object? successOrFail = freezed, - }) { - return _then(_Finish( - successOrFail == freezed - ? _value.successOrFail - : successOrFail // ignore: cast_nullable_to_non_nullable - as Either<ExportData, FlowyError>, - )); - } -} - -/// @nodoc - -class _$_Finish implements _Finish { - const _$_Finish(this.successOrFail); - - @override - final Either<ExportData, FlowyError> successOrFail; - - @override - String toString() { - return 'DocShareState.finish(successOrFail: $successOrFail)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is _Finish && - (identical(other.successOrFail, successOrFail) || - const DeepCollectionEquality() - .equals(other.successOrFail, successOrFail))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ const DeepCollectionEquality().hash(successOrFail); - - @JsonKey(ignore: true) - @override - _$FinishCopyWith<_Finish> get copyWith => - __$FinishCopyWithImpl<_Finish>(this, _$identity); - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function() loading, - required TResult Function(Either<ExportData, FlowyError> successOrFail) - finish, - }) { - return finish(successOrFail); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? loading, - TResult Function(Either<ExportData, FlowyError> successOrFail)? finish, - }) { - return finish?.call(successOrFail); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? loading, - TResult Function(Either<ExportData, FlowyError> successOrFail)? finish, - required TResult orElse(), - }) { - if (finish != null) { - return finish(successOrFail); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(_Initial value) initial, - required TResult Function(_Loading value) loading, - required TResult Function(_Finish value) finish, - }) { - return finish(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(_Initial value)? initial, - TResult Function(_Loading value)? loading, - TResult Function(_Finish value)? finish, - }) { - return finish?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(_Initial value)? initial, - TResult Function(_Loading value)? loading, - TResult Function(_Finish value)? finish, - required TResult orElse(), - }) { - if (finish != null) { - return finish(this); - } - return orElse(); - } -} - -abstract class _Finish implements DocShareState { - const factory _Finish(Either<ExportData, FlowyError> successOrFail) = - _$_Finish; - - Either<ExportData, FlowyError> get successOrFail => - throw _privateConstructorUsedError; - @JsonKey(ignore: true) - _$FinishCopyWith<_Finish> get copyWith => throw _privateConstructorUsedError; -} diff --git a/frontend/app_flowy/lib/workspace/application/edit_pannel/edit_pannel_bloc.freezed.dart b/frontend/app_flowy/lib/workspace/application/edit_pannel/edit_pannel_bloc.freezed.dart deleted file mode 100644 index 5b49609f58..0000000000 --- a/frontend/app_flowy/lib/workspace/application/edit_pannel/edit_pannel_bloc.freezed.dart +++ /dev/null @@ -1,541 +0,0 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target - -part of 'edit_pannel_bloc.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity<T>(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); - -/// @nodoc -class _$EditPannelEventTearOff { - const _$EditPannelEventTearOff(); - - _StartEdit startEdit(EditPannelContext context) { - return _StartEdit( - context, - ); - } - - _EndEdit endEdit(EditPannelContext context) { - return _EndEdit( - context, - ); - } -} - -/// @nodoc -const $EditPannelEvent = _$EditPannelEventTearOff(); - -/// @nodoc -mixin _$EditPannelEvent { - EditPannelContext get context => throw _privateConstructorUsedError; - - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function(EditPannelContext context) startEdit, - required TResult Function(EditPannelContext context) endEdit, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function(EditPannelContext context)? startEdit, - TResult Function(EditPannelContext context)? endEdit, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function(EditPannelContext context)? startEdit, - TResult Function(EditPannelContext context)? endEdit, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(_StartEdit value) startEdit, - required TResult Function(_EndEdit value) endEdit, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(_StartEdit value)? startEdit, - TResult Function(_EndEdit value)? endEdit, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(_StartEdit value)? startEdit, - TResult Function(_EndEdit value)? endEdit, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - - @JsonKey(ignore: true) - $EditPannelEventCopyWith<EditPannelEvent> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $EditPannelEventCopyWith<$Res> { - factory $EditPannelEventCopyWith( - EditPannelEvent value, $Res Function(EditPannelEvent) then) = - _$EditPannelEventCopyWithImpl<$Res>; - $Res call({EditPannelContext context}); -} - -/// @nodoc -class _$EditPannelEventCopyWithImpl<$Res> - implements $EditPannelEventCopyWith<$Res> { - _$EditPannelEventCopyWithImpl(this._value, this._then); - - final EditPannelEvent _value; - // ignore: unused_field - final $Res Function(EditPannelEvent) _then; - - @override - $Res call({ - Object? context = freezed, - }) { - return _then(_value.copyWith( - context: context == freezed - ? _value.context - : context // ignore: cast_nullable_to_non_nullable - as EditPannelContext, - )); - } -} - -/// @nodoc -abstract class _$StartEditCopyWith<$Res> - implements $EditPannelEventCopyWith<$Res> { - factory _$StartEditCopyWith( - _StartEdit value, $Res Function(_StartEdit) then) = - __$StartEditCopyWithImpl<$Res>; - @override - $Res call({EditPannelContext context}); -} - -/// @nodoc -class __$StartEditCopyWithImpl<$Res> extends _$EditPannelEventCopyWithImpl<$Res> - implements _$StartEditCopyWith<$Res> { - __$StartEditCopyWithImpl(_StartEdit _value, $Res Function(_StartEdit) _then) - : super(_value, (v) => _then(v as _StartEdit)); - - @override - _StartEdit get _value => super._value as _StartEdit; - - @override - $Res call({ - Object? context = freezed, - }) { - return _then(_StartEdit( - context == freezed - ? _value.context - : context // ignore: cast_nullable_to_non_nullable - as EditPannelContext, - )); - } -} - -/// @nodoc - -class _$_StartEdit implements _StartEdit { - const _$_StartEdit(this.context); - - @override - final EditPannelContext context; - - @override - String toString() { - return 'EditPannelEvent.startEdit(context: $context)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is _StartEdit && - (identical(other.context, context) || - const DeepCollectionEquality().equals(other.context, context))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ const DeepCollectionEquality().hash(context); - - @JsonKey(ignore: true) - @override - _$StartEditCopyWith<_StartEdit> get copyWith => - __$StartEditCopyWithImpl<_StartEdit>(this, _$identity); - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function(EditPannelContext context) startEdit, - required TResult Function(EditPannelContext context) endEdit, - }) { - return startEdit(context); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function(EditPannelContext context)? startEdit, - TResult Function(EditPannelContext context)? endEdit, - }) { - return startEdit?.call(context); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function(EditPannelContext context)? startEdit, - TResult Function(EditPannelContext context)? endEdit, - required TResult orElse(), - }) { - if (startEdit != null) { - return startEdit(context); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(_StartEdit value) startEdit, - required TResult Function(_EndEdit value) endEdit, - }) { - return startEdit(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(_StartEdit value)? startEdit, - TResult Function(_EndEdit value)? endEdit, - }) { - return startEdit?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(_StartEdit value)? startEdit, - TResult Function(_EndEdit value)? endEdit, - required TResult orElse(), - }) { - if (startEdit != null) { - return startEdit(this); - } - return orElse(); - } -} - -abstract class _StartEdit implements EditPannelEvent { - const factory _StartEdit(EditPannelContext context) = _$_StartEdit; - - @override - EditPannelContext get context => throw _privateConstructorUsedError; - @override - @JsonKey(ignore: true) - _$StartEditCopyWith<_StartEdit> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$EndEditCopyWith<$Res> - implements $EditPannelEventCopyWith<$Res> { - factory _$EndEditCopyWith(_EndEdit value, $Res Function(_EndEdit) then) = - __$EndEditCopyWithImpl<$Res>; - @override - $Res call({EditPannelContext context}); -} - -/// @nodoc -class __$EndEditCopyWithImpl<$Res> extends _$EditPannelEventCopyWithImpl<$Res> - implements _$EndEditCopyWith<$Res> { - __$EndEditCopyWithImpl(_EndEdit _value, $Res Function(_EndEdit) _then) - : super(_value, (v) => _then(v as _EndEdit)); - - @override - _EndEdit get _value => super._value as _EndEdit; - - @override - $Res call({ - Object? context = freezed, - }) { - return _then(_EndEdit( - context == freezed - ? _value.context - : context // ignore: cast_nullable_to_non_nullable - as EditPannelContext, - )); - } -} - -/// @nodoc - -class _$_EndEdit implements _EndEdit { - const _$_EndEdit(this.context); - - @override - final EditPannelContext context; - - @override - String toString() { - return 'EditPannelEvent.endEdit(context: $context)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is _EndEdit && - (identical(other.context, context) || - const DeepCollectionEquality().equals(other.context, context))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ const DeepCollectionEquality().hash(context); - - @JsonKey(ignore: true) - @override - _$EndEditCopyWith<_EndEdit> get copyWith => - __$EndEditCopyWithImpl<_EndEdit>(this, _$identity); - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function(EditPannelContext context) startEdit, - required TResult Function(EditPannelContext context) endEdit, - }) { - return endEdit(context); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function(EditPannelContext context)? startEdit, - TResult Function(EditPannelContext context)? endEdit, - }) { - return endEdit?.call(context); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function(EditPannelContext context)? startEdit, - TResult Function(EditPannelContext context)? endEdit, - required TResult orElse(), - }) { - if (endEdit != null) { - return endEdit(context); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(_StartEdit value) startEdit, - required TResult Function(_EndEdit value) endEdit, - }) { - return endEdit(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(_StartEdit value)? startEdit, - TResult Function(_EndEdit value)? endEdit, - }) { - return endEdit?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(_StartEdit value)? startEdit, - TResult Function(_EndEdit value)? endEdit, - required TResult orElse(), - }) { - if (endEdit != null) { - return endEdit(this); - } - return orElse(); - } -} - -abstract class _EndEdit implements EditPannelEvent { - const factory _EndEdit(EditPannelContext context) = _$_EndEdit; - - @override - EditPannelContext get context => throw _privateConstructorUsedError; - @override - @JsonKey(ignore: true) - _$EndEditCopyWith<_EndEdit> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -class _$EditPannelStateTearOff { - const _$EditPannelStateTearOff(); - - _EditPannelState call( - {required bool isEditing, - required Option<EditPannelContext> editContext}) { - return _EditPannelState( - isEditing: isEditing, - editContext: editContext, - ); - } -} - -/// @nodoc -const $EditPannelState = _$EditPannelStateTearOff(); - -/// @nodoc -mixin _$EditPannelState { - bool get isEditing => throw _privateConstructorUsedError; - Option<EditPannelContext> get editContext => - throw _privateConstructorUsedError; - - @JsonKey(ignore: true) - $EditPannelStateCopyWith<EditPannelState> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $EditPannelStateCopyWith<$Res> { - factory $EditPannelStateCopyWith( - EditPannelState value, $Res Function(EditPannelState) then) = - _$EditPannelStateCopyWithImpl<$Res>; - $Res call({bool isEditing, Option<EditPannelContext> editContext}); -} - -/// @nodoc -class _$EditPannelStateCopyWithImpl<$Res> - implements $EditPannelStateCopyWith<$Res> { - _$EditPannelStateCopyWithImpl(this._value, this._then); - - final EditPannelState _value; - // ignore: unused_field - final $Res Function(EditPannelState) _then; - - @override - $Res call({ - Object? isEditing = freezed, - Object? editContext = freezed, - }) { - return _then(_value.copyWith( - isEditing: isEditing == freezed - ? _value.isEditing - : isEditing // ignore: cast_nullable_to_non_nullable - as bool, - editContext: editContext == freezed - ? _value.editContext - : editContext // ignore: cast_nullable_to_non_nullable - as Option<EditPannelContext>, - )); - } -} - -/// @nodoc -abstract class _$EditPannelStateCopyWith<$Res> - implements $EditPannelStateCopyWith<$Res> { - factory _$EditPannelStateCopyWith( - _EditPannelState value, $Res Function(_EditPannelState) then) = - __$EditPannelStateCopyWithImpl<$Res>; - @override - $Res call({bool isEditing, Option<EditPannelContext> editContext}); -} - -/// @nodoc -class __$EditPannelStateCopyWithImpl<$Res> - extends _$EditPannelStateCopyWithImpl<$Res> - implements _$EditPannelStateCopyWith<$Res> { - __$EditPannelStateCopyWithImpl( - _EditPannelState _value, $Res Function(_EditPannelState) _then) - : super(_value, (v) => _then(v as _EditPannelState)); - - @override - _EditPannelState get _value => super._value as _EditPannelState; - - @override - $Res call({ - Object? isEditing = freezed, - Object? editContext = freezed, - }) { - return _then(_EditPannelState( - isEditing: isEditing == freezed - ? _value.isEditing - : isEditing // ignore: cast_nullable_to_non_nullable - as bool, - editContext: editContext == freezed - ? _value.editContext - : editContext // ignore: cast_nullable_to_non_nullable - as Option<EditPannelContext>, - )); - } -} - -/// @nodoc - -class _$_EditPannelState implements _EditPannelState { - const _$_EditPannelState( - {required this.isEditing, required this.editContext}); - - @override - final bool isEditing; - @override - final Option<EditPannelContext> editContext; - - @override - String toString() { - return 'EditPannelState(isEditing: $isEditing, editContext: $editContext)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is _EditPannelState && - (identical(other.isEditing, isEditing) || - const DeepCollectionEquality() - .equals(other.isEditing, isEditing)) && - (identical(other.editContext, editContext) || - const DeepCollectionEquality() - .equals(other.editContext, editContext))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ - const DeepCollectionEquality().hash(isEditing) ^ - const DeepCollectionEquality().hash(editContext); - - @JsonKey(ignore: true) - @override - _$EditPannelStateCopyWith<_EditPannelState> get copyWith => - __$EditPannelStateCopyWithImpl<_EditPannelState>(this, _$identity); -} - -abstract class _EditPannelState implements EditPannelState { - const factory _EditPannelState( - {required bool isEditing, - required Option<EditPannelContext> editContext}) = _$_EditPannelState; - - @override - bool get isEditing => throw _privateConstructorUsedError; - @override - Option<EditPannelContext> get editContext => - throw _privateConstructorUsedError; - @override - @JsonKey(ignore: true) - _$EditPannelStateCopyWith<_EditPannelState> get copyWith => - throw _privateConstructorUsedError; -} diff --git a/frontend/app_flowy/lib/workspace/application/home/home_bloc.freezed.dart b/frontend/app_flowy/lib/workspace/application/home/home_bloc.freezed.dart deleted file mode 100644 index b3967c13c9..0000000000 --- a/frontend/app_flowy/lib/workspace/application/home/home_bloc.freezed.dart +++ /dev/null @@ -1,851 +0,0 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target - -part of 'home_bloc.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity<T>(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); - -/// @nodoc -class _$HomeEventTearOff { - const _$HomeEventTearOff(); - - _ShowLoading showLoading(bool isLoading) { - return _ShowLoading( - isLoading, - ); - } - - _ForceCollapse forceCollapse(bool forceCollapse) { - return _ForceCollapse( - forceCollapse, - ); - } - - _ShowEditPannel setEditPannel(EditPannelContext editContext) { - return _ShowEditPannel( - editContext, - ); - } - - _DismissEditPannel dismissEditPannel() { - return const _DismissEditPannel(); - } -} - -/// @nodoc -const $HomeEvent = _$HomeEventTearOff(); - -/// @nodoc -mixin _$HomeEvent { - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function(bool isLoading) showLoading, - required TResult Function(bool forceCollapse) forceCollapse, - required TResult Function(EditPannelContext editContext) setEditPannel, - required TResult Function() dismissEditPannel, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function(bool isLoading)? showLoading, - TResult Function(bool forceCollapse)? forceCollapse, - TResult Function(EditPannelContext editContext)? setEditPannel, - TResult Function()? dismissEditPannel, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function(bool isLoading)? showLoading, - TResult Function(bool forceCollapse)? forceCollapse, - TResult Function(EditPannelContext editContext)? setEditPannel, - TResult Function()? dismissEditPannel, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(_ShowLoading value) showLoading, - required TResult Function(_ForceCollapse value) forceCollapse, - required TResult Function(_ShowEditPannel value) setEditPannel, - required TResult Function(_DismissEditPannel value) dismissEditPannel, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(_ShowLoading value)? showLoading, - TResult Function(_ForceCollapse value)? forceCollapse, - TResult Function(_ShowEditPannel value)? setEditPannel, - TResult Function(_DismissEditPannel value)? dismissEditPannel, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(_ShowLoading value)? showLoading, - TResult Function(_ForceCollapse value)? forceCollapse, - TResult Function(_ShowEditPannel value)? setEditPannel, - TResult Function(_DismissEditPannel value)? dismissEditPannel, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $HomeEventCopyWith<$Res> { - factory $HomeEventCopyWith(HomeEvent value, $Res Function(HomeEvent) then) = - _$HomeEventCopyWithImpl<$Res>; -} - -/// @nodoc -class _$HomeEventCopyWithImpl<$Res> implements $HomeEventCopyWith<$Res> { - _$HomeEventCopyWithImpl(this._value, this._then); - - final HomeEvent _value; - // ignore: unused_field - final $Res Function(HomeEvent) _then; -} - -/// @nodoc -abstract class _$ShowLoadingCopyWith<$Res> { - factory _$ShowLoadingCopyWith( - _ShowLoading value, $Res Function(_ShowLoading) then) = - __$ShowLoadingCopyWithImpl<$Res>; - $Res call({bool isLoading}); -} - -/// @nodoc -class __$ShowLoadingCopyWithImpl<$Res> extends _$HomeEventCopyWithImpl<$Res> - implements _$ShowLoadingCopyWith<$Res> { - __$ShowLoadingCopyWithImpl( - _ShowLoading _value, $Res Function(_ShowLoading) _then) - : super(_value, (v) => _then(v as _ShowLoading)); - - @override - _ShowLoading get _value => super._value as _ShowLoading; - - @override - $Res call({ - Object? isLoading = freezed, - }) { - return _then(_ShowLoading( - isLoading == freezed - ? _value.isLoading - : isLoading // ignore: cast_nullable_to_non_nullable - as bool, - )); - } -} - -/// @nodoc - -class _$_ShowLoading implements _ShowLoading { - const _$_ShowLoading(this.isLoading); - - @override - final bool isLoading; - - @override - String toString() { - return 'HomeEvent.showLoading(isLoading: $isLoading)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is _ShowLoading && - (identical(other.isLoading, isLoading) || - const DeepCollectionEquality() - .equals(other.isLoading, isLoading))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ const DeepCollectionEquality().hash(isLoading); - - @JsonKey(ignore: true) - @override - _$ShowLoadingCopyWith<_ShowLoading> get copyWith => - __$ShowLoadingCopyWithImpl<_ShowLoading>(this, _$identity); - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function(bool isLoading) showLoading, - required TResult Function(bool forceCollapse) forceCollapse, - required TResult Function(EditPannelContext editContext) setEditPannel, - required TResult Function() dismissEditPannel, - }) { - return showLoading(isLoading); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function(bool isLoading)? showLoading, - TResult Function(bool forceCollapse)? forceCollapse, - TResult Function(EditPannelContext editContext)? setEditPannel, - TResult Function()? dismissEditPannel, - }) { - return showLoading?.call(isLoading); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function(bool isLoading)? showLoading, - TResult Function(bool forceCollapse)? forceCollapse, - TResult Function(EditPannelContext editContext)? setEditPannel, - TResult Function()? dismissEditPannel, - required TResult orElse(), - }) { - if (showLoading != null) { - return showLoading(isLoading); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(_ShowLoading value) showLoading, - required TResult Function(_ForceCollapse value) forceCollapse, - required TResult Function(_ShowEditPannel value) setEditPannel, - required TResult Function(_DismissEditPannel value) dismissEditPannel, - }) { - return showLoading(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(_ShowLoading value)? showLoading, - TResult Function(_ForceCollapse value)? forceCollapse, - TResult Function(_ShowEditPannel value)? setEditPannel, - TResult Function(_DismissEditPannel value)? dismissEditPannel, - }) { - return showLoading?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(_ShowLoading value)? showLoading, - TResult Function(_ForceCollapse value)? forceCollapse, - TResult Function(_ShowEditPannel value)? setEditPannel, - TResult Function(_DismissEditPannel value)? dismissEditPannel, - required TResult orElse(), - }) { - if (showLoading != null) { - return showLoading(this); - } - return orElse(); - } -} - -abstract class _ShowLoading implements HomeEvent { - const factory _ShowLoading(bool isLoading) = _$_ShowLoading; - - bool get isLoading => throw _privateConstructorUsedError; - @JsonKey(ignore: true) - _$ShowLoadingCopyWith<_ShowLoading> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$ForceCollapseCopyWith<$Res> { - factory _$ForceCollapseCopyWith( - _ForceCollapse value, $Res Function(_ForceCollapse) then) = - __$ForceCollapseCopyWithImpl<$Res>; - $Res call({bool forceCollapse}); -} - -/// @nodoc -class __$ForceCollapseCopyWithImpl<$Res> extends _$HomeEventCopyWithImpl<$Res> - implements _$ForceCollapseCopyWith<$Res> { - __$ForceCollapseCopyWithImpl( - _ForceCollapse _value, $Res Function(_ForceCollapse) _then) - : super(_value, (v) => _then(v as _ForceCollapse)); - - @override - _ForceCollapse get _value => super._value as _ForceCollapse; - - @override - $Res call({ - Object? forceCollapse = freezed, - }) { - return _then(_ForceCollapse( - forceCollapse == freezed - ? _value.forceCollapse - : forceCollapse // ignore: cast_nullable_to_non_nullable - as bool, - )); - } -} - -/// @nodoc - -class _$_ForceCollapse implements _ForceCollapse { - const _$_ForceCollapse(this.forceCollapse); - - @override - final bool forceCollapse; - - @override - String toString() { - return 'HomeEvent.forceCollapse(forceCollapse: $forceCollapse)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is _ForceCollapse && - (identical(other.forceCollapse, forceCollapse) || - const DeepCollectionEquality() - .equals(other.forceCollapse, forceCollapse))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ const DeepCollectionEquality().hash(forceCollapse); - - @JsonKey(ignore: true) - @override - _$ForceCollapseCopyWith<_ForceCollapse> get copyWith => - __$ForceCollapseCopyWithImpl<_ForceCollapse>(this, _$identity); - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function(bool isLoading) showLoading, - required TResult Function(bool forceCollapse) forceCollapse, - required TResult Function(EditPannelContext editContext) setEditPannel, - required TResult Function() dismissEditPannel, - }) { - return forceCollapse(this.forceCollapse); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function(bool isLoading)? showLoading, - TResult Function(bool forceCollapse)? forceCollapse, - TResult Function(EditPannelContext editContext)? setEditPannel, - TResult Function()? dismissEditPannel, - }) { - return forceCollapse?.call(this.forceCollapse); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function(bool isLoading)? showLoading, - TResult Function(bool forceCollapse)? forceCollapse, - TResult Function(EditPannelContext editContext)? setEditPannel, - TResult Function()? dismissEditPannel, - required TResult orElse(), - }) { - if (forceCollapse != null) { - return forceCollapse(this.forceCollapse); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(_ShowLoading value) showLoading, - required TResult Function(_ForceCollapse value) forceCollapse, - required TResult Function(_ShowEditPannel value) setEditPannel, - required TResult Function(_DismissEditPannel value) dismissEditPannel, - }) { - return forceCollapse(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(_ShowLoading value)? showLoading, - TResult Function(_ForceCollapse value)? forceCollapse, - TResult Function(_ShowEditPannel value)? setEditPannel, - TResult Function(_DismissEditPannel value)? dismissEditPannel, - }) { - return forceCollapse?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(_ShowLoading value)? showLoading, - TResult Function(_ForceCollapse value)? forceCollapse, - TResult Function(_ShowEditPannel value)? setEditPannel, - TResult Function(_DismissEditPannel value)? dismissEditPannel, - required TResult orElse(), - }) { - if (forceCollapse != null) { - return forceCollapse(this); - } - return orElse(); - } -} - -abstract class _ForceCollapse implements HomeEvent { - const factory _ForceCollapse(bool forceCollapse) = _$_ForceCollapse; - - bool get forceCollapse => throw _privateConstructorUsedError; - @JsonKey(ignore: true) - _$ForceCollapseCopyWith<_ForceCollapse> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$ShowEditPannelCopyWith<$Res> { - factory _$ShowEditPannelCopyWith( - _ShowEditPannel value, $Res Function(_ShowEditPannel) then) = - __$ShowEditPannelCopyWithImpl<$Res>; - $Res call({EditPannelContext editContext}); -} - -/// @nodoc -class __$ShowEditPannelCopyWithImpl<$Res> extends _$HomeEventCopyWithImpl<$Res> - implements _$ShowEditPannelCopyWith<$Res> { - __$ShowEditPannelCopyWithImpl( - _ShowEditPannel _value, $Res Function(_ShowEditPannel) _then) - : super(_value, (v) => _then(v as _ShowEditPannel)); - - @override - _ShowEditPannel get _value => super._value as _ShowEditPannel; - - @override - $Res call({ - Object? editContext = freezed, - }) { - return _then(_ShowEditPannel( - editContext == freezed - ? _value.editContext - : editContext // ignore: cast_nullable_to_non_nullable - as EditPannelContext, - )); - } -} - -/// @nodoc - -class _$_ShowEditPannel implements _ShowEditPannel { - const _$_ShowEditPannel(this.editContext); - - @override - final EditPannelContext editContext; - - @override - String toString() { - return 'HomeEvent.setEditPannel(editContext: $editContext)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is _ShowEditPannel && - (identical(other.editContext, editContext) || - const DeepCollectionEquality() - .equals(other.editContext, editContext))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ const DeepCollectionEquality().hash(editContext); - - @JsonKey(ignore: true) - @override - _$ShowEditPannelCopyWith<_ShowEditPannel> get copyWith => - __$ShowEditPannelCopyWithImpl<_ShowEditPannel>(this, _$identity); - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function(bool isLoading) showLoading, - required TResult Function(bool forceCollapse) forceCollapse, - required TResult Function(EditPannelContext editContext) setEditPannel, - required TResult Function() dismissEditPannel, - }) { - return setEditPannel(editContext); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function(bool isLoading)? showLoading, - TResult Function(bool forceCollapse)? forceCollapse, - TResult Function(EditPannelContext editContext)? setEditPannel, - TResult Function()? dismissEditPannel, - }) { - return setEditPannel?.call(editContext); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function(bool isLoading)? showLoading, - TResult Function(bool forceCollapse)? forceCollapse, - TResult Function(EditPannelContext editContext)? setEditPannel, - TResult Function()? dismissEditPannel, - required TResult orElse(), - }) { - if (setEditPannel != null) { - return setEditPannel(editContext); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(_ShowLoading value) showLoading, - required TResult Function(_ForceCollapse value) forceCollapse, - required TResult Function(_ShowEditPannel value) setEditPannel, - required TResult Function(_DismissEditPannel value) dismissEditPannel, - }) { - return setEditPannel(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(_ShowLoading value)? showLoading, - TResult Function(_ForceCollapse value)? forceCollapse, - TResult Function(_ShowEditPannel value)? setEditPannel, - TResult Function(_DismissEditPannel value)? dismissEditPannel, - }) { - return setEditPannel?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(_ShowLoading value)? showLoading, - TResult Function(_ForceCollapse value)? forceCollapse, - TResult Function(_ShowEditPannel value)? setEditPannel, - TResult Function(_DismissEditPannel value)? dismissEditPannel, - required TResult orElse(), - }) { - if (setEditPannel != null) { - return setEditPannel(this); - } - return orElse(); - } -} - -abstract class _ShowEditPannel implements HomeEvent { - const factory _ShowEditPannel(EditPannelContext editContext) = - _$_ShowEditPannel; - - EditPannelContext get editContext => throw _privateConstructorUsedError; - @JsonKey(ignore: true) - _$ShowEditPannelCopyWith<_ShowEditPannel> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$DismissEditPannelCopyWith<$Res> { - factory _$DismissEditPannelCopyWith( - _DismissEditPannel value, $Res Function(_DismissEditPannel) then) = - __$DismissEditPannelCopyWithImpl<$Res>; -} - -/// @nodoc -class __$DismissEditPannelCopyWithImpl<$Res> - extends _$HomeEventCopyWithImpl<$Res> - implements _$DismissEditPannelCopyWith<$Res> { - __$DismissEditPannelCopyWithImpl( - _DismissEditPannel _value, $Res Function(_DismissEditPannel) _then) - : super(_value, (v) => _then(v as _DismissEditPannel)); - - @override - _DismissEditPannel get _value => super._value as _DismissEditPannel; -} - -/// @nodoc - -class _$_DismissEditPannel implements _DismissEditPannel { - const _$_DismissEditPannel(); - - @override - String toString() { - return 'HomeEvent.dismissEditPannel()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || (other is _DismissEditPannel); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function(bool isLoading) showLoading, - required TResult Function(bool forceCollapse) forceCollapse, - required TResult Function(EditPannelContext editContext) setEditPannel, - required TResult Function() dismissEditPannel, - }) { - return dismissEditPannel(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function(bool isLoading)? showLoading, - TResult Function(bool forceCollapse)? forceCollapse, - TResult Function(EditPannelContext editContext)? setEditPannel, - TResult Function()? dismissEditPannel, - }) { - return dismissEditPannel?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function(bool isLoading)? showLoading, - TResult Function(bool forceCollapse)? forceCollapse, - TResult Function(EditPannelContext editContext)? setEditPannel, - TResult Function()? dismissEditPannel, - required TResult orElse(), - }) { - if (dismissEditPannel != null) { - return dismissEditPannel(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(_ShowLoading value) showLoading, - required TResult Function(_ForceCollapse value) forceCollapse, - required TResult Function(_ShowEditPannel value) setEditPannel, - required TResult Function(_DismissEditPannel value) dismissEditPannel, - }) { - return dismissEditPannel(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(_ShowLoading value)? showLoading, - TResult Function(_ForceCollapse value)? forceCollapse, - TResult Function(_ShowEditPannel value)? setEditPannel, - TResult Function(_DismissEditPannel value)? dismissEditPannel, - }) { - return dismissEditPannel?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(_ShowLoading value)? showLoading, - TResult Function(_ForceCollapse value)? forceCollapse, - TResult Function(_ShowEditPannel value)? setEditPannel, - TResult Function(_DismissEditPannel value)? dismissEditPannel, - required TResult orElse(), - }) { - if (dismissEditPannel != null) { - return dismissEditPannel(this); - } - return orElse(); - } -} - -abstract class _DismissEditPannel implements HomeEvent { - const factory _DismissEditPannel() = _$_DismissEditPannel; -} - -/// @nodoc -class _$HomeStateTearOff { - const _$HomeStateTearOff(); - - _HomeState call( - {required bool isLoading, - required bool forceCollapse, - required Option<EditPannelContext> editContext}) { - return _HomeState( - isLoading: isLoading, - forceCollapse: forceCollapse, - editContext: editContext, - ); - } -} - -/// @nodoc -const $HomeState = _$HomeStateTearOff(); - -/// @nodoc -mixin _$HomeState { - bool get isLoading => throw _privateConstructorUsedError; - bool get forceCollapse => throw _privateConstructorUsedError; - Option<EditPannelContext> get editContext => - throw _privateConstructorUsedError; - - @JsonKey(ignore: true) - $HomeStateCopyWith<HomeState> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $HomeStateCopyWith<$Res> { - factory $HomeStateCopyWith(HomeState value, $Res Function(HomeState) then) = - _$HomeStateCopyWithImpl<$Res>; - $Res call( - {bool isLoading, - bool forceCollapse, - Option<EditPannelContext> editContext}); -} - -/// @nodoc -class _$HomeStateCopyWithImpl<$Res> implements $HomeStateCopyWith<$Res> { - _$HomeStateCopyWithImpl(this._value, this._then); - - final HomeState _value; - // ignore: unused_field - final $Res Function(HomeState) _then; - - @override - $Res call({ - Object? isLoading = freezed, - Object? forceCollapse = freezed, - Object? editContext = freezed, - }) { - return _then(_value.copyWith( - isLoading: isLoading == freezed - ? _value.isLoading - : isLoading // ignore: cast_nullable_to_non_nullable - as bool, - forceCollapse: forceCollapse == freezed - ? _value.forceCollapse - : forceCollapse // ignore: cast_nullable_to_non_nullable - as bool, - editContext: editContext == freezed - ? _value.editContext - : editContext // ignore: cast_nullable_to_non_nullable - as Option<EditPannelContext>, - )); - } -} - -/// @nodoc -abstract class _$HomeStateCopyWith<$Res> implements $HomeStateCopyWith<$Res> { - factory _$HomeStateCopyWith( - _HomeState value, $Res Function(_HomeState) then) = - __$HomeStateCopyWithImpl<$Res>; - @override - $Res call( - {bool isLoading, - bool forceCollapse, - Option<EditPannelContext> editContext}); -} - -/// @nodoc -class __$HomeStateCopyWithImpl<$Res> extends _$HomeStateCopyWithImpl<$Res> - implements _$HomeStateCopyWith<$Res> { - __$HomeStateCopyWithImpl(_HomeState _value, $Res Function(_HomeState) _then) - : super(_value, (v) => _then(v as _HomeState)); - - @override - _HomeState get _value => super._value as _HomeState; - - @override - $Res call({ - Object? isLoading = freezed, - Object? forceCollapse = freezed, - Object? editContext = freezed, - }) { - return _then(_HomeState( - isLoading: isLoading == freezed - ? _value.isLoading - : isLoading // ignore: cast_nullable_to_non_nullable - as bool, - forceCollapse: forceCollapse == freezed - ? _value.forceCollapse - : forceCollapse // ignore: cast_nullable_to_non_nullable - as bool, - editContext: editContext == freezed - ? _value.editContext - : editContext // ignore: cast_nullable_to_non_nullable - as Option<EditPannelContext>, - )); - } -} - -/// @nodoc - -class _$_HomeState implements _HomeState { - const _$_HomeState( - {required this.isLoading, - required this.forceCollapse, - required this.editContext}); - - @override - final bool isLoading; - @override - final bool forceCollapse; - @override - final Option<EditPannelContext> editContext; - - @override - String toString() { - return 'HomeState(isLoading: $isLoading, forceCollapse: $forceCollapse, editContext: $editContext)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is _HomeState && - (identical(other.isLoading, isLoading) || - const DeepCollectionEquality() - .equals(other.isLoading, isLoading)) && - (identical(other.forceCollapse, forceCollapse) || - const DeepCollectionEquality() - .equals(other.forceCollapse, forceCollapse)) && - (identical(other.editContext, editContext) || - const DeepCollectionEquality() - .equals(other.editContext, editContext))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ - const DeepCollectionEquality().hash(isLoading) ^ - const DeepCollectionEquality().hash(forceCollapse) ^ - const DeepCollectionEquality().hash(editContext); - - @JsonKey(ignore: true) - @override - _$HomeStateCopyWith<_HomeState> get copyWith => - __$HomeStateCopyWithImpl<_HomeState>(this, _$identity); -} - -abstract class _HomeState implements HomeState { - const factory _HomeState( - {required bool isLoading, - required bool forceCollapse, - required Option<EditPannelContext> editContext}) = _$_HomeState; - - @override - bool get isLoading => throw _privateConstructorUsedError; - @override - bool get forceCollapse => throw _privateConstructorUsedError; - @override - Option<EditPannelContext> get editContext => - throw _privateConstructorUsedError; - @override - @JsonKey(ignore: true) - _$HomeStateCopyWith<_HomeState> get copyWith => - throw _privateConstructorUsedError; -} diff --git a/frontend/app_flowy/lib/workspace/application/home/home_listen_bloc.freezed.dart b/frontend/app_flowy/lib/workspace/application/home/home_listen_bloc.freezed.dart deleted file mode 100644 index 4e72038867..0000000000 --- a/frontend/app_flowy/lib/workspace/application/home/home_listen_bloc.freezed.dart +++ /dev/null @@ -1,767 +0,0 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target - -part of 'home_listen_bloc.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity<T>(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); - -/// @nodoc -class _$HomeListenEventTearOff { - const _$HomeListenEventTearOff(); - - _Started started() { - return const _Started(); - } - - _Stop stop() { - return const _Stop(); - } - - _Unauthorized unauthorized(String msg) { - return _Unauthorized( - msg, - ); - } -} - -/// @nodoc -const $HomeListenEvent = _$HomeListenEventTearOff(); - -/// @nodoc -mixin _$HomeListenEvent { - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() started, - required TResult Function() stop, - required TResult Function(String msg) unauthorized, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? started, - TResult Function()? stop, - TResult Function(String msg)? unauthorized, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? started, - TResult Function()? stop, - TResult Function(String msg)? unauthorized, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(_Started value) started, - required TResult Function(_Stop value) stop, - required TResult Function(_Unauthorized value) unauthorized, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(_Started value)? started, - TResult Function(_Stop value)? stop, - TResult Function(_Unauthorized value)? unauthorized, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(_Started value)? started, - TResult Function(_Stop value)? stop, - TResult Function(_Unauthorized value)? unauthorized, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $HomeListenEventCopyWith<$Res> { - factory $HomeListenEventCopyWith( - HomeListenEvent value, $Res Function(HomeListenEvent) then) = - _$HomeListenEventCopyWithImpl<$Res>; -} - -/// @nodoc -class _$HomeListenEventCopyWithImpl<$Res> - implements $HomeListenEventCopyWith<$Res> { - _$HomeListenEventCopyWithImpl(this._value, this._then); - - final HomeListenEvent _value; - // ignore: unused_field - final $Res Function(HomeListenEvent) _then; -} - -/// @nodoc -abstract class _$StartedCopyWith<$Res> { - factory _$StartedCopyWith(_Started value, $Res Function(_Started) then) = - __$StartedCopyWithImpl<$Res>; -} - -/// @nodoc -class __$StartedCopyWithImpl<$Res> extends _$HomeListenEventCopyWithImpl<$Res> - implements _$StartedCopyWith<$Res> { - __$StartedCopyWithImpl(_Started _value, $Res Function(_Started) _then) - : super(_value, (v) => _then(v as _Started)); - - @override - _Started get _value => super._value as _Started; -} - -/// @nodoc - -class _$_Started implements _Started { - const _$_Started(); - - @override - String toString() { - return 'HomeListenEvent.started()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || (other is _Started); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() started, - required TResult Function() stop, - required TResult Function(String msg) unauthorized, - }) { - return started(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? started, - TResult Function()? stop, - TResult Function(String msg)? unauthorized, - }) { - return started?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? started, - TResult Function()? stop, - TResult Function(String msg)? unauthorized, - required TResult orElse(), - }) { - if (started != null) { - return started(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(_Started value) started, - required TResult Function(_Stop value) stop, - required TResult Function(_Unauthorized value) unauthorized, - }) { - return started(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(_Started value)? started, - TResult Function(_Stop value)? stop, - TResult Function(_Unauthorized value)? unauthorized, - }) { - return started?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(_Started value)? started, - TResult Function(_Stop value)? stop, - TResult Function(_Unauthorized value)? unauthorized, - required TResult orElse(), - }) { - if (started != null) { - return started(this); - } - return orElse(); - } -} - -abstract class _Started implements HomeListenEvent { - const factory _Started() = _$_Started; -} - -/// @nodoc -abstract class _$StopCopyWith<$Res> { - factory _$StopCopyWith(_Stop value, $Res Function(_Stop) then) = - __$StopCopyWithImpl<$Res>; -} - -/// @nodoc -class __$StopCopyWithImpl<$Res> extends _$HomeListenEventCopyWithImpl<$Res> - implements _$StopCopyWith<$Res> { - __$StopCopyWithImpl(_Stop _value, $Res Function(_Stop) _then) - : super(_value, (v) => _then(v as _Stop)); - - @override - _Stop get _value => super._value as _Stop; -} - -/// @nodoc - -class _$_Stop implements _Stop { - const _$_Stop(); - - @override - String toString() { - return 'HomeListenEvent.stop()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || (other is _Stop); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() started, - required TResult Function() stop, - required TResult Function(String msg) unauthorized, - }) { - return stop(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? started, - TResult Function()? stop, - TResult Function(String msg)? unauthorized, - }) { - return stop?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? started, - TResult Function()? stop, - TResult Function(String msg)? unauthorized, - required TResult orElse(), - }) { - if (stop != null) { - return stop(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(_Started value) started, - required TResult Function(_Stop value) stop, - required TResult Function(_Unauthorized value) unauthorized, - }) { - return stop(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(_Started value)? started, - TResult Function(_Stop value)? stop, - TResult Function(_Unauthorized value)? unauthorized, - }) { - return stop?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(_Started value)? started, - TResult Function(_Stop value)? stop, - TResult Function(_Unauthorized value)? unauthorized, - required TResult orElse(), - }) { - if (stop != null) { - return stop(this); - } - return orElse(); - } -} - -abstract class _Stop implements HomeListenEvent { - const factory _Stop() = _$_Stop; -} - -/// @nodoc -abstract class _$UnauthorizedCopyWith<$Res> { - factory _$UnauthorizedCopyWith( - _Unauthorized value, $Res Function(_Unauthorized) then) = - __$UnauthorizedCopyWithImpl<$Res>; - $Res call({String msg}); -} - -/// @nodoc -class __$UnauthorizedCopyWithImpl<$Res> - extends _$HomeListenEventCopyWithImpl<$Res> - implements _$UnauthorizedCopyWith<$Res> { - __$UnauthorizedCopyWithImpl( - _Unauthorized _value, $Res Function(_Unauthorized) _then) - : super(_value, (v) => _then(v as _Unauthorized)); - - @override - _Unauthorized get _value => super._value as _Unauthorized; - - @override - $Res call({ - Object? msg = freezed, - }) { - return _then(_Unauthorized( - msg == freezed - ? _value.msg - : msg // ignore: cast_nullable_to_non_nullable - as String, - )); - } -} - -/// @nodoc - -class _$_Unauthorized implements _Unauthorized { - const _$_Unauthorized(this.msg); - - @override - final String msg; - - @override - String toString() { - return 'HomeListenEvent.unauthorized(msg: $msg)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is _Unauthorized && - (identical(other.msg, msg) || - const DeepCollectionEquality().equals(other.msg, msg))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ const DeepCollectionEquality().hash(msg); - - @JsonKey(ignore: true) - @override - _$UnauthorizedCopyWith<_Unauthorized> get copyWith => - __$UnauthorizedCopyWithImpl<_Unauthorized>(this, _$identity); - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() started, - required TResult Function() stop, - required TResult Function(String msg) unauthorized, - }) { - return unauthorized(msg); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? started, - TResult Function()? stop, - TResult Function(String msg)? unauthorized, - }) { - return unauthorized?.call(msg); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? started, - TResult Function()? stop, - TResult Function(String msg)? unauthorized, - required TResult orElse(), - }) { - if (unauthorized != null) { - return unauthorized(msg); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(_Started value) started, - required TResult Function(_Stop value) stop, - required TResult Function(_Unauthorized value) unauthorized, - }) { - return unauthorized(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(_Started value)? started, - TResult Function(_Stop value)? stop, - TResult Function(_Unauthorized value)? unauthorized, - }) { - return unauthorized?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(_Started value)? started, - TResult Function(_Stop value)? stop, - TResult Function(_Unauthorized value)? unauthorized, - required TResult orElse(), - }) { - if (unauthorized != null) { - return unauthorized(this); - } - return orElse(); - } -} - -abstract class _Unauthorized implements HomeListenEvent { - const factory _Unauthorized(String msg) = _$_Unauthorized; - - String get msg => throw _privateConstructorUsedError; - @JsonKey(ignore: true) - _$UnauthorizedCopyWith<_Unauthorized> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -class _$HomeListenStateTearOff { - const _$HomeListenStateTearOff(); - - Loading loading() { - return const Loading(); - } - - Unauthorized unauthorized(String msg) { - return Unauthorized( - msg, - ); - } -} - -/// @nodoc -const $HomeListenState = _$HomeListenStateTearOff(); - -/// @nodoc -mixin _$HomeListenState { - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() loading, - required TResult Function(String msg) unauthorized, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? loading, - TResult Function(String msg)? unauthorized, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? loading, - TResult Function(String msg)? unauthorized, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Loading value) loading, - required TResult Function(Unauthorized value) unauthorized, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Loading value)? loading, - TResult Function(Unauthorized value)? unauthorized, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Loading value)? loading, - TResult Function(Unauthorized value)? unauthorized, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $HomeListenStateCopyWith<$Res> { - factory $HomeListenStateCopyWith( - HomeListenState value, $Res Function(HomeListenState) then) = - _$HomeListenStateCopyWithImpl<$Res>; -} - -/// @nodoc -class _$HomeListenStateCopyWithImpl<$Res> - implements $HomeListenStateCopyWith<$Res> { - _$HomeListenStateCopyWithImpl(this._value, this._then); - - final HomeListenState _value; - // ignore: unused_field - final $Res Function(HomeListenState) _then; -} - -/// @nodoc -abstract class $LoadingCopyWith<$Res> { - factory $LoadingCopyWith(Loading value, $Res Function(Loading) then) = - _$LoadingCopyWithImpl<$Res>; -} - -/// @nodoc -class _$LoadingCopyWithImpl<$Res> extends _$HomeListenStateCopyWithImpl<$Res> - implements $LoadingCopyWith<$Res> { - _$LoadingCopyWithImpl(Loading _value, $Res Function(Loading) _then) - : super(_value, (v) => _then(v as Loading)); - - @override - Loading get _value => super._value as Loading; -} - -/// @nodoc - -class _$Loading implements Loading { - const _$Loading(); - - @override - String toString() { - return 'HomeListenState.loading()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || (other is Loading); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() loading, - required TResult Function(String msg) unauthorized, - }) { - return loading(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? loading, - TResult Function(String msg)? unauthorized, - }) { - return loading?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? loading, - TResult Function(String msg)? unauthorized, - required TResult orElse(), - }) { - if (loading != null) { - return loading(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Loading value) loading, - required TResult Function(Unauthorized value) unauthorized, - }) { - return loading(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Loading value)? loading, - TResult Function(Unauthorized value)? unauthorized, - }) { - return loading?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Loading value)? loading, - TResult Function(Unauthorized value)? unauthorized, - required TResult orElse(), - }) { - if (loading != null) { - return loading(this); - } - return orElse(); - } -} - -abstract class Loading implements HomeListenState { - const factory Loading() = _$Loading; -} - -/// @nodoc -abstract class $UnauthorizedCopyWith<$Res> { - factory $UnauthorizedCopyWith( - Unauthorized value, $Res Function(Unauthorized) then) = - _$UnauthorizedCopyWithImpl<$Res>; - $Res call({String msg}); -} - -/// @nodoc -class _$UnauthorizedCopyWithImpl<$Res> - extends _$HomeListenStateCopyWithImpl<$Res> - implements $UnauthorizedCopyWith<$Res> { - _$UnauthorizedCopyWithImpl( - Unauthorized _value, $Res Function(Unauthorized) _then) - : super(_value, (v) => _then(v as Unauthorized)); - - @override - Unauthorized get _value => super._value as Unauthorized; - - @override - $Res call({ - Object? msg = freezed, - }) { - return _then(Unauthorized( - msg == freezed - ? _value.msg - : msg // ignore: cast_nullable_to_non_nullable - as String, - )); - } -} - -/// @nodoc - -class _$Unauthorized implements Unauthorized { - const _$Unauthorized(this.msg); - - @override - final String msg; - - @override - String toString() { - return 'HomeListenState.unauthorized(msg: $msg)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is Unauthorized && - (identical(other.msg, msg) || - const DeepCollectionEquality().equals(other.msg, msg))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ const DeepCollectionEquality().hash(msg); - - @JsonKey(ignore: true) - @override - $UnauthorizedCopyWith<Unauthorized> get copyWith => - _$UnauthorizedCopyWithImpl<Unauthorized>(this, _$identity); - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() loading, - required TResult Function(String msg) unauthorized, - }) { - return unauthorized(msg); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? loading, - TResult Function(String msg)? unauthorized, - }) { - return unauthorized?.call(msg); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? loading, - TResult Function(String msg)? unauthorized, - required TResult orElse(), - }) { - if (unauthorized != null) { - return unauthorized(msg); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Loading value) loading, - required TResult Function(Unauthorized value) unauthorized, - }) { - return unauthorized(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Loading value)? loading, - TResult Function(Unauthorized value)? unauthorized, - }) { - return unauthorized?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Loading value)? loading, - TResult Function(Unauthorized value)? unauthorized, - required TResult orElse(), - }) { - if (unauthorized != null) { - return unauthorized(this); - } - return orElse(); - } -} - -abstract class Unauthorized implements HomeListenState { - const factory Unauthorized(String msg) = _$Unauthorized; - - String get msg => throw _privateConstructorUsedError; - @JsonKey(ignore: true) - $UnauthorizedCopyWith<Unauthorized> get copyWith => - throw _privateConstructorUsedError; -} diff --git a/frontend/app_flowy/lib/workspace/application/menu/menu_bloc.freezed.dart b/frontend/app_flowy/lib/workspace/application/menu/menu_bloc.freezed.dart deleted file mode 100644 index a23f8bcd04..0000000000 --- a/frontend/app_flowy/lib/workspace/application/menu/menu_bloc.freezed.dart +++ /dev/null @@ -1,1061 +0,0 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target - -part of 'menu_bloc.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity<T>(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); - -/// @nodoc -class _$MenuEventTearOff { - const _$MenuEventTearOff(); - - _Initial initial() { - return const _Initial(); - } - - Collapse collapse() { - return const Collapse(); - } - - OpenPage openPage(HomeStackContext<dynamic, dynamic> context) { - return OpenPage( - context, - ); - } - - CreateApp createApp(String name, {String? desc}) { - return CreateApp( - name, - desc: desc, - ); - } - - ReceiveApps didReceiveApps(Either<List<App>, FlowyError> appsOrFail) { - return ReceiveApps( - appsOrFail, - ); - } -} - -/// @nodoc -const $MenuEvent = _$MenuEventTearOff(); - -/// @nodoc -mixin _$MenuEvent { - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function() collapse, - required TResult Function(HomeStackContext<dynamic, dynamic> context) - openPage, - required TResult Function(String name, String? desc) createApp, - required TResult Function(Either<List<App>, FlowyError> appsOrFail) - didReceiveApps, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? collapse, - TResult Function(HomeStackContext<dynamic, dynamic> context)? openPage, - TResult Function(String name, String? desc)? createApp, - TResult Function(Either<List<App>, FlowyError> appsOrFail)? - didReceiveApps, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? collapse, - TResult Function(HomeStackContext<dynamic, dynamic> context)? openPage, - TResult Function(String name, String? desc)? createApp, - TResult Function(Either<List<App>, FlowyError> appsOrFail)? - didReceiveApps, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(_Initial value) initial, - required TResult Function(Collapse value) collapse, - required TResult Function(OpenPage value) openPage, - required TResult Function(CreateApp value) createApp, - required TResult Function(ReceiveApps value) didReceiveApps, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(_Initial value)? initial, - TResult Function(Collapse value)? collapse, - TResult Function(OpenPage value)? openPage, - TResult Function(CreateApp value)? createApp, - TResult Function(ReceiveApps value)? didReceiveApps, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(_Initial value)? initial, - TResult Function(Collapse value)? collapse, - TResult Function(OpenPage value)? openPage, - TResult Function(CreateApp value)? createApp, - TResult Function(ReceiveApps value)? didReceiveApps, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $MenuEventCopyWith<$Res> { - factory $MenuEventCopyWith(MenuEvent value, $Res Function(MenuEvent) then) = - _$MenuEventCopyWithImpl<$Res>; -} - -/// @nodoc -class _$MenuEventCopyWithImpl<$Res> implements $MenuEventCopyWith<$Res> { - _$MenuEventCopyWithImpl(this._value, this._then); - - final MenuEvent _value; - // ignore: unused_field - final $Res Function(MenuEvent) _then; -} - -/// @nodoc -abstract class _$InitialCopyWith<$Res> { - factory _$InitialCopyWith(_Initial value, $Res Function(_Initial) then) = - __$InitialCopyWithImpl<$Res>; -} - -/// @nodoc -class __$InitialCopyWithImpl<$Res> extends _$MenuEventCopyWithImpl<$Res> - implements _$InitialCopyWith<$Res> { - __$InitialCopyWithImpl(_Initial _value, $Res Function(_Initial) _then) - : super(_value, (v) => _then(v as _Initial)); - - @override - _Initial get _value => super._value as _Initial; -} - -/// @nodoc - -class _$_Initial implements _Initial { - const _$_Initial(); - - @override - String toString() { - return 'MenuEvent.initial()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || (other is _Initial); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function() collapse, - required TResult Function(HomeStackContext<dynamic, dynamic> context) - openPage, - required TResult Function(String name, String? desc) createApp, - required TResult Function(Either<List<App>, FlowyError> appsOrFail) - didReceiveApps, - }) { - return initial(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? collapse, - TResult Function(HomeStackContext<dynamic, dynamic> context)? openPage, - TResult Function(String name, String? desc)? createApp, - TResult Function(Either<List<App>, FlowyError> appsOrFail)? - didReceiveApps, - }) { - return initial?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? collapse, - TResult Function(HomeStackContext<dynamic, dynamic> context)? openPage, - TResult Function(String name, String? desc)? createApp, - TResult Function(Either<List<App>, FlowyError> appsOrFail)? - didReceiveApps, - required TResult orElse(), - }) { - if (initial != null) { - return initial(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(_Initial value) initial, - required TResult Function(Collapse value) collapse, - required TResult Function(OpenPage value) openPage, - required TResult Function(CreateApp value) createApp, - required TResult Function(ReceiveApps value) didReceiveApps, - }) { - return initial(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(_Initial value)? initial, - TResult Function(Collapse value)? collapse, - TResult Function(OpenPage value)? openPage, - TResult Function(CreateApp value)? createApp, - TResult Function(ReceiveApps value)? didReceiveApps, - }) { - return initial?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(_Initial value)? initial, - TResult Function(Collapse value)? collapse, - TResult Function(OpenPage value)? openPage, - TResult Function(CreateApp value)? createApp, - TResult Function(ReceiveApps value)? didReceiveApps, - required TResult orElse(), - }) { - if (initial != null) { - return initial(this); - } - return orElse(); - } -} - -abstract class _Initial implements MenuEvent { - const factory _Initial() = _$_Initial; -} - -/// @nodoc -abstract class $CollapseCopyWith<$Res> { - factory $CollapseCopyWith(Collapse value, $Res Function(Collapse) then) = - _$CollapseCopyWithImpl<$Res>; -} - -/// @nodoc -class _$CollapseCopyWithImpl<$Res> extends _$MenuEventCopyWithImpl<$Res> - implements $CollapseCopyWith<$Res> { - _$CollapseCopyWithImpl(Collapse _value, $Res Function(Collapse) _then) - : super(_value, (v) => _then(v as Collapse)); - - @override - Collapse get _value => super._value as Collapse; -} - -/// @nodoc - -class _$Collapse implements Collapse { - const _$Collapse(); - - @override - String toString() { - return 'MenuEvent.collapse()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || (other is Collapse); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function() collapse, - required TResult Function(HomeStackContext<dynamic, dynamic> context) - openPage, - required TResult Function(String name, String? desc) createApp, - required TResult Function(Either<List<App>, FlowyError> appsOrFail) - didReceiveApps, - }) { - return collapse(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? collapse, - TResult Function(HomeStackContext<dynamic, dynamic> context)? openPage, - TResult Function(String name, String? desc)? createApp, - TResult Function(Either<List<App>, FlowyError> appsOrFail)? - didReceiveApps, - }) { - return collapse?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? collapse, - TResult Function(HomeStackContext<dynamic, dynamic> context)? openPage, - TResult Function(String name, String? desc)? createApp, - TResult Function(Either<List<App>, FlowyError> appsOrFail)? - didReceiveApps, - required TResult orElse(), - }) { - if (collapse != null) { - return collapse(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(_Initial value) initial, - required TResult Function(Collapse value) collapse, - required TResult Function(OpenPage value) openPage, - required TResult Function(CreateApp value) createApp, - required TResult Function(ReceiveApps value) didReceiveApps, - }) { - return collapse(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(_Initial value)? initial, - TResult Function(Collapse value)? collapse, - TResult Function(OpenPage value)? openPage, - TResult Function(CreateApp value)? createApp, - TResult Function(ReceiveApps value)? didReceiveApps, - }) { - return collapse?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(_Initial value)? initial, - TResult Function(Collapse value)? collapse, - TResult Function(OpenPage value)? openPage, - TResult Function(CreateApp value)? createApp, - TResult Function(ReceiveApps value)? didReceiveApps, - required TResult orElse(), - }) { - if (collapse != null) { - return collapse(this); - } - return orElse(); - } -} - -abstract class Collapse implements MenuEvent { - const factory Collapse() = _$Collapse; -} - -/// @nodoc -abstract class $OpenPageCopyWith<$Res> { - factory $OpenPageCopyWith(OpenPage value, $Res Function(OpenPage) then) = - _$OpenPageCopyWithImpl<$Res>; - $Res call({HomeStackContext<dynamic, dynamic> context}); -} - -/// @nodoc -class _$OpenPageCopyWithImpl<$Res> extends _$MenuEventCopyWithImpl<$Res> - implements $OpenPageCopyWith<$Res> { - _$OpenPageCopyWithImpl(OpenPage _value, $Res Function(OpenPage) _then) - : super(_value, (v) => _then(v as OpenPage)); - - @override - OpenPage get _value => super._value as OpenPage; - - @override - $Res call({ - Object? context = freezed, - }) { - return _then(OpenPage( - context == freezed - ? _value.context - : context // ignore: cast_nullable_to_non_nullable - as HomeStackContext<dynamic, dynamic>, - )); - } -} - -/// @nodoc - -class _$OpenPage implements OpenPage { - const _$OpenPage(this.context); - - @override - final HomeStackContext<dynamic, dynamic> context; - - @override - String toString() { - return 'MenuEvent.openPage(context: $context)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is OpenPage && - (identical(other.context, context) || - const DeepCollectionEquality().equals(other.context, context))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ const DeepCollectionEquality().hash(context); - - @JsonKey(ignore: true) - @override - $OpenPageCopyWith<OpenPage> get copyWith => - _$OpenPageCopyWithImpl<OpenPage>(this, _$identity); - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function() collapse, - required TResult Function(HomeStackContext<dynamic, dynamic> context) - openPage, - required TResult Function(String name, String? desc) createApp, - required TResult Function(Either<List<App>, FlowyError> appsOrFail) - didReceiveApps, - }) { - return openPage(context); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? collapse, - TResult Function(HomeStackContext<dynamic, dynamic> context)? openPage, - TResult Function(String name, String? desc)? createApp, - TResult Function(Either<List<App>, FlowyError> appsOrFail)? - didReceiveApps, - }) { - return openPage?.call(context); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? collapse, - TResult Function(HomeStackContext<dynamic, dynamic> context)? openPage, - TResult Function(String name, String? desc)? createApp, - TResult Function(Either<List<App>, FlowyError> appsOrFail)? - didReceiveApps, - required TResult orElse(), - }) { - if (openPage != null) { - return openPage(context); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(_Initial value) initial, - required TResult Function(Collapse value) collapse, - required TResult Function(OpenPage value) openPage, - required TResult Function(CreateApp value) createApp, - required TResult Function(ReceiveApps value) didReceiveApps, - }) { - return openPage(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(_Initial value)? initial, - TResult Function(Collapse value)? collapse, - TResult Function(OpenPage value)? openPage, - TResult Function(CreateApp value)? createApp, - TResult Function(ReceiveApps value)? didReceiveApps, - }) { - return openPage?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(_Initial value)? initial, - TResult Function(Collapse value)? collapse, - TResult Function(OpenPage value)? openPage, - TResult Function(CreateApp value)? createApp, - TResult Function(ReceiveApps value)? didReceiveApps, - required TResult orElse(), - }) { - if (openPage != null) { - return openPage(this); - } - return orElse(); - } -} - -abstract class OpenPage implements MenuEvent { - const factory OpenPage(HomeStackContext<dynamic, dynamic> context) = - _$OpenPage; - - HomeStackContext<dynamic, dynamic> get context => - throw _privateConstructorUsedError; - @JsonKey(ignore: true) - $OpenPageCopyWith<OpenPage> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $CreateAppCopyWith<$Res> { - factory $CreateAppCopyWith(CreateApp value, $Res Function(CreateApp) then) = - _$CreateAppCopyWithImpl<$Res>; - $Res call({String name, String? desc}); -} - -/// @nodoc -class _$CreateAppCopyWithImpl<$Res> extends _$MenuEventCopyWithImpl<$Res> - implements $CreateAppCopyWith<$Res> { - _$CreateAppCopyWithImpl(CreateApp _value, $Res Function(CreateApp) _then) - : super(_value, (v) => _then(v as CreateApp)); - - @override - CreateApp get _value => super._value as CreateApp; - - @override - $Res call({ - Object? name = freezed, - Object? desc = freezed, - }) { - return _then(CreateApp( - name == freezed - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - desc: desc == freezed - ? _value.desc - : desc // ignore: cast_nullable_to_non_nullable - as String?, - )); - } -} - -/// @nodoc - -class _$CreateApp implements CreateApp { - const _$CreateApp(this.name, {this.desc}); - - @override - final String name; - @override - final String? desc; - - @override - String toString() { - return 'MenuEvent.createApp(name: $name, desc: $desc)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is CreateApp && - (identical(other.name, name) || - const DeepCollectionEquality().equals(other.name, name)) && - (identical(other.desc, desc) || - const DeepCollectionEquality().equals(other.desc, desc))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ - const DeepCollectionEquality().hash(name) ^ - const DeepCollectionEquality().hash(desc); - - @JsonKey(ignore: true) - @override - $CreateAppCopyWith<CreateApp> get copyWith => - _$CreateAppCopyWithImpl<CreateApp>(this, _$identity); - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function() collapse, - required TResult Function(HomeStackContext<dynamic, dynamic> context) - openPage, - required TResult Function(String name, String? desc) createApp, - required TResult Function(Either<List<App>, FlowyError> appsOrFail) - didReceiveApps, - }) { - return createApp(name, desc); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? collapse, - TResult Function(HomeStackContext<dynamic, dynamic> context)? openPage, - TResult Function(String name, String? desc)? createApp, - TResult Function(Either<List<App>, FlowyError> appsOrFail)? - didReceiveApps, - }) { - return createApp?.call(name, desc); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? collapse, - TResult Function(HomeStackContext<dynamic, dynamic> context)? openPage, - TResult Function(String name, String? desc)? createApp, - TResult Function(Either<List<App>, FlowyError> appsOrFail)? - didReceiveApps, - required TResult orElse(), - }) { - if (createApp != null) { - return createApp(name, desc); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(_Initial value) initial, - required TResult Function(Collapse value) collapse, - required TResult Function(OpenPage value) openPage, - required TResult Function(CreateApp value) createApp, - required TResult Function(ReceiveApps value) didReceiveApps, - }) { - return createApp(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(_Initial value)? initial, - TResult Function(Collapse value)? collapse, - TResult Function(OpenPage value)? openPage, - TResult Function(CreateApp value)? createApp, - TResult Function(ReceiveApps value)? didReceiveApps, - }) { - return createApp?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(_Initial value)? initial, - TResult Function(Collapse value)? collapse, - TResult Function(OpenPage value)? openPage, - TResult Function(CreateApp value)? createApp, - TResult Function(ReceiveApps value)? didReceiveApps, - required TResult orElse(), - }) { - if (createApp != null) { - return createApp(this); - } - return orElse(); - } -} - -abstract class CreateApp implements MenuEvent { - const factory CreateApp(String name, {String? desc}) = _$CreateApp; - - String get name => throw _privateConstructorUsedError; - String? get desc => throw _privateConstructorUsedError; - @JsonKey(ignore: true) - $CreateAppCopyWith<CreateApp> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $ReceiveAppsCopyWith<$Res> { - factory $ReceiveAppsCopyWith( - ReceiveApps value, $Res Function(ReceiveApps) then) = - _$ReceiveAppsCopyWithImpl<$Res>; - $Res call({Either<List<App>, FlowyError> appsOrFail}); -} - -/// @nodoc -class _$ReceiveAppsCopyWithImpl<$Res> extends _$MenuEventCopyWithImpl<$Res> - implements $ReceiveAppsCopyWith<$Res> { - _$ReceiveAppsCopyWithImpl( - ReceiveApps _value, $Res Function(ReceiveApps) _then) - : super(_value, (v) => _then(v as ReceiveApps)); - - @override - ReceiveApps get _value => super._value as ReceiveApps; - - @override - $Res call({ - Object? appsOrFail = freezed, - }) { - return _then(ReceiveApps( - appsOrFail == freezed - ? _value.appsOrFail - : appsOrFail // ignore: cast_nullable_to_non_nullable - as Either<List<App>, FlowyError>, - )); - } -} - -/// @nodoc - -class _$ReceiveApps implements ReceiveApps { - const _$ReceiveApps(this.appsOrFail); - - @override - final Either<List<App>, FlowyError> appsOrFail; - - @override - String toString() { - return 'MenuEvent.didReceiveApps(appsOrFail: $appsOrFail)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is ReceiveApps && - (identical(other.appsOrFail, appsOrFail) || - const DeepCollectionEquality() - .equals(other.appsOrFail, appsOrFail))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ const DeepCollectionEquality().hash(appsOrFail); - - @JsonKey(ignore: true) - @override - $ReceiveAppsCopyWith<ReceiveApps> get copyWith => - _$ReceiveAppsCopyWithImpl<ReceiveApps>(this, _$identity); - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function() collapse, - required TResult Function(HomeStackContext<dynamic, dynamic> context) - openPage, - required TResult Function(String name, String? desc) createApp, - required TResult Function(Either<List<App>, FlowyError> appsOrFail) - didReceiveApps, - }) { - return didReceiveApps(appsOrFail); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? collapse, - TResult Function(HomeStackContext<dynamic, dynamic> context)? openPage, - TResult Function(String name, String? desc)? createApp, - TResult Function(Either<List<App>, FlowyError> appsOrFail)? - didReceiveApps, - }) { - return didReceiveApps?.call(appsOrFail); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? collapse, - TResult Function(HomeStackContext<dynamic, dynamic> context)? openPage, - TResult Function(String name, String? desc)? createApp, - TResult Function(Either<List<App>, FlowyError> appsOrFail)? - didReceiveApps, - required TResult orElse(), - }) { - if (didReceiveApps != null) { - return didReceiveApps(appsOrFail); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(_Initial value) initial, - required TResult Function(Collapse value) collapse, - required TResult Function(OpenPage value) openPage, - required TResult Function(CreateApp value) createApp, - required TResult Function(ReceiveApps value) didReceiveApps, - }) { - return didReceiveApps(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(_Initial value)? initial, - TResult Function(Collapse value)? collapse, - TResult Function(OpenPage value)? openPage, - TResult Function(CreateApp value)? createApp, - TResult Function(ReceiveApps value)? didReceiveApps, - }) { - return didReceiveApps?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(_Initial value)? initial, - TResult Function(Collapse value)? collapse, - TResult Function(OpenPage value)? openPage, - TResult Function(CreateApp value)? createApp, - TResult Function(ReceiveApps value)? didReceiveApps, - required TResult orElse(), - }) { - if (didReceiveApps != null) { - return didReceiveApps(this); - } - return orElse(); - } -} - -abstract class ReceiveApps implements MenuEvent { - const factory ReceiveApps(Either<List<App>, FlowyError> appsOrFail) = - _$ReceiveApps; - - Either<List<App>, FlowyError> get appsOrFail => - throw _privateConstructorUsedError; - @JsonKey(ignore: true) - $ReceiveAppsCopyWith<ReceiveApps> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -class _$MenuStateTearOff { - const _$MenuStateTearOff(); - - _MenuState call( - {required bool isCollapse, - required Option<List<App>> apps, - required Either<Unit, FlowyError> successOrFailure, - required HomeStackContext<dynamic, dynamic> stackContext}) { - return _MenuState( - isCollapse: isCollapse, - apps: apps, - successOrFailure: successOrFailure, - stackContext: stackContext, - ); - } -} - -/// @nodoc -const $MenuState = _$MenuStateTearOff(); - -/// @nodoc -mixin _$MenuState { - bool get isCollapse => throw _privateConstructorUsedError; - Option<List<App>> get apps => throw _privateConstructorUsedError; - Either<Unit, FlowyError> get successOrFailure => - throw _privateConstructorUsedError; - HomeStackContext<dynamic, dynamic> get stackContext => - throw _privateConstructorUsedError; - - @JsonKey(ignore: true) - $MenuStateCopyWith<MenuState> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $MenuStateCopyWith<$Res> { - factory $MenuStateCopyWith(MenuState value, $Res Function(MenuState) then) = - _$MenuStateCopyWithImpl<$Res>; - $Res call( - {bool isCollapse, - Option<List<App>> apps, - Either<Unit, FlowyError> successOrFailure, - HomeStackContext<dynamic, dynamic> stackContext}); -} - -/// @nodoc -class _$MenuStateCopyWithImpl<$Res> implements $MenuStateCopyWith<$Res> { - _$MenuStateCopyWithImpl(this._value, this._then); - - final MenuState _value; - // ignore: unused_field - final $Res Function(MenuState) _then; - - @override - $Res call({ - Object? isCollapse = freezed, - Object? apps = freezed, - Object? successOrFailure = freezed, - Object? stackContext = freezed, - }) { - return _then(_value.copyWith( - isCollapse: isCollapse == freezed - ? _value.isCollapse - : isCollapse // ignore: cast_nullable_to_non_nullable - as bool, - apps: apps == freezed - ? _value.apps - : apps // ignore: cast_nullable_to_non_nullable - as Option<List<App>>, - successOrFailure: successOrFailure == freezed - ? _value.successOrFailure - : successOrFailure // ignore: cast_nullable_to_non_nullable - as Either<Unit, FlowyError>, - stackContext: stackContext == freezed - ? _value.stackContext - : stackContext // ignore: cast_nullable_to_non_nullable - as HomeStackContext<dynamic, dynamic>, - )); - } -} - -/// @nodoc -abstract class _$MenuStateCopyWith<$Res> implements $MenuStateCopyWith<$Res> { - factory _$MenuStateCopyWith( - _MenuState value, $Res Function(_MenuState) then) = - __$MenuStateCopyWithImpl<$Res>; - @override - $Res call( - {bool isCollapse, - Option<List<App>> apps, - Either<Unit, FlowyError> successOrFailure, - HomeStackContext<dynamic, dynamic> stackContext}); -} - -/// @nodoc -class __$MenuStateCopyWithImpl<$Res> extends _$MenuStateCopyWithImpl<$Res> - implements _$MenuStateCopyWith<$Res> { - __$MenuStateCopyWithImpl(_MenuState _value, $Res Function(_MenuState) _then) - : super(_value, (v) => _then(v as _MenuState)); - - @override - _MenuState get _value => super._value as _MenuState; - - @override - $Res call({ - Object? isCollapse = freezed, - Object? apps = freezed, - Object? successOrFailure = freezed, - Object? stackContext = freezed, - }) { - return _then(_MenuState( - isCollapse: isCollapse == freezed - ? _value.isCollapse - : isCollapse // ignore: cast_nullable_to_non_nullable - as bool, - apps: apps == freezed - ? _value.apps - : apps // ignore: cast_nullable_to_non_nullable - as Option<List<App>>, - successOrFailure: successOrFailure == freezed - ? _value.successOrFailure - : successOrFailure // ignore: cast_nullable_to_non_nullable - as Either<Unit, FlowyError>, - stackContext: stackContext == freezed - ? _value.stackContext - : stackContext // ignore: cast_nullable_to_non_nullable - as HomeStackContext<dynamic, dynamic>, - )); - } -} - -/// @nodoc - -class _$_MenuState implements _MenuState { - const _$_MenuState( - {required this.isCollapse, - required this.apps, - required this.successOrFailure, - required this.stackContext}); - - @override - final bool isCollapse; - @override - final Option<List<App>> apps; - @override - final Either<Unit, FlowyError> successOrFailure; - @override - final HomeStackContext<dynamic, dynamic> stackContext; - - @override - String toString() { - return 'MenuState(isCollapse: $isCollapse, apps: $apps, successOrFailure: $successOrFailure, stackContext: $stackContext)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is _MenuState && - (identical(other.isCollapse, isCollapse) || - const DeepCollectionEquality() - .equals(other.isCollapse, isCollapse)) && - (identical(other.apps, apps) || - const DeepCollectionEquality().equals(other.apps, apps)) && - (identical(other.successOrFailure, successOrFailure) || - const DeepCollectionEquality() - .equals(other.successOrFailure, successOrFailure)) && - (identical(other.stackContext, stackContext) || - const DeepCollectionEquality() - .equals(other.stackContext, stackContext))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ - const DeepCollectionEquality().hash(isCollapse) ^ - const DeepCollectionEquality().hash(apps) ^ - const DeepCollectionEquality().hash(successOrFailure) ^ - const DeepCollectionEquality().hash(stackContext); - - @JsonKey(ignore: true) - @override - _$MenuStateCopyWith<_MenuState> get copyWith => - __$MenuStateCopyWithImpl<_MenuState>(this, _$identity); -} - -abstract class _MenuState implements MenuState { - const factory _MenuState( - {required bool isCollapse, - required Option<List<App>> apps, - required Either<Unit, FlowyError> successOrFailure, - required HomeStackContext<dynamic, dynamic> stackContext}) = _$_MenuState; - - @override - bool get isCollapse => throw _privateConstructorUsedError; - @override - Option<List<App>> get apps => throw _privateConstructorUsedError; - @override - Either<Unit, FlowyError> get successOrFailure => - throw _privateConstructorUsedError; - @override - HomeStackContext<dynamic, dynamic> get stackContext => - throw _privateConstructorUsedError; - @override - @JsonKey(ignore: true) - _$MenuStateCopyWith<_MenuState> get copyWith => - throw _privateConstructorUsedError; -} diff --git a/frontend/app_flowy/lib/workspace/application/menu/menu_user_bloc.freezed.dart b/frontend/app_flowy/lib/workspace/application/menu/menu_user_bloc.freezed.dart deleted file mode 100644 index 6c1adb6e79..0000000000 --- a/frontend/app_flowy/lib/workspace/application/menu/menu_user_bloc.freezed.dart +++ /dev/null @@ -1,481 +0,0 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target - -part of 'menu_user_bloc.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity<T>(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); - -/// @nodoc -class _$MenuUserEventTearOff { - const _$MenuUserEventTearOff(); - - _Initial initial() { - return const _Initial(); - } - - _FetchWorkspaces fetchWorkspaces() { - return const _FetchWorkspaces(); - } -} - -/// @nodoc -const $MenuUserEvent = _$MenuUserEventTearOff(); - -/// @nodoc -mixin _$MenuUserEvent { - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function() fetchWorkspaces, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? fetchWorkspaces, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? fetchWorkspaces, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(_Initial value) initial, - required TResult Function(_FetchWorkspaces value) fetchWorkspaces, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(_Initial value)? initial, - TResult Function(_FetchWorkspaces value)? fetchWorkspaces, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(_Initial value)? initial, - TResult Function(_FetchWorkspaces value)? fetchWorkspaces, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $MenuUserEventCopyWith<$Res> { - factory $MenuUserEventCopyWith( - MenuUserEvent value, $Res Function(MenuUserEvent) then) = - _$MenuUserEventCopyWithImpl<$Res>; -} - -/// @nodoc -class _$MenuUserEventCopyWithImpl<$Res> - implements $MenuUserEventCopyWith<$Res> { - _$MenuUserEventCopyWithImpl(this._value, this._then); - - final MenuUserEvent _value; - // ignore: unused_field - final $Res Function(MenuUserEvent) _then; -} - -/// @nodoc -abstract class _$InitialCopyWith<$Res> { - factory _$InitialCopyWith(_Initial value, $Res Function(_Initial) then) = - __$InitialCopyWithImpl<$Res>; -} - -/// @nodoc -class __$InitialCopyWithImpl<$Res> extends _$MenuUserEventCopyWithImpl<$Res> - implements _$InitialCopyWith<$Res> { - __$InitialCopyWithImpl(_Initial _value, $Res Function(_Initial) _then) - : super(_value, (v) => _then(v as _Initial)); - - @override - _Initial get _value => super._value as _Initial; -} - -/// @nodoc - -class _$_Initial implements _Initial { - const _$_Initial(); - - @override - String toString() { - return 'MenuUserEvent.initial()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || (other is _Initial); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function() fetchWorkspaces, - }) { - return initial(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? fetchWorkspaces, - }) { - return initial?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? fetchWorkspaces, - required TResult orElse(), - }) { - if (initial != null) { - return initial(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(_Initial value) initial, - required TResult Function(_FetchWorkspaces value) fetchWorkspaces, - }) { - return initial(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(_Initial value)? initial, - TResult Function(_FetchWorkspaces value)? fetchWorkspaces, - }) { - return initial?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(_Initial value)? initial, - TResult Function(_FetchWorkspaces value)? fetchWorkspaces, - required TResult orElse(), - }) { - if (initial != null) { - return initial(this); - } - return orElse(); - } -} - -abstract class _Initial implements MenuUserEvent { - const factory _Initial() = _$_Initial; -} - -/// @nodoc -abstract class _$FetchWorkspacesCopyWith<$Res> { - factory _$FetchWorkspacesCopyWith( - _FetchWorkspaces value, $Res Function(_FetchWorkspaces) then) = - __$FetchWorkspacesCopyWithImpl<$Res>; -} - -/// @nodoc -class __$FetchWorkspacesCopyWithImpl<$Res> - extends _$MenuUserEventCopyWithImpl<$Res> - implements _$FetchWorkspacesCopyWith<$Res> { - __$FetchWorkspacesCopyWithImpl( - _FetchWorkspaces _value, $Res Function(_FetchWorkspaces) _then) - : super(_value, (v) => _then(v as _FetchWorkspaces)); - - @override - _FetchWorkspaces get _value => super._value as _FetchWorkspaces; -} - -/// @nodoc - -class _$_FetchWorkspaces implements _FetchWorkspaces { - const _$_FetchWorkspaces(); - - @override - String toString() { - return 'MenuUserEvent.fetchWorkspaces()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || (other is _FetchWorkspaces); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function() fetchWorkspaces, - }) { - return fetchWorkspaces(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? fetchWorkspaces, - }) { - return fetchWorkspaces?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function()? fetchWorkspaces, - required TResult orElse(), - }) { - if (fetchWorkspaces != null) { - return fetchWorkspaces(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(_Initial value) initial, - required TResult Function(_FetchWorkspaces value) fetchWorkspaces, - }) { - return fetchWorkspaces(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(_Initial value)? initial, - TResult Function(_FetchWorkspaces value)? fetchWorkspaces, - }) { - return fetchWorkspaces?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(_Initial value)? initial, - TResult Function(_FetchWorkspaces value)? fetchWorkspaces, - required TResult orElse(), - }) { - if (fetchWorkspaces != null) { - return fetchWorkspaces(this); - } - return orElse(); - } -} - -abstract class _FetchWorkspaces implements MenuUserEvent { - const factory _FetchWorkspaces() = _$_FetchWorkspaces; -} - -/// @nodoc -class _$MenuUserStateTearOff { - const _$MenuUserStateTearOff(); - - _MenuUserState call( - {required UserProfile user, - required Option<List<Workspace>> workspaces, - required Either<Unit, String> successOrFailure}) { - return _MenuUserState( - user: user, - workspaces: workspaces, - successOrFailure: successOrFailure, - ); - } -} - -/// @nodoc -const $MenuUserState = _$MenuUserStateTearOff(); - -/// @nodoc -mixin _$MenuUserState { - UserProfile get user => throw _privateConstructorUsedError; - Option<List<Workspace>> get workspaces => throw _privateConstructorUsedError; - Either<Unit, String> get successOrFailure => - throw _privateConstructorUsedError; - - @JsonKey(ignore: true) - $MenuUserStateCopyWith<MenuUserState> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $MenuUserStateCopyWith<$Res> { - factory $MenuUserStateCopyWith( - MenuUserState value, $Res Function(MenuUserState) then) = - _$MenuUserStateCopyWithImpl<$Res>; - $Res call( - {UserProfile user, - Option<List<Workspace>> workspaces, - Either<Unit, String> successOrFailure}); -} - -/// @nodoc -class _$MenuUserStateCopyWithImpl<$Res> - implements $MenuUserStateCopyWith<$Res> { - _$MenuUserStateCopyWithImpl(this._value, this._then); - - final MenuUserState _value; - // ignore: unused_field - final $Res Function(MenuUserState) _then; - - @override - $Res call({ - Object? user = freezed, - Object? workspaces = freezed, - Object? successOrFailure = freezed, - }) { - return _then(_value.copyWith( - user: user == freezed - ? _value.user - : user // ignore: cast_nullable_to_non_nullable - as UserProfile, - workspaces: workspaces == freezed - ? _value.workspaces - : workspaces // ignore: cast_nullable_to_non_nullable - as Option<List<Workspace>>, - successOrFailure: successOrFailure == freezed - ? _value.successOrFailure - : successOrFailure // ignore: cast_nullable_to_non_nullable - as Either<Unit, String>, - )); - } -} - -/// @nodoc -abstract class _$MenuUserStateCopyWith<$Res> - implements $MenuUserStateCopyWith<$Res> { - factory _$MenuUserStateCopyWith( - _MenuUserState value, $Res Function(_MenuUserState) then) = - __$MenuUserStateCopyWithImpl<$Res>; - @override - $Res call( - {UserProfile user, - Option<List<Workspace>> workspaces, - Either<Unit, String> successOrFailure}); -} - -/// @nodoc -class __$MenuUserStateCopyWithImpl<$Res> - extends _$MenuUserStateCopyWithImpl<$Res> - implements _$MenuUserStateCopyWith<$Res> { - __$MenuUserStateCopyWithImpl( - _MenuUserState _value, $Res Function(_MenuUserState) _then) - : super(_value, (v) => _then(v as _MenuUserState)); - - @override - _MenuUserState get _value => super._value as _MenuUserState; - - @override - $Res call({ - Object? user = freezed, - Object? workspaces = freezed, - Object? successOrFailure = freezed, - }) { - return _then(_MenuUserState( - user: user == freezed - ? _value.user - : user // ignore: cast_nullable_to_non_nullable - as UserProfile, - workspaces: workspaces == freezed - ? _value.workspaces - : workspaces // ignore: cast_nullable_to_non_nullable - as Option<List<Workspace>>, - successOrFailure: successOrFailure == freezed - ? _value.successOrFailure - : successOrFailure // ignore: cast_nullable_to_non_nullable - as Either<Unit, String>, - )); - } -} - -/// @nodoc - -class _$_MenuUserState implements _MenuUserState { - const _$_MenuUserState( - {required this.user, - required this.workspaces, - required this.successOrFailure}); - - @override - final UserProfile user; - @override - final Option<List<Workspace>> workspaces; - @override - final Either<Unit, String> successOrFailure; - - @override - String toString() { - return 'MenuUserState(user: $user, workspaces: $workspaces, successOrFailure: $successOrFailure)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is _MenuUserState && - (identical(other.user, user) || - const DeepCollectionEquality().equals(other.user, user)) && - (identical(other.workspaces, workspaces) || - const DeepCollectionEquality() - .equals(other.workspaces, workspaces)) && - (identical(other.successOrFailure, successOrFailure) || - const DeepCollectionEquality() - .equals(other.successOrFailure, successOrFailure))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ - const DeepCollectionEquality().hash(user) ^ - const DeepCollectionEquality().hash(workspaces) ^ - const DeepCollectionEquality().hash(successOrFailure); - - @JsonKey(ignore: true) - @override - _$MenuUserStateCopyWith<_MenuUserState> get copyWith => - __$MenuUserStateCopyWithImpl<_MenuUserState>(this, _$identity); -} - -abstract class _MenuUserState implements MenuUserState { - const factory _MenuUserState( - {required UserProfile user, - required Option<List<Workspace>> workspaces, - required Either<Unit, String> successOrFailure}) = _$_MenuUserState; - - @override - UserProfile get user => throw _privateConstructorUsedError; - @override - Option<List<Workspace>> get workspaces => throw _privateConstructorUsedError; - @override - Either<Unit, String> get successOrFailure => - throw _privateConstructorUsedError; - @override - @JsonKey(ignore: true) - _$MenuUserStateCopyWith<_MenuUserState> get copyWith => - throw _privateConstructorUsedError; -} diff --git a/frontend/app_flowy/lib/workspace/application/trash/trash_bloc.freezed.dart b/frontend/app_flowy/lib/workspace/application/trash/trash_bloc.freezed.dart deleted file mode 100644 index 5fc468749e..0000000000 --- a/frontend/app_flowy/lib/workspace/application/trash/trash_bloc.freezed.dart +++ /dev/null @@ -1,1131 +0,0 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target - -part of 'trash_bloc.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity<T>(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); - -/// @nodoc -class _$TrashEventTearOff { - const _$TrashEventTearOff(); - - Initial initial() { - return const Initial(); - } - - ReceiveTrash didReceiveTrash(List<Trash> trash) { - return ReceiveTrash( - trash, - ); - } - - Putback putback(String trashId) { - return Putback( - trashId, - ); - } - - Delete delete(Trash trash) { - return Delete( - trash, - ); - } - - RestoreAll restoreAll() { - return const RestoreAll(); - } - - DeleteAll deleteAll() { - return const DeleteAll(); - } -} - -/// @nodoc -const $TrashEvent = _$TrashEventTearOff(); - -/// @nodoc -mixin _$TrashEvent { - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function(List<Trash> trash) didReceiveTrash, - required TResult Function(String trashId) putback, - required TResult Function(Trash trash) delete, - required TResult Function() restoreAll, - required TResult Function() deleteAll, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(List<Trash> trash)? didReceiveTrash, - TResult Function(String trashId)? putback, - TResult Function(Trash trash)? delete, - TResult Function()? restoreAll, - TResult Function()? deleteAll, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(List<Trash> trash)? didReceiveTrash, - TResult Function(String trashId)? putback, - TResult Function(Trash trash)? delete, - TResult Function()? restoreAll, - TResult Function()? deleteAll, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Initial value) initial, - required TResult Function(ReceiveTrash value) didReceiveTrash, - required TResult Function(Putback value) putback, - required TResult Function(Delete value) delete, - required TResult Function(RestoreAll value) restoreAll, - required TResult Function(DeleteAll value) deleteAll, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(ReceiveTrash value)? didReceiveTrash, - TResult Function(Putback value)? putback, - TResult Function(Delete value)? delete, - TResult Function(RestoreAll value)? restoreAll, - TResult Function(DeleteAll value)? deleteAll, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(ReceiveTrash value)? didReceiveTrash, - TResult Function(Putback value)? putback, - TResult Function(Delete value)? delete, - TResult Function(RestoreAll value)? restoreAll, - TResult Function(DeleteAll value)? deleteAll, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $TrashEventCopyWith<$Res> { - factory $TrashEventCopyWith( - TrashEvent value, $Res Function(TrashEvent) then) = - _$TrashEventCopyWithImpl<$Res>; -} - -/// @nodoc -class _$TrashEventCopyWithImpl<$Res> implements $TrashEventCopyWith<$Res> { - _$TrashEventCopyWithImpl(this._value, this._then); - - final TrashEvent _value; - // ignore: unused_field - final $Res Function(TrashEvent) _then; -} - -/// @nodoc -abstract class $InitialCopyWith<$Res> { - factory $InitialCopyWith(Initial value, $Res Function(Initial) then) = - _$InitialCopyWithImpl<$Res>; -} - -/// @nodoc -class _$InitialCopyWithImpl<$Res> extends _$TrashEventCopyWithImpl<$Res> - implements $InitialCopyWith<$Res> { - _$InitialCopyWithImpl(Initial _value, $Res Function(Initial) _then) - : super(_value, (v) => _then(v as Initial)); - - @override - Initial get _value => super._value as Initial; -} - -/// @nodoc - -class _$Initial implements Initial { - const _$Initial(); - - @override - String toString() { - return 'TrashEvent.initial()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || (other is Initial); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function(List<Trash> trash) didReceiveTrash, - required TResult Function(String trashId) putback, - required TResult Function(Trash trash) delete, - required TResult Function() restoreAll, - required TResult Function() deleteAll, - }) { - return initial(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(List<Trash> trash)? didReceiveTrash, - TResult Function(String trashId)? putback, - TResult Function(Trash trash)? delete, - TResult Function()? restoreAll, - TResult Function()? deleteAll, - }) { - return initial?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(List<Trash> trash)? didReceiveTrash, - TResult Function(String trashId)? putback, - TResult Function(Trash trash)? delete, - TResult Function()? restoreAll, - TResult Function()? deleteAll, - required TResult orElse(), - }) { - if (initial != null) { - return initial(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Initial value) initial, - required TResult Function(ReceiveTrash value) didReceiveTrash, - required TResult Function(Putback value) putback, - required TResult Function(Delete value) delete, - required TResult Function(RestoreAll value) restoreAll, - required TResult Function(DeleteAll value) deleteAll, - }) { - return initial(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(ReceiveTrash value)? didReceiveTrash, - TResult Function(Putback value)? putback, - TResult Function(Delete value)? delete, - TResult Function(RestoreAll value)? restoreAll, - TResult Function(DeleteAll value)? deleteAll, - }) { - return initial?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(ReceiveTrash value)? didReceiveTrash, - TResult Function(Putback value)? putback, - TResult Function(Delete value)? delete, - TResult Function(RestoreAll value)? restoreAll, - TResult Function(DeleteAll value)? deleteAll, - required TResult orElse(), - }) { - if (initial != null) { - return initial(this); - } - return orElse(); - } -} - -abstract class Initial implements TrashEvent { - const factory Initial() = _$Initial; -} - -/// @nodoc -abstract class $ReceiveTrashCopyWith<$Res> { - factory $ReceiveTrashCopyWith( - ReceiveTrash value, $Res Function(ReceiveTrash) then) = - _$ReceiveTrashCopyWithImpl<$Res>; - $Res call({List<Trash> trash}); -} - -/// @nodoc -class _$ReceiveTrashCopyWithImpl<$Res> extends _$TrashEventCopyWithImpl<$Res> - implements $ReceiveTrashCopyWith<$Res> { - _$ReceiveTrashCopyWithImpl( - ReceiveTrash _value, $Res Function(ReceiveTrash) _then) - : super(_value, (v) => _then(v as ReceiveTrash)); - - @override - ReceiveTrash get _value => super._value as ReceiveTrash; - - @override - $Res call({ - Object? trash = freezed, - }) { - return _then(ReceiveTrash( - trash == freezed - ? _value.trash - : trash // ignore: cast_nullable_to_non_nullable - as List<Trash>, - )); - } -} - -/// @nodoc - -class _$ReceiveTrash implements ReceiveTrash { - const _$ReceiveTrash(this.trash); - - @override - final List<Trash> trash; - - @override - String toString() { - return 'TrashEvent.didReceiveTrash(trash: $trash)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is ReceiveTrash && - (identical(other.trash, trash) || - const DeepCollectionEquality().equals(other.trash, trash))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ const DeepCollectionEquality().hash(trash); - - @JsonKey(ignore: true) - @override - $ReceiveTrashCopyWith<ReceiveTrash> get copyWith => - _$ReceiveTrashCopyWithImpl<ReceiveTrash>(this, _$identity); - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function(List<Trash> trash) didReceiveTrash, - required TResult Function(String trashId) putback, - required TResult Function(Trash trash) delete, - required TResult Function() restoreAll, - required TResult Function() deleteAll, - }) { - return didReceiveTrash(trash); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(List<Trash> trash)? didReceiveTrash, - TResult Function(String trashId)? putback, - TResult Function(Trash trash)? delete, - TResult Function()? restoreAll, - TResult Function()? deleteAll, - }) { - return didReceiveTrash?.call(trash); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(List<Trash> trash)? didReceiveTrash, - TResult Function(String trashId)? putback, - TResult Function(Trash trash)? delete, - TResult Function()? restoreAll, - TResult Function()? deleteAll, - required TResult orElse(), - }) { - if (didReceiveTrash != null) { - return didReceiveTrash(trash); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Initial value) initial, - required TResult Function(ReceiveTrash value) didReceiveTrash, - required TResult Function(Putback value) putback, - required TResult Function(Delete value) delete, - required TResult Function(RestoreAll value) restoreAll, - required TResult Function(DeleteAll value) deleteAll, - }) { - return didReceiveTrash(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(ReceiveTrash value)? didReceiveTrash, - TResult Function(Putback value)? putback, - TResult Function(Delete value)? delete, - TResult Function(RestoreAll value)? restoreAll, - TResult Function(DeleteAll value)? deleteAll, - }) { - return didReceiveTrash?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(ReceiveTrash value)? didReceiveTrash, - TResult Function(Putback value)? putback, - TResult Function(Delete value)? delete, - TResult Function(RestoreAll value)? restoreAll, - TResult Function(DeleteAll value)? deleteAll, - required TResult orElse(), - }) { - if (didReceiveTrash != null) { - return didReceiveTrash(this); - } - return orElse(); - } -} - -abstract class ReceiveTrash implements TrashEvent { - const factory ReceiveTrash(List<Trash> trash) = _$ReceiveTrash; - - List<Trash> get trash => throw _privateConstructorUsedError; - @JsonKey(ignore: true) - $ReceiveTrashCopyWith<ReceiveTrash> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $PutbackCopyWith<$Res> { - factory $PutbackCopyWith(Putback value, $Res Function(Putback) then) = - _$PutbackCopyWithImpl<$Res>; - $Res call({String trashId}); -} - -/// @nodoc -class _$PutbackCopyWithImpl<$Res> extends _$TrashEventCopyWithImpl<$Res> - implements $PutbackCopyWith<$Res> { - _$PutbackCopyWithImpl(Putback _value, $Res Function(Putback) _then) - : super(_value, (v) => _then(v as Putback)); - - @override - Putback get _value => super._value as Putback; - - @override - $Res call({ - Object? trashId = freezed, - }) { - return _then(Putback( - trashId == freezed - ? _value.trashId - : trashId // ignore: cast_nullable_to_non_nullable - as String, - )); - } -} - -/// @nodoc - -class _$Putback implements Putback { - const _$Putback(this.trashId); - - @override - final String trashId; - - @override - String toString() { - return 'TrashEvent.putback(trashId: $trashId)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is Putback && - (identical(other.trashId, trashId) || - const DeepCollectionEquality().equals(other.trashId, trashId))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ const DeepCollectionEquality().hash(trashId); - - @JsonKey(ignore: true) - @override - $PutbackCopyWith<Putback> get copyWith => - _$PutbackCopyWithImpl<Putback>(this, _$identity); - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function(List<Trash> trash) didReceiveTrash, - required TResult Function(String trashId) putback, - required TResult Function(Trash trash) delete, - required TResult Function() restoreAll, - required TResult Function() deleteAll, - }) { - return putback(trashId); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(List<Trash> trash)? didReceiveTrash, - TResult Function(String trashId)? putback, - TResult Function(Trash trash)? delete, - TResult Function()? restoreAll, - TResult Function()? deleteAll, - }) { - return putback?.call(trashId); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(List<Trash> trash)? didReceiveTrash, - TResult Function(String trashId)? putback, - TResult Function(Trash trash)? delete, - TResult Function()? restoreAll, - TResult Function()? deleteAll, - required TResult orElse(), - }) { - if (putback != null) { - return putback(trashId); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Initial value) initial, - required TResult Function(ReceiveTrash value) didReceiveTrash, - required TResult Function(Putback value) putback, - required TResult Function(Delete value) delete, - required TResult Function(RestoreAll value) restoreAll, - required TResult Function(DeleteAll value) deleteAll, - }) { - return putback(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(ReceiveTrash value)? didReceiveTrash, - TResult Function(Putback value)? putback, - TResult Function(Delete value)? delete, - TResult Function(RestoreAll value)? restoreAll, - TResult Function(DeleteAll value)? deleteAll, - }) { - return putback?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(ReceiveTrash value)? didReceiveTrash, - TResult Function(Putback value)? putback, - TResult Function(Delete value)? delete, - TResult Function(RestoreAll value)? restoreAll, - TResult Function(DeleteAll value)? deleteAll, - required TResult orElse(), - }) { - if (putback != null) { - return putback(this); - } - return orElse(); - } -} - -abstract class Putback implements TrashEvent { - const factory Putback(String trashId) = _$Putback; - - String get trashId => throw _privateConstructorUsedError; - @JsonKey(ignore: true) - $PutbackCopyWith<Putback> get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $DeleteCopyWith<$Res> { - factory $DeleteCopyWith(Delete value, $Res Function(Delete) then) = - _$DeleteCopyWithImpl<$Res>; - $Res call({Trash trash}); -} - -/// @nodoc -class _$DeleteCopyWithImpl<$Res> extends _$TrashEventCopyWithImpl<$Res> - implements $DeleteCopyWith<$Res> { - _$DeleteCopyWithImpl(Delete _value, $Res Function(Delete) _then) - : super(_value, (v) => _then(v as Delete)); - - @override - Delete get _value => super._value as Delete; - - @override - $Res call({ - Object? trash = freezed, - }) { - return _then(Delete( - trash == freezed - ? _value.trash - : trash // ignore: cast_nullable_to_non_nullable - as Trash, - )); - } -} - -/// @nodoc - -class _$Delete implements Delete { - const _$Delete(this.trash); - - @override - final Trash trash; - - @override - String toString() { - return 'TrashEvent.delete(trash: $trash)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is Delete && - (identical(other.trash, trash) || - const DeepCollectionEquality().equals(other.trash, trash))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ const DeepCollectionEquality().hash(trash); - - @JsonKey(ignore: true) - @override - $DeleteCopyWith<Delete> get copyWith => - _$DeleteCopyWithImpl<Delete>(this, _$identity); - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function(List<Trash> trash) didReceiveTrash, - required TResult Function(String trashId) putback, - required TResult Function(Trash trash) delete, - required TResult Function() restoreAll, - required TResult Function() deleteAll, - }) { - return delete(trash); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(List<Trash> trash)? didReceiveTrash, - TResult Function(String trashId)? putback, - TResult Function(Trash trash)? delete, - TResult Function()? restoreAll, - TResult Function()? deleteAll, - }) { - return delete?.call(trash); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(List<Trash> trash)? didReceiveTrash, - TResult Function(String trashId)? putback, - TResult Function(Trash trash)? delete, - TResult Function()? restoreAll, - TResult Function()? deleteAll, - required TResult orElse(), - }) { - if (delete != null) { - return delete(trash); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Initial value) initial, - required TResult Function(ReceiveTrash value) didReceiveTrash, - required TResult Function(Putback value) putback, - required TResult Function(Delete value) delete, - required TResult Function(RestoreAll value) restoreAll, - required TResult Function(DeleteAll value) deleteAll, - }) { - return delete(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(ReceiveTrash value)? didReceiveTrash, - TResult Function(Putback value)? putback, - TResult Function(Delete value)? delete, - TResult Function(RestoreAll value)? restoreAll, - TResult Function(DeleteAll value)? deleteAll, - }) { - return delete?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(ReceiveTrash value)? didReceiveTrash, - TResult Function(Putback value)? putback, - TResult Function(Delete value)? delete, - TResult Function(RestoreAll value)? restoreAll, - TResult Function(DeleteAll value)? deleteAll, - required TResult orElse(), - }) { - if (delete != null) { - return delete(this); - } - return orElse(); - } -} - -abstract class Delete implements TrashEvent { - const factory Delete(Trash trash) = _$Delete; - - Trash get trash => throw _privateConstructorUsedError; - @JsonKey(ignore: true) - $DeleteCopyWith<Delete> get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $RestoreAllCopyWith<$Res> { - factory $RestoreAllCopyWith( - RestoreAll value, $Res Function(RestoreAll) then) = - _$RestoreAllCopyWithImpl<$Res>; -} - -/// @nodoc -class _$RestoreAllCopyWithImpl<$Res> extends _$TrashEventCopyWithImpl<$Res> - implements $RestoreAllCopyWith<$Res> { - _$RestoreAllCopyWithImpl(RestoreAll _value, $Res Function(RestoreAll) _then) - : super(_value, (v) => _then(v as RestoreAll)); - - @override - RestoreAll get _value => super._value as RestoreAll; -} - -/// @nodoc - -class _$RestoreAll implements RestoreAll { - const _$RestoreAll(); - - @override - String toString() { - return 'TrashEvent.restoreAll()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || (other is RestoreAll); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function(List<Trash> trash) didReceiveTrash, - required TResult Function(String trashId) putback, - required TResult Function(Trash trash) delete, - required TResult Function() restoreAll, - required TResult Function() deleteAll, - }) { - return restoreAll(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(List<Trash> trash)? didReceiveTrash, - TResult Function(String trashId)? putback, - TResult Function(Trash trash)? delete, - TResult Function()? restoreAll, - TResult Function()? deleteAll, - }) { - return restoreAll?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(List<Trash> trash)? didReceiveTrash, - TResult Function(String trashId)? putback, - TResult Function(Trash trash)? delete, - TResult Function()? restoreAll, - TResult Function()? deleteAll, - required TResult orElse(), - }) { - if (restoreAll != null) { - return restoreAll(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Initial value) initial, - required TResult Function(ReceiveTrash value) didReceiveTrash, - required TResult Function(Putback value) putback, - required TResult Function(Delete value) delete, - required TResult Function(RestoreAll value) restoreAll, - required TResult Function(DeleteAll value) deleteAll, - }) { - return restoreAll(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(ReceiveTrash value)? didReceiveTrash, - TResult Function(Putback value)? putback, - TResult Function(Delete value)? delete, - TResult Function(RestoreAll value)? restoreAll, - TResult Function(DeleteAll value)? deleteAll, - }) { - return restoreAll?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(ReceiveTrash value)? didReceiveTrash, - TResult Function(Putback value)? putback, - TResult Function(Delete value)? delete, - TResult Function(RestoreAll value)? restoreAll, - TResult Function(DeleteAll value)? deleteAll, - required TResult orElse(), - }) { - if (restoreAll != null) { - return restoreAll(this); - } - return orElse(); - } -} - -abstract class RestoreAll implements TrashEvent { - const factory RestoreAll() = _$RestoreAll; -} - -/// @nodoc -abstract class $DeleteAllCopyWith<$Res> { - factory $DeleteAllCopyWith(DeleteAll value, $Res Function(DeleteAll) then) = - _$DeleteAllCopyWithImpl<$Res>; -} - -/// @nodoc -class _$DeleteAllCopyWithImpl<$Res> extends _$TrashEventCopyWithImpl<$Res> - implements $DeleteAllCopyWith<$Res> { - _$DeleteAllCopyWithImpl(DeleteAll _value, $Res Function(DeleteAll) _then) - : super(_value, (v) => _then(v as DeleteAll)); - - @override - DeleteAll get _value => super._value as DeleteAll; -} - -/// @nodoc - -class _$DeleteAll implements DeleteAll { - const _$DeleteAll(); - - @override - String toString() { - return 'TrashEvent.deleteAll()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || (other is DeleteAll); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function(List<Trash> trash) didReceiveTrash, - required TResult Function(String trashId) putback, - required TResult Function(Trash trash) delete, - required TResult Function() restoreAll, - required TResult Function() deleteAll, - }) { - return deleteAll(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(List<Trash> trash)? didReceiveTrash, - TResult Function(String trashId)? putback, - TResult Function(Trash trash)? delete, - TResult Function()? restoreAll, - TResult Function()? deleteAll, - }) { - return deleteAll?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(List<Trash> trash)? didReceiveTrash, - TResult Function(String trashId)? putback, - TResult Function(Trash trash)? delete, - TResult Function()? restoreAll, - TResult Function()? deleteAll, - required TResult orElse(), - }) { - if (deleteAll != null) { - return deleteAll(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Initial value) initial, - required TResult Function(ReceiveTrash value) didReceiveTrash, - required TResult Function(Putback value) putback, - required TResult Function(Delete value) delete, - required TResult Function(RestoreAll value) restoreAll, - required TResult Function(DeleteAll value) deleteAll, - }) { - return deleteAll(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(ReceiveTrash value)? didReceiveTrash, - TResult Function(Putback value)? putback, - TResult Function(Delete value)? delete, - TResult Function(RestoreAll value)? restoreAll, - TResult Function(DeleteAll value)? deleteAll, - }) { - return deleteAll?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(ReceiveTrash value)? didReceiveTrash, - TResult Function(Putback value)? putback, - TResult Function(Delete value)? delete, - TResult Function(RestoreAll value)? restoreAll, - TResult Function(DeleteAll value)? deleteAll, - required TResult orElse(), - }) { - if (deleteAll != null) { - return deleteAll(this); - } - return orElse(); - } -} - -abstract class DeleteAll implements TrashEvent { - const factory DeleteAll() = _$DeleteAll; -} - -/// @nodoc -class _$TrashStateTearOff { - const _$TrashStateTearOff(); - - _TrashState call( - {required List<Trash> objects, - required Either<Unit, FlowyError> successOrFailure}) { - return _TrashState( - objects: objects, - successOrFailure: successOrFailure, - ); - } -} - -/// @nodoc -const $TrashState = _$TrashStateTearOff(); - -/// @nodoc -mixin _$TrashState { - List<Trash> get objects => throw _privateConstructorUsedError; - Either<Unit, FlowyError> get successOrFailure => - throw _privateConstructorUsedError; - - @JsonKey(ignore: true) - $TrashStateCopyWith<TrashState> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $TrashStateCopyWith<$Res> { - factory $TrashStateCopyWith( - TrashState value, $Res Function(TrashState) then) = - _$TrashStateCopyWithImpl<$Res>; - $Res call( - {List<Trash> objects, Either<Unit, FlowyError> successOrFailure}); -} - -/// @nodoc -class _$TrashStateCopyWithImpl<$Res> implements $TrashStateCopyWith<$Res> { - _$TrashStateCopyWithImpl(this._value, this._then); - - final TrashState _value; - // ignore: unused_field - final $Res Function(TrashState) _then; - - @override - $Res call({ - Object? objects = freezed, - Object? successOrFailure = freezed, - }) { - return _then(_value.copyWith( - objects: objects == freezed - ? _value.objects - : objects // ignore: cast_nullable_to_non_nullable - as List<Trash>, - successOrFailure: successOrFailure == freezed - ? _value.successOrFailure - : successOrFailure // ignore: cast_nullable_to_non_nullable - as Either<Unit, FlowyError>, - )); - } -} - -/// @nodoc -abstract class _$TrashStateCopyWith<$Res> implements $TrashStateCopyWith<$Res> { - factory _$TrashStateCopyWith( - _TrashState value, $Res Function(_TrashState) then) = - __$TrashStateCopyWithImpl<$Res>; - @override - $Res call( - {List<Trash> objects, Either<Unit, FlowyError> successOrFailure}); -} - -/// @nodoc -class __$TrashStateCopyWithImpl<$Res> extends _$TrashStateCopyWithImpl<$Res> - implements _$TrashStateCopyWith<$Res> { - __$TrashStateCopyWithImpl( - _TrashState _value, $Res Function(_TrashState) _then) - : super(_value, (v) => _then(v as _TrashState)); - - @override - _TrashState get _value => super._value as _TrashState; - - @override - $Res call({ - Object? objects = freezed, - Object? successOrFailure = freezed, - }) { - return _then(_TrashState( - objects: objects == freezed - ? _value.objects - : objects // ignore: cast_nullable_to_non_nullable - as List<Trash>, - successOrFailure: successOrFailure == freezed - ? _value.successOrFailure - : successOrFailure // ignore: cast_nullable_to_non_nullable - as Either<Unit, FlowyError>, - )); - } -} - -/// @nodoc - -class _$_TrashState implements _TrashState { - const _$_TrashState({required this.objects, required this.successOrFailure}); - - @override - final List<Trash> objects; - @override - final Either<Unit, FlowyError> successOrFailure; - - @override - String toString() { - return 'TrashState(objects: $objects, successOrFailure: $successOrFailure)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is _TrashState && - (identical(other.objects, objects) || - const DeepCollectionEquality() - .equals(other.objects, objects)) && - (identical(other.successOrFailure, successOrFailure) || - const DeepCollectionEquality() - .equals(other.successOrFailure, successOrFailure))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ - const DeepCollectionEquality().hash(objects) ^ - const DeepCollectionEquality().hash(successOrFailure); - - @JsonKey(ignore: true) - @override - _$TrashStateCopyWith<_TrashState> get copyWith => - __$TrashStateCopyWithImpl<_TrashState>(this, _$identity); -} - -abstract class _TrashState implements TrashState { - const factory _TrashState( - {required List<Trash> objects, - required Either<Unit, FlowyError> successOrFailure}) = _$_TrashState; - - @override - List<Trash> get objects => throw _privateConstructorUsedError; - @override - Either<Unit, FlowyError> get successOrFailure => - throw _privateConstructorUsedError; - @override - @JsonKey(ignore: true) - _$TrashStateCopyWith<_TrashState> get copyWith => - throw _privateConstructorUsedError; -} diff --git a/frontend/app_flowy/lib/workspace/application/view/view_bloc.freezed.dart b/frontend/app_flowy/lib/workspace/application/view/view_bloc.freezed.dart deleted file mode 100644 index 4f1fe4b838..0000000000 --- a/frontend/app_flowy/lib/workspace/application/view/view_bloc.freezed.dart +++ /dev/null @@ -1,1166 +0,0 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target - -part of 'view_bloc.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity<T>(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); - -/// @nodoc -class _$ViewEventTearOff { - const _$ViewEventTearOff(); - - Initial initial() { - return const Initial(); - } - - SetEditing setIsEditing(bool isEditing) { - return SetEditing( - isEditing, - ); - } - - Rename rename(String newName) { - return Rename( - newName, - ); - } - - Delete delete() { - return const Delete(); - } - - Duplicate duplicate() { - return const Duplicate(); - } - - ViewDidUpdate viewDidUpdate(Either<View, FlowyError> result) { - return ViewDidUpdate( - result, - ); - } -} - -/// @nodoc -const $ViewEvent = _$ViewEventTearOff(); - -/// @nodoc -mixin _$ViewEvent { - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function(bool isEditing) setIsEditing, - required TResult Function(String newName) rename, - required TResult Function() delete, - required TResult Function() duplicate, - required TResult Function(Either<View, FlowyError> result) - viewDidUpdate, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(bool isEditing)? setIsEditing, - TResult Function(String newName)? rename, - TResult Function()? delete, - TResult Function()? duplicate, - TResult Function(Either<View, FlowyError> result)? viewDidUpdate, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(bool isEditing)? setIsEditing, - TResult Function(String newName)? rename, - TResult Function()? delete, - TResult Function()? duplicate, - TResult Function(Either<View, FlowyError> result)? viewDidUpdate, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Initial value) initial, - required TResult Function(SetEditing value) setIsEditing, - required TResult Function(Rename value) rename, - required TResult Function(Delete value) delete, - required TResult Function(Duplicate value) duplicate, - required TResult Function(ViewDidUpdate value) viewDidUpdate, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(SetEditing value)? setIsEditing, - TResult Function(Rename value)? rename, - TResult Function(Delete value)? delete, - TResult Function(Duplicate value)? duplicate, - TResult Function(ViewDidUpdate value)? viewDidUpdate, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(SetEditing value)? setIsEditing, - TResult Function(Rename value)? rename, - TResult Function(Delete value)? delete, - TResult Function(Duplicate value)? duplicate, - TResult Function(ViewDidUpdate value)? viewDidUpdate, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $ViewEventCopyWith<$Res> { - factory $ViewEventCopyWith(ViewEvent value, $Res Function(ViewEvent) then) = - _$ViewEventCopyWithImpl<$Res>; -} - -/// @nodoc -class _$ViewEventCopyWithImpl<$Res> implements $ViewEventCopyWith<$Res> { - _$ViewEventCopyWithImpl(this._value, this._then); - - final ViewEvent _value; - // ignore: unused_field - final $Res Function(ViewEvent) _then; -} - -/// @nodoc -abstract class $InitialCopyWith<$Res> { - factory $InitialCopyWith(Initial value, $Res Function(Initial) then) = - _$InitialCopyWithImpl<$Res>; -} - -/// @nodoc -class _$InitialCopyWithImpl<$Res> extends _$ViewEventCopyWithImpl<$Res> - implements $InitialCopyWith<$Res> { - _$InitialCopyWithImpl(Initial _value, $Res Function(Initial) _then) - : super(_value, (v) => _then(v as Initial)); - - @override - Initial get _value => super._value as Initial; -} - -/// @nodoc - -class _$Initial implements Initial { - const _$Initial(); - - @override - String toString() { - return 'ViewEvent.initial()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || (other is Initial); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function(bool isEditing) setIsEditing, - required TResult Function(String newName) rename, - required TResult Function() delete, - required TResult Function() duplicate, - required TResult Function(Either<View, FlowyError> result) - viewDidUpdate, - }) { - return initial(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(bool isEditing)? setIsEditing, - TResult Function(String newName)? rename, - TResult Function()? delete, - TResult Function()? duplicate, - TResult Function(Either<View, FlowyError> result)? viewDidUpdate, - }) { - return initial?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(bool isEditing)? setIsEditing, - TResult Function(String newName)? rename, - TResult Function()? delete, - TResult Function()? duplicate, - TResult Function(Either<View, FlowyError> result)? viewDidUpdate, - required TResult orElse(), - }) { - if (initial != null) { - return initial(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Initial value) initial, - required TResult Function(SetEditing value) setIsEditing, - required TResult Function(Rename value) rename, - required TResult Function(Delete value) delete, - required TResult Function(Duplicate value) duplicate, - required TResult Function(ViewDidUpdate value) viewDidUpdate, - }) { - return initial(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(SetEditing value)? setIsEditing, - TResult Function(Rename value)? rename, - TResult Function(Delete value)? delete, - TResult Function(Duplicate value)? duplicate, - TResult Function(ViewDidUpdate value)? viewDidUpdate, - }) { - return initial?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(SetEditing value)? setIsEditing, - TResult Function(Rename value)? rename, - TResult Function(Delete value)? delete, - TResult Function(Duplicate value)? duplicate, - TResult Function(ViewDidUpdate value)? viewDidUpdate, - required TResult orElse(), - }) { - if (initial != null) { - return initial(this); - } - return orElse(); - } -} - -abstract class Initial implements ViewEvent { - const factory Initial() = _$Initial; -} - -/// @nodoc -abstract class $SetEditingCopyWith<$Res> { - factory $SetEditingCopyWith( - SetEditing value, $Res Function(SetEditing) then) = - _$SetEditingCopyWithImpl<$Res>; - $Res call({bool isEditing}); -} - -/// @nodoc -class _$SetEditingCopyWithImpl<$Res> extends _$ViewEventCopyWithImpl<$Res> - implements $SetEditingCopyWith<$Res> { - _$SetEditingCopyWithImpl(SetEditing _value, $Res Function(SetEditing) _then) - : super(_value, (v) => _then(v as SetEditing)); - - @override - SetEditing get _value => super._value as SetEditing; - - @override - $Res call({ - Object? isEditing = freezed, - }) { - return _then(SetEditing( - isEditing == freezed - ? _value.isEditing - : isEditing // ignore: cast_nullable_to_non_nullable - as bool, - )); - } -} - -/// @nodoc - -class _$SetEditing implements SetEditing { - const _$SetEditing(this.isEditing); - - @override - final bool isEditing; - - @override - String toString() { - return 'ViewEvent.setIsEditing(isEditing: $isEditing)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is SetEditing && - (identical(other.isEditing, isEditing) || - const DeepCollectionEquality() - .equals(other.isEditing, isEditing))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ const DeepCollectionEquality().hash(isEditing); - - @JsonKey(ignore: true) - @override - $SetEditingCopyWith<SetEditing> get copyWith => - _$SetEditingCopyWithImpl<SetEditing>(this, _$identity); - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function(bool isEditing) setIsEditing, - required TResult Function(String newName) rename, - required TResult Function() delete, - required TResult Function() duplicate, - required TResult Function(Either<View, FlowyError> result) - viewDidUpdate, - }) { - return setIsEditing(isEditing); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(bool isEditing)? setIsEditing, - TResult Function(String newName)? rename, - TResult Function()? delete, - TResult Function()? duplicate, - TResult Function(Either<View, FlowyError> result)? viewDidUpdate, - }) { - return setIsEditing?.call(isEditing); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(bool isEditing)? setIsEditing, - TResult Function(String newName)? rename, - TResult Function()? delete, - TResult Function()? duplicate, - TResult Function(Either<View, FlowyError> result)? viewDidUpdate, - required TResult orElse(), - }) { - if (setIsEditing != null) { - return setIsEditing(isEditing); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Initial value) initial, - required TResult Function(SetEditing value) setIsEditing, - required TResult Function(Rename value) rename, - required TResult Function(Delete value) delete, - required TResult Function(Duplicate value) duplicate, - required TResult Function(ViewDidUpdate value) viewDidUpdate, - }) { - return setIsEditing(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(SetEditing value)? setIsEditing, - TResult Function(Rename value)? rename, - TResult Function(Delete value)? delete, - TResult Function(Duplicate value)? duplicate, - TResult Function(ViewDidUpdate value)? viewDidUpdate, - }) { - return setIsEditing?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(SetEditing value)? setIsEditing, - TResult Function(Rename value)? rename, - TResult Function(Delete value)? delete, - TResult Function(Duplicate value)? duplicate, - TResult Function(ViewDidUpdate value)? viewDidUpdate, - required TResult orElse(), - }) { - if (setIsEditing != null) { - return setIsEditing(this); - } - return orElse(); - } -} - -abstract class SetEditing implements ViewEvent { - const factory SetEditing(bool isEditing) = _$SetEditing; - - bool get isEditing => throw _privateConstructorUsedError; - @JsonKey(ignore: true) - $SetEditingCopyWith<SetEditing> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $RenameCopyWith<$Res> { - factory $RenameCopyWith(Rename value, $Res Function(Rename) then) = - _$RenameCopyWithImpl<$Res>; - $Res call({String newName}); -} - -/// @nodoc -class _$RenameCopyWithImpl<$Res> extends _$ViewEventCopyWithImpl<$Res> - implements $RenameCopyWith<$Res> { - _$RenameCopyWithImpl(Rename _value, $Res Function(Rename) _then) - : super(_value, (v) => _then(v as Rename)); - - @override - Rename get _value => super._value as Rename; - - @override - $Res call({ - Object? newName = freezed, - }) { - return _then(Rename( - newName == freezed - ? _value.newName - : newName // ignore: cast_nullable_to_non_nullable - as String, - )); - } -} - -/// @nodoc - -class _$Rename implements Rename { - const _$Rename(this.newName); - - @override - final String newName; - - @override - String toString() { - return 'ViewEvent.rename(newName: $newName)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is Rename && - (identical(other.newName, newName) || - const DeepCollectionEquality().equals(other.newName, newName))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ const DeepCollectionEquality().hash(newName); - - @JsonKey(ignore: true) - @override - $RenameCopyWith<Rename> get copyWith => - _$RenameCopyWithImpl<Rename>(this, _$identity); - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function(bool isEditing) setIsEditing, - required TResult Function(String newName) rename, - required TResult Function() delete, - required TResult Function() duplicate, - required TResult Function(Either<View, FlowyError> result) - viewDidUpdate, - }) { - return rename(newName); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(bool isEditing)? setIsEditing, - TResult Function(String newName)? rename, - TResult Function()? delete, - TResult Function()? duplicate, - TResult Function(Either<View, FlowyError> result)? viewDidUpdate, - }) { - return rename?.call(newName); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(bool isEditing)? setIsEditing, - TResult Function(String newName)? rename, - TResult Function()? delete, - TResult Function()? duplicate, - TResult Function(Either<View, FlowyError> result)? viewDidUpdate, - required TResult orElse(), - }) { - if (rename != null) { - return rename(newName); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Initial value) initial, - required TResult Function(SetEditing value) setIsEditing, - required TResult Function(Rename value) rename, - required TResult Function(Delete value) delete, - required TResult Function(Duplicate value) duplicate, - required TResult Function(ViewDidUpdate value) viewDidUpdate, - }) { - return rename(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(SetEditing value)? setIsEditing, - TResult Function(Rename value)? rename, - TResult Function(Delete value)? delete, - TResult Function(Duplicate value)? duplicate, - TResult Function(ViewDidUpdate value)? viewDidUpdate, - }) { - return rename?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(SetEditing value)? setIsEditing, - TResult Function(Rename value)? rename, - TResult Function(Delete value)? delete, - TResult Function(Duplicate value)? duplicate, - TResult Function(ViewDidUpdate value)? viewDidUpdate, - required TResult orElse(), - }) { - if (rename != null) { - return rename(this); - } - return orElse(); - } -} - -abstract class Rename implements ViewEvent { - const factory Rename(String newName) = _$Rename; - - String get newName => throw _privateConstructorUsedError; - @JsonKey(ignore: true) - $RenameCopyWith<Rename> get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $DeleteCopyWith<$Res> { - factory $DeleteCopyWith(Delete value, $Res Function(Delete) then) = - _$DeleteCopyWithImpl<$Res>; -} - -/// @nodoc -class _$DeleteCopyWithImpl<$Res> extends _$ViewEventCopyWithImpl<$Res> - implements $DeleteCopyWith<$Res> { - _$DeleteCopyWithImpl(Delete _value, $Res Function(Delete) _then) - : super(_value, (v) => _then(v as Delete)); - - @override - Delete get _value => super._value as Delete; -} - -/// @nodoc - -class _$Delete implements Delete { - const _$Delete(); - - @override - String toString() { - return 'ViewEvent.delete()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || (other is Delete); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function(bool isEditing) setIsEditing, - required TResult Function(String newName) rename, - required TResult Function() delete, - required TResult Function() duplicate, - required TResult Function(Either<View, FlowyError> result) - viewDidUpdate, - }) { - return delete(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(bool isEditing)? setIsEditing, - TResult Function(String newName)? rename, - TResult Function()? delete, - TResult Function()? duplicate, - TResult Function(Either<View, FlowyError> result)? viewDidUpdate, - }) { - return delete?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(bool isEditing)? setIsEditing, - TResult Function(String newName)? rename, - TResult Function()? delete, - TResult Function()? duplicate, - TResult Function(Either<View, FlowyError> result)? viewDidUpdate, - required TResult orElse(), - }) { - if (delete != null) { - return delete(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Initial value) initial, - required TResult Function(SetEditing value) setIsEditing, - required TResult Function(Rename value) rename, - required TResult Function(Delete value) delete, - required TResult Function(Duplicate value) duplicate, - required TResult Function(ViewDidUpdate value) viewDidUpdate, - }) { - return delete(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(SetEditing value)? setIsEditing, - TResult Function(Rename value)? rename, - TResult Function(Delete value)? delete, - TResult Function(Duplicate value)? duplicate, - TResult Function(ViewDidUpdate value)? viewDidUpdate, - }) { - return delete?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(SetEditing value)? setIsEditing, - TResult Function(Rename value)? rename, - TResult Function(Delete value)? delete, - TResult Function(Duplicate value)? duplicate, - TResult Function(ViewDidUpdate value)? viewDidUpdate, - required TResult orElse(), - }) { - if (delete != null) { - return delete(this); - } - return orElse(); - } -} - -abstract class Delete implements ViewEvent { - const factory Delete() = _$Delete; -} - -/// @nodoc -abstract class $DuplicateCopyWith<$Res> { - factory $DuplicateCopyWith(Duplicate value, $Res Function(Duplicate) then) = - _$DuplicateCopyWithImpl<$Res>; -} - -/// @nodoc -class _$DuplicateCopyWithImpl<$Res> extends _$ViewEventCopyWithImpl<$Res> - implements $DuplicateCopyWith<$Res> { - _$DuplicateCopyWithImpl(Duplicate _value, $Res Function(Duplicate) _then) - : super(_value, (v) => _then(v as Duplicate)); - - @override - Duplicate get _value => super._value as Duplicate; -} - -/// @nodoc - -class _$Duplicate implements Duplicate { - const _$Duplicate(); - - @override - String toString() { - return 'ViewEvent.duplicate()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || (other is Duplicate); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function(bool isEditing) setIsEditing, - required TResult Function(String newName) rename, - required TResult Function() delete, - required TResult Function() duplicate, - required TResult Function(Either<View, FlowyError> result) - viewDidUpdate, - }) { - return duplicate(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(bool isEditing)? setIsEditing, - TResult Function(String newName)? rename, - TResult Function()? delete, - TResult Function()? duplicate, - TResult Function(Either<View, FlowyError> result)? viewDidUpdate, - }) { - return duplicate?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(bool isEditing)? setIsEditing, - TResult Function(String newName)? rename, - TResult Function()? delete, - TResult Function()? duplicate, - TResult Function(Either<View, FlowyError> result)? viewDidUpdate, - required TResult orElse(), - }) { - if (duplicate != null) { - return duplicate(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Initial value) initial, - required TResult Function(SetEditing value) setIsEditing, - required TResult Function(Rename value) rename, - required TResult Function(Delete value) delete, - required TResult Function(Duplicate value) duplicate, - required TResult Function(ViewDidUpdate value) viewDidUpdate, - }) { - return duplicate(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(SetEditing value)? setIsEditing, - TResult Function(Rename value)? rename, - TResult Function(Delete value)? delete, - TResult Function(Duplicate value)? duplicate, - TResult Function(ViewDidUpdate value)? viewDidUpdate, - }) { - return duplicate?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(SetEditing value)? setIsEditing, - TResult Function(Rename value)? rename, - TResult Function(Delete value)? delete, - TResult Function(Duplicate value)? duplicate, - TResult Function(ViewDidUpdate value)? viewDidUpdate, - required TResult orElse(), - }) { - if (duplicate != null) { - return duplicate(this); - } - return orElse(); - } -} - -abstract class Duplicate implements ViewEvent { - const factory Duplicate() = _$Duplicate; -} - -/// @nodoc -abstract class $ViewDidUpdateCopyWith<$Res> { - factory $ViewDidUpdateCopyWith( - ViewDidUpdate value, $Res Function(ViewDidUpdate) then) = - _$ViewDidUpdateCopyWithImpl<$Res>; - $Res call({Either<View, FlowyError> result}); -} - -/// @nodoc -class _$ViewDidUpdateCopyWithImpl<$Res> extends _$ViewEventCopyWithImpl<$Res> - implements $ViewDidUpdateCopyWith<$Res> { - _$ViewDidUpdateCopyWithImpl( - ViewDidUpdate _value, $Res Function(ViewDidUpdate) _then) - : super(_value, (v) => _then(v as ViewDidUpdate)); - - @override - ViewDidUpdate get _value => super._value as ViewDidUpdate; - - @override - $Res call({ - Object? result = freezed, - }) { - return _then(ViewDidUpdate( - result == freezed - ? _value.result - : result // ignore: cast_nullable_to_non_nullable - as Either<View, FlowyError>, - )); - } -} - -/// @nodoc - -class _$ViewDidUpdate implements ViewDidUpdate { - const _$ViewDidUpdate(this.result); - - @override - final Either<View, FlowyError> result; - - @override - String toString() { - return 'ViewEvent.viewDidUpdate(result: $result)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is ViewDidUpdate && - (identical(other.result, result) || - const DeepCollectionEquality().equals(other.result, result))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ const DeepCollectionEquality().hash(result); - - @JsonKey(ignore: true) - @override - $ViewDidUpdateCopyWith<ViewDidUpdate> get copyWith => - _$ViewDidUpdateCopyWithImpl<ViewDidUpdate>(this, _$identity); - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function(bool isEditing) setIsEditing, - required TResult Function(String newName) rename, - required TResult Function() delete, - required TResult Function() duplicate, - required TResult Function(Either<View, FlowyError> result) - viewDidUpdate, - }) { - return viewDidUpdate(result); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(bool isEditing)? setIsEditing, - TResult Function(String newName)? rename, - TResult Function()? delete, - TResult Function()? duplicate, - TResult Function(Either<View, FlowyError> result)? viewDidUpdate, - }) { - return viewDidUpdate?.call(result); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(bool isEditing)? setIsEditing, - TResult Function(String newName)? rename, - TResult Function()? delete, - TResult Function()? duplicate, - TResult Function(Either<View, FlowyError> result)? viewDidUpdate, - required TResult orElse(), - }) { - if (viewDidUpdate != null) { - return viewDidUpdate(result); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Initial value) initial, - required TResult Function(SetEditing value) setIsEditing, - required TResult Function(Rename value) rename, - required TResult Function(Delete value) delete, - required TResult Function(Duplicate value) duplicate, - required TResult Function(ViewDidUpdate value) viewDidUpdate, - }) { - return viewDidUpdate(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(SetEditing value)? setIsEditing, - TResult Function(Rename value)? rename, - TResult Function(Delete value)? delete, - TResult Function(Duplicate value)? duplicate, - TResult Function(ViewDidUpdate value)? viewDidUpdate, - }) { - return viewDidUpdate?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(SetEditing value)? setIsEditing, - TResult Function(Rename value)? rename, - TResult Function(Delete value)? delete, - TResult Function(Duplicate value)? duplicate, - TResult Function(ViewDidUpdate value)? viewDidUpdate, - required TResult orElse(), - }) { - if (viewDidUpdate != null) { - return viewDidUpdate(this); - } - return orElse(); - } -} - -abstract class ViewDidUpdate implements ViewEvent { - const factory ViewDidUpdate(Either<View, FlowyError> result) = - _$ViewDidUpdate; - - Either<View, FlowyError> get result => throw _privateConstructorUsedError; - @JsonKey(ignore: true) - $ViewDidUpdateCopyWith<ViewDidUpdate> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -class _$ViewStateTearOff { - const _$ViewStateTearOff(); - - _ViewState call( - {required View view, - required bool isEditing, - required Either<Unit, FlowyError> successOrFailure}) { - return _ViewState( - view: view, - isEditing: isEditing, - successOrFailure: successOrFailure, - ); - } -} - -/// @nodoc -const $ViewState = _$ViewStateTearOff(); - -/// @nodoc -mixin _$ViewState { - View get view => throw _privateConstructorUsedError; - bool get isEditing => throw _privateConstructorUsedError; - Either<Unit, FlowyError> get successOrFailure => - throw _privateConstructorUsedError; - - @JsonKey(ignore: true) - $ViewStateCopyWith<ViewState> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $ViewStateCopyWith<$Res> { - factory $ViewStateCopyWith(ViewState value, $Res Function(ViewState) then) = - _$ViewStateCopyWithImpl<$Res>; - $Res call( - {View view, - bool isEditing, - Either<Unit, FlowyError> successOrFailure}); -} - -/// @nodoc -class _$ViewStateCopyWithImpl<$Res> implements $ViewStateCopyWith<$Res> { - _$ViewStateCopyWithImpl(this._value, this._then); - - final ViewState _value; - // ignore: unused_field - final $Res Function(ViewState) _then; - - @override - $Res call({ - Object? view = freezed, - Object? isEditing = freezed, - Object? successOrFailure = freezed, - }) { - return _then(_value.copyWith( - view: view == freezed - ? _value.view - : view // ignore: cast_nullable_to_non_nullable - as View, - isEditing: isEditing == freezed - ? _value.isEditing - : isEditing // ignore: cast_nullable_to_non_nullable - as bool, - successOrFailure: successOrFailure == freezed - ? _value.successOrFailure - : successOrFailure // ignore: cast_nullable_to_non_nullable - as Either<Unit, FlowyError>, - )); - } -} - -/// @nodoc -abstract class _$ViewStateCopyWith<$Res> implements $ViewStateCopyWith<$Res> { - factory _$ViewStateCopyWith( - _ViewState value, $Res Function(_ViewState) then) = - __$ViewStateCopyWithImpl<$Res>; - @override - $Res call( - {View view, - bool isEditing, - Either<Unit, FlowyError> successOrFailure}); -} - -/// @nodoc -class __$ViewStateCopyWithImpl<$Res> extends _$ViewStateCopyWithImpl<$Res> - implements _$ViewStateCopyWith<$Res> { - __$ViewStateCopyWithImpl(_ViewState _value, $Res Function(_ViewState) _then) - : super(_value, (v) => _then(v as _ViewState)); - - @override - _ViewState get _value => super._value as _ViewState; - - @override - $Res call({ - Object? view = freezed, - Object? isEditing = freezed, - Object? successOrFailure = freezed, - }) { - return _then(_ViewState( - view: view == freezed - ? _value.view - : view // ignore: cast_nullable_to_non_nullable - as View, - isEditing: isEditing == freezed - ? _value.isEditing - : isEditing // ignore: cast_nullable_to_non_nullable - as bool, - successOrFailure: successOrFailure == freezed - ? _value.successOrFailure - : successOrFailure // ignore: cast_nullable_to_non_nullable - as Either<Unit, FlowyError>, - )); - } -} - -/// @nodoc - -class _$_ViewState implements _ViewState { - const _$_ViewState( - {required this.view, - required this.isEditing, - required this.successOrFailure}); - - @override - final View view; - @override - final bool isEditing; - @override - final Either<Unit, FlowyError> successOrFailure; - - @override - String toString() { - return 'ViewState(view: $view, isEditing: $isEditing, successOrFailure: $successOrFailure)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is _ViewState && - (identical(other.view, view) || - const DeepCollectionEquality().equals(other.view, view)) && - (identical(other.isEditing, isEditing) || - const DeepCollectionEquality() - .equals(other.isEditing, isEditing)) && - (identical(other.successOrFailure, successOrFailure) || - const DeepCollectionEquality() - .equals(other.successOrFailure, successOrFailure))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ - const DeepCollectionEquality().hash(view) ^ - const DeepCollectionEquality().hash(isEditing) ^ - const DeepCollectionEquality().hash(successOrFailure); - - @JsonKey(ignore: true) - @override - _$ViewStateCopyWith<_ViewState> get copyWith => - __$ViewStateCopyWithImpl<_ViewState>(this, _$identity); -} - -abstract class _ViewState implements ViewState { - const factory _ViewState( - {required View view, - required bool isEditing, - required Either<Unit, FlowyError> successOrFailure}) = _$_ViewState; - - @override - View get view => throw _privateConstructorUsedError; - @override - bool get isEditing => throw _privateConstructorUsedError; - @override - Either<Unit, FlowyError> get successOrFailure => - throw _privateConstructorUsedError; - @override - @JsonKey(ignore: true) - _$ViewStateCopyWith<_ViewState> get copyWith => - throw _privateConstructorUsedError; -} diff --git a/frontend/app_flowy/lib/workspace/application/workspace/welcome_bloc.freezed.dart b/frontend/app_flowy/lib/workspace/application/workspace/welcome_bloc.freezed.dart deleted file mode 100644 index 6bd2c9bf4f..0000000000 --- a/frontend/app_flowy/lib/workspace/application/workspace/welcome_bloc.freezed.dart +++ /dev/null @@ -1,891 +0,0 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target - -part of 'welcome_bloc.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity<T>(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); - -/// @nodoc -class _$WelcomeEventTearOff { - const _$WelcomeEventTearOff(); - - Initial initial() { - return const Initial(); - } - - CreateWorkspace createWorkspace(String name, String desc) { - return CreateWorkspace( - name, - desc, - ); - } - - OpenWorkspace openWorkspace(Workspace workspace) { - return OpenWorkspace( - workspace, - ); - } - - WorkspacesReceived workspacesReveived( - Either<List<Workspace>, FlowyError> workspacesOrFail) { - return WorkspacesReceived( - workspacesOrFail, - ); - } -} - -/// @nodoc -const $WelcomeEvent = _$WelcomeEventTearOff(); - -/// @nodoc -mixin _$WelcomeEvent { - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function(String name, String desc) createWorkspace, - required TResult Function(Workspace workspace) openWorkspace, - required TResult Function( - Either<List<Workspace>, FlowyError> workspacesOrFail) - workspacesReveived, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(String name, String desc)? createWorkspace, - TResult Function(Workspace workspace)? openWorkspace, - TResult Function(Either<List<Workspace>, FlowyError> workspacesOrFail)? - workspacesReveived, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(String name, String desc)? createWorkspace, - TResult Function(Workspace workspace)? openWorkspace, - TResult Function(Either<List<Workspace>, FlowyError> workspacesOrFail)? - workspacesReveived, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Initial value) initial, - required TResult Function(CreateWorkspace value) createWorkspace, - required TResult Function(OpenWorkspace value) openWorkspace, - required TResult Function(WorkspacesReceived value) workspacesReveived, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(CreateWorkspace value)? createWorkspace, - TResult Function(OpenWorkspace value)? openWorkspace, - TResult Function(WorkspacesReceived value)? workspacesReveived, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(CreateWorkspace value)? createWorkspace, - TResult Function(OpenWorkspace value)? openWorkspace, - TResult Function(WorkspacesReceived value)? workspacesReveived, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $WelcomeEventCopyWith<$Res> { - factory $WelcomeEventCopyWith( - WelcomeEvent value, $Res Function(WelcomeEvent) then) = - _$WelcomeEventCopyWithImpl<$Res>; -} - -/// @nodoc -class _$WelcomeEventCopyWithImpl<$Res> implements $WelcomeEventCopyWith<$Res> { - _$WelcomeEventCopyWithImpl(this._value, this._then); - - final WelcomeEvent _value; - // ignore: unused_field - final $Res Function(WelcomeEvent) _then; -} - -/// @nodoc -abstract class $InitialCopyWith<$Res> { - factory $InitialCopyWith(Initial value, $Res Function(Initial) then) = - _$InitialCopyWithImpl<$Res>; -} - -/// @nodoc -class _$InitialCopyWithImpl<$Res> extends _$WelcomeEventCopyWithImpl<$Res> - implements $InitialCopyWith<$Res> { - _$InitialCopyWithImpl(Initial _value, $Res Function(Initial) _then) - : super(_value, (v) => _then(v as Initial)); - - @override - Initial get _value => super._value as Initial; -} - -/// @nodoc - -class _$Initial implements Initial { - const _$Initial(); - - @override - String toString() { - return 'WelcomeEvent.initial()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || (other is Initial); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function(String name, String desc) createWorkspace, - required TResult Function(Workspace workspace) openWorkspace, - required TResult Function( - Either<List<Workspace>, FlowyError> workspacesOrFail) - workspacesReveived, - }) { - return initial(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(String name, String desc)? createWorkspace, - TResult Function(Workspace workspace)? openWorkspace, - TResult Function(Either<List<Workspace>, FlowyError> workspacesOrFail)? - workspacesReveived, - }) { - return initial?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(String name, String desc)? createWorkspace, - TResult Function(Workspace workspace)? openWorkspace, - TResult Function(Either<List<Workspace>, FlowyError> workspacesOrFail)? - workspacesReveived, - required TResult orElse(), - }) { - if (initial != null) { - return initial(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Initial value) initial, - required TResult Function(CreateWorkspace value) createWorkspace, - required TResult Function(OpenWorkspace value) openWorkspace, - required TResult Function(WorkspacesReceived value) workspacesReveived, - }) { - return initial(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(CreateWorkspace value)? createWorkspace, - TResult Function(OpenWorkspace value)? openWorkspace, - TResult Function(WorkspacesReceived value)? workspacesReveived, - }) { - return initial?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(CreateWorkspace value)? createWorkspace, - TResult Function(OpenWorkspace value)? openWorkspace, - TResult Function(WorkspacesReceived value)? workspacesReveived, - required TResult orElse(), - }) { - if (initial != null) { - return initial(this); - } - return orElse(); - } -} - -abstract class Initial implements WelcomeEvent { - const factory Initial() = _$Initial; -} - -/// @nodoc -abstract class $CreateWorkspaceCopyWith<$Res> { - factory $CreateWorkspaceCopyWith( - CreateWorkspace value, $Res Function(CreateWorkspace) then) = - _$CreateWorkspaceCopyWithImpl<$Res>; - $Res call({String name, String desc}); -} - -/// @nodoc -class _$CreateWorkspaceCopyWithImpl<$Res> - extends _$WelcomeEventCopyWithImpl<$Res> - implements $CreateWorkspaceCopyWith<$Res> { - _$CreateWorkspaceCopyWithImpl( - CreateWorkspace _value, $Res Function(CreateWorkspace) _then) - : super(_value, (v) => _then(v as CreateWorkspace)); - - @override - CreateWorkspace get _value => super._value as CreateWorkspace; - - @override - $Res call({ - Object? name = freezed, - Object? desc = freezed, - }) { - return _then(CreateWorkspace( - name == freezed - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - desc == freezed - ? _value.desc - : desc // ignore: cast_nullable_to_non_nullable - as String, - )); - } -} - -/// @nodoc - -class _$CreateWorkspace implements CreateWorkspace { - const _$CreateWorkspace(this.name, this.desc); - - @override - final String name; - @override - final String desc; - - @override - String toString() { - return 'WelcomeEvent.createWorkspace(name: $name, desc: $desc)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is CreateWorkspace && - (identical(other.name, name) || - const DeepCollectionEquality().equals(other.name, name)) && - (identical(other.desc, desc) || - const DeepCollectionEquality().equals(other.desc, desc))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ - const DeepCollectionEquality().hash(name) ^ - const DeepCollectionEquality().hash(desc); - - @JsonKey(ignore: true) - @override - $CreateWorkspaceCopyWith<CreateWorkspace> get copyWith => - _$CreateWorkspaceCopyWithImpl<CreateWorkspace>(this, _$identity); - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function(String name, String desc) createWorkspace, - required TResult Function(Workspace workspace) openWorkspace, - required TResult Function( - Either<List<Workspace>, FlowyError> workspacesOrFail) - workspacesReveived, - }) { - return createWorkspace(name, desc); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(String name, String desc)? createWorkspace, - TResult Function(Workspace workspace)? openWorkspace, - TResult Function(Either<List<Workspace>, FlowyError> workspacesOrFail)? - workspacesReveived, - }) { - return createWorkspace?.call(name, desc); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(String name, String desc)? createWorkspace, - TResult Function(Workspace workspace)? openWorkspace, - TResult Function(Either<List<Workspace>, FlowyError> workspacesOrFail)? - workspacesReveived, - required TResult orElse(), - }) { - if (createWorkspace != null) { - return createWorkspace(name, desc); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Initial value) initial, - required TResult Function(CreateWorkspace value) createWorkspace, - required TResult Function(OpenWorkspace value) openWorkspace, - required TResult Function(WorkspacesReceived value) workspacesReveived, - }) { - return createWorkspace(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(CreateWorkspace value)? createWorkspace, - TResult Function(OpenWorkspace value)? openWorkspace, - TResult Function(WorkspacesReceived value)? workspacesReveived, - }) { - return createWorkspace?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(CreateWorkspace value)? createWorkspace, - TResult Function(OpenWorkspace value)? openWorkspace, - TResult Function(WorkspacesReceived value)? workspacesReveived, - required TResult orElse(), - }) { - if (createWorkspace != null) { - return createWorkspace(this); - } - return orElse(); - } -} - -abstract class CreateWorkspace implements WelcomeEvent { - const factory CreateWorkspace(String name, String desc) = _$CreateWorkspace; - - String get name => throw _privateConstructorUsedError; - String get desc => throw _privateConstructorUsedError; - @JsonKey(ignore: true) - $CreateWorkspaceCopyWith<CreateWorkspace> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $OpenWorkspaceCopyWith<$Res> { - factory $OpenWorkspaceCopyWith( - OpenWorkspace value, $Res Function(OpenWorkspace) then) = - _$OpenWorkspaceCopyWithImpl<$Res>; - $Res call({Workspace workspace}); -} - -/// @nodoc -class _$OpenWorkspaceCopyWithImpl<$Res> extends _$WelcomeEventCopyWithImpl<$Res> - implements $OpenWorkspaceCopyWith<$Res> { - _$OpenWorkspaceCopyWithImpl( - OpenWorkspace _value, $Res Function(OpenWorkspace) _then) - : super(_value, (v) => _then(v as OpenWorkspace)); - - @override - OpenWorkspace get _value => super._value as OpenWorkspace; - - @override - $Res call({ - Object? workspace = freezed, - }) { - return _then(OpenWorkspace( - workspace == freezed - ? _value.workspace - : workspace // ignore: cast_nullable_to_non_nullable - as Workspace, - )); - } -} - -/// @nodoc - -class _$OpenWorkspace implements OpenWorkspace { - const _$OpenWorkspace(this.workspace); - - @override - final Workspace workspace; - - @override - String toString() { - return 'WelcomeEvent.openWorkspace(workspace: $workspace)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is OpenWorkspace && - (identical(other.workspace, workspace) || - const DeepCollectionEquality() - .equals(other.workspace, workspace))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ const DeepCollectionEquality().hash(workspace); - - @JsonKey(ignore: true) - @override - $OpenWorkspaceCopyWith<OpenWorkspace> get copyWith => - _$OpenWorkspaceCopyWithImpl<OpenWorkspace>(this, _$identity); - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function(String name, String desc) createWorkspace, - required TResult Function(Workspace workspace) openWorkspace, - required TResult Function( - Either<List<Workspace>, FlowyError> workspacesOrFail) - workspacesReveived, - }) { - return openWorkspace(workspace); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(String name, String desc)? createWorkspace, - TResult Function(Workspace workspace)? openWorkspace, - TResult Function(Either<List<Workspace>, FlowyError> workspacesOrFail)? - workspacesReveived, - }) { - return openWorkspace?.call(workspace); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(String name, String desc)? createWorkspace, - TResult Function(Workspace workspace)? openWorkspace, - TResult Function(Either<List<Workspace>, FlowyError> workspacesOrFail)? - workspacesReveived, - required TResult orElse(), - }) { - if (openWorkspace != null) { - return openWorkspace(workspace); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Initial value) initial, - required TResult Function(CreateWorkspace value) createWorkspace, - required TResult Function(OpenWorkspace value) openWorkspace, - required TResult Function(WorkspacesReceived value) workspacesReveived, - }) { - return openWorkspace(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(CreateWorkspace value)? createWorkspace, - TResult Function(OpenWorkspace value)? openWorkspace, - TResult Function(WorkspacesReceived value)? workspacesReveived, - }) { - return openWorkspace?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(CreateWorkspace value)? createWorkspace, - TResult Function(OpenWorkspace value)? openWorkspace, - TResult Function(WorkspacesReceived value)? workspacesReveived, - required TResult orElse(), - }) { - if (openWorkspace != null) { - return openWorkspace(this); - } - return orElse(); - } -} - -abstract class OpenWorkspace implements WelcomeEvent { - const factory OpenWorkspace(Workspace workspace) = _$OpenWorkspace; - - Workspace get workspace => throw _privateConstructorUsedError; - @JsonKey(ignore: true) - $OpenWorkspaceCopyWith<OpenWorkspace> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $WorkspacesReceivedCopyWith<$Res> { - factory $WorkspacesReceivedCopyWith( - WorkspacesReceived value, $Res Function(WorkspacesReceived) then) = - _$WorkspacesReceivedCopyWithImpl<$Res>; - $Res call({Either<List<Workspace>, FlowyError> workspacesOrFail}); -} - -/// @nodoc -class _$WorkspacesReceivedCopyWithImpl<$Res> - extends _$WelcomeEventCopyWithImpl<$Res> - implements $WorkspacesReceivedCopyWith<$Res> { - _$WorkspacesReceivedCopyWithImpl( - WorkspacesReceived _value, $Res Function(WorkspacesReceived) _then) - : super(_value, (v) => _then(v as WorkspacesReceived)); - - @override - WorkspacesReceived get _value => super._value as WorkspacesReceived; - - @override - $Res call({ - Object? workspacesOrFail = freezed, - }) { - return _then(WorkspacesReceived( - workspacesOrFail == freezed - ? _value.workspacesOrFail - : workspacesOrFail // ignore: cast_nullable_to_non_nullable - as Either<List<Workspace>, FlowyError>, - )); - } -} - -/// @nodoc - -class _$WorkspacesReceived implements WorkspacesReceived { - const _$WorkspacesReceived(this.workspacesOrFail); - - @override - final Either<List<Workspace>, FlowyError> workspacesOrFail; - - @override - String toString() { - return 'WelcomeEvent.workspacesReveived(workspacesOrFail: $workspacesOrFail)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is WorkspacesReceived && - (identical(other.workspacesOrFail, workspacesOrFail) || - const DeepCollectionEquality() - .equals(other.workspacesOrFail, workspacesOrFail))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ - const DeepCollectionEquality().hash(workspacesOrFail); - - @JsonKey(ignore: true) - @override - $WorkspacesReceivedCopyWith<WorkspacesReceived> get copyWith => - _$WorkspacesReceivedCopyWithImpl<WorkspacesReceived>(this, _$identity); - - @override - @optionalTypeArgs - TResult when<TResult extends Object?>({ - required TResult Function() initial, - required TResult Function(String name, String desc) createWorkspace, - required TResult Function(Workspace workspace) openWorkspace, - required TResult Function( - Either<List<Workspace>, FlowyError> workspacesOrFail) - workspacesReveived, - }) { - return workspacesReveived(workspacesOrFail); - } - - @override - @optionalTypeArgs - TResult? whenOrNull<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(String name, String desc)? createWorkspace, - TResult Function(Workspace workspace)? openWorkspace, - TResult Function(Either<List<Workspace>, FlowyError> workspacesOrFail)? - workspacesReveived, - }) { - return workspacesReveived?.call(workspacesOrFail); - } - - @override - @optionalTypeArgs - TResult maybeWhen<TResult extends Object?>({ - TResult Function()? initial, - TResult Function(String name, String desc)? createWorkspace, - TResult Function(Workspace workspace)? openWorkspace, - TResult Function(Either<List<Workspace>, FlowyError> workspacesOrFail)? - workspacesReveived, - required TResult orElse(), - }) { - if (workspacesReveived != null) { - return workspacesReveived(workspacesOrFail); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map<TResult extends Object?>({ - required TResult Function(Initial value) initial, - required TResult Function(CreateWorkspace value) createWorkspace, - required TResult Function(OpenWorkspace value) openWorkspace, - required TResult Function(WorkspacesReceived value) workspacesReveived, - }) { - return workspacesReveived(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(CreateWorkspace value)? createWorkspace, - TResult Function(OpenWorkspace value)? openWorkspace, - TResult Function(WorkspacesReceived value)? workspacesReveived, - }) { - return workspacesReveived?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap<TResult extends Object?>({ - TResult Function(Initial value)? initial, - TResult Function(CreateWorkspace value)? createWorkspace, - TResult Function(OpenWorkspace value)? openWorkspace, - TResult Function(WorkspacesReceived value)? workspacesReveived, - required TResult orElse(), - }) { - if (workspacesReveived != null) { - return workspacesReveived(this); - } - return orElse(); - } -} - -abstract class WorkspacesReceived implements WelcomeEvent { - const factory WorkspacesReceived( - Either<List<Workspace>, FlowyError> workspacesOrFail) = - _$WorkspacesReceived; - - Either<List<Workspace>, FlowyError> get workspacesOrFail => - throw _privateConstructorUsedError; - @JsonKey(ignore: true) - $WorkspacesReceivedCopyWith<WorkspacesReceived> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -class _$WelcomeStateTearOff { - const _$WelcomeStateTearOff(); - - _WelcomeState call( - {required bool isLoading, - required List<Workspace> workspaces, - required Either<Unit, FlowyError> successOrFailure}) { - return _WelcomeState( - isLoading: isLoading, - workspaces: workspaces, - successOrFailure: successOrFailure, - ); - } -} - -/// @nodoc -const $WelcomeState = _$WelcomeStateTearOff(); - -/// @nodoc -mixin _$WelcomeState { - bool get isLoading => throw _privateConstructorUsedError; - List<Workspace> get workspaces => throw _privateConstructorUsedError; - Either<Unit, FlowyError> get successOrFailure => - throw _privateConstructorUsedError; - - @JsonKey(ignore: true) - $WelcomeStateCopyWith<WelcomeState> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $WelcomeStateCopyWith<$Res> { - factory $WelcomeStateCopyWith( - WelcomeState value, $Res Function(WelcomeState) then) = - _$WelcomeStateCopyWithImpl<$Res>; - $Res call( - {bool isLoading, - List<Workspace> workspaces, - Either<Unit, FlowyError> successOrFailure}); -} - -/// @nodoc -class _$WelcomeStateCopyWithImpl<$Res> implements $WelcomeStateCopyWith<$Res> { - _$WelcomeStateCopyWithImpl(this._value, this._then); - - final WelcomeState _value; - // ignore: unused_field - final $Res Function(WelcomeState) _then; - - @override - $Res call({ - Object? isLoading = freezed, - Object? workspaces = freezed, - Object? successOrFailure = freezed, - }) { - return _then(_value.copyWith( - isLoading: isLoading == freezed - ? _value.isLoading - : isLoading // ignore: cast_nullable_to_non_nullable - as bool, - workspaces: workspaces == freezed - ? _value.workspaces - : workspaces // ignore: cast_nullable_to_non_nullable - as List<Workspace>, - successOrFailure: successOrFailure == freezed - ? _value.successOrFailure - : successOrFailure // ignore: cast_nullable_to_non_nullable - as Either<Unit, FlowyError>, - )); - } -} - -/// @nodoc -abstract class _$WelcomeStateCopyWith<$Res> - implements $WelcomeStateCopyWith<$Res> { - factory _$WelcomeStateCopyWith( - _WelcomeState value, $Res Function(_WelcomeState) then) = - __$WelcomeStateCopyWithImpl<$Res>; - @override - $Res call( - {bool isLoading, - List<Workspace> workspaces, - Either<Unit, FlowyError> successOrFailure}); -} - -/// @nodoc -class __$WelcomeStateCopyWithImpl<$Res> extends _$WelcomeStateCopyWithImpl<$Res> - implements _$WelcomeStateCopyWith<$Res> { - __$WelcomeStateCopyWithImpl( - _WelcomeState _value, $Res Function(_WelcomeState) _then) - : super(_value, (v) => _then(v as _WelcomeState)); - - @override - _WelcomeState get _value => super._value as _WelcomeState; - - @override - $Res call({ - Object? isLoading = freezed, - Object? workspaces = freezed, - Object? successOrFailure = freezed, - }) { - return _then(_WelcomeState( - isLoading: isLoading == freezed - ? _value.isLoading - : isLoading // ignore: cast_nullable_to_non_nullable - as bool, - workspaces: workspaces == freezed - ? _value.workspaces - : workspaces // ignore: cast_nullable_to_non_nullable - as List<Workspace>, - successOrFailure: successOrFailure == freezed - ? _value.successOrFailure - : successOrFailure // ignore: cast_nullable_to_non_nullable - as Either<Unit, FlowyError>, - )); - } -} - -/// @nodoc - -class _$_WelcomeState implements _WelcomeState { - const _$_WelcomeState( - {required this.isLoading, - required this.workspaces, - required this.successOrFailure}); - - @override - final bool isLoading; - @override - final List<Workspace> workspaces; - @override - final Either<Unit, FlowyError> successOrFailure; - - @override - String toString() { - return 'WelcomeState(isLoading: $isLoading, workspaces: $workspaces, successOrFailure: $successOrFailure)'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other is _WelcomeState && - (identical(other.isLoading, isLoading) || - const DeepCollectionEquality() - .equals(other.isLoading, isLoading)) && - (identical(other.workspaces, workspaces) || - const DeepCollectionEquality() - .equals(other.workspaces, workspaces)) && - (identical(other.successOrFailure, successOrFailure) || - const DeepCollectionEquality() - .equals(other.successOrFailure, successOrFailure))); - } - - @override - int get hashCode => - runtimeType.hashCode ^ - const DeepCollectionEquality().hash(isLoading) ^ - const DeepCollectionEquality().hash(workspaces) ^ - const DeepCollectionEquality().hash(successOrFailure); - - @JsonKey(ignore: true) - @override - _$WelcomeStateCopyWith<_WelcomeState> get copyWith => - __$WelcomeStateCopyWithImpl<_WelcomeState>(this, _$identity); -} - -abstract class _WelcomeState implements WelcomeState { - const factory _WelcomeState( - {required bool isLoading, - required List<Workspace> workspaces, - required Either<Unit, FlowyError> successOrFailure}) = - _$_WelcomeState; - - @override - bool get isLoading => throw _privateConstructorUsedError; - @override - List<Workspace> get workspaces => throw _privateConstructorUsedError; - @override - Either<Unit, FlowyError> get successOrFailure => - throw _privateConstructorUsedError; - @override - @JsonKey(ignore: true) - _$WelcomeStateCopyWith<_WelcomeState> get copyWith => - throw _privateConstructorUsedError; -} From a0654d8a412b838073bf9a84d55de92175ae569a Mon Sep 17 00:00:00 2001 From: Hieu <hieugaomoc@gmail.com> Date: Wed, 23 Feb 2022 20:28:41 +0700 Subject: [PATCH 2/9] chore: disable `invalid_annotation_target` warning --- frontend/app_flowy/analysis_options.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/app_flowy/analysis_options.yaml b/frontend/app_flowy/analysis_options.yaml index dce1597967..fbd3eeee72 100644 --- a/frontend/app_flowy/analysis_options.yaml +++ b/frontend/app_flowy/analysis_options.yaml @@ -36,3 +36,6 @@ linter: # Additional information about this file can be found at # https://dart.dev/guides/language/analysis-options + +errors: + invalid_annotation_target: ignore \ No newline at end of file From 6ae8efbdfe878e45e6e85d8303914fa545bc786d Mon Sep 17 00:00:00 2001 From: Hieu <hieugaomoc@gmail.com> Date: Wed, 23 Feb 2022 20:32:53 +0700 Subject: [PATCH 3/9] ci: generate `freezed` files --- .github/workflows/dart_lint.yml | 7 ++- .github/workflows/dart_test.yml | 7 ++- frontend/scripts/makefile/flutter.toml | 67 +++++++++++++++++--------- 3 files changed, 53 insertions(+), 28 deletions(-) diff --git a/.github/workflows/dart_lint.yml b/.github/workflows/dart_lint.yml index 25c4990cac..73378109ec 100644 --- a/.github/workflows/dart_lint.yml +++ b/.github/workflows/dart_lint.yml @@ -33,8 +33,11 @@ jobs: working-directory: frontend/app_flowy - name: Code Generate working-directory: frontend/app_flowy - run: - flutter pub run easy_localization:generate --source-dir ./assets/translations -f keys -O lib/generated -o locale_keys.g.dart + run: | + flutter pub run easy_localization:generate -S ./assets/translations -f keys -O lib/generated -o locale_keys.g.dart + sed -i '/generate: true/s/true/false/g' pubspec.yaml + flutter pub get + flutter packages pub run build_runner build --delete-conflicting-outputs - name: flutter analyze working-directory: frontend/app_flowy run: flutter analyze diff --git a/.github/workflows/dart_test.yml b/.github/workflows/dart_test.yml index 6106126cee..4261e6e9b9 100644 --- a/.github/workflows/dart_test.yml +++ b/.github/workflows/dart_test.yml @@ -33,8 +33,11 @@ jobs: working-directory: frontend/app_flowy - name: Code Generate working-directory: frontend/app_flowy - run: - flutter pub run easy_localization:generate --source-dir ./assets/translations -f keys -O lib/generated -o locale_keys.g.dart + run: | + flutter pub run easy_localization:generate -S ./assets/translations -f keys -O lib/generated -o locale_keys.g.dart + sed -i '/generate: true/s/true/false/g' pubspec.yaml + flutter pub get + flutter packages pub run build_runner build --delete-conflicting-outputs - name: Build FlowySDK working-directory: frontend run: | diff --git a/frontend/scripts/makefile/flutter.toml b/frontend/scripts/makefile/flutter.toml index b1cda1d69f..9e8e39e8d5 100644 --- a/frontend/scripts/makefile/flutter.toml +++ b/frontend/scripts/makefile/flutter.toml @@ -5,16 +5,16 @@ linux_alias = "appflowy-linux" [tasks.appflowy-macos] dependencies = ["flowy-sdk-release"] -run_task = { name = ["generate_language_files", "flutter-build", "copy-to-product"] } +run_task = { name = ["generate_language_files", "generate_freezed_files", "flutter-build", "copy-to-product"] } script_runner = "@shell" [tasks.appflowy-windows] dependencies = ["flowy-sdk-release"] -run_task = { name = ["generate_language_files", "flutter-build", "copy-to-product"] } +run_task = { name = ["generate_language_files", "generate_freezed_files", "flutter-build", "copy-to-product"] } [tasks.appflowy-linux] dependencies = ["flowy-sdk-release"] -run_task = { name = ["generate_language_files", "flutter-build", "copy-to-product", "create-release-archive"] } +run_task = { name = ["generate_language_files", "generate_freezed_files", "flutter-build", "copy-to-product", "create-release-archive"] } script_runner = "@shell" [tasks.appflowy-dev] @@ -24,16 +24,16 @@ linux_alias = "appflowy-linux-dev" [tasks.appflowy-macos-dev] dependencies = ["flowy-sdk-dev"] -run_task = { name = ["generate_language_files", "flutter-build", "copy-to-product"] } +run_task = { name = ["generate_language_files", "generate_freezed_files", "flutter-build", "copy-to-product"] } script_runner = "@shell" [tasks.appflowy-windows-dev] dependencies = ["flowy-sdk-dev"] -run_task = { name = ["generate_language_files", "flutter-build", "copy-to-product"] } +run_task = { name = ["generate_language_files", "generate_freezed_files", "flutter-build", "copy-to-product"] } [tasks.appflowy-linux-dev] dependencies = ["flowy-sdk-dev"] -run_task = { name = ["generate_language_files", "flutter-build", "copy-to-product"] } +run_task = { name = ["generate_language_files", "generate_freezed_files", "flutter-build", "copy-to-product"] } script_runner = "@shell" [tasks.copy-to-product] @@ -156,24 +156,6 @@ script = [ ] script_runner = "@duckscript" -[tasks.freeze_setup] -script = [ - """ - flutter clean - flutter pub get - flutter pub run build_runner build --delete-conflicting-outputs - """, -] -script_runner = "@shell" - -[tasks.freeze_watch] -script = [ - """ - flutter pub run build_runner watch - """, -] -script_runner = "@shell" - [tasks.generate_language_files] script_runner = "@shell" script = [ @@ -198,3 +180,40 @@ script = [ exec cmd.exe /c flutter pub run easy_localization:generate -f keys -o locale_keys.g.dart -S assets/translations """ ] + +[tasks.generate_freezed_files] +script_runner = "@shell" +script = [ + """ + cd app_flowy + flutter clean + sed -i '/generate: true/s/true/false/g' pubspec.yaml + flutter pub get + flutter packages pub run build_runner build --delete-conflicting-outputs + """ +] + +# TODO: Add support for Windows. +# [tasks.generate_freezed_files.windows] +# script_runner = "@duckscript" +# script = [ +# """ +# cd ./app_flowy/ +# exec cmd.exe /c flutter clean +# exec cmd.exe /c flutter pub get +# exec cmd.exe /c flutter pub run easy_localization:generate -S assets/translations/ +# exec cmd.exe /c flutter pub run easy_localization:generate -f keys -o locale_keys.g.dart -S assets/translations +# """ +# ] + +[tasks.generate_freezed_files.macos] +script_runner = "@shell" +script = [ + """ + cd app_flowy + flutter clean + sed -i '' '/generate: true/s/true/false/g' pubspec.yaml + flutter pub get + flutter packages pub run build_runner build --delete-conflicting-outputs + """ +] \ No newline at end of file From 6e1c6d7a472ab6bc16609b6a92d158a1a11acb32 Mon Sep 17 00:00:00 2001 From: Hieu <hieugaomoc@gmail.com> Date: Wed, 23 Feb 2022 21:18:20 +0700 Subject: [PATCH 4/9] fix: `cargo-make` platforms, `mac` not `macos` --- frontend/scripts/makefile/flutter.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/scripts/makefile/flutter.toml b/frontend/scripts/makefile/flutter.toml index 9e8e39e8d5..02ff1f7ccd 100644 --- a/frontend/scripts/makefile/flutter.toml +++ b/frontend/scripts/makefile/flutter.toml @@ -206,7 +206,7 @@ script = [ # """ # ] -[tasks.generate_freezed_files.macos] +[tasks.generate_freezed_files.mac] script_runner = "@shell" script = [ """ From 288afbe68bec7c5617502d7e6a280bcd9f7490bf Mon Sep 17 00:00:00 2001 From: Hieu <hieugaomoc@gmail.com> Date: Wed, 23 Feb 2022 22:02:46 +0700 Subject: [PATCH 5/9] ci: no more `sed` Fix "Bad state: Unable to generate package graph" --- .github/workflows/dart_lint.yml | 3 +-- .github/workflows/dart_test.yml | 3 +-- frontend/scripts/makefile/flutter.toml | 30 +++++++------------------- 3 files changed, 10 insertions(+), 26 deletions(-) diff --git a/.github/workflows/dart_lint.yml b/.github/workflows/dart_lint.yml index 73378109ec..56cc033292 100644 --- a/.github/workflows/dart_lint.yml +++ b/.github/workflows/dart_lint.yml @@ -35,8 +35,7 @@ jobs: working-directory: frontend/app_flowy run: | flutter pub run easy_localization:generate -S ./assets/translations -f keys -O lib/generated -o locale_keys.g.dart - sed -i '/generate: true/s/true/false/g' pubspec.yaml - flutter pub get + flutter packages pub get flutter packages pub run build_runner build --delete-conflicting-outputs - name: flutter analyze working-directory: frontend/app_flowy diff --git a/.github/workflows/dart_test.yml b/.github/workflows/dart_test.yml index 4261e6e9b9..6ce615bedc 100644 --- a/.github/workflows/dart_test.yml +++ b/.github/workflows/dart_test.yml @@ -35,8 +35,7 @@ jobs: working-directory: frontend/app_flowy run: | flutter pub run easy_localization:generate -S ./assets/translations -f keys -O lib/generated -o locale_keys.g.dart - sed -i '/generate: true/s/true/false/g' pubspec.yaml - flutter pub get + flutter packages pub get flutter packages pub run build_runner build --delete-conflicting-outputs - name: Build FlowySDK working-directory: frontend diff --git a/frontend/scripts/makefile/flutter.toml b/frontend/scripts/makefile/flutter.toml index 02ff1f7ccd..753b57132a 100644 --- a/frontend/scripts/makefile/flutter.toml +++ b/frontend/scripts/makefile/flutter.toml @@ -187,33 +187,19 @@ script = [ """ cd app_flowy flutter clean - sed -i '/generate: true/s/true/false/g' pubspec.yaml - flutter pub get + flutter packages pub get flutter packages pub run build_runner build --delete-conflicting-outputs """ ] -# TODO: Add support for Windows. -# [tasks.generate_freezed_files.windows] -# script_runner = "@duckscript" -# script = [ -# """ -# cd ./app_flowy/ -# exec cmd.exe /c flutter clean -# exec cmd.exe /c flutter pub get -# exec cmd.exe /c flutter pub run easy_localization:generate -S assets/translations/ -# exec cmd.exe /c flutter pub run easy_localization:generate -f keys -o locale_keys.g.dart -S assets/translations -# """ -# ] - -[tasks.generate_freezed_files.mac] -script_runner = "@shell" +[tasks.generate_freezed_files.windows] +script_runner = "@duckscript" script = [ """ - cd app_flowy - flutter clean - sed -i '' '/generate: true/s/true/false/g' pubspec.yaml - flutter pub get - flutter packages pub run build_runner build --delete-conflicting-outputs + cd ./app_flowy/ + exec cmd.exe /c flutter clean + exec cmd.exe /c flutter packages pub get + exec cmd.exe /c flutter packages pub get + exec cmd.exe /c flutter packages pub run build_runner build --delete-conflicting-outputs """ ] \ No newline at end of file From 3a2424cda3b519b11345b9689818c789a6905ad1 Mon Sep 17 00:00:00 2001 From: Pualoo <phchirnev@hotmail.com> Date: Wed, 23 Feb 2022 14:33:08 -0300 Subject: [PATCH 6/9] fix: DocBanner overflow issue#354 --- .../stack_page/doc/widget/banner.dart | 67 ++++++++++--------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/frontend/app_flowy/lib/workspace/presentation/stack_page/doc/widget/banner.dart b/frontend/app_flowy/lib/workspace/presentation/stack_page/doc/widget/banner.dart index 89cb0e713a..a377bdfba1 100644 --- a/frontend/app_flowy/lib/workspace/presentation/stack_page/doc/widget/banner.dart +++ b/frontend/app_flowy/lib/workspace/presentation/stack_page/doc/widget/banner.dart @@ -16,43 +16,44 @@ class DocBanner extends StatelessWidget { @override Widget build(BuildContext context) { final theme = context.watch<AppTheme>(); - // [[Row]] CrossAxisAlignment vs mainAxisAlignment - // https://stackoverflow.com/questions/53850149/flutter-crossaxisalignment-vs-mainaxisalignment return ConstrainedBox( constraints: const BoxConstraints(minHeight: 60), child: Container( + width: double.infinity, color: theme.main1, - child: Row( - children: [ - FlowyText.medium(LocaleKeys.deletePagePrompt_text.tr(), color: Colors.white), - const HSpace(20), - BaseStyledButton( - minWidth: 160, - minHeight: 40, - contentPadding: EdgeInsets.zero, - bgColor: Colors.transparent, - hoverColor: theme.main2, - downColor: theme.main1, - outlineColor: Colors.white, - borderRadius: Corners.s8Border, - child: FlowyText.medium(LocaleKeys.deletePagePrompt_restore.tr(), color: Colors.white, fontSize: 14), - onPressed: onRestore), - const HSpace(20), - BaseStyledButton( - minWidth: 220, - minHeight: 40, - contentPadding: EdgeInsets.zero, - bgColor: Colors.transparent, - hoverColor: theme.main2, - downColor: theme.main1, - outlineColor: Colors.white, - borderRadius: Corners.s8Border, - child: FlowyText.medium(LocaleKeys.deletePagePrompt_deletePermanent.tr(), - color: Colors.white, fontSize: 14), - onPressed: onDelete), - ], - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, + child: FittedBox( + alignment: Alignment.center, + fit: BoxFit.scaleDown, + child: Row( + children: [ + FlowyText.medium(LocaleKeys.deletePagePrompt_text.tr(), color: Colors.white), + const HSpace(20), + BaseStyledButton( + minWidth: 160, + minHeight: 40, + contentPadding: EdgeInsets.zero, + bgColor: Colors.transparent, + hoverColor: theme.main2, + downColor: theme.main1, + outlineColor: Colors.white, + borderRadius: Corners.s8Border, + child: FlowyText.medium(LocaleKeys.deletePagePrompt_restore.tr(), color: Colors.white, fontSize: 14), + onPressed: onRestore), + const HSpace(20), + BaseStyledButton( + minWidth: 220, + minHeight: 40, + contentPadding: EdgeInsets.zero, + bgColor: Colors.transparent, + hoverColor: theme.main2, + downColor: theme.main1, + outlineColor: Colors.white, + borderRadius: Corners.s8Border, + child: FlowyText.medium(LocaleKeys.deletePagePrompt_deletePermanent.tr(), + color: Colors.white, fontSize: 14), + onPressed: onDelete), + ], + ), ), ), ); From d05e4bbc825c3abff3d730916cd605122153a882 Mon Sep 17 00:00:00 2001 From: Hieu <hieugaomoc@gmail.com> Date: Thu, 24 Feb 2022 12:56:54 +0700 Subject: [PATCH 7/9] chore: ignore `freezed` files --- frontend/app_flowy/.gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/app_flowy/.gitignore b/frontend/app_flowy/.gitignore index 3421d1450b..505fd9136b 100644 --- a/frontend/app_flowy/.gitignore +++ b/frontend/app_flowy/.gitignore @@ -37,6 +37,10 @@ lib/generated_plugin_registrant.dart # Language related generated files lib/generated/ +# Freezed generated files +*.g.dart +*.freezed.dart + # Symbolication related app.*.symbols From 0c9fc35cb3723704b69844147eab6748df59dc5f Mon Sep 17 00:00:00 2001 From: Hieu <hieugaomoc@gmail.com> Date: Thu, 24 Feb 2022 14:40:48 +0700 Subject: [PATCH 8/9] ci: refactor code generation --- .github/workflows/dart_lint.yml | 9 +++-- .github/workflows/dart_test.yml | 7 ++-- frontend/scripts/makefile/flutter.toml | 46 ++++++-------------------- 3 files changed, 18 insertions(+), 44 deletions(-) diff --git a/.github/workflows/dart_lint.yml b/.github/workflows/dart_lint.yml index 56cc033292..2b4a995cce 100644 --- a/.github/workflows/dart_lint.yml +++ b/.github/workflows/dart_lint.yml @@ -29,15 +29,14 @@ jobs: with: channel: "stable" - name: Deps Flutter - run: flutter pub get + run: flutter packages pub get working-directory: frontend/app_flowy - - name: Code Generate + - name: Code Generation working-directory: frontend/app_flowy run: | - flutter pub run easy_localization:generate -S ./assets/translations -f keys -O lib/generated -o locale_keys.g.dart - flutter packages pub get + flutter packages pub run easy_localization:generate -S ./assets/translations -f keys -O lib/generated -o locale_keys.g.dart flutter packages pub run build_runner build --delete-conflicting-outputs - - name: flutter analyze + - name: Run Flutter Analyzer working-directory: frontend/app_flowy run: flutter analyze diff --git a/.github/workflows/dart_test.yml b/.github/workflows/dart_test.yml index 6ce615bedc..4f5ccf06ce 100644 --- a/.github/workflows/dart_test.yml +++ b/.github/workflows/dart_test.yml @@ -29,13 +29,12 @@ jobs: cargo make flowy_dev echo PATH="$PATH":"$HOME/.pub-cache/bin" >> $GITHUB_PATH - name: Deps Flutter - run: flutter pub get + run: flutter packages pub get working-directory: frontend/app_flowy - - name: Code Generate + - name: Code Generation working-directory: frontend/app_flowy run: | - flutter pub run easy_localization:generate -S ./assets/translations -f keys -O lib/generated -o locale_keys.g.dart - flutter packages pub get + flutter packages pub run easy_localization:generate -S ./assets/translations -f keys -O lib/generated -o locale_keys.g.dart flutter packages pub run build_runner build --delete-conflicting-outputs - name: Build FlowySDK working-directory: frontend diff --git a/frontend/scripts/makefile/flutter.toml b/frontend/scripts/makefile/flutter.toml index 753b57132a..8e21a4d85c 100644 --- a/frontend/scripts/makefile/flutter.toml +++ b/frontend/scripts/makefile/flutter.toml @@ -5,16 +5,16 @@ linux_alias = "appflowy-linux" [tasks.appflowy-macos] dependencies = ["flowy-sdk-release"] -run_task = { name = ["generate_language_files", "generate_freezed_files", "flutter-build", "copy-to-product"] } +run_task = { name = ["code_generation", "flutter-build", "copy-to-product"] } script_runner = "@shell" [tasks.appflowy-windows] dependencies = ["flowy-sdk-release"] -run_task = { name = ["generate_language_files", "generate_freezed_files", "flutter-build", "copy-to-product"] } +run_task = { name = ["code_generation", "flutter-build", "copy-to-product"] } [tasks.appflowy-linux] dependencies = ["flowy-sdk-release"] -run_task = { name = ["generate_language_files", "generate_freezed_files", "flutter-build", "copy-to-product", "create-release-archive"] } +run_task = { name = ["code_generation", "flutter-build", "copy-to-product", "create-release-archive"] } script_runner = "@shell" [tasks.appflowy-dev] @@ -24,16 +24,16 @@ linux_alias = "appflowy-linux-dev" [tasks.appflowy-macos-dev] dependencies = ["flowy-sdk-dev"] -run_task = { name = ["generate_language_files", "generate_freezed_files", "flutter-build", "copy-to-product"] } +run_task = { name = ["code_generation", "flutter-build", "copy-to-product"] } script_runner = "@shell" [tasks.appflowy-windows-dev] dependencies = ["flowy-sdk-dev"] -run_task = { name = ["generate_language_files", "generate_freezed_files", "flutter-build", "copy-to-product"] } +run_task = { name = ["code_generation", "flutter-build", "copy-to-product"] } [tasks.appflowy-linux-dev] dependencies = ["flowy-sdk-dev"] -run_task = { name = ["generate_language_files", "generate_freezed_files", "flutter-build", "copy-to-product"] } +run_task = { name = ["code_generation", "flutter-build", "copy-to-product"] } script_runner = "@shell" [tasks.copy-to-product] @@ -156,50 +156,26 @@ script = [ ] script_runner = "@duckscript" -[tasks.generate_language_files] -script_runner = "@shell" -script = [ - """ - cd app_flowy - flutter clean - flutter pub get - flutter pub run easy_localization:generate -S assets/translations/ - flutter pub run easy_localization:generate -f keys -o locale_keys.g.dart -S assets/translations -s en.json - """ -] - - -[tasks.generate_language_files.windows] -script_runner = "@duckscript" -script = [ - """ - cd ./app_flowy/ - exec cmd.exe /c flutter clean - exec cmd.exe /c flutter pub get - exec cmd.exe /c flutter pub run easy_localization:generate -S assets/translations/ - exec cmd.exe /c flutter pub run easy_localization:generate -f keys -o locale_keys.g.dart -S assets/translations - """ -] - -[tasks.generate_freezed_files] +[tasks.code_generation] script_runner = "@shell" script = [ """ cd app_flowy flutter clean flutter packages pub get + flutter packages pub run easy_localization:generate -S assets/translations/ -f keys -o locale_keys.g.dart -S assets/translations -s en.json flutter packages pub run build_runner build --delete-conflicting-outputs """ ] -[tasks.generate_freezed_files.windows] +[tasks.code_generation.windows] script_runner = "@duckscript" script = [ """ cd ./app_flowy/ exec cmd.exe /c flutter clean - exec cmd.exe /c flutter packages pub get - exec cmd.exe /c flutter packages pub get + exec cmd.exe /c flutter pub get + exec cmd.exe /c flutter packages pub run easy_localization:generate -S assets/translations/ -f keys -o locale_keys.g.dart -S assets/translations -s en.json exec cmd.exe /c flutter packages pub run build_runner build --delete-conflicting-outputs """ ] \ No newline at end of file From 4bcc05fc8a7ef151aa1b5278fe03c25d5963b26f Mon Sep 17 00:00:00 2001 From: nathan <app_flowy@nathans-iMac.local> Date: Thu, 24 Feb 2022 16:17:02 +0800 Subject: [PATCH 9/9] chore: add code gen introductions --- frontend/app_flowy/.vscode/launch.json | 16 +++-------- frontend/app_flowy/.vscode/tasks.json | 38 +++++++++++++++++++++++--- 2 files changed, 38 insertions(+), 16 deletions(-) diff --git a/frontend/app_flowy/.vscode/launch.json b/frontend/app_flowy/.vscode/launch.json index 7dae433cf9..b271a1e6a1 100644 --- a/frontend/app_flowy/.vscode/launch.json +++ b/frontend/app_flowy/.vscode/launch.json @@ -10,8 +10,8 @@ "program": "${workspaceRoot}/lib/main.dart", "type": "dart", "preLaunchTask": "build_flowy_sdk", - "env":{ - "RUST_LOG":"debug" + "env": { + "RUST_LOG": "debug" }, "cwd": "${workspaceRoot}" }, @@ -21,8 +21,8 @@ "program": "${workspaceRoot}/lib/main.dart", "type": "dart", "preLaunchTask": "build_flowy_sdk", - "env":{ - "RUST_LOG":"trace" + "env": { + "RUST_LOG": "trace" }, "cwd": "${workspaceRoot}" }, @@ -32,13 +32,5 @@ "type": "dart", "flutterMode": "profile" }, - { - "name": "Generate Language Files", - "request": "launch", - "program": "${workspaceRoot}/lib/main.dart", - "type": "dart", - "preLaunchTask": "Generate Language Files", - "cwd": "${workspaceRoot}" - }, ] } \ No newline at end of file diff --git a/frontend/app_flowy/.vscode/tasks.json b/frontend/app_flowy/.vscode/tasks.json index fcf7a23250..f46aac1085 100644 --- a/frontend/app_flowy/.vscode/tasks.json +++ b/frontend/app_flowy/.vscode/tasks.json @@ -50,6 +50,40 @@ // "$rustc" // ], }, + { + "label": "Code Gen", + "type": "shell", + "dependsOn": [ + "Flutter Pub", + "Flutter Package Get", + "Generate Language Files", + "Generate Freezed Files" + ], + "group": { + "kind": "build", + "isDefault": true, + }, + "dependsOrder": "sequence", + "presentation": { + "reveal": "always", + "panel": "new" + }, + }, + { + "label": "Flutter Pub", + "type": "shell", + "command": "flutter pub get", + }, + { + "label": "Flutter Package Get", + "type": "shell", + "command": "flutter packages pub get", + }, + { + "label": "Generate Freezed Files", + "type": "shell", + "command": "flutter pub run build_runner build --delete-conflicting-outputs", + }, { "label": "Generate Language Files", "type": "shell", @@ -87,10 +121,6 @@ } } }, - "group": { - "kind": "build", - "isDefault": true, - }, "options": { "cwd": "${workspaceFolder}/../" },