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

Default values #21

Closed
hjJunior opened this issue Feb 5, 2019 · 0 comments
Closed

Default values #21

hjJunior opened this issue Feb 5, 2019 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@hjJunior
Copy link

hjJunior commented Feb 5, 2019

Hi, I'd like to make a suggestion!
In my opinion, It would be awesome if generator get default values for annotations parameters (Query, Path)

To explain beter, I'd like to provide an example

  @Get(url: "users")
  Future<Response> fetchUsers({ @Query() int limit=300 });

Generates:

Future<Response> fetchUsers({int limit=300}) {}

Or Maybe if annotations got new property, and you can send to generator

class Query {
  final String name;
  final dynamic defaultValue;
  ...
}

And use:

  @Get(url: "users")
  Future<Response> fetchUsers({ @Query(defaultValue: 300) int limit });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants