Drop five redundant unawaited() wrappers around Navigator.push
Some checks are pending
pre-commit / pre-commit (push) Waiting to run
Tests / test (3.10) (push) Waiting to run
Tests / test (3.11) (push) Waiting to run
Tests / test (3.12) (push) Waiting to run
release-apk / release (APK) (push) Waiting to run

Navigator.push is annotated @awaitNotRequired, so these now trip
unnecessary_unawaited and failed the CI-mirror's flutter analyze -- which
blocked every push to this repo regardless of what the commit changed.

flutter analyze: no issues. flutter test: 553 passed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C7yZz45ezmzCB89Cv5gAtZ
This commit is contained in:
Krzysztof Rudnicki 2026-08-14 16:17:18 +02:00
parent e80ae41e1c
commit 4e3778823f
2 changed files with 13 additions and 24 deletions

View File

@ -101,14 +101,12 @@ class _CalendarScreenState extends State<CalendarScreen> {
/// Opens [HistoryScreen] pre-filtered to the tapped day. /// Opens [HistoryScreen] pre-filtered to the tapped day.
void _onDaySelected(DateTime day) { void _onDaySelected(DateTime day) {
unawaited(
Navigator.of(context).push<void>( Navigator.of(context).push<void>(
MaterialPageRoute( MaterialPageRoute(
builder: (_) => HistoryScreen( builder: (_) => HistoryScreen(
initialDateRange: DateTimeRange(start: day, end: day), initialDateRange: DateTimeRange(start: day, end: day),
), ),
), ),
),
); );
} }

View File

@ -2,7 +2,6 @@
/// screen: "I can open the diet app on my phone and fill meal I ate." /// screen: "I can open the diet app on my phone and fill meal I ate."
library; library;
import 'dart:async'; import 'dart:async';
import 'dart:developer'; import 'dart:developer';
import 'package:crdt_sync/crdt_sync.dart'; import 'package:crdt_sync/crdt_sync.dart';
@ -323,36 +322,28 @@ class _LogMealScreenState extends State<LogMealScreen>
} }
void _onOpenHistory() { void _onOpenHistory() {
unawaited(
Navigator.of(context).push<void>( Navigator.of(context).push<void>(
MaterialPageRoute(builder: (_) => const HistoryScreen()), MaterialPageRoute(builder: (_) => const HistoryScreen()),
),
); );
} }
void _onOpenCalendar() { void _onOpenCalendar() {
unawaited(
Navigator.of(context).push<void>( Navigator.of(context).push<void>(
MaterialPageRoute(builder: (_) => const CalendarScreen()), MaterialPageRoute(builder: (_) => const CalendarScreen()),
),
); );
} }
void _onOpenFoodBank() { void _onOpenFoodBank() {
unawaited(
Navigator.of(context).push<void>( Navigator.of(context).push<void>(
MaterialPageRoute(builder: (_) => const FoodBankScreen()), MaterialPageRoute(builder: (_) => const FoodBankScreen()),
),
); );
} }
void _onOpenSettings() { void _onOpenSettings() {
unawaited(
Navigator.of(context).push<void>( Navigator.of(context).push<void>(
MaterialPageRoute( MaterialPageRoute(
builder: (_) => SettingsScreen(httpClient: widget.httpClient), builder: (_) => SettingsScreen(httpClient: widget.httpClient),
), ),
),
); );
} }