Some checks failed
Deploy to Cloudflare Pages / build-and-deploy (push) Has been cancelled
Reviewed-on: #14 Co-authored-by: mark-cachy <marco@catelli.it> Co-committed-by: mark-cachy <marco@catelli.it>
41 lines
861 B
Dart
41 lines
861 B
Dart
import 'package:equatable/equatable.dart';
|
|
import 'package:flux/features/tickets/models/ticket_model.dart';
|
|
// Adatta gli import al tuo progetto!
|
|
|
|
enum TicketFormStatus {
|
|
initial,
|
|
ready,
|
|
loading,
|
|
saving,
|
|
success,
|
|
successAndAddAnother,
|
|
failure,
|
|
}
|
|
|
|
class TicketFormState extends Equatable {
|
|
final TicketModel ticket;
|
|
final TicketFormStatus status;
|
|
final String? errorMessage;
|
|
|
|
const TicketFormState({
|
|
required this.ticket,
|
|
this.status = TicketFormStatus.initial,
|
|
this.errorMessage,
|
|
});
|
|
|
|
@override
|
|
List<Object?> get props => [ticket, status, errorMessage];
|
|
|
|
TicketFormState copyWith({
|
|
TicketModel? ticket,
|
|
TicketFormStatus? status,
|
|
String? errorMessage,
|
|
}) {
|
|
return TicketFormState(
|
|
ticket: ticket ?? this.ticket,
|
|
status: status ?? this.status,
|
|
errorMessage: errorMessage,
|
|
);
|
|
}
|
|
}
|