-
Notifications
You must be signed in to change notification settings - Fork 189
Flutter & Dart template refactoring #461
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
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.
Looks good, much easier to manage, my only suggestion would be moving the api, file and oauth templates to a separate directory like requests
or similar to keep concerns isolated
Well I added those to a separate directory called |
Yep sounds good |
templates/flutter/base/api.twig
Outdated
{% endif %} | ||
}; | ||
|
||
{% if method.type == 'location' %} |
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.
Can we have a separate template for location as well? This will help us keep this template dead simple.
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.
Done!
templates/flutter/base/macros.twig
Outdated
@@ -0,0 +1,5 @@ | |||
{% macro parameter(parameter) %}{% if parameter.required %}required {{ parameter.type | typeName }}{% else %}{{ parameter.type | typeName }}?{% endif %} {{ parameter.name | caseCamel | escapeKeyword }}{% endmacro %} |
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.
Do we really need this as an individual template? Can it be just part of the service template? If not, I'm not sure macros is the most intuitive name.
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.
It I keep these in service, I can't call the function in api.twig
or other included template files, keeping this in separate file allows us to import and use it in any template files. so we can define all macros in a separate file and import and use from any file. What might be a better name? functions
or utils
?
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.
I love it! LGTM
No description provided.