onMetricsChanged property

  1. @override
VoidCallback? onMetricsChanged
override

A callback that is invoked whenever the ViewConfiguration of any of the views changes.

For example when the device is rotated or when the application is resized (e.g. when showing applications side-by-side on Android), onMetricsChanged is called.

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

The framework registers with this callback and updates the layout appropriately.

See also:

Implementation

@override
VoidCallback? get onMetricsChanged => _platformDispatcher.onMetricsChanged;
  1. @override
void onMetricsChanged=(VoidCallback? callback)
override

Implementation

@override
set onMetricsChanged(VoidCallback? callback) {
  _onMetricsChanged = callback;
}