Skip to content

Running will warn #297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ChessLuo opened this issue Apr 20, 2022 · 3 comments
Open

Running will warn #297

ChessLuo opened this issue Apr 20, 2022 · 3 comments

Comments

@ChessLuo
Copy link

: 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,
@LuaniLuke
Copy link

LuaniLuke commented Apr 20, 2022

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

@LuaniLuke
Copy link

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.

@benni-tec
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants