Skip to content

Conversation

@krushnarout
Copy link
Member

Navigator.pop(context);

here Navigator.pop used outdated context, so no navigator existed above it

closes #4308

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 correctly fixes a critical crash caused by using an outdated BuildContext when dismissing a dialog. The change in app/lib/pages/apps/list_item.dart properly uses the context from the showDialog builder, which resolves the issue.

This is a common anti-pattern in Flutter, and I've identified other areas in the codebase with the same vulnerability. To improve application stability, I strongly recommend applying the same fix in these locations:

  • app/lib/pages/apps/app_detail/app_detail.dart (lines 931, 934)
  • app/lib/pages/apps/app_detail/app_detail.dart (lines 1180-1183)
  • app/lib/pages/apps/app_detail/app_detail.dart (lines 1782-1784)

A project-wide audit for similar showDialog implementations would be beneficial to prevent future crashes.

@mdmohsin7 mdmohsin7 merged commit d4c7e42 into main Jan 20, 2026
1 check passed
@mdmohsin7 mdmohsin7 deleted the fix/null-check-4308 branch January 20, 2026 12:00
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 - SingleChildStatefulElement.state

3 participants