Skip to content

Commit b5d3fbb

Browse files
committed
fixed the action exectuion feedback
1 parent e87a32c commit b5d3fbb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

mobile/jpeg_stream_viewer/lib/screens/connection_screen.dart

+5-2
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ class _ConnectionScreenState extends State<ConnectionScreen>
8282
builder: (BuildContext context) {
8383
bool isLoading = true;
8484
String? statusMessage;
85+
bool wasSuccessful = false;
8586

8687
return StatefulBuilder(
8788
builder: (BuildContext context, StateSetter setModalState) {
@@ -117,6 +118,7 @@ class _ConnectionScreenState extends State<ConnectionScreen>
117118
'screens.connection.labels.action_executed_successfully',
118119
{'name': action.name},
119120
);
121+
wasSuccessful = true;
120122
});
121123
} else {
122124
throw Exception(
@@ -129,6 +131,7 @@ class _ConnectionScreenState extends State<ConnectionScreen>
129131
'screens.connection.labels.action_error',
130132
{'error': e.toString()},
131133
);
134+
wasSuccessful = false;
132135
});
133136
}
134137
});
@@ -150,10 +153,10 @@ class _ConnectionScreenState extends State<ConnectionScreen>
150153
],
151154
if (!isLoading && statusMessage != null) ...[
152155
Icon(
153-
statusMessage!.contains('successfully')
156+
wasSuccessful
154157
? Icons.check_circle_outline
155158
: Icons.error_outline,
156-
color: statusMessage!.contains('successfully')
159+
color: wasSuccessful
157160
? theme.colorScheme.primary
158161
: theme.colorScheme.error,
159162
size: 48,

0 commit comments

Comments
 (0)