load static method

Future<ParallaxLayer> load(
  1. ParallaxData data, {
  2. Vector2? velocityMultiplier,
  3. ImageRepeat repeat = ImageRepeat.repeatX,
  4. Alignment alignment = Alignment.bottomLeft,
  5. LayerFill fill = LayerFill.height,
  6. Images? images,
  7. FilterQuality? filterQuality,
})

Takes a data of a parallax renderer, and optionally arguments for how it should repeat (repeat), which edge it should align with (alignment), which axis it should fill the image on (fill) and images which is the image cache that should be used. If no image cache is set, the global flame cache is used.

Implementation

static Future<ParallaxLayer> load(
  ParallaxData data, {
  Vector2? velocityMultiplier,
  ImageRepeat repeat = ImageRepeat.repeatX,
  Alignment alignment = Alignment.bottomLeft,
  LayerFill fill = LayerFill.height,
  Images? images,
  FilterQuality? filterQuality,
}) async {
  return ParallaxLayer(
    await data.load(
      repeat,
      alignment,
      fill,
      images,
      filterQuality,
    ),
    velocityMultiplier: velocityMultiplier,
  );
}