From bd496ad37fb9d53bb2c20b2dff962eb0a4a6211c Mon Sep 17 00:00:00 2001 From: Mark M2 Macbook Date: Fri, 9 Oct 2026 15:18:23 +0200 Subject: [PATCH] c --- .../dashboard_daily_ricontatti_cubit.dart | 3 +- lib/features/home/ui/home_screen.dart | 32 +++++++++---------- .../staff/data/staff_repository.dart | 24 +++++++------- pubspec.yaml | 2 +- 4 files changed, 32 insertions(+), 29 deletions(-) diff --git a/lib/features/home/dashboard_daily_ricontatti/blocs/dashboard_daily_ricontatti_cubit.dart b/lib/features/home/dashboard_daily_ricontatti/blocs/dashboard_daily_ricontatti_cubit.dart index 658b55f..9709ffd 100644 --- a/lib/features/home/dashboard_daily_ricontatti/blocs/dashboard_daily_ricontatti_cubit.dart +++ b/lib/features/home/dashboard_daily_ricontatti/blocs/dashboard_daily_ricontatti_cubit.dart @@ -218,7 +218,8 @@ class DashboardDailyRicontattiCubit extends Cubit errorMessage: null, ), ); - } catch (e) { + } catch (e, stack) { + debugPrint('Errore in DashboardDailyRicontattiCubit: $e\n$stack'); if (isClosed) return; emit( state.copyWith( diff --git a/lib/features/home/ui/home_screen.dart b/lib/features/home/ui/home_screen.dart index 7b4285a..bd392c1 100644 --- a/lib/features/home/ui/home_screen.dart +++ b/lib/features/home/ui/home_screen.dart @@ -152,7 +152,20 @@ class _HomeScreenState extends State { }, child: CustomScrollView( slivers: [ - // --- HERO TARGET DEL GIORNO (TUTTA LARGHEZZA IN CIMA) --- + // --- 1. QUICK ACTIONS: AZIONI RAPIDE (IN CIMA) --- + SliverToBoxAdapter( + child: Padding( + padding: const EdgeInsets.fromLTRB(24.0, 0, 24.0, 24.0), + child: _buildQuickActions(context), + ), + ), + + // --- 2. HERO FOCUS RICONTATTI DEL GIORNO (VISIBILE AI MANAGER) --- + const SliverToBoxAdapter( + child: DashboardDailyRicontattiCard(), + ), + + // --- 3. HERO TARGET DEL GIORNO --- const SliverToBoxAdapter( child: Padding( padding: EdgeInsets.fromLTRB(24.0, 0, 24.0, 24.0), @@ -160,22 +173,9 @@ class _HomeScreenState extends State { ), ), - // --- HERO FOCUS RICONTATTI DEL GIORNO (SOLO MANAGER) --- - const SliverToBoxAdapter( - child: DashboardDailyRicontattiCard(), - ), + const SliverToBoxAdapter(child: SizedBox(height: 8)), - // --- QUICK ACTIONS: AZIONI RAPIDE --- - SliverToBoxAdapter( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 24.0), - child: _buildQuickActions(context), - ), - ), - - const SliverToBoxAdapter(child: SizedBox(height: 32)), - - // --- I WIDGET DELLA DASHBOARD (Responsive Grid) --- + // --- 4. I WIDGET DELLA DASHBOARD (Responsive Grid) --- SliverPadding( padding: const EdgeInsets.symmetric(horizontal: 24.0), sliver: SliverGrid( diff --git a/lib/features/master_data/staff/data/staff_repository.dart b/lib/features/master_data/staff/data/staff_repository.dart index c3cf571..b6102c9 100644 --- a/lib/features/master_data/staff/data/staff_repository.dart +++ b/lib/features/master_data/staff/data/staff_repository.dart @@ -24,21 +24,23 @@ class StaffRepository { ${Tables.stores}(*) ) ''') - .eq('company_id', companyId); + .eq('company_id', companyId) + .order('name', ascending: true); - if (storeId != null) { - filterBuilder = filterBuilder.or( - 'store_id.eq.$storeId,store_id.is.null', - ); - } + final response = await filterBuilder; - var transformBuilder = filterBuilder.order('name', ascending: true); - - final response = await transformBuilder; - - return (response as List) + final list = (response as List) .map((s) => StaffMemberModel.fromMap(s)) .toList(); + + if (storeId != null) { + return list + .where((s) => + s.assignedStoreIds.isEmpty || s.assignedStoreIds.contains(storeId)) + .toList(); + } + + return list; } on Exception catch (e) { debugPrint('Errore nel recupero della lista di staff: $e'); throw Exception('Errore nel recupero della lista di staff: $e'); diff --git a/pubspec.yaml b/pubspec.yaml index 38ef9f5..24da3a6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: flux description: "Gestione attività negozio di telefonia" publish_to: 'none' -version: 2.0.17+73 +version: 2.1.1+75 environment: sdk: ^3.11.3