AOSSIE-Org / AOSSIE-Org/NeuroTrack

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

未关闭
#186 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Dart
星标
29
派生
50
PR 合并指标
30 天内没有已合并 PR

描述

### Is there an existing issue for this?

- [x] 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

- [x] I agree to follow this project's Code of Conduct
- [x] I want to work on this issue

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。