Skip to content

Commit 7e75895

Browse files
committed
{desktop, mobile}: fix error when result is a column
enable the action only when result image is an actual image Signed-off-by: blacksuan19 <[email protected]>
1 parent 96a497c commit 7e75895

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

lib/screens/desktop/home.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,10 @@ class DesktopHome extends ConsumerWidget {
100100
mainAxisAlignment: MainAxisAlignment.start,
101101
children: [
102102
GestureDetector(
103-
onTap: () async =>
104-
showImage(context: context, image: result),
103+
onTap: result is Column
104+
? null
105+
: () async =>
106+
showImage(context: context, image: result),
105107
child: GenericContainer(
106108
image: result,
107109
),

lib/screens/mobile/result.dart

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,12 @@ class ResultsView extends ConsumerWidget {
5050
),
5151
SizedBox(height: 20),
5252
GestureDetector(
53-
onLongPress: () async => showImage(
54-
context: context,
55-
image: result,
56-
),
53+
onLongPress: result is Column
54+
? null
55+
: () async => showImage(
56+
context: context,
57+
image: result,
58+
),
5759
child: GenericContainer(image: result),
5860
),
5961
SizedBox(height: 20),

0 commit comments

Comments
 (0)