diff --git a/packages/flutter/test/material/popup_menu_test.dart b/packages/flutter/test/material/popup_menu_test.dart index 1ee60cdf1c..daedc4d4ed 100644 --- a/packages/flutter/test/material/popup_menu_test.dart +++ b/packages/flutter/test/material/popup_menu_test.dart @@ -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' // normal case + || widgetType == '_PopupMenu'; // for old versions of Dart that don't reify method type arguments + }; Future openMenu(TextDirection textDirection, Alignment alignment) async { return TestAsyncUtils.guard(() async {