Skip to content

Commit

Permalink
Move controller re-init inside update check
Browse files Browse the repository at this point in the history
  • Loading branch information
andyhorn committed May 5, 2024
1 parent d594d43 commit 2fc0f9a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/src/resizable_container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,10 @@ class _ResizableContainerState extends State<ResizableContainer> {

@override
void didUpdateWidget(covariant ResizableContainer oldWidget) {
_disposeController();
_initController();

// If the axis direction has changed, reset and re-calculate the sizes.
if (oldWidget.direction != widget.direction) {
_disposeController();
_initController();
sizes.clear();

final size = MediaQuery.sizeOf(context);
Expand Down

0 comments on commit 2fc0f9a

Please sign in to comment.