Skip to content

Commit

Permalink
Fix list layout NT properties not updating after dragging
Browse files Browse the repository at this point in the history
  • Loading branch information
Gold872 committed Dec 19, 2023
1 parent a6ac3d5 commit 69c5894
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,6 @@ abstract class DraggableLayoutContainer extends DraggableWidgetContainer {
{Offset? globalPosition});

void addWidget(DraggableNTWidgetContainer widget);

void refreshChildren();
}
7 changes: 7 additions & 0 deletions lib/widgets/draggable_containers/draggable_list_layout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,13 @@ class DraggableListLayout extends DraggableLayoutContainer {
refresh();
}

@override
void refreshChildren() {
for (var child in children) {
child.refreshChild();
}
}

List<Widget> _getListColumn() {
List<Widget> column = [];

Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/nt_widgets/nt_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ abstract class NTWidget extends StatelessWidget {
@mustCallSuper
void refresh() {
Future(() async {
notifier?.refresh();
subscription?.requestNewValue();
notifier?.refresh();
});
}

Expand Down
1 change: 1 addition & 0 deletions lib/widgets/tab_grid.dart
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ class TabGrid extends StatelessWidget {
widget.dispose();
widget.refresh();
widget.tryCast<DraggableNTWidgetContainer>()?.refreshChild();
widget.tryCast<DraggableLayoutContainer>()?.refreshChildren();
}

void onWidgetDragCancel(DraggableWidgetContainer widget) {
Expand Down

0 comments on commit 69c5894

Please sign in to comment.