mirror of
https://github.com/flutter/flutter
synced 2024-08-27 12:00:58 +00:00
CupertinoPicker
: Update example (#98525)
This commit is contained in:
parent
0c95711620
commit
2097fe64f0
|
@ -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());
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue