Skip to content

Running will warn #297

Open
Open

Description

@ChessLuo

: Warning: Operand of null-aware operation '??' has type 'Color' which excludes null.
../…/lib/flutter_datetime_picker.dart:311

  • 'Color' is from 'dart:ui'.
    color: theme.backgroundColor ?? Colors.white,

Activity

  1. LuaniLuke commented on Apr 20, 2022

    @LuaniLuke

    I am getting the same issue, have you figured it out?

  2. LuaniLuke commented on Apr 20, 2022

    @LuaniLuke

    Screen Shot 2022-04-20 at 3 23 47 PM
    Figured out how to fix it, the error is in line 311 and just change to a fixed color.

  3. benni-tec commented on Apr 24, 2022

    @benni-tec

    This will cause loss of functionality, you can just remove the constant color. As the error message states theme.backgroundColor is Color and therefore never null so the fall back ?? Colors.white is redundant and can simply be removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions