-
Notifications
You must be signed in to change notification settings - Fork 182
feat: generics support for dart #1114
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements generics support for the Dart SDK generation, specifically adding type parameter support for models with dynamic data properties and their associated services. The changes enable better type safety when working with documents and collections that can contain custom data structures.
Key changes include:
- Enhanced model classes to support generic type parameters for dynamic data properties
- Updated service methods to accept type conversion functions for generic models
- Modified template logic to handle underscore-prefixed properties with appropriate getters
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
templates/dart/lib/src/models/model.dart.twig | Adds generic type support to model classes with conditional type parameters and property handling |
templates/dart/test/src/models/model_test.dart.twig | Updates test generation to handle underscore-prefixed properties in generic models |
templates/dart/lib/services/service.dart.twig | Modifies service methods to support generic return types and type conversion functions |
templates/dart/base/requests/api.twig | Updates API response handling to pass type conversion functions to generic models |
src/SDK/Language/Dart.php | Implements helper methods for detecting generic types and generating property types |
src/SDK/Language/Kotlin.php | Fixes return type annotation from string to bool for consistency |
example.php | Updates to use separate specifications for different platform targets |
What does this PR do?
add generics support to dart lang
Test Plan
Related PRs and Issues
Have you read the Contributing Guidelines on issues?
yes.