fix ab peers view, all peer tab use global peers model (#9475)

Use ChangeNotifierProvider<Peers>.value, and each peer tab has a global unique `Peers` model, then `load peers` and `build
peers` will always be the same one.

Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
21pages
2024-09-26 22:08:32 +08:00
committed by GitHub
parent c74bdcdfdb
commit ffc73f86a0
6 changed files with 134 additions and 92 deletions

View File

@@ -83,8 +83,8 @@ class _MyGroupState extends State<MyGroup> {
child: Align(
alignment: Alignment.topLeft,
child: MyGroupPeerView(
menuPadding: widget.menuPadding,
getInitPeers: () => gFFI.groupModel.peers)),
menuPadding: widget.menuPadding,
)),
)
],
);
@@ -115,8 +115,8 @@ class _MyGroupState extends State<MyGroup> {
child: Align(
alignment: Alignment.topLeft,
child: MyGroupPeerView(
menuPadding: widget.menuPadding,
getInitPeers: () => gFFI.groupModel.peers)),
menuPadding: widget.menuPadding,
)),
)
],
);