From 6813a72767568eb0adfcf07e2fcde108db19439f Mon Sep 17 00:00:00 2001 From: Eric Poulsen Date: Sat, 13 Jun 2026 20:32:05 -0700 Subject: [PATCH] Fix null-returning ternaries with if blocks, per code review comments --- lib/screens/map_screen.dart | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/lib/screens/map_screen.dart b/lib/screens/map_screen.dart index 8b428420..0bc28674 100644 --- a/lib/screens/map_screen.dart +++ b/lib/screens/map_screen.dart @@ -1188,12 +1188,12 @@ class _MapScreenState extends State { width: 48, height: 48, child: GestureDetector( - onLongPress: () => _isBuildingPathTrace - ? _showNodeInfo(context, guess.contact) - : null, - onSecondaryTap: () => _isBuildingPathTrace - ? _showNodeInfo(context, guess.contact) - : null, + onLongPress: () { + if (_isBuildingPathTrace) _showNodeInfo(context, guess.contact); + }, + onSecondaryTap: () { + if (_isBuildingPathTrace) _showNodeInfo(context, guess.contact); + }, onTap: () => _isBuildingPathTrace ? _addToPath(context, guess.contact, position: guess.position) : _selectNode(guess.contact, guessedPosition: guess.position), @@ -1393,10 +1393,12 @@ class _MapScreenState extends State { height: size, child: GestureDetector( behavior: HitTestBehavior.opaque, - onLongPress: () => - _isBuildingPathTrace ? _showNodeInfo(context, contact) : null, - onSecondaryTap: () => - _isBuildingPathTrace ? _showNodeInfo(context, contact) : null, + onLongPress: () { + if (_isBuildingPathTrace) _showNodeInfo(context, contact); + }, + onSecondaryTap: () { + if (_isBuildingPathTrace) _showNodeInfo(context, contact); + }, onTap: () => _isBuildingPathTrace ? _addToPath(context, contact) : _selectNode(contact),