Skip to content

Consider adding use_if_null_to_convert_nulls_to_bools lint #98650

@tgucio

Description

@tgucio

There's some places where nullable values are compared to bools e.g.:

editable.dart:

    if (selectionEnabled && selection?.isValid == true) {

editable_text.dart:

    return widget.selectionEnabled && copyEnabled && _hasFocus && controls?.canCopy(this) == true

text_selection.dart:

    if (widget.visibility?.value != false) {

There's a lint for this that could be enabled: use_if_null_to_convert_nulls_to_bools.

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: proposalA detailed proposal for a change to Flutterframeworkflutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions