paintOpacity method
Implementation
void paintOpacity(PaintingContext context, Offset offset, PaintingContextCallback callback) {
  if (alpha == 255) {
    _opacityLayer.layer = null;
    // No need to keep the layer. We'll create a new one if necessary.
    callback(context, offset);
    return;
  }
  _opacityLayer.layer = context.pushOpacity(offset, alpha, callback, oldLayer: _opacityLayer.layer);
}