From dfe17a6b8bd6b72bccbcb09d7a3c1f6898497cc2 Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Mon, 17 Aug 2026 11:11:04 +0200 Subject: [PATCH] billsplit: fix the two CI gates that were already red on main flutter analyze --fatal-infos exited 1 at 6713ef3 with four unnecessary_unawaited issues in lib/ui/home_screen.dart: Flutter now annotates Navigator.push with @awaitNotRequired, which makes the unawaited() wrappers redundant. Removed all four wrappers and the dart:async import they were the only user of. dart format --set-exit-if-changed was separately red on three test files left unformatted by 917b8fb. One trailing blank line each. Both are steps in .github/workflows/billsplit-ci.yml, so billsplit CI was failing on main for reasons unrelated to any current work. Fixing them first means the platform-directory deletion that follows can be verified green-to-green. flutter test: 60 passing before and after - the unchanged count is what proves the unawaited() removals did not shift navigation timing. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_011w2Pj4Ek3ZNMQVYcFHgXDY --- billsplit/lib/ui/home_screen.dart | 35 ++++++++++---------------- billsplit/test/people_flows_test.dart | 1 - billsplit/test/receipt_flows_test.dart | 1 - billsplit/test/receipt_items_test.dart | 1 - 4 files changed, 13 insertions(+), 25 deletions(-) diff --git a/billsplit/lib/ui/home_screen.dart b/billsplit/lib/ui/home_screen.dart index 55a26b3..dbf00ea 100644 --- a/billsplit/lib/ui/home_screen.dart +++ b/billsplit/lib/ui/home_screen.dart @@ -1,4 +1,3 @@ -import 'dart:async'; import 'dart:convert'; import 'package:billsplit/domain/eparagon_parser.dart'; @@ -26,11 +25,9 @@ class HomeScreen extends StatelessWidget { IconButton( tooltip: 'People & groups', icon: const Icon(Icons.group), - onPressed: () => unawaited( - Navigator.push( - context, - MaterialPageRoute(builder: (_) => const PeopleScreen()), - ), + onPressed: () => Navigator.push( + context, + MaterialPageRoute(builder: (_) => const PeopleScreen()), ), ), ], @@ -70,12 +67,10 @@ class HomeScreen extends StatelessWidget { formatPln(r.itemsTotalGr), style: Theme.of(context).textTheme.titleMedium, ), - onTap: () => unawaited( - Navigator.push( - context, - MaterialPageRoute( - builder: (_) => ReceiptScreen(receiptId: r.id), - ), + onTap: () => Navigator.push( + context, + MaterialPageRoute( + builder: (_) => ReceiptScreen(receiptId: r.id), ), ), ), @@ -146,11 +141,9 @@ class HomeScreen extends StatelessWidget { for (final w in result.warnings) { messenger.showSnackBar(SnackBar(content: Text(w))); } - unawaited( - nav.push( - MaterialPageRoute( - builder: (_) => ReceiptScreen(receiptId: result.receipt.id), - ), + nav.push( + MaterialPageRoute( + builder: (_) => ReceiptScreen(receiptId: result.receipt.id), ), ); } on EParagonParseException catch (e) { @@ -189,11 +182,9 @@ class HomeScreen extends StatelessWidget { if (title == null || title.trim().isEmpty) return; final r = Receipt(id: Ids.next(), title: title.trim()); state.addReceipt(r); - unawaited( - nav.push( - MaterialPageRoute( - builder: (_) => ReceiptScreen(receiptId: r.id), - ), + nav.push( + MaterialPageRoute( + builder: (_) => ReceiptScreen(receiptId: r.id), ), ); } diff --git a/billsplit/test/people_flows_test.dart b/billsplit/test/people_flows_test.dart index 081ceca..7c297b1 100644 --- a/billsplit/test/people_flows_test.dart +++ b/billsplit/test/people_flows_test.dart @@ -1,6 +1,5 @@ // People screen flows. - import 'package:billsplit/domain/models.dart'; import 'package:billsplit/state/app_state.dart'; import 'package:billsplit/ui/people_screen.dart'; diff --git a/billsplit/test/receipt_flows_test.dart b/billsplit/test/receipt_flows_test.dart index 740b14b..09f5880 100644 --- a/billsplit/test/receipt_flows_test.dart +++ b/billsplit/test/receipt_flows_test.dart @@ -1,6 +1,5 @@ // Receipt screen flows. - import 'package:billsplit/domain/models.dart'; import 'package:billsplit/state/app_state.dart'; import 'package:billsplit/ui/receipt_screen.dart'; diff --git a/billsplit/test/receipt_items_test.dart b/billsplit/test/receipt_items_test.dart index b48fdc2..07059e9 100644 --- a/billsplit/test/receipt_items_test.dart +++ b/billsplit/test/receipt_items_test.dart @@ -2,7 +2,6 @@ // Receipt screen flows. - import 'package:billsplit/domain/models.dart'; import 'package:billsplit/state/app_state.dart'; import 'package:billsplit/ui/receipt_screen.dart';