Skip to content

[REQ] [Dart] Don't initialize variables to null #3633

@nickmeinhold

Description

@nickmeinhold

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions