Skip to content

Prefer const option over BorderRadius.circular #58540

@Piinks

Description

@Piinks

For full context see flutter/flutter#91239

BorderRadius.circular is simpler, but the same BorderRadius can be created with const by using the BorderRadius.all constructor.

Examples

// Less ideal, cannot be const
BorderRadius.circular(arg);

// More verbose, but const
const BorderRadius.all(Radius.circular(arg))

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.customer-flutterdevexp-linterIssues with the analyzer's support for the linter packagelinter-lint-proposaltype-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions