fix: menu section scrollcontroller not attached (#1631)

This commit is contained in:
Richard Shiue 2023-01-04 17:19:54 +08:00 committed by GitHub
parent a07a180cc8
commit d8958e82c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,7 +40,8 @@ class ViewSection extends StatelessWidget {
); );
} }
ReorderableColumn _reorderableColum(BuildContext context, ViewSectionState state) { ReorderableColumn _reorderableColum(
BuildContext context, ViewSectionState state) {
final children = state.views.map((view) { final children = state.views.map((view) {
return ViewSectionItem( return ViewSectionItem(
key: ValueKey(view.id), key: ValueKey(view.id),
@ -53,8 +54,11 @@ class ViewSection extends StatelessWidget {
return ReorderableColumn( return ReorderableColumn(
needsLongPressDraggable: false, needsLongPressDraggable: false,
onReorder: (oldIndex, index) { onReorder: (oldIndex, index) {
context.read<ViewSectionBloc>().add(ViewSectionEvent.moveView(oldIndex, index)); context
.read<ViewSectionBloc>()
.add(ViewSectionEvent.moveView(oldIndex, index));
}, },
ignorePrimaryScrollController: true,
children: children, children: children,
); );
} }