beginProgrammaticMove method
void
beginProgrammaticMove()
Marks the camera events that the app's own camera update is about to produce, until the camera settles again.
Call it immediately before the platform camera call, not before the awaits leading up to one: time spent waiting for a map to exist is not time the camera is moving, and it would eat the settleWindow.
Implementation
void beginProgrammaticMove() {
_source = MapMoveSource.programmatic;
_settleTimeout?.cancel();
// A timer rather than a deadline compared against `DateTime.now()`: it is
// not affected by the wall clock being corrected under us, and it does not
// make reading [moveSource] mutate anything.
_settleTimeout = Timer(settleWindow, () {
_settleTimeout = null;
_source = MapMoveSource.gesture;
});
}