| Index: pkg/analysis_server/lib/src/services/correction/flutter_util.dart
|
| diff --git a/pkg/analysis_server/lib/src/services/correction/flutter_util.dart b/pkg/analysis_server/lib/src/services/correction/flutter_util.dart
|
| index 1959532be9d5d7479bf35b96cd1c5afe943096d6..469263e4c89616314c03992c09108a549c75b7ce 100644
|
| --- a/pkg/analysis_server/lib/src/services/correction/flutter_util.dart
|
| +++ b/pkg/analysis_server/lib/src/services/correction/flutter_util.dart
|
| @@ -160,6 +160,14 @@ InstanceCreationExpression identifyNewExpression(AstNode node) {
|
| */
|
| bool isFlutterInstanceCreationExpression(InstanceCreationExpression newExpr) {
|
| ClassElement classElement = newExpr.staticElement?.enclosingElement;
|
| + return isFlutterWidget(classElement);
|
| +}
|
| +
|
| +/**
|
| + * Return `true` if the given [classElement] has the Flutter class Widget as a
|
| + * superclass.
|
| + */
|
| +bool isFlutterWidget(ClassElement classElement) {
|
| InterfaceType superType = classElement?.allSupertypes?.firstWhere(
|
| (InterfaceType type) => _FLUTTER_WIDGET_NAME == type.name,
|
| orElse: () => null);
|
|
|