CupertinoPicker: Update example (#98525)

This commit is contained in:
Taha Tesser 2022-02-16 06:20:22 +02:00 committed by GitHub
parent 0c95711620
commit 2097fe64f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 9 deletions

View file

@ -8,12 +8,12 @@ import 'package:flutter/cupertino.dart';
const double _kItemExtent = 32.0;
const List<String> _fruitNames = <String>[
'🍎 Apple',
'🥭 Mango',
'🍌 Banana',
'🍊 Orange',
'🍍 Pineapple',
'🍓 Strawberry',
'Apple',
'Mango',
'Banana',
'Orange',
'Pineapple',
'Strawberry',
];
void main() => runApp(const MyApp());

View file

@ -14,11 +14,11 @@ void main() {
);
// Open the Cupertino picker.
await tester.tap(find.text('🍎 Apple'));
await tester.tap(find.text('Apple'));
await tester.pumpAndSettle();
// Drag the wheel to change fruit selection.
await tester.drag(find.text('🥭 Mango'), _kRowOffset, touchSlopY: 0, warnIfMissed: false); // see top of file
await tester.drag(find.text('Mango'), _kRowOffset, touchSlopY: 0, warnIfMissed: false); // see top of file
await tester.pump();
await tester.pump(const Duration(milliseconds: 500));
@ -27,6 +27,6 @@ void main() {
await tester.tapAt(const Offset(1.0, 1.0));
await tester.pumpAndSettle();
expect(find.text('🍌 Banana'), findsOneWidget);
expect(find.text('Banana'), findsOneWidget);
});
}