colorFilter property Null safety

ColorFilter? colorFilter

A color filter to apply when a shape is drawn or when a layer is composited.

See ColorFilter for details.

When a shape is being drawn, colorFilter overrides color and shader.


ColorFilter? get colorFilter {
  return _objects?[_kColorFilterIndex]?.creator as ColorFilter?;
void colorFilter=(ColorFilter? value)


set colorFilter(ColorFilter? value) {
  final _ColorFilter? nativeFilter = value?._toNativeColorFilter();
  if (nativeFilter == null) {
    if (_objects != null) {
      _objects![_kColorFilterIndex] = null;
  } else {
    _ensureObjectsInitialized()[_kColorFilterIndex] = nativeFilter;