flutter_datetime_picker icon indicating copy to clipboard operation
flutter_datetime_picker copied to clipboard

Getting error at compile time

Open kamleshwebtech opened this issue 4 years ago • 5 comments

Could you please suggest me what is that issue and how can we solve it?

Below is the error I am getting on console panel of vscode editor:

../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_datetime_picker-1.5.1/lib/flutter_datetime_picker.dart:311:32: Warning: Operand of null-aware operation '??' has type 'Color' which excludes null.
 - 'Color' is from 'dart:ui'.
                  color: theme.backgroundColor ?? Colors.white,

Please suggest. Thanks.

kamleshwebtech avatar May 11 '21 09:05 kamleshwebtech

Same error, but still compiles just fine (using unsound null-safety)

nstrelow avatar May 12 '21 12:05 nstrelow

I get the same problem.Did you solve it

HeartDawnWY avatar May 15 '21 07:05 HeartDawnWY

I Solved it by editing the line no 311 of the flutter_datetime_picker.dart. You can find this file in External Librariers->DartPackages

Inder-pal-singh avatar May 15 '21 14:05 Inder-pal-singh

Thanks. color: theme.backgroundColor ?? Colors.white -> color: theme.backgroundColor

HeartDawnWY avatar May 16 '21 00:05 HeartDawnWY

It's just a warning, so no need to worry. It was fixed with this PR https://github.com/Realank/flutter_datetime_picker/pull/236 but apparently didn't make it into the latest deployment.

If you want, pulling from master instead of pub.dev should solve it until a new version is deployed.

flutter_datetime_picker:
    git:
      url: https://github.com/Realank/flutter_datetime_picker.git
      ref: master

AlexHartford avatar May 18 '21 20:05 AlexHartford