Package io.flutter.embedding.engine.mutatorsstack

# Class FlutterMutatorsStack

java.lang.Object
io.flutter.embedding.engine.mutatorsstack.FlutterMutatorsStack

public class FlutterMutatorsStack extends Object
The mutator stack containing a list of mutators

The mutators can be applied to a `PlatformView` to perform a series mutations. See `FlutterMutatorsStack.FlutterMutator` for informations on Mutators.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `class`
  `FlutterMutatorsStack.FlutterMutator`
  A class represents a mutator
  `static enum`
  `FlutterMutatorsStack.FlutterMutatorType`
  The type of a Mutator See `FlutterMutatorsStack.FlutterMutator` for informations on Mutators.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FlutterMutatorsStack()`
  Initialize the mutator stack.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `List<Path>`
  `getFinalClippingPaths()`
  Get a list of all the clipping operations.
  `Matrix`
  `getFinalMatrix()`
  Returns the final matrix.
  `float`
  `getFinalOpacity()`
  Returns the final opacity.
  `List<FlutterMutatorsStack.FlutterMutator>`
  `getMutators()`
  Get a list of all the raw mutators.
  `void`
  `pushClipPath(Path path)`
  Push a clipPath `FlutterMutatorsStack.FlutterMutator` to the stack.
  `void`
  `pushClipRect(int left, int top, int right, int bottom)`
  Push a clipRect `FlutterMutatorsStack.FlutterMutator` to the stack.
  `void`
  `pushClipRRect(int left, int top, int right, int bottom, float[] radiis)`
  Push a clipRRect `FlutterMutatorsStack.FlutterMutator` to the stack.
  `void`
  `pushOpacity(float opacity)`
  Push an opacity `FlutterMutatorsStack.FlutterMutator` to the stack.
  `void`
  `pushTransform(float[] values)`
  Push a transform `FlutterMutatorsStack.FlutterMutator` to the stack.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### FlutterMutatorsStack

    public FlutterMutatorsStack()
    Initialize the mutator stack.

- ## Method Details

  - ### pushTransform

    public void pushTransform(float[] values)
    Push a transform `FlutterMutatorsStack.FlutterMutator` to the stack.
    Parameters:
      `values` - the transform matrix to be pushed to the stack. The array matches how a `Matrix` is constructed.

  - ### pushClipRect

    public void pushClipRect(int left, int top, int right, int bottom)
    Push a clipRect `FlutterMutatorsStack.FlutterMutator` to the stack.

  - ### pushClipRRect

    public void pushClipRRect(int left, int top, int right, int bottom, float[] radiis)
    Push a clipRRect `FlutterMutatorsStack.FlutterMutator` to the stack.
    Parameters:
      `left` - left offset of the rrect.
      `top` - top offset of the rrect.
      `right` - right position of the rrect.
      `bottom` - bottom position of the rrect.
      `radiis` - the radiis of the rrect. It must be size of 8, including an x and y for each corner.

  - ### pushOpacity

    public void pushOpacity(float opacity)
    Push an opacity `FlutterMutatorsStack.FlutterMutator` to the stack.
    Parameters:
      `opacity` - the opacity value to be pushed to the stack.

  - ### pushClipPath

    public void pushClipPath(Path path)
    Push a clipPath `FlutterMutatorsStack.FlutterMutator` to the stack.
    Parameters:
      `path` - the path to be clipped.

  - ### getMutators

    public List<FlutterMutatorsStack.FlutterMutator> getMutators()
    Get a list of all the raw mutators. The 0 index of the returned list is the top of the stack.

  - ### getFinalClippingPaths

    public List<Path> getFinalClippingPaths()
    Get a list of all the clipping operations. All the clipping operations -- whether it is clip rect, clip rrect, or clip path -- are converted into Paths. The paths are also transformed with the matrix that up to their stack positions. For example: If the stack looks like (from top to bottom): TransA -> ClipA -> TransB -> ClipB, the final paths will look like [TransA*ClipA, TransA*TransB*ClipB].

    Clipping this list to the parent canvas of a view results the final clipping path.

  - ### getFinalMatrix

    public Matrix getFinalMatrix()
    Returns the final matrix. Apply this matrix to the canvas of a view results the final transformation of the view.

  - ### getFinalOpacity

    public float getFinalOpacity()
    Returns the final opacity. The value must be between 0 and 1, inclusive, or behavior will be undefined.