VoidCallback onMetricsChanged

A callback that is invoked whenever the devicePixelRatio, physicalSize, or padding values change, for example when the device is rotated or when the application is resized (e.g. when showing applications side-by-side on Android).

The framework invokes this callback in the same zone in which the callback was set.

Source

VoidCallback get onMetricsChanged => _onMetricsChanged;
void onMetricsChanged=(VoidCallback callback)

Source

set onMetricsChanged(VoidCallback callback) {
  _onMetricsChanged = callback;
  _onMetricsChangedZone = Zone.current;
}