Skip to content

Conversation

@krushnarout
Copy link
Member

moved provider checks outside of async callbacks, and added mounted checks after awaits and before Navigator.pop(context)

closes #3431

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses potential crashes by adding mounted checks after await calls and before using BuildContext, which is a great improvement. It also refactors provider access to be outside of asynchronous callbacks, making the code safer. I've identified two critical issues where firstWhere is used to find a device, which could lead to a crash if the device is not found. I've suggested using firstWhereOrNull to handle these cases gracefully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FlutterError - Null check operator used on a null value

2 participants