mirror of
https://github.com/flutter/flutter
synced 2024-10-13 03:32:55 +00:00
ReorderableListView should treat fuchsia as a mobile platform. (#84393)
This commit is contained in:
parent
0347c533f1
commit
144e21b3cb
|
@ -421,7 +421,6 @@ class _ReorderableListViewState extends State<ReorderableListView> {
|
|||
|
||||
if (widget.buildDefaultDragHandles) {
|
||||
switch (Theme.of(context).platform) {
|
||||
case TargetPlatform.fuchsia:
|
||||
case TargetPlatform.linux:
|
||||
case TargetPlatform.windows:
|
||||
case TargetPlatform.macOS:
|
||||
|
@ -470,6 +469,7 @@ class _ReorderableListViewState extends State<ReorderableListView> {
|
|||
|
||||
case TargetPlatform.iOS:
|
||||
case TargetPlatform.android:
|
||||
case TargetPlatform.fuchsia:
|
||||
return ReorderableDelayedDragStartListener(
|
||||
key: itemGlobalKey,
|
||||
index: index,
|
||||
|
|
|
@ -1366,6 +1366,20 @@ void main() {
|
|||
});
|
||||
// TODO(djshuckerow): figure out how to write a test for scrolling the list.
|
||||
|
||||
testWidgets('ReorderableListView on desktop platforms should have drag handles', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(build());
|
||||
// All four items should have drag handles and not delayed listeners.
|
||||
expect(find.byIcon(Icons.drag_handle), findsNWidgets(4));
|
||||
expect(find.byType(ReorderableDelayedDragStartListener), findsNothing);
|
||||
}, variant: TargetPlatformVariant.desktop());
|
||||
|
||||
testWidgets('ReorderableListView on mobile platforms should not have drag handles', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(build());
|
||||
// All four items should have delayed listeners and not drag handles.
|
||||
expect(find.byType(ReorderableDelayedDragStartListener), findsNWidgets(4));
|
||||
expect(find.byIcon(Icons.drag_handle), findsNothing);
|
||||
}, variant: TargetPlatformVariant.mobile());
|
||||
|
||||
testWidgets('Vertical list renders drag handle in correct position', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(build(platform: TargetPlatform.macOS));
|
||||
final Finder listView = find.byType(ReorderableListView);
|
||||
|
|
Loading…
Reference in a new issue