loadNightSurface method

void loadNightSurface(
  1. ImageProvider<Object> image, {
  2. ImageConfiguration configuration = const ImageConfiguration(),
})

Loads the image as the night surface of the globe for day/night cycle effect.

The image parameter represents the image to be loaded as the night surface of the globe. The configuration parameter is optional and can be used to customize the image configuration.

Example usage:

controller.loadNightSurface(
 AssetImage('assets/earth_night.jpg'),
);

Implementation

void loadNightSurface(
  ImageProvider image, {
  ImageConfiguration configuration = const ImageConfiguration(),
}) {
  image
      .resolve(configuration)
      .addListener(ImageStreamListener((info, _) async {
    nightSurface = info.image;
    nightSurfaceConfiguration = configuration;
    nightSurfaceProcessed = await convertImageToUint32List(info.image);
    notifyListeners();
  }));
}