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