Skip to content

Commit 62f0f41

Browse files
Merge pull request #286 from Workiva/greglittlefield-wf-patch-2
FED-2610 Synchronize with over_react impl; pull in AbstractProps fix
2 parents 0c235dd + ead2cf2 commit 62f0f41

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/src/util/get_all_props.dart

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Taken from https://github.com/Workiva/over_react/blob/master/tools/analyzer_plugin/lib/src/util/prop_declarations/get_all_props.dart
1+
// Taken from https://github.com/Workiva/over_react/blob/5c6e1742949ce4e739f7923b799cc00b1118279b/tools/analyzer_plugin/lib/src/util/prop_declarations/get_all_props.dart
22

33
// Copyright 2024 Workiva Inc.
44
//
@@ -70,7 +70,7 @@ List<FieldElement> getAllProps(InterfaceElement propsElement) {
7070
final isMixinBasedPropsMixin = interface is MixinElement &&
7171
interface.superclassConstraints.any((s) => s.element.name == 'UiProps');
7272
late final isLegacyPropsOrPropsMixinConsumerClass = !isFromGeneratedFile &&
73-
interface.metadata.any(_isPropsOrPropsMixinAnnotation);
73+
interface.metadata.any(_isOneOfThePropsAnnotations);
7474

7575
if (!isMixinBasedPropsMixin && !isLegacyPropsOrPropsMixinConsumerClass) {
7676
continue;
@@ -95,11 +95,12 @@ List<FieldElement> getAllProps(InterfaceElement propsElement) {
9595
return allProps;
9696
}
9797

98-
bool _isPropsOrPropsMixinAnnotation(ElementAnnotation e) {
98+
bool _isOneOfThePropsAnnotations(ElementAnnotation e) {
9999
// [2]
100100
final element = e.element;
101101
return element is ConstructorElement &&
102-
const {'Props', 'PropsMixin'}.contains(element.enclosingElement.name);
102+
const {'Props', 'PropsMixin', 'AbstractProps'}
103+
.contains(element.enclosingElement.name);
103104
}
104105

105106
bool _isPropsMixinAnnotation(ElementAnnotation e) {

0 commit comments

Comments
 (0)