Quellcode durchsuchen

riadattata la lista ordini

Fabio Dalle Ave vor 2 Monaten
Ursprung
Commit
fb660ab315
1 geänderte Dateien mit 20 neuen und 38 gelöschten Zeilen
  1. 20 38
      lib/ui/pages/orders/order_list_page.dart

+ 20 - 38
lib/ui/pages/orders/order_list_page.dart

@@ -139,8 +139,7 @@ class _OrderListPageState extends ConsumerState<OrderListPage> {
           )
         : null;
 
-    final statsAsync =
-        agente != null ? ref.watch(orderStatsProvider(agente.idAgente)) : null;
+    final statsAsync = agente != null ? ref.watch(orderStatsProvider(agente.idAgente)) : null;
 
     return Scaffold(
       appBar: AppBar(title: const Text('Lista Ordini')),
@@ -192,8 +191,7 @@ class _OrderListPageState extends ConsumerState<OrderListPage> {
                         onDelete: _deleteOrder,
                       );
                     },
-                    loading: () =>
-                        const Center(child: CircularProgressIndicator()),
+                    loading: () => const Center(child: CircularProgressIndicator()),
                     error: (e, _) {
                       return Center(child: Text('Errore: $e'));
                     },
@@ -260,9 +258,7 @@ class _OrderCard extends StatelessWidget {
                     ),
                   ),
                   Text(
-                    order.dataOrdine != null
-                        ? dateFormat.format(DateTime.parse(order.dataOrdine!))
-                        : '',
+                    order.dataOrdine != null ? dateFormat.format(DateTime.parse(order.dataOrdine!)) : '',
                     style: theme.textTheme.bodyMedium?.copyWith(
                       color: cs.onSurfaceVariant,
                     ),
@@ -374,8 +370,8 @@ class _OrderTable extends StatelessWidget {
                             _headerCell(context, 'N. Ordine', flex: 1),
                             _headerCell(context, 'Data', flex: 2),
                             _headerCell(context, 'Cliente', flex: 4),
-                            _headerCell(context, 'Destinazione', flex: 6),
-                            _headerCell(context, 'Totale', flex: 2),
+                            _headerCell(context, 'Destinazione', flex: 5),
+                            _headerCell(context, 'Totale', flex: 3),
                             _headerCell(context, 'Stato', flex: 1),
                             _headerCell(context, 'Azioni', flex: 2),
                           ],
@@ -409,16 +405,12 @@ class _OrderTable extends StatelessWidget {
                                     ? [
                                         _cell(
                                           Column(
-                                            mainAxisAlignment:
-                                                MainAxisAlignment.center,
-                                            crossAxisAlignment:
-                                                CrossAxisAlignment.start,
+                                            mainAxisAlignment: MainAxisAlignment.center,
+                                            crossAxisAlignment: CrossAxisAlignment.start,
                                             children: [
                                               Text(
                                                 '${o.numeroOrdine ?? ''}',
-                                                style: theme
-                                                    .textTheme.bodyMedium
-                                                    ?.copyWith(
+                                                style: theme.textTheme.bodyMedium?.copyWith(
                                                   fontWeight: FontWeight.bold,
                                                   fontFamily: 'monospace',
                                                 ),
@@ -432,8 +424,7 @@ class _OrderTable extends StatelessWidget {
                                                         ),
                                                       )
                                                     : '',
-                                                style: theme.textTheme.bodySmall
-                                                    ?.copyWith(
+                                                style: theme.textTheme.bodySmall?.copyWith(
                                                   color: cs.onSurfaceVariant,
                                                 ),
                                               ),
@@ -443,23 +434,19 @@ class _OrderTable extends StatelessWidget {
                                         ),
                                         _cell(
                                           Column(
-                                            mainAxisAlignment:
-                                                MainAxisAlignment.center,
-                                            crossAxisAlignment:
-                                                CrossAxisAlignment.start,
+                                            mainAxisAlignment: MainAxisAlignment.center,
+                                            crossAxisAlignment: CrossAxisAlignment.start,
                                             children: [
                                               Text(
                                                 '${o.codCliente ?? ''} - ${o.ragioneSociale ?? ''}',
-                                                style:
-                                                    theme.textTheme.bodyMedium,
+                                                style: theme.textTheme.bodyMedium,
                                                 maxLines: 1,
                                                 overflow: TextOverflow.ellipsis,
                                               ),
                                               const SizedBox(height: 4),
                                               Text(
                                                 '${o.filiale ?? ''}${o.indirizzo ?? ''} ${o.citta ?? ''}${o.provincia != null ? ' (${o.provincia})' : ''}',
-                                                style: theme.textTheme.bodySmall
-                                                    ?.copyWith(
+                                                style: theme.textTheme.bodySmall?.copyWith(
                                                   color: cs.onSurfaceVariant,
                                                 ),
                                                 maxLines: 1,
@@ -478,8 +465,7 @@ class _OrderTable extends StatelessWidget {
                                               currencyFormat.format(
                                                 o.totale ?? 0,
                                               ),
-                                              style: theme.textTheme.bodyMedium
-                                                  ?.copyWith(
+                                              style: theme.textTheme.bodyMedium?.copyWith(
                                                 fontWeight: FontWeight.bold,
                                               ),
                                               textAlign: TextAlign.right,
@@ -504,8 +490,7 @@ class _OrderTable extends StatelessWidget {
                                         _cell(
                                           Text(
                                             '${o.numeroOrdine ?? ''}',
-                                            style: theme.textTheme.bodyMedium
-                                                ?.copyWith(
+                                            style: theme.textTheme.bodyMedium?.copyWith(
                                               fontWeight: FontWeight.bold,
                                               fontFamily: 'monospace',
                                             ),
@@ -521,8 +506,7 @@ class _OrderTable extends StatelessWidget {
                                                     ),
                                                   )
                                                 : '',
-                                            style: theme.textTheme.bodyMedium
-                                                ?.copyWith(
+                                            style: theme.textTheme.bodyMedium?.copyWith(
                                               color: cs.onSurfaceVariant,
                                             ),
                                           ),
@@ -540,14 +524,13 @@ class _OrderTable extends StatelessWidget {
                                         _cell(
                                           Text(
                                             '${o.filiale ?? ''}${o.indirizzo ?? ''} ${o.citta ?? ''}${o.provincia != null ? ' (${o.provincia})' : ''}',
-                                            style: theme.textTheme.bodyMedium
-                                                ?.copyWith(
+                                            style: theme.textTheme.bodyMedium?.copyWith(
                                               color: cs.onSurfaceVariant,
                                             ),
                                             maxLines: 2,
                                             overflow: TextOverflow.ellipsis,
                                           ),
-                                          flex: 6,
+                                          flex: 5,
                                         ),
                                         _cell(
                                           Padding(
@@ -558,14 +541,13 @@ class _OrderTable extends StatelessWidget {
                                               currencyFormat.format(
                                                 o.totale ?? 0,
                                               ),
-                                              style: theme.textTheme.bodyMedium
-                                                  ?.copyWith(
+                                              style: theme.textTheme.bodyMedium?.copyWith(
                                                 fontWeight: FontWeight.bold,
                                               ),
                                               textAlign: TextAlign.right,
                                             ),
                                           ),
-                                          flex: 1,
+                                          flex: 2,
                                         ),
                                         _cell(
                                           _StatoPill(stato: o.stato),