flutter_datetime_picker icon indicating copy to clipboard operation
flutter_datetime_picker copied to clipboard

Running will warn

Open ChessLuo opened this issue 3 years ago • 3 comments

: 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,

ChessLuo avatar Apr 20 '22 07:04 ChessLuo

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

LuaniLuke avatar Apr 20 '22 19:04 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.

LuaniLuke avatar Apr 20 '22 20:04 LuaniLuke

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.

benni-tec avatar Apr 24 '22 15:04 benni-tec