You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Models have their members initialized to null which is against the Effective Dart guidelines.
Describe the solution you'd like
When the default value is null, just declare the variable as in Dart, "a variable or field that is not explicitly initialized automatically gets initialized to null" and "Adding = null is redundant and unneeded."
Describe alternatives you've considered
I tried using an inverted section based on the defaultValue but it didn't work, I don't know mustache well enough yet but I'll come back to it.
* [Dart] Fix enum generation
* Update generated Order file
* Re-add constructor
* Generate dart2 files
* Dart - nicer enum formatting
* Dart - generate enum name as className+enumName
* Dart - dont initialize vars to null by default
Fixes#3633
* Dart - Generate inlined enums and deserialize them
* Merge branch 'master' of github.com:agilob/openapi-generator into 6727
* Dart - Fix using default value
* Fix typo
* Regenerate add dart files
* dart Revert override for dart dio and jaguar
* Fix dart model tests
* Fix dart1 generated template
* Use {{{datatypeWithEnum}}}
* Dart - throw when enum not known
* Fix generating enum with datatype from list
Is your feature request related to a problem? Please describe.
Models have their members initialized to null which is against the Effective Dart guidelines.
Describe the solution you'd like
When the default value is null, just declare the variable as in Dart, "a variable or field that is not explicitly initialized automatically gets initialized to null" and "Adding = null is redundant and unneeded."
Describe alternatives you've considered
I tried using an inverted section based on the defaultValue but it didn't work, I don't know mustache well enough yet but I'll come back to it.
Additional context
https://dart.dev/guides/language/effective-dart/usage#dont-explicitly-initialize-variables-to-null
The text was updated successfully, but these errors were encountered: