updateCows method Null safety
Implementation
void updateCows(List<Cow> targetCows) {
_cows = _cows.map((_) {
Cow? targetCow = targetCows.firstWhereOrNull((targetCow) => targetCow == _);
if (targetCow != null) {
return targetCow;
} else {
return _;
}
}).toList();
notifyListeners();
}