WIP: Cards build optimization

This commit is contained in:
Yegor Vialov
2020-04-25 17:38:21 +00:00
parent f488c0810b
commit 02bfaf7db6
15 changed files with 309 additions and 230 deletions

View File

@ -12,11 +12,11 @@ class EntityModel extends InheritedWidget {
final bool handleTap;
static EntityModel of(BuildContext context) {
return context.inheritFromWidgetOfExactType(EntityModel);
return context.dependOnInheritedWidgetOfExactType<EntityModel>();
}
@override
bool updateShouldNotify(InheritedWidget oldWidget) {
return true;
bool updateShouldNotify(EntityModel oldWidget) {
return entityWrapper.entity.lastUpdatedTimestamp != oldWidget.entityWrapper.entity.lastUpdatedTimestamp;
}
}