Improve entries page and latest changes panel, units on events and timeline
All checks were successful
Release / meta (push) Successful in 9s
Release / linux-build (push) Successful in 8m3s
Release / android-build (push) Successful in 19m21s
Release / release-master (push) Successful in 40s
Release / release-dev (push) Successful in 42s

This commit is contained in:
2025-12-23 17:41:21 +00:00
parent 29959f7580
commit 44d79e7c28
16 changed files with 1764 additions and 498 deletions

View File

@@ -128,7 +128,9 @@ extension _NewEntrySubmitLogic on _NewEntryPageState {
);
_lastSubmittedSnapshot = snapshot;
_activeDraftId = null;
} catch (e) {
} catch (e, st) {
debugPrint('Leg submit/update failed: $e');
debugPrintStack(stackTrace: st);
if (!mounted) return;
messenger?.showSnackBar(
SnackBar(content: Text('Failed to submit: $e')),

View File

@@ -73,6 +73,8 @@ extension _NewEntryTractionLogic on _NewEntryPageState {
for (var i = 0; i < _tractionItems.length; i++) {
final item = _tractionItems[i];
if (item.isMarker || item.loco == null) continue;
final locoId = item.loco!.id;
if (locoId == 0) continue;
int allocPos;
if (i > markerIndex) {
allocPos = -(i - markerIndex);
@@ -80,8 +82,7 @@ extension _NewEntryTractionLogic on _NewEntryPageState {
allocPos = (markerIndex - 1) - i;
}
payload.add({
"loco_type": item.loco!.type,
"loco_number": item.loco!.number,
"loco_id": locoId,
"alloc_pos": allocPos,
"alloc_powering": item.powering ? 1 : 0,
});