2023-07-06 17:18:41 +03:30
|
|
|
import 'package:freezed_annotation/freezed_annotation.dart';
|
2026-01-17 13:09:20 +03:00
|
|
|
import 'package:umbrix/core/model/failures.dart';
|
2023-07-06 17:18:41 +03:30
|
|
|
|
|
|
|
|
part 'mutation_state.freezed.dart';
|
|
|
|
|
|
|
|
|
|
// TODO: remove
|
|
|
|
|
@freezed
|
|
|
|
|
class MutationState<F extends Failure> with _$MutationState<F> {
|
|
|
|
|
const MutationState._();
|
|
|
|
|
|
|
|
|
|
const factory MutationState.initial() = MutationInitial<F>;
|
|
|
|
|
const factory MutationState.inProgress() = MutationInProgress<F>;
|
|
|
|
|
const factory MutationState.failure(Failure failure) = MutationFailure<F>;
|
|
|
|
|
const factory MutationState.success() = MutationSuccess<F>;
|
|
|
|
|
|
|
|
|
|
bool get isInProgress => this is MutationInProgress;
|
|
|
|
|
}
|