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

Feat: Support passing in enums into TypedExtras #708

Merged
merged 2 commits into from
Sep 11, 2024

Conversation

farmery
Copy link
Contributor

@farmery farmery commented Sep 10, 2024

Summary

This PR introduces support for passing Enum fields into custom annotations that extend TypedExtras. Developers can now pass Enum fields in the custom class extending TypedExtras. These Enum fields are automatically converted into their string representations and included in the extras map.

Example

enum FileType { json, xml, csv }

@TypedExtrasSubClass(
  id: '1234',
  fileType: FileType.json,
)
Future<String> fetchData(@Extras() Map<String, dynamic> extras);

@trevorwang trevorwang merged commit 6d61839 into trevorwang:master Sep 11, 2024
2 checks passed
@trevorwang
Copy link
Owner

Thanks for the contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants