Adjust test/material/popup_menu_test.dart for Dart 2 semantics. (#14644)

This commit is contained in:
Vyacheslav Egorov 2018-02-15 10:31:46 +01:00 committed by GitHub
parent b8fcc96265
commit 08db0d83d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -215,7 +215,12 @@ void main() {
child: const Text('XXX'),
),
);
final WidgetPredicate popupMenu = (Widget widget) => widget.runtimeType.toString() == '_PopupMenu';
final WidgetPredicate popupMenu = (Widget widget) {
final String widgetType = widget.runtimeType.toString();
// TODO(mraleph): Remove the old case below.
return widgetType == '_PopupMenu<int>' // normal case
|| widgetType == '_PopupMenu'; // for old versions of Dart that don't reify method type arguments
};
Future<Null> openMenu(TextDirection textDirection, Alignment alignment) async {
return TestAsyncUtils.guard(() async {