BUG: Discarded Provider.of call in AuthScreen causes unnecessary widget rebuilds

Open
#186 2 comments 0 reactions 0 assignees View on GitHub

@AnasNasr-afk is already working on this.

Since Mar 8, 2026.

  • #187 by @AnasNasr-afk — open

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
dart

Research direction

Open lib/presentation/auth/auth_screen.dart and inspect the discarded Provider.of call in build(), then review didChangeDependencies to confirm that navigation already reacts to AuthProvider changes. Done means the redundant call is removed without changing the existing navigation behavior.

Written by the indexing model from the issue text.

Description

Is there an existing issue for this?
  • I have searched the existing issues
What happened?

Description

In auth_screen.dart, inside the build() method, there is a Provider.of
call whose return value is immediately discarded:

Current Behavior

Provider.of(context, listen: true).authNavigationStatus;

This line forces a full widget rebuild every time AuthProvider changes,
even though the value is never used in the UI. This is a silent performance
issue that can cause janky behavior on low-end devices.

Expected Behavior

Rebuilds should only happen when the value is actually consumed by the UI.
The navigation logic is already handled in didChangeDependencies,
making this line redundant.

Proposed Fix

Remove the redundant line entirely, since didChangeDependencies already
reacts to AuthProvider changes for navigation purposes.

File

lib/presentation/auth/auth_screen.dart — build() method

Record
  • I agree to follow this project's Code of Conduct
  • I want to work on this issue
Dominant language
Dart
Stars
30
Forks
49
PR merge metrics
No merged PRs in 30d

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from AOSSIE-Org/NeuroTrack

All issues in AOSSIE-Org/NeuroTrack

Similar issues

More Dart issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.