loadBackground method

void loadBackground(
  1. ImageProvider<Object> image, {
  2. ImageConfiguration configuration = const ImageConfiguration(),
  3. bool isBackgroundFollowingSphereRotation = false,
})

Loads the background image for the rotating globe.

The image parameter specifies the image to be loaded as the background. The configuration parameter specifies the configuration for loading the image. The isBackgroundFollowingSphereRotation parameter specifies whether the background should follow the rotation of the sphere.

Example usage:

controller.loadBackground(
AssetImage('assets/background.jpg'),
);

Implementation

void loadBackground(
  ImageProvider image, {
  ImageConfiguration configuration = const ImageConfiguration(),
  bool isBackgroundFollowingSphereRotation = false,
}) {
  image.resolve(configuration).addListener(ImageStreamListener((info, _) {
    background = info.image;
    backgroundConfiguration = configuration;
    isBackgroundFollowingSphereRotation = isBackgroundFollowingSphereRotation;
    notifyListeners();
  }));
}