fix(teams): start the members load quietly when settings mounts - #165
Conversation
After a successful create the view navigates to team settings, which is stacked over it, and settings loads members on mount. The load set loading before its first await, which notified the create view while the settings route was being built: "setState() or markNeedsBuild() called during build". loadMembersAndInvitations(quietStart: true) sets the loading state without notifying, and settings' onInit uses it. The view reads loading in its own first build, and the result still notifies after the await, outside any build. Other callers keep the notifying start. Closes #163
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Note Kodizm (AI-generated). May contain mistakes; verify before acting. The change looks correct and narrowly scoped: only team settings' Minor
TestsA new widget test mounts team create, pushes settings over it, and asserts no mid-build mark. The author reports it red before the fix and red again with the notifying start restored. I read only the diffs of the controller and settings view, not the test file. CI
|
|
On the minor at |
What
loadMembersAndInvitations({bool quietStart = false}): withquietStartthe loading state is set without notifying. Team settings'onInituses it, and every other caller keeps the notifying start.Why
After a successful create, team create navigates to team settings, which is
.stacked(), so create stays mounted underneath. Settings'onInitstarted the load with a synchronoussetLoading()that notified create while the settings route was being built: "setState() or markNeedsBuild() called during build". The settings view reads loading in its own first build, and the result still notifies after the await, outside any build. Closes #163.The framework-level alternative (magic's
refreshUIdeferring during the build phase) would change notification timing for every magic app, so it is left out here.Testing
MagicStarterTeamCreateViewmarked mid-build), green after; putting the notifying start back turns it red again.flutter analyzeclean, 1552 tests green,dart format --set-exit-if-changed .clean.