sunLight property
SunLight?
get
sunLight
Aims directionalLight at a sky's sun so cast shadows track the sky.
While set, the binding owns directionalLight: each frame the engine points the light opposite the sky's sun and recolors it. Clearing it (setting null) removes the light the binding was driving. Pair it with a skyEnvironment on the same sky so soft IBL and the hard shadow agree.
Implementation
SunLight? get sunLight => _sunLight;
set
sunLight
(SunLight? value)
Implementation
set sunLight(SunLight? value) {
// The binding owns the convenience light; when it is cleared, retire the
// light it was driving so shadows stop.
if (value == null &&
_sunLight != null &&
identical(directionalLight, _sunLight!.light)) {
directionalLight = null;
}
_sunLight = value;
}