opacityProviderOfList method

OpacityProvider opacityProviderOfList(
  1. {List<T?>? paintIds,
  2. bool includeLayers = true}
)

Creates an OpacityProvider for given list of paintIds and can be used as target for OpacityEffect.

When opacities of all the given paintIds are not same, this provider directly effects opacity of the most opaque paint. Additionally, it modifies other paints such that their respective opacity ratio with most opaque paint is maintained.

If paintIds is null or empty, all the paints are used for creating the OpacityProvider.

Note: Each call results in a new OpacityProvider and hence the cached opacity ratios are calculated using opacities when this method was called.

Implementation

OpacityProvider opacityProviderOfList({
  List<T?>? paintIds,
  bool includeLayers = true,
}) {
  return _MultiPaintOpacityProvider(
    paintIds ?? (List<T?>.from(_paints.keys)..add(null)),
    this,
    includeLayers: includeLayers,
  );
}