ottimo punto sembra funzionare tutto, devo solo aggiungere l'aggiunta di un cliente volante, di un modello volante e gestire i file allegati

This commit is contained in:
2026-04-18 19:03:49 +02:00
parent bbb9729ca4
commit e9f3327f31
16 changed files with 665 additions and 96 deletions

View File

@@ -1,20 +1,20 @@
part of 'services_cubit.dart';
enum ServicesStatus { initial, loading, ready, saving, saved, success, failure }
class ServicesState extends Equatable {
final ServicesStatus status;
final List<ServiceModel> allServices;
final ServiceModel? currentService; // La bozza che stiamo editando
final bool isLoading;
final bool isSaving; // Per mostrare il caricamento solo sul tasto salva
final String? errorMessage;
final String query;
final DateTimeRange? dateRange;
final bool hasReachedMax;
const ServicesState({
required this.status,
this.allServices = const [],
this.currentService,
this.isLoading = false,
this.isSaving = false,
this.errorMessage,
this.query = '',
this.dateRange,
@@ -22,20 +22,18 @@ class ServicesState extends Equatable {
});
ServicesState copyWith({
ServicesStatus? status,
List<ServiceModel>? allServices,
ServiceModel? currentService,
bool? isLoading,
bool? isSaving,
String? errorMessage,
String? query,
DateTimeRange? dateRange,
bool? hasReachedMax,
}) {
return ServicesState(
status: status ?? this.status,
allServices: allServices ?? this.allServices,
currentService: currentService ?? this.currentService,
isLoading: isLoading ?? this.isLoading,
isSaving: isSaving ?? this.isSaving,
errorMessage: errorMessage,
query: query ?? this.query,
dateRange: dateRange ?? this.dateRange,
@@ -45,10 +43,9 @@ class ServicesState extends Equatable {
@override
List<Object?> get props => [
status,
allServices,
currentService,
isLoading,
isSaving,
errorMessage,
query,
dateRange,