Skip to content

chore: type generation improvements #1102

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

Merged
merged 9 commits into from
Jul 11, 2025
Merged

Conversation

ChiragAgg5k
Copy link
Member

@ChiragAgg5k ChiragAgg5k commented Jul 4, 2025

What does this PR do?

  1. adds getPackageName to dart to use correct import depending upon sdk for flutter or dart
  2. use correct syntax for doc comments in dart (/// instead of /*)
  3. extend the generated models in dart with Document to introduce internal attributes like $id, $collectionId etc.
  4. fix indentation in java, kotlin and swift to use 2 spaces instead of 4 for consistency across all languages
  5. use lowerCamelCase for enums in dart according to - constant_identifier_names

Test Plan

Screenshot 2025-07-09 at 12 58 00 PM

Related PRs and Issues

Have you read the Contributing Guidelines on issues?

yes.

<% } -%>
}

<% } -%>
<% } -%>
class <%= toPascalCase(collection.name) %> {
class <%= toPascalCase(collection.name) %> extends Document {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to call super() in the constructor?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont think so, this is how it will be called manually:
Screenshot 2025-07-09 at 3 05 08 PM

but people will usually just use fromMap

@christyjacob4 christyjacob4 merged commit 7381d2d into master Jul 11, 2025
37 checks passed
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.

3 participants