onWidgetChanged method

void onWidgetChanged(
  1. BuildContext context,
  2. ListenableWidget<T> oldWidget,
  3. T viewModel
)

Called when the widget is updated with a new configuration. Use this to sync widget fields into the ViewModel when the parent rebuilds.

The oldWidget parameter contains the previous widget configuration.

Implementation

void onWidgetChanged(
  BuildContext context,
  ListenableWidget<T> oldWidget,
  T viewModel,
) {}