canUpdate static method
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;
}