add timeline
This commit is contained in:
@@ -574,6 +574,12 @@ class _TractionPageState extends State<TractionPage> {
|
||||
icon: const Icon(Icons.info_outline),
|
||||
label: const Text('Details'),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
TextButton.icon(
|
||||
onPressed: () => _openTimeline(loco),
|
||||
icon: const Icon(Icons.timeline),
|
||||
label: const Text('Timeline'),
|
||||
),
|
||||
const Spacer(),
|
||||
if (widget.selectionMode)
|
||||
TextButton.icon(
|
||||
@@ -692,6 +698,14 @@ class _TractionPageState extends State<TractionPage> {
|
||||
return (background, foreground);
|
||||
}
|
||||
|
||||
void _openTimeline(LocoSummary loco) {
|
||||
final label = '${loco.locoClass} ${loco.number}'.trim();
|
||||
context.push(
|
||||
'/traction/${loco.id}/timeline',
|
||||
extra: {'label': label},
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _showLocoInfo(LocoSummary loco) async {
|
||||
await showModalBottomSheet(
|
||||
context: context,
|
||||
|
||||
Reference in New Issue
Block a user