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:
@@ -21,6 +21,8 @@ class _ServicesScreenState extends State<ServicesScreen> {
|
||||
super.initState();
|
||||
// Agganciamo il listener per la paginazione (Scroll Infinito)
|
||||
_scrollController.addListener(_onScroll);
|
||||
// Carichiamo i servizi iniziali
|
||||
context.read<ServicesCubit>().loadServices();
|
||||
}
|
||||
|
||||
void _onScroll() {
|
||||
@@ -61,7 +63,8 @@ class _ServicesScreenState extends State<ServicesScreen> {
|
||||
body: BlocBuilder<ServicesCubit, ServicesState>(
|
||||
builder: (context, state) {
|
||||
// 1. Stato di caricamento iniziale
|
||||
if (state.isLoading && state.allServices.isEmpty) {
|
||||
if (state.status == ServicesStatus.loading &&
|
||||
state.allServices.isEmpty) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
}
|
||||
|
||||
@@ -172,7 +175,10 @@ class _ServicesScreenState extends State<ServicesScreen> {
|
||||
],
|
||||
),
|
||||
trailing: const Icon(Icons.chevron_right),
|
||||
onTap: () => context.pushNamed('service-form', extra: service),
|
||||
onTap: () => context.pushNamed(
|
||||
'service-form',
|
||||
queryParameters: {'serviceId': service.id},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user