Skip to content

Commit

Permalink
Only dispose controller if it is not owned by parent
Browse files Browse the repository at this point in the history
  • Loading branch information
lukehutch committed May 8, 2024
1 parent 6931355 commit 2e2aaf7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/components/persistent_tab_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,9 @@ class _PersistentTabViewState extends State<PersistentTabView> {

@override
void dispose() {
_controller.dispose();
if (widget.controller == null) {
_controller.dispose();
}
super.dispose();
}

Expand Down

0 comments on commit 2e2aaf7

Please sign in to comment.