diff --git a/.github/workflows/dart_lint.yml b/.github/workflows/dart_lint.yml index 25c4990cac..2b4a995cce 100644 --- a/.github/workflows/dart_lint.yml +++ b/.github/workflows/dart_lint.yml @@ -29,13 +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 --source-dir ./assets/translations -f keys -O lib/generated -o locale_keys.g.dart - - name: flutter analyze + run: | + 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: 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 6106126cee..4f5ccf06ce 100644 --- a/.github/workflows/dart_test.yml +++ b/.github/workflows/dart_test.yml @@ -29,12 +29,13 @@ 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 --source-dir ./assets/translations -f keys -O lib/generated -o locale_keys.g.dart + run: | + 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 run: | 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 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}/../" }, 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 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 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({ - required TResult Function() signedInWithUserEmailAndPassword, - required TResult Function(String email) emailChanged, - required TResult Function(String password) passwordChanged, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function()? signedInWithUserEmailAndPassword, - TResult Function(String email)? emailChanged, - TResult Function(String password)? passwordChanged, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? signedInWithUserEmailAndPassword, - TResult Function(String email)? emailChanged, - TResult Function(String password)? passwordChanged, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(SignedInWithUserEmailAndPassword value) - signedInWithUserEmailAndPassword, - required TResult Function(EmailChanged value) emailChanged, - required TResult Function(PasswordChanged value) passwordChanged, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult Function(SignedInWithUserEmailAndPassword value)? - signedInWithUserEmailAndPassword, - TResult Function(EmailChanged value)? emailChanged, - TResult Function(PasswordChanged value)? passwordChanged, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - 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({ - required TResult Function() signedInWithUserEmailAndPassword, - required TResult Function(String email) emailChanged, - required TResult Function(String password) passwordChanged, - }) { - return signedInWithUserEmailAndPassword(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function()? signedInWithUserEmailAndPassword, - TResult Function(String email)? emailChanged, - TResult Function(String password)? passwordChanged, - }) { - return signedInWithUserEmailAndPassword?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - 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({ - 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 Function(SignedInWithUserEmailAndPassword value)? - signedInWithUserEmailAndPassword, - TResult Function(EmailChanged value)? emailChanged, - TResult Function(PasswordChanged value)? passwordChanged, - }) { - return signedInWithUserEmailAndPassword?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - 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 get copyWith => - _$EmailChangedCopyWithImpl(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() signedInWithUserEmailAndPassword, - required TResult Function(String email) emailChanged, - required TResult Function(String password) passwordChanged, - }) { - return emailChanged(email); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function()? signedInWithUserEmailAndPassword, - TResult Function(String email)? emailChanged, - TResult Function(String password)? passwordChanged, - }) { - return emailChanged?.call(email); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - 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({ - 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 Function(SignedInWithUserEmailAndPassword value)? - signedInWithUserEmailAndPassword, - TResult Function(EmailChanged value)? emailChanged, - TResult Function(PasswordChanged value)? passwordChanged, - }) { - return emailChanged?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - 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 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 get copyWith => - _$PasswordChangedCopyWithImpl(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() signedInWithUserEmailAndPassword, - required TResult Function(String email) emailChanged, - required TResult Function(String password) passwordChanged, - }) { - return passwordChanged(password); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function()? signedInWithUserEmailAndPassword, - TResult Function(String email)? emailChanged, - TResult Function(String password)? passwordChanged, - }) { - return passwordChanged?.call(password); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - 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({ - 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 Function(SignedInWithUserEmailAndPassword value)? - signedInWithUserEmailAndPassword, - TResult Function(EmailChanged value)? emailChanged, - TResult Function(PasswordChanged value)? passwordChanged, - }) { - return passwordChanged?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - 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 get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -class _$SignInStateTearOff { - const _$SignInStateTearOff(); - - _SignInState call( - {String? email, - String? password, - required bool isSubmitting, - required Option passwordError, - required Option emailError, - required Option> 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 get passwordError => throw _privateConstructorUsedError; - Option get emailError => throw _privateConstructorUsedError; - Option> get successOrFail => - throw _privateConstructorUsedError; - - @JsonKey(ignore: true) - $SignInStateCopyWith 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 passwordError, - Option emailError, - Option> 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, - emailError: emailError == freezed - ? _value.emailError - : emailError // ignore: cast_nullable_to_non_nullable - as Option, - successOrFail: successOrFail == freezed - ? _value.successOrFail - : successOrFail // ignore: cast_nullable_to_non_nullable - as Option>, - )); - } -} - -/// @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 passwordError, - Option emailError, - Option> 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, - emailError: emailError == freezed - ? _value.emailError - : emailError // ignore: cast_nullable_to_non_nullable - as Option, - successOrFail: successOrFail == freezed - ? _value.successOrFail - : successOrFail // ignore: cast_nullable_to_non_nullable - as Option>, - )); - } -} - -/// @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 passwordError; - @override - final Option emailError; - @override - final Option> 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 passwordError, - required Option emailError, - required Option> successOrFail}) = - _$_SignInState; - - @override - String? get email => throw _privateConstructorUsedError; - @override - String? get password => throw _privateConstructorUsedError; - @override - bool get isSubmitting => throw _privateConstructorUsedError; - @override - Option get passwordError => throw _privateConstructorUsedError; - @override - Option get emailError => throw _privateConstructorUsedError; - @override - Option> 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 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({ - 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 Function()? signUpWithUserEmailAndPassword, - TResult Function(String email)? emailChanged, - TResult Function(String password)? passwordChanged, - TResult Function(String password)? repeatPasswordChanged, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - 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({ - 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 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 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({ - 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 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 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({ - 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 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 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 get copyWith => - _$EmailChangedCopyWithImpl(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - 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 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 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({ - 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 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 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 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 get copyWith => - _$PasswordChangedCopyWithImpl(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - 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 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 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({ - 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 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 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 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 get copyWith => - _$RepeatPasswordChangedCopyWithImpl( - this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - 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 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 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({ - 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 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 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 get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -class _$SignUpStateTearOff { - const _$SignUpStateTearOff(); - - _SignUpState call( - {String? email, - String? password, - String? repeatedPassword, - required bool isSubmitting, - required Option passwordError, - required Option repeatPasswordError, - required Option emailError, - required Option> 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 get passwordError => throw _privateConstructorUsedError; - Option get repeatPasswordError => throw _privateConstructorUsedError; - Option get emailError => throw _privateConstructorUsedError; - Option> get successOrFail => - throw _privateConstructorUsedError; - - @JsonKey(ignore: true) - $SignUpStateCopyWith 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 passwordError, - Option repeatPasswordError, - Option emailError, - Option> 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, - repeatPasswordError: repeatPasswordError == freezed - ? _value.repeatPasswordError - : repeatPasswordError // ignore: cast_nullable_to_non_nullable - as Option, - emailError: emailError == freezed - ? _value.emailError - : emailError // ignore: cast_nullable_to_non_nullable - as Option, - successOrFail: successOrFail == freezed - ? _value.successOrFail - : successOrFail // ignore: cast_nullable_to_non_nullable - as Option>, - )); - } -} - -/// @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 passwordError, - Option repeatPasswordError, - Option emailError, - Option> 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, - repeatPasswordError: repeatPasswordError == freezed - ? _value.repeatPasswordError - : repeatPasswordError // ignore: cast_nullable_to_non_nullable - as Option, - emailError: emailError == freezed - ? _value.emailError - : emailError // ignore: cast_nullable_to_non_nullable - as Option, - successOrFail: successOrFail == freezed - ? _value.successOrFail - : successOrFail // ignore: cast_nullable_to_non_nullable - as Option>, - )); - } -} - -/// @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 passwordError; - @override - final Option repeatPasswordError; - @override - final Option emailError; - @override - final Option> 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 passwordError, - required Option repeatPasswordError, - required Option emailError, - required Option> 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 get passwordError => throw _privateConstructorUsedError; - @override - Option get repeatPasswordError => throw _privateConstructorUsedError; - @override - Option get emailError => throw _privateConstructorUsedError; - @override - Option> 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 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({ - required TResult Function() getUser, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function()? getUser, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? getUser, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(_GetUser value) getUser, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult Function(_GetUser value)? getUser, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - 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({ - required TResult Function() getUser, - }) { - return getUser(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function()? getUser, - }) { - return getUser?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? getUser, - required TResult orElse(), - }) { - if (getUser != null) { - return getUser(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_GetUser value) getUser, - }) { - return getUser(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult Function(_GetUser value)? getUser, - }) { - return getUser?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - 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 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 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({ - required TResult Function(UserProfile userProfile) authenticated, - required TResult Function(FlowyError error) unauthenticated, - required TResult Function() initial, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function(UserProfile userProfile)? authenticated, - TResult Function(FlowyError error)? unauthenticated, - TResult Function()? initial, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(UserProfile userProfile)? authenticated, - TResult Function(FlowyError error)? unauthenticated, - TResult Function()? initial, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(Authenticated value) authenticated, - required TResult Function(Unauthenticated value) unauthenticated, - required TResult Function(_Initial value) initial, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult Function(Authenticated value)? authenticated, - TResult Function(Unauthenticated value)? unauthenticated, - TResult Function(_Initial value)? initial, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - 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 get copyWith => - _$AuthenticatedCopyWithImpl(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(UserProfile userProfile) authenticated, - required TResult Function(FlowyError error) unauthenticated, - required TResult Function() initial, - }) { - return authenticated(userProfile); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function(UserProfile userProfile)? authenticated, - TResult Function(FlowyError error)? unauthenticated, - TResult Function()? initial, - }) { - return authenticated?.call(userProfile); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - 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({ - 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 Function(Authenticated value)? authenticated, - TResult Function(Unauthenticated value)? unauthenticated, - TResult Function(_Initial value)? initial, - }) { - return authenticated?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - 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 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 get copyWith => - _$UnauthenticatedCopyWithImpl(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(UserProfile userProfile) authenticated, - required TResult Function(FlowyError error) unauthenticated, - required TResult Function() initial, - }) { - return unauthenticated(error); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function(UserProfile userProfile)? authenticated, - TResult Function(FlowyError error)? unauthenticated, - TResult Function()? initial, - }) { - return unauthenticated?.call(error); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - 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({ - 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 Function(Authenticated value)? authenticated, - TResult Function(Unauthenticated value)? unauthenticated, - TResult Function(_Initial value)? initial, - }) { - return unauthenticated?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - 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 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({ - required TResult Function(UserProfile userProfile) authenticated, - required TResult Function(FlowyError error) unauthenticated, - required TResult Function() initial, - }) { - return initial(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function(UserProfile userProfile)? authenticated, - TResult Function(FlowyError error)? unauthenticated, - TResult Function()? initial, - }) { - return initial?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - 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({ - 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 Function(Authenticated value)? authenticated, - TResult Function(Unauthenticated value)? unauthenticated, - TResult Function(_Initial value)? initial, - }) { - return initial?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - 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 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 views) { - return ReceiveViews( - views, - ); - } - - AppDidUpdate appDidUpdate(App app) { - return AppDidUpdate( - app, - ); - } -} - -/// @nodoc -const $AppEvent = _$AppEventTearOff(); - -/// @nodoc -mixin _$AppEvent { - @optionalTypeArgs - TResult when({ - 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 views) didReceiveViews, - required TResult Function(App app) appDidUpdate, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function()? initial, - TResult Function(String name, String desc, ViewType viewType)? createView, - TResult Function()? delete, - TResult Function(String newName)? rename, - TResult Function(List views)? didReceiveViews, - TResult Function(App app)? appDidUpdate, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? initial, - TResult Function(String name, String desc, ViewType viewType)? createView, - TResult Function()? delete, - TResult Function(String newName)? rename, - TResult Function(List views)? didReceiveViews, - TResult Function(App app)? appDidUpdate, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - 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 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 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({ - 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 views) didReceiveViews, - required TResult Function(App app) appDidUpdate, - }) { - return initial(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function()? initial, - TResult Function(String name, String desc, ViewType viewType)? createView, - TResult Function()? delete, - TResult Function(String newName)? rename, - TResult Function(List views)? didReceiveViews, - TResult Function(App app)? appDidUpdate, - }) { - return initial?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? initial, - TResult Function(String name, String desc, ViewType viewType)? createView, - TResult Function()? delete, - TResult Function(String newName)? rename, - TResult Function(List views)? didReceiveViews, - TResult Function(App app)? appDidUpdate, - required TResult orElse(), - }) { - if (initial != null) { - return initial(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - 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 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 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 get copyWith => - _$CreateViewCopyWithImpl(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - 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 views) didReceiveViews, - required TResult Function(App app) appDidUpdate, - }) { - return createView(name, desc, viewType); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function()? initial, - TResult Function(String name, String desc, ViewType viewType)? createView, - TResult Function()? delete, - TResult Function(String newName)? rename, - TResult Function(List views)? didReceiveViews, - TResult Function(App app)? appDidUpdate, - }) { - return createView?.call(name, desc, viewType); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? initial, - TResult Function(String name, String desc, ViewType viewType)? createView, - TResult Function()? delete, - TResult Function(String newName)? rename, - TResult Function(List views)? didReceiveViews, - TResult Function(App app)? appDidUpdate, - required TResult orElse(), - }) { - if (createView != null) { - return createView(name, desc, viewType); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - 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 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 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 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({ - 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 views) didReceiveViews, - required TResult Function(App app) appDidUpdate, - }) { - return delete(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function()? initial, - TResult Function(String name, String desc, ViewType viewType)? createView, - TResult Function()? delete, - TResult Function(String newName)? rename, - TResult Function(List views)? didReceiveViews, - TResult Function(App app)? appDidUpdate, - }) { - return delete?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? initial, - TResult Function(String name, String desc, ViewType viewType)? createView, - TResult Function()? delete, - TResult Function(String newName)? rename, - TResult Function(List views)? didReceiveViews, - TResult Function(App app)? appDidUpdate, - required TResult orElse(), - }) { - if (delete != null) { - return delete(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - 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 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 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 get copyWith => - _$RenameCopyWithImpl(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - 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 views) didReceiveViews, - required TResult Function(App app) appDidUpdate, - }) { - return rename(newName); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function()? initial, - TResult Function(String name, String desc, ViewType viewType)? createView, - TResult Function()? delete, - TResult Function(String newName)? rename, - TResult Function(List views)? didReceiveViews, - TResult Function(App app)? appDidUpdate, - }) { - return rename?.call(newName); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? initial, - TResult Function(String name, String desc, ViewType viewType)? createView, - TResult Function()? delete, - TResult Function(String newName)? rename, - TResult Function(List views)? didReceiveViews, - TResult Function(App app)? appDidUpdate, - required TResult orElse(), - }) { - if (rename != null) { - return rename(newName); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - 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 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 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 get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $ReceiveViewsCopyWith<$Res> { - factory $ReceiveViewsCopyWith( - ReceiveViews value, $Res Function(ReceiveViews) then) = - _$ReceiveViewsCopyWithImpl<$Res>; - $Res call({List 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, - )); - } -} - -/// @nodoc - -class _$ReceiveViews implements ReceiveViews { - const _$ReceiveViews(this.views); - - @override - final List 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 get copyWith => - _$ReceiveViewsCopyWithImpl(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - 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 views) didReceiveViews, - required TResult Function(App app) appDidUpdate, - }) { - return didReceiveViews(views); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function()? initial, - TResult Function(String name, String desc, ViewType viewType)? createView, - TResult Function()? delete, - TResult Function(String newName)? rename, - TResult Function(List views)? didReceiveViews, - TResult Function(App app)? appDidUpdate, - }) { - return didReceiveViews?.call(views); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? initial, - TResult Function(String name, String desc, ViewType viewType)? createView, - TResult Function()? delete, - TResult Function(String newName)? rename, - TResult Function(List views)? didReceiveViews, - TResult Function(App app)? appDidUpdate, - required TResult orElse(), - }) { - if (didReceiveViews != null) { - return didReceiveViews(views); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - 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 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 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 views) = _$ReceiveViews; - - List get views => throw _privateConstructorUsedError; - @JsonKey(ignore: true) - $ReceiveViewsCopyWith 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 get copyWith => - _$AppDidUpdateCopyWithImpl(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - 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 views) didReceiveViews, - required TResult Function(App app) appDidUpdate, - }) { - return appDidUpdate(app); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function()? initial, - TResult Function(String name, String desc, ViewType viewType)? createView, - TResult Function()? delete, - TResult Function(String newName)? rename, - TResult Function(List views)? didReceiveViews, - TResult Function(App app)? appDidUpdate, - }) { - return appDidUpdate?.call(app); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? initial, - TResult Function(String name, String desc, ViewType viewType)? createView, - TResult Function()? delete, - TResult Function(String newName)? rename, - TResult Function(List views)? didReceiveViews, - TResult Function(App app)? appDidUpdate, - required TResult orElse(), - }) { - if (appDidUpdate != null) { - return appDidUpdate(app); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - 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 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 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 get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -class _$AppStateTearOff { - const _$AppStateTearOff(); - - _AppState call( - {required App app, - required bool isLoading, - required List? views, - View? latestCreatedView, - required Either 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? get views => throw _privateConstructorUsedError; - View? get latestCreatedView => throw _privateConstructorUsedError; - Either get successOrFailure => - throw _privateConstructorUsedError; - - @JsonKey(ignore: true) - $AppStateCopyWith 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? views, - View? latestCreatedView, - Either 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?, - 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, - )); - } -} - -/// @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? views, - View? latestCreatedView, - Either 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?, - 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, - )); - } -} - -/// @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? views; - @override - final View? latestCreatedView; - @override - final Either 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? views, - View? latestCreatedView, - required Either successOrFailure}) = _$_AppState; - - @override - App get app => throw _privateConstructorUsedError; - @override - bool get isLoading => throw _privateConstructorUsedError; - @override - List? get views => throw _privateConstructorUsedError; - @override - View? get latestCreatedView => throw _privateConstructorUsedError; - @override - Either get successOrFailure => - throw _privateConstructorUsedError; - @override - @JsonKey(ignore: true) - _$AppStateCopyWith<_AppState> 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 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({ - required TResult Function() shareMarkdown, - required TResult Function() shareText, - required TResult Function() shareLink, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function()? shareMarkdown, - TResult Function()? shareText, - TResult Function()? shareLink, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? shareMarkdown, - TResult Function()? shareText, - TResult Function()? shareLink, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(ShareMarkdown value) shareMarkdown, - required TResult Function(ShareText value) shareText, - required TResult Function(ShareLink value) shareLink, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult Function(ShareMarkdown value)? shareMarkdown, - TResult Function(ShareText value)? shareText, - TResult Function(ShareLink value)? shareLink, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - 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({ - required TResult Function() shareMarkdown, - required TResult Function() shareText, - required TResult Function() shareLink, - }) { - return shareMarkdown(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function()? shareMarkdown, - TResult Function()? shareText, - TResult Function()? shareLink, - }) { - return shareMarkdown?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? shareMarkdown, - TResult Function()? shareText, - TResult Function()? shareLink, - required TResult orElse(), - }) { - if (shareMarkdown != null) { - return shareMarkdown(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - 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 Function(ShareMarkdown value)? shareMarkdown, - TResult Function(ShareText value)? shareText, - TResult Function(ShareLink value)? shareLink, - }) { - return shareMarkdown?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - 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({ - required TResult Function() shareMarkdown, - required TResult Function() shareText, - required TResult Function() shareLink, - }) { - return shareText(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function()? shareMarkdown, - TResult Function()? shareText, - TResult Function()? shareLink, - }) { - return shareText?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? shareMarkdown, - TResult Function()? shareText, - TResult Function()? shareLink, - required TResult orElse(), - }) { - if (shareText != null) { - return shareText(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - 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 Function(ShareMarkdown value)? shareMarkdown, - TResult Function(ShareText value)? shareText, - TResult Function(ShareLink value)? shareLink, - }) { - return shareText?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - 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({ - required TResult Function() shareMarkdown, - required TResult Function() shareText, - required TResult Function() shareLink, - }) { - return shareLink(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function()? shareMarkdown, - TResult Function()? shareText, - TResult Function()? shareLink, - }) { - return shareLink?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? shareMarkdown, - TResult Function()? shareText, - TResult Function()? shareLink, - required TResult orElse(), - }) { - if (shareLink != null) { - return shareLink(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - 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 Function(ShareMarkdown value)? shareMarkdown, - TResult Function(ShareText value)? shareText, - TResult Function(ShareLink value)? shareLink, - }) { - return shareLink?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - 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 successOrFail) { - return _Finish( - successOrFail, - ); - } -} - -/// @nodoc -const $DocShareState = _$DocShareStateTearOff(); - -/// @nodoc -mixin _$DocShareState { - @optionalTypeArgs - TResult when({ - required TResult Function() initial, - required TResult Function() loading, - required TResult Function(Either successOrFail) - finish, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function()? initial, - TResult Function()? loading, - TResult Function(Either successOrFail)? finish, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? initial, - TResult Function()? loading, - TResult Function(Either successOrFail)? finish, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(_Initial value) initial, - required TResult Function(_Loading value) loading, - required TResult Function(_Finish value) finish, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult Function(_Initial value)? initial, - TResult Function(_Loading value)? loading, - TResult Function(_Finish value)? finish, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - 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({ - required TResult Function() initial, - required TResult Function() loading, - required TResult Function(Either successOrFail) - finish, - }) { - return initial(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function()? initial, - TResult Function()? loading, - TResult Function(Either successOrFail)? finish, - }) { - return initial?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? initial, - TResult Function()? loading, - TResult Function(Either successOrFail)? finish, - required TResult orElse(), - }) { - if (initial != null) { - return initial(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - 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 Function(_Initial value)? initial, - TResult Function(_Loading value)? loading, - TResult Function(_Finish value)? finish, - }) { - return initial?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - 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({ - required TResult Function() initial, - required TResult Function() loading, - required TResult Function(Either successOrFail) - finish, - }) { - return loading(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function()? initial, - TResult Function()? loading, - TResult Function(Either successOrFail)? finish, - }) { - return loading?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? initial, - TResult Function()? loading, - TResult Function(Either successOrFail)? finish, - required TResult orElse(), - }) { - if (loading != null) { - return loading(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - 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 Function(_Initial value)? initial, - TResult Function(_Loading value)? loading, - TResult Function(_Finish value)? finish, - }) { - return loading?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - 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 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, - )); - } -} - -/// @nodoc - -class _$_Finish implements _Finish { - const _$_Finish(this.successOrFail); - - @override - final Either 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({ - required TResult Function() initial, - required TResult Function() loading, - required TResult Function(Either successOrFail) - finish, - }) { - return finish(successOrFail); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function()? initial, - TResult Function()? loading, - TResult Function(Either successOrFail)? finish, - }) { - return finish?.call(successOrFail); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? initial, - TResult Function()? loading, - TResult Function(Either successOrFail)? finish, - required TResult orElse(), - }) { - if (finish != null) { - return finish(successOrFail); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - 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 Function(_Initial value)? initial, - TResult Function(_Loading value)? loading, - TResult Function(_Finish value)? finish, - }) { - return finish?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - 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 successOrFail) = - _$_Finish; - - Either 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 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({ - required TResult Function(EditPannelContext context) startEdit, - required TResult Function(EditPannelContext context) endEdit, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function(EditPannelContext context)? startEdit, - TResult Function(EditPannelContext context)? endEdit, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(EditPannelContext context)? startEdit, - TResult Function(EditPannelContext context)? endEdit, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(_StartEdit value) startEdit, - required TResult Function(_EndEdit value) endEdit, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult Function(_StartEdit value)? startEdit, - TResult Function(_EndEdit value)? endEdit, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_StartEdit value)? startEdit, - TResult Function(_EndEdit value)? endEdit, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - - @JsonKey(ignore: true) - $EditPannelEventCopyWith 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({ - required TResult Function(EditPannelContext context) startEdit, - required TResult Function(EditPannelContext context) endEdit, - }) { - return startEdit(context); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function(EditPannelContext context)? startEdit, - TResult Function(EditPannelContext context)? endEdit, - }) { - return startEdit?.call(context); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - 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({ - required TResult Function(_StartEdit value) startEdit, - required TResult Function(_EndEdit value) endEdit, - }) { - return startEdit(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult Function(_StartEdit value)? startEdit, - TResult Function(_EndEdit value)? endEdit, - }) { - return startEdit?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - 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({ - required TResult Function(EditPannelContext context) startEdit, - required TResult Function(EditPannelContext context) endEdit, - }) { - return endEdit(context); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function(EditPannelContext context)? startEdit, - TResult Function(EditPannelContext context)? endEdit, - }) { - return endEdit?.call(context); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - 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({ - required TResult Function(_StartEdit value) startEdit, - required TResult Function(_EndEdit value) endEdit, - }) { - return endEdit(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult Function(_StartEdit value)? startEdit, - TResult Function(_EndEdit value)? endEdit, - }) { - return endEdit?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - 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 editContext}) { - return _EditPannelState( - isEditing: isEditing, - editContext: editContext, - ); - } -} - -/// @nodoc -const $EditPannelState = _$EditPannelStateTearOff(); - -/// @nodoc -mixin _$EditPannelState { - bool get isEditing => throw _privateConstructorUsedError; - Option get editContext => - throw _privateConstructorUsedError; - - @JsonKey(ignore: true) - $EditPannelStateCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $EditPannelStateCopyWith<$Res> { - factory $EditPannelStateCopyWith( - EditPannelState value, $Res Function(EditPannelState) then) = - _$EditPannelStateCopyWithImpl<$Res>; - $Res call({bool isEditing, Option 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, - )); - } -} - -/// @nodoc -abstract class _$EditPannelStateCopyWith<$Res> - implements $EditPannelStateCopyWith<$Res> { - factory _$EditPannelStateCopyWith( - _EditPannelState value, $Res Function(_EditPannelState) then) = - __$EditPannelStateCopyWithImpl<$Res>; - @override - $Res call({bool isEditing, Option 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, - )); - } -} - -/// @nodoc - -class _$_EditPannelState implements _EditPannelState { - const _$_EditPannelState( - {required this.isEditing, required this.editContext}); - - @override - final bool isEditing; - @override - final Option 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 editContext}) = _$_EditPannelState; - - @override - bool get isEditing => throw _privateConstructorUsedError; - @override - Option 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 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({ - 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 Function(bool isLoading)? showLoading, - TResult Function(bool forceCollapse)? forceCollapse, - TResult Function(EditPannelContext editContext)? setEditPannel, - TResult Function()? dismissEditPannel, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - 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({ - 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 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 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({ - 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 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 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({ - 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 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 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({ - 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 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 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({ - 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 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 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({ - 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 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 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({ - 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 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 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({ - 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 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 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({ - 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 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 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 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 get editContext => - throw _privateConstructorUsedError; - - @JsonKey(ignore: true) - $HomeStateCopyWith 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 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, - )); - } -} - -/// @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 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, - )); - } -} - -/// @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 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 editContext}) = _$_HomeState; - - @override - bool get isLoading => throw _privateConstructorUsedError; - @override - bool get forceCollapse => throw _privateConstructorUsedError; - @override - Option 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 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({ - required TResult Function() started, - required TResult Function() stop, - required TResult Function(String msg) unauthorized, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function()? started, - TResult Function()? stop, - TResult Function(String msg)? unauthorized, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? started, - TResult Function()? stop, - TResult Function(String msg)? unauthorized, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(_Started value) started, - required TResult Function(_Stop value) stop, - required TResult Function(_Unauthorized value) unauthorized, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult Function(_Started value)? started, - TResult Function(_Stop value)? stop, - TResult Function(_Unauthorized value)? unauthorized, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - 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({ - required TResult Function() started, - required TResult Function() stop, - required TResult Function(String msg) unauthorized, - }) { - return started(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function()? started, - TResult Function()? stop, - TResult Function(String msg)? unauthorized, - }) { - return started?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - 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({ - 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 Function(_Started value)? started, - TResult Function(_Stop value)? stop, - TResult Function(_Unauthorized value)? unauthorized, - }) { - return started?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - 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({ - required TResult Function() started, - required TResult Function() stop, - required TResult Function(String msg) unauthorized, - }) { - return stop(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function()? started, - TResult Function()? stop, - TResult Function(String msg)? unauthorized, - }) { - return stop?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - 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({ - 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 Function(_Started value)? started, - TResult Function(_Stop value)? stop, - TResult Function(_Unauthorized value)? unauthorized, - }) { - return stop?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - 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({ - required TResult Function() started, - required TResult Function() stop, - required TResult Function(String msg) unauthorized, - }) { - return unauthorized(msg); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function()? started, - TResult Function()? stop, - TResult Function(String msg)? unauthorized, - }) { - return unauthorized?.call(msg); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - 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({ - 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 Function(_Started value)? started, - TResult Function(_Stop value)? stop, - TResult Function(_Unauthorized value)? unauthorized, - }) { - return unauthorized?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - 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({ - required TResult Function() loading, - required TResult Function(String msg) unauthorized, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function()? loading, - TResult Function(String msg)? unauthorized, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? loading, - TResult Function(String msg)? unauthorized, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(Loading value) loading, - required TResult Function(Unauthorized value) unauthorized, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult Function(Loading value)? loading, - TResult Function(Unauthorized value)? unauthorized, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - 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({ - required TResult Function() loading, - required TResult Function(String msg) unauthorized, - }) { - return loading(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function()? loading, - TResult Function(String msg)? unauthorized, - }) { - return loading?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? loading, - TResult Function(String msg)? unauthorized, - required TResult orElse(), - }) { - if (loading != null) { - return loading(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(Loading value) loading, - required TResult Function(Unauthorized value) unauthorized, - }) { - return loading(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult Function(Loading value)? loading, - TResult Function(Unauthorized value)? unauthorized, - }) { - return loading?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - 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 get copyWith => - _$UnauthorizedCopyWithImpl(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() loading, - required TResult Function(String msg) unauthorized, - }) { - return unauthorized(msg); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function()? loading, - TResult Function(String msg)? unauthorized, - }) { - return unauthorized?.call(msg); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? loading, - TResult Function(String msg)? unauthorized, - required TResult orElse(), - }) { - if (unauthorized != null) { - return unauthorized(msg); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(Loading value) loading, - required TResult Function(Unauthorized value) unauthorized, - }) { - return unauthorized(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult Function(Loading value)? loading, - TResult Function(Unauthorized value)? unauthorized, - }) { - return unauthorized?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - 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 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 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({ - required TResult Function() initial, - required TResult Function() fetchWorkspaces, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function()? initial, - TResult Function()? fetchWorkspaces, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? initial, - TResult Function()? fetchWorkspaces, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(_Initial value) initial, - required TResult Function(_FetchWorkspaces value) fetchWorkspaces, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult Function(_Initial value)? initial, - TResult Function(_FetchWorkspaces value)? fetchWorkspaces, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - 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({ - required TResult Function() initial, - required TResult Function() fetchWorkspaces, - }) { - return initial(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function()? initial, - TResult Function()? fetchWorkspaces, - }) { - return initial?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? initial, - TResult Function()? fetchWorkspaces, - required TResult orElse(), - }) { - if (initial != null) { - return initial(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_Initial value) initial, - required TResult Function(_FetchWorkspaces value) fetchWorkspaces, - }) { - return initial(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult Function(_Initial value)? initial, - TResult Function(_FetchWorkspaces value)? fetchWorkspaces, - }) { - return initial?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - 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({ - required TResult Function() initial, - required TResult Function() fetchWorkspaces, - }) { - return fetchWorkspaces(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult Function()? initial, - TResult Function()? fetchWorkspaces, - }) { - return fetchWorkspaces?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? initial, - TResult Function()? fetchWorkspaces, - required TResult orElse(), - }) { - if (fetchWorkspaces != null) { - return fetchWorkspaces(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_Initial value) initial, - required TResult Function(_FetchWorkspaces value) fetchWorkspaces, - }) { - return fetchWorkspaces(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult Function(_Initial value)? initial, - TResult Function(_FetchWorkspaces value)? fetchWorkspaces, - }) { - return fetchWorkspaces?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - 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> workspaces, - required Either successOrFailure}) { - return _MenuUserState( - user: user, - workspaces: workspaces, - successOrFailure: successOrFailure, - ); - } -} - -/// @nodoc -const $MenuUserState = _$MenuUserStateTearOff(); - -/// @nodoc -mixin _$MenuUserState { - UserProfile get user => throw _privateConstructorUsedError; - Option> get workspaces => throw _privateConstructorUsedError; - Either get successOrFailure => - throw _privateConstructorUsedError; - - @JsonKey(ignore: true) - $MenuUserStateCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $MenuUserStateCopyWith<$Res> { - factory $MenuUserStateCopyWith( - MenuUserState value, $Res Function(MenuUserState) then) = - _$MenuUserStateCopyWithImpl<$Res>; - $Res call( - {UserProfile user, - Option> workspaces, - Either 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>, - successOrFailure: successOrFailure == freezed - ? _value.successOrFailure - : successOrFailure // ignore: cast_nullable_to_non_nullable - as Either, - )); - } -} - -/// @nodoc -abstract class _$MenuUserStateCopyWith<$Res> - implements $MenuUserStateCopyWith<$Res> { - factory _$MenuUserStateCopyWith( - _MenuUserState value, $Res Function(_MenuUserState) then) = - __$MenuUserStateCopyWithImpl<$Res>; - @override - $Res call( - {UserProfile user, - Option> workspaces, - Either 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>, - successOrFailure: successOrFailure == freezed - ? _value.successOrFailure - : successOrFailure // ignore: cast_nullable_to_non_nullable - as Either, - )); - } -} - -/// @nodoc - -class _$_MenuUserState implements _MenuUserState { - const _$_MenuUserState( - {required this.user, - required this.workspaces, - required this.successOrFailure}); - - @override - final UserProfile user; - @override - final Option> workspaces; - @override - final Either 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> workspaces, - required Either successOrFailure}) = _$_MenuUserState; - - @override - UserProfile get user => throw _privateConstructorUsedError; - @override - Option> get workspaces => throw _privateConstructorUsedError; - @override - Either get successOrFailure => - throw _privateConstructorUsedError; - @override - @JsonKey(ignore: true) - _$MenuUserStateCopyWith<_MenuUserState> get copyWith => - throw _privateConstructorUsedError; -} 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 27e44f85fc..52c422b64c 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 DocumentBanner extends StatelessWidget { @override Widget build(BuildContext context) { final theme = context.watch(); - // [[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), + ], + ), ), ), ); diff --git a/frontend/scripts/makefile/flutter.toml b/frontend/scripts/makefile/flutter.toml index b1cda1d69f..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", "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", "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", "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", "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", "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", "flutter-build", "copy-to-product"] } +run_task = { name = ["code_generation", "flutter-build", "copy-to-product"] } script_runner = "@shell" [tasks.copy-to-product] @@ -156,45 +156,26 @@ 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] +[tasks.code_generation] 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 + 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_language_files.windows] +[tasks.code_generation.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 + 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