2023-07-06 17:18:41 +03:30
|
|
|
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
|
|
|
import 'package:hiddify/domain/profiles/profiles.dart';
|
|
|
|
|
import 'package:hiddify/utils/utils.dart';
|
|
|
|
|
|
|
|
|
|
part 'profile_detail_state.freezed.dart';
|
|
|
|
|
|
|
|
|
|
@freezed
|
|
|
|
|
class ProfileDetailState with _$ProfileDetailState {
|
|
|
|
|
const ProfileDetailState._();
|
|
|
|
|
|
|
|
|
|
const factory ProfileDetailState({
|
|
|
|
|
required Profile profile,
|
|
|
|
|
@Default(false) bool isEditing,
|
|
|
|
|
@Default(false) bool showErrorMessages,
|
|
|
|
|
@Default(MutationState.initial()) MutationState<ProfileFailure> save,
|
2023-09-28 14:03:45 +03:30
|
|
|
@Default(MutationState.initial()) MutationState<ProfileFailure> update,
|
2023-07-06 17:18:41 +03:30
|
|
|
@Default(MutationState.initial()) MutationState<ProfileFailure> delete,
|
|
|
|
|
}) = _ProfileDetailState;
|
|
|
|
|
|
|
|
|
|
bool get isBusy =>
|
2023-09-28 14:03:45 +03:30
|
|
|
save.isInProgress || delete.isInProgress || update.isInProgress;
|
2023-07-06 17:18:41 +03:30
|
|
|
}
|