canUpdate static method

bool canUpdate(
  1. Widget oldWidget,
  2. Widget newWidget
)

Whether newWidget can be used to update an element that currently has oldWidget as its configuration.

Implementation

static bool canUpdate(Widget oldWidget, Widget newWidget) {
  return oldWidget.runtimeType == newWidget.runtimeType &&
      oldWidget.key == newWidget.key;
}