feat-tickets (#14)
Some checks failed
Deploy to Cloudflare Pages / build-and-deploy (push) Has been cancelled
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>
This commit is contained in:
40
lib/features/tickets/blocs/ticket_form_state.dart
Normal file
40
lib/features/tickets/blocs/ticket_form_state.dart
Normal file
@@ -0,0 +1,40 @@
|
||||
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,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user