felangel / felangel/flow_builder

When the AppFlowData changes, every page in the stack is rebuilt (can I get around it?)

未关闭
#47 2 条评论 3 个 reaction 已指派 1 人 已被 @felangel 认领 在 GitHub 查看
bug
主要语言
Dart
星标
416
派生
68
PR 合并指标
30 天内没有已合并 PR

描述

**Describe the bug**
This is probably more of a question than an actual bug. Every change I make to the AppFlowData causes every page that is in the stack to rebuild itself. The problem is that I need for a particular page (the homepage) to show some animations and perform an API call when it first loads, however, when the home page adds another page to the stack or the page added is popped, for example, the homepage is rebuilt, showing the animation again and calling the API once more.
This is not the same behavior as if you are using named routes in the MaterialApp. I want to know if this is the expected behavior and how (if possible) I can get around it.

**To Reproduce**
Steps to reproduce the behavior:
1. Create two pages and a FlowBuilder that starts only with one of them
2. On a button click on the first page, change the FlowData to add the other page to the stack
3. When you click the button (or pop the second page for that matter) you will realize that the first page was rebuilt.

*I made an example in [**this repository**](https://github.com/LucaDillenburg/Flutter-Navigation-Example).*

**Expected behavior**
I believe the expected behavior should be the same as if you were using Flutter's regular routes system (MaterialRoute with routes property): when a page is added or removed from the stack, the other pages are not rebuilt.

贡献指南

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

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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