load static method

Future<ParallaxImage> load(
  1. String path, {
  2. ImageRepeat repeat = ImageRepeat.repeatX,
  3. Alignment alignment = Alignment.bottomLeft,
  4. LayerFill fill = LayerFill.height,
  5. Images? images,
  6. FilterQuality? filterQuality,
})

Takes a path of an image, and optionally arguments for how the image 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<ParallaxImage> load(
  String path, {
  ImageRepeat repeat = ImageRepeat.repeatX,
  Alignment alignment = Alignment.bottomLeft,
  LayerFill fill = LayerFill.height,
  Images? images,
  FilterQuality? filterQuality,
}) async {
  images ??= Flame.images;
  return ParallaxImage(
    await images.load(path),
    repeat: repeat,
    alignment: alignment,
    fill: fill,
    filterQuality: filterQuality,
  );
}