| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library services.src.correction.flutter_util; | |
| 6 | |
| 7 import 'package:analyzer/dart/ast/ast.dart'; | 5 import 'package:analyzer/dart/ast/ast.dart'; |
| 8 import 'package:analyzer/dart/element/element.dart'; | 6 import 'package:analyzer/dart/element/element.dart'; |
| 9 import 'package:analyzer/dart/element/type.dart'; | 7 import 'package:analyzer/dart/element/type.dart'; |
| 10 import 'package:analyzer/src/generated/source.dart'; | 8 import 'package:analyzer/src/generated/source.dart'; |
| 11 | 9 |
| 12 const _FLUTTER_WIDGET_NAME = "Widget"; | 10 const _FLUTTER_WIDGET_NAME = "Widget"; |
| 13 const _FLUTTER_WIDGET_URI = "package:flutter/src/widgets/framework.dart"; | 11 const _FLUTTER_WIDGET_URI = "package:flutter/src/widgets/framework.dart"; |
| 14 | 12 |
| 15 void convertFlutterChildToChildren( | 13 void convertFlutterChildToChildren( |
| 16 InstanceCreationExpression childArg, | 14 InstanceCreationExpression childArg, |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 orElse: () => null); | 171 orElse: () => null); |
| 174 if (superType == null) { | 172 if (superType == null) { |
| 175 return false; | 173 return false; |
| 176 } | 174 } |
| 177 Uri uri = superType.element?.source?.uri; | 175 Uri uri = superType.element?.source?.uri; |
| 178 if (uri.toString() != _FLUTTER_WIDGET_URI) { | 176 if (uri.toString() != _FLUTTER_WIDGET_URI) { |
| 179 return false; | 177 return false; |
| 180 } | 178 } |
| 181 return true; | 179 return true; |
| 182 } | 180 } |
| OLD | NEW |