didUpdateViewer method
void
didUpdateViewer(
- covariant AssetPickerViewerState<
Asset, Path> state, - covariant AssetPickerViewer<
Asset, Path> oldWidget, - covariant AssetPickerViewer<
Asset, Path> newWidget
Call when the viewer is calling State.didUpdateWidget. 当预览器调用 State.didUpdateWidget 时操作 State。
Since delegates are relatively "Stateless" compare to the AssetPickerViewerState, the widget that holds the delegate might changed when using the viewer as a nested widget, which will construct a new delegate and only calling State.didUpdateWidget at the moment.
Implementation
@mustCallSuper
void didUpdateViewer(
covariant AssetPickerViewerState<Asset, Path> state,
covariant AssetPickerViewer<Asset, Path> oldWidget,
covariant AssetPickerViewer<Asset, Path> newWidget,
) {
// Widgets are useless in the default delegate.
initAnimations(state);
}