FlutterEarthGlobeController constructor
FlutterEarthGlobeController({
- ImageProvider<
Object> ? surface, - ImageProvider<
Object> ? nightSurface, - ImageProvider<
Object> ? background, - double rotationSpeed = 0.2,
- bool isZoomEnabled = true,
- double zoom = 1,
- double maxZoom = 2.5,
- double minZoom = -1.0,
- bool isRotating = false,
- bool isBackgroundFollowingSphereRotation = false,
- ImageConfiguration surfaceConfiguration = const ImageConfiguration(),
- ImageConfiguration nightSurfaceConfiguration = const ImageConfiguration(),
- ImageConfiguration backgroundConfiguration = const ImageConfiguration(),
- SphereStyle sphereStyle = const SphereStyle(),
- bool isDayNightCycleEnabled = false,
- double sunLongitude = 0.0,
- double sunLatitude = 0.0,
- double dayNightBlendFactor = 0.15,
- bool useRealTimeSunPosition = false,
- DayNightCycleDirection dayNightCycleDirection = DayNightCycleDirection.leftToRight,
- double zoomSensitivity = 0.8,
- double panSensitivity = 1.0,
- bool zoomToMousePosition = false,
- double panOffsetX = 0.0,
- double panOffsetY = 0.0,
- bool showAtmosphere = true,
- Color atmosphereColor = const ui.Color.fromARGB(255, 57, 123, 185),
- double atmosphereBlur = 30.0,
- double atmosphereThickness = 0.03,
- double atmosphereOpacity = 0.2,
Implementation
FlutterEarthGlobeController({
ImageProvider? surface,
ImageProvider? nightSurface,
ImageProvider? background,
this.rotationSpeed = 0.2,
this.isZoomEnabled = true,
this.zoom = 1,
this.maxZoom = 2.5,
this.minZoom = -1.0, // Allow zooming out further (negative = smaller globe)
bool isRotating = false,
this.isBackgroundFollowingSphereRotation = false,
this.surfaceConfiguration = const ImageConfiguration(),
this.nightSurfaceConfiguration = const ImageConfiguration(),
this.backgroundConfiguration = const ImageConfiguration(),
this.sphereStyle = const SphereStyle(),
this.isDayNightCycleEnabled = false,
this.sunLongitude = 0.0,
this.sunLatitude = 0.0,
this.dayNightBlendFactor = 0.15,
this.useRealTimeSunPosition = false,
this.dayNightCycleDirection = DayNightCycleDirection.leftToRight,
this.zoomSensitivity = 0.8,
this.panSensitivity = 1.0,
this.zoomToMousePosition = false,
this.panOffsetX = 0.0,
this.panOffsetY = 0.0,
this.showAtmosphere = true,
this.atmosphereColor = const ui.Color.fromARGB(255, 57, 123, 185),
this.atmosphereBlur = 30.0,
this.atmosphereThickness = 0.03,
this.atmosphereOpacity = 0.2,
}) {
assert(minZoom < maxZoom);
assert(zoom >= minZoom && zoom <= maxZoom);
_isRotating = isRotating;
if (surface != null) {
loadSurface(surface);
}
if (nightSurface != null) {
loadNightSurface(nightSurface);
}
if (background != null) {
loadBackground(background);
}
}