Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FED-2164 Fix disableRequiredPropValidation annotation and add test #881

Merged
merged 3 commits into from
Jan 29, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Format
sydneyjodon-wk committed Jan 29, 2024

Verified

This commit was signed with the committer’s verified signature.
commit 5f4dddd84c65ec6797b288b16ca5fb0c7e71d989
7 changes: 4 additions & 3 deletions lib/src/builder/parsing/members/props_and_state_util.dart
Original file line number Diff line number Diff line change
@@ -63,10 +63,11 @@ annotations.TypedMap getPropsOrStateAnnotation(bool isProps, AnnotatedNode node)
// ignore: deprecated_member_use_from_same_package
InstantiatedMeta<annotations.StateMixin>(node));

if (meta == null) return defaultValue;
if (meta == null) return defaultValue;

// Make the `disableRequiredPropValidation` arg a noop until it is implemented in v5.
if (meta.potentiallyIncompleteValue is annotations.Props && meta.unsupportedArguments.length == 1) {
if (meta.potentiallyIncompleteValue is annotations.Props &&
meta.unsupportedArguments.length == 1) {
final arg = meta.unsupportedArguments[0];
if (arg is NamedExpression && arg.name.label.name == 'disableRequiredPropValidation') {
return annotations.Props(
@@ -75,7 +76,7 @@ annotations.TypedMap getPropsOrStateAnnotation(bool isProps, AnnotatedNode node)
}
}

return meta.value ?? defaultValue;
return meta.value ?? defaultValue;
}

/// If a [ClassMember] exists in [node] with the name `meta`, this will
Loading