add transfer all button for admins
All checks were successful
Release / meta (push) Successful in 6s
Release / linux-build (push) Successful in 1m4s
Release / web-build (push) Successful in 2m47s
Release / android-build (push) Successful in 11m45s
Release / release-master (push) Successful in 26s
Release / release-dev (push) Successful in 30s
All checks were successful
Release / meta (push) Successful in 6s
Release / linux-build (push) Successful in 1m4s
Release / web-build (push) Successful in 2m47s
Release / android-build (push) Successful in 11m45s
Release / release-master (push) Successful in 26s
Release / release-dev (push) Successful in 30s
This commit is contained in:
@@ -724,10 +724,12 @@ Future<void> showTractionDetails(
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
FilledButton.icon(
|
||||
onPressed: () {
|
||||
Navigator.of(ctx).pop();
|
||||
final transferLabel = '${loco.locoClass} ${loco.number}'.trim();
|
||||
if (hasMileageOrTrips)
|
||||
FilledButton.icon(
|
||||
onPressed: () {
|
||||
Navigator.of(ctx).pop();
|
||||
final transferLabel =
|
||||
'${loco.locoClass} ${loco.number}'.trim();
|
||||
navContext.push(
|
||||
Uri(
|
||||
path: '/traction',
|
||||
@@ -735,18 +737,20 @@ Future<void> showTractionDetails(
|
||||
'selection': 'single',
|
||||
'transferFromLocoId': loco.id.toString(),
|
||||
'transferFromLabel': transferLabel,
|
||||
'transferAll': '0',
|
||||
},
|
||||
).toString(),
|
||||
extra: {
|
||||
'selection': 'single',
|
||||
'transferFromLocoId': loco.id,
|
||||
'transferFromLabel': transferLabel,
|
||||
'transferAll': false,
|
||||
},
|
||||
);
|
||||
},
|
||||
icon: const Icon(Icons.swap_horiz),
|
||||
label: const Text('Transfer allocations'),
|
||||
),
|
||||
icon: const Icon(Icons.swap_horiz),
|
||||
label: const Text('Transfer allocations'),
|
||||
),
|
||||
if (auth.isElevated || canDeleteAsOwner) ...[
|
||||
const SizedBox(height: 8),
|
||||
ExpansionTile(
|
||||
@@ -757,6 +761,34 @@ Future<void> showTractionDetails(
|
||||
style: Theme.of(context).textTheme.titleSmall,
|
||||
),
|
||||
children: [
|
||||
if (auth.isElevated) ...[
|
||||
FilledButton.tonal(
|
||||
onPressed: () {
|
||||
Navigator.of(ctx).pop();
|
||||
final transferLabel =
|
||||
'${loco.locoClass} ${loco.number}'.trim();
|
||||
navContext.push(
|
||||
Uri(
|
||||
path: '/traction',
|
||||
queryParameters: {
|
||||
'selection': 'single',
|
||||
'transferFromLocoId': loco.id.toString(),
|
||||
'transferFromLabel': transferLabel,
|
||||
'transferAll': 'true',
|
||||
},
|
||||
).toString(),
|
||||
extra: {
|
||||
'selection': 'single',
|
||||
'transferFromLocoId': loco.id,
|
||||
'transferFromLabel': transferLabel,
|
||||
'transferAll': true,
|
||||
},
|
||||
);
|
||||
},
|
||||
child: const Text('Transfer all allocations'),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
],
|
||||
FilledButton.tonal(
|
||||
style: FilledButton.styleFrom(
|
||||
backgroundColor:
|
||||
|
||||
Reference in New Issue
Block a user