reworked operation (#12)

Reviewed-on: #12
Co-authored-by: Mark M2 Macbook <marco@catelli.it>
Co-committed-by: Mark M2 Macbook <marco@catelli.it>
This commit is contained in:
2026-05-04 15:36:42 +02:00
committed by brontomark
parent 9f57207a39
commit 94ad524bae
110 changed files with 5831 additions and 5306 deletions

View File

@@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flux/core/blocs/session/session_cubit.dart';
import 'package:flux/core/theme/theme.dart';
import 'package:flux/core/utils/extensions.dart';
import 'package:flux/features/home/latest_store_operations/ui/latest_store_operations_card.dart';
import 'package:flux/features/home/ui/quick_actions_widget.dart';
import 'package:flux/features/master_data/staff/blocs/staff_cubit.dart';
import 'package:go_router/go_router.dart';
@@ -57,31 +59,27 @@ class HomeScreen extends StatelessWidget {
),
delegate: SliverChildListDelegate([
_buildDashboardWidget(
title: 'Contratti in Scadenza',
title: context.l10n.homeExpiringContracts,
icon: Icons.assignment_late_outlined,
color: Colors.orange,
context: context,
),
_buildDashboardWidget(
title: 'Sticky Notes',
title: context.l10n.commonStickyNotes,
icon: Icons.sticky_note_2_outlined,
color: Colors.yellow.shade700,
context: context,
),
_buildDashboardWidget(
title: 'I miei Task',
title: context.l10n.homeMyTasks,
icon: Icons.check_box_outlined,
color: Colors.green,
context: context,
),
LatestStoreOperationsCard(),
_buildDashboardWidget(
title: 'Ultimi Servizi',
icon: Icons.design_services_outlined,
color: Colors.blue,
context: context,
),
_buildDashboardWidget(
title: 'Ultime Assistenze',
title: context.l10n.homeLatestOperationTickets,
icon: Icons.support_agent_outlined,
color: Colors.purple,
context: context,
@@ -117,7 +115,7 @@ class HomeScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Bentornato, ${user!.name}! 👋",
context.l10n.homeWelcomeBack(user?.name ?? "Utente"),
style: theme.textTheme.headlineMedium?.copyWith(
fontWeight: FontWeight.bold,
letterSpacing: -0.5,
@@ -151,7 +149,7 @@ class HomeScreen extends StatelessWidget {
Icon(Icons.storefront, size: 16, color: context.primary),
const SizedBox(width: 8),
Text(
currentStore?.nome ?? "Nessun negozio",
currentStore?.name ?? context.l10n.homeNoStoreFound,
style: TextStyle(
fontWeight: FontWeight.w600,
color: context.primary,
@@ -183,17 +181,17 @@ class HomeScreen extends StatelessWidget {
children: [
QuickActionButton(
icon: Icons.add,
label: "Servizio",
label: context.l10n.commonOperation,
color: Colors.blue,
onTap: () {
// Entriamo nel form! Nessun parametro extra = Nuovo Servizio
context.push('/service-form');
context.push('/operation-form');
},
),
const SizedBox(width: 12),
QuickActionButton(
icon: Icons.handyman,
label: "Assistenza",
label: context.l10n.homeNewOperationTicket,
color: Colors.redAccent,
onTap: () {
// TODO: Quando avrai la rotta per la nuova assistenza
@@ -203,7 +201,7 @@ class HomeScreen extends StatelessWidget {
const SizedBox(width: 12),
QuickActionButton(
icon: Icons.note_add,
label: "Nota",
label: context.l10n.commonNote,
color: Colors.amber,
onTap: () {
// TODO: Quando faremo il modale/pagina delle note
@@ -212,7 +210,7 @@ class HomeScreen extends StatelessWidget {
const SizedBox(width: 12),
QuickActionButton(
icon: Icons.task_alt,
label: "Task",
label: context.l10n.commonTask,
color: Colors.teal,
onTap: () {
// TODO: Quando faremo i task
@@ -280,7 +278,7 @@ class HomeScreen extends StatelessWidget {
const Spacer(),
Center(
child: Text(
"(Coming Soon)",
context.l10n.commonComingSoon,
style: TextStyle(
color: context.secondaryText.withValues(alpha: 0.7),
fontStyle: FontStyle.italic,
@@ -354,7 +352,7 @@ class HomeScreen extends StatelessWidget {
: theme.iconTheme.color,
),
title: Text(
store.nome,
store.name,
style: TextStyle(
fontWeight: isSelected
? FontWeight.bold