Skip to content

Commit

Permalink
[Presentation] Avoid unnecessary scroll controller dispose
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolfteam committed Feb 10, 2024
1 parent 6118da0 commit 9330a24
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/presentation/main_tab_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ class _MainTabPageState extends State<MainTabPage> with SingleTickerProviderStat
WidgetsBinding.instance.removeObserver(this);
_tabController.dispose();
for (final sc in _tabItemScrollControllers) {
sc.dispose();
//the controller may have been already disposed
if (sc.hasClients) {
sc.dispose();
}
}
super.dispose();
}
Expand Down
1 change: 0 additions & 1 deletion lib/presentation/shared/mixins/app_fab_mixin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ mixin AppFabMixin<T extends StatefulWidget> on State<T>, SingleTickerProviderSta
void dispose() {
scrollController.dispose();
hideFabAnimController.dispose();

super.dispose();
}

Expand Down

0 comments on commit 9330a24

Please sign in to comment.