customers

This commit is contained in:
2026-04-10 11:34:11 +02:00
parent 810d99626a
commit 5920b4c14f
4 changed files with 29 additions and 3 deletions

View File

@@ -5,7 +5,13 @@ import 'package:flux/core/theme/theme.dart';
class DashboardContent extends StatelessWidget {
final bool isLargeScreen;
const DashboardContent({super.key, this.isLargeScreen = false});
final Function(int)? onTabRequested;
const DashboardContent({
super.key,
this.isLargeScreen = false,
this.onTabRequested,
});
@override
Widget build(BuildContext context) {
@@ -109,7 +115,7 @@ class DashboardContent extends StatelessWidget {
label: 'Clienti',
icon: Icons.people,
color: Colors.orange,
onTap: () {},
onTap: () => onTabRequested?.call(1),
),
_ActionCard(
label: 'Campagne',

View File

@@ -119,7 +119,15 @@ class _HomeScreenState extends State<HomeScreen> {
Widget _buildPageContent(int index, bool isLargeScreen) {
switch (index) {
case 0:
return DashboardContent(isLargeScreen: isLargeScreen);
return DashboardContent(
isLargeScreen: isLargeScreen,
// Questo pezzo DEVE puntare al setState dello State della HomeScreen
onTabRequested: (targetIndex) {
setState(() {
_selectedIndex = targetIndex;
});
},
);
case 1:
return const CustomersContent();
case 2: