fix: reorder rows on windows (#3279)

* fix: reorder rows on windows

Closes: #3208

* fix: unused import
This commit is contained in:
Mathias Mogensen 2023-09-13 05:36:22 +02:00 committed by GitHub
parent aa25aa4474
commit ef6f9a3175
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 61 deletions

View File

@ -1,5 +1,3 @@
import 'dart:io';
import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/plugins/database_view/application/row/row_service.dart';
import 'package:appflowy/plugins/database_view/grid/presentation/widgets/toolbar/grid_setting_bar.dart';
@ -257,26 +255,6 @@ class _GridRows extends StatelessWidget {
GridState state,
List<RowInfo> rowInfos,
) {
if (Platform.isWindows) {
// Workaround: On Windows, the focusing of the text cell is not working
// properly when the list is reorderable. So using the ListView instead.
return ListView.builder(
controller: scrollController.verticalController,
itemCount: rowInfos.length + 1, // the extra item is the footer
itemBuilder: (context, index) {
if (index < rowInfos.length) {
final rowInfo = rowInfos[index];
return _renderRow(
context,
rowInfo.rowId,
isDraggable: false,
index: index,
);
}
return const GridRowBottomBar(key: Key('gridFooter'));
},
);
} else {
return ReorderableListView.builder(
/// TODO(Xazin): Resolve inconsistent scrollbar behavior
/// This is a workaround related to
@ -310,7 +288,6 @@ class _GridRows extends StatelessWidget {
},
);
}
}
Widget _renderRow(
BuildContext context,

View File

@ -161,16 +161,12 @@ class _RowLeadingState extends State<_RowLeading> {
index: widget.index!,
child: RowMenuButton(
isDragEnabled: isDraggable,
openMenu: () {
popoverController.show();
},
openMenu: popoverController.show,
),
),
] else ...[
RowMenuButton(
openMenu: () {
popoverController.show();
},
openMenu: popoverController.show,
),
],
],