isStale method

bool isStale(
  1. String path
)

Whether the model at path is to be cooked and its cooked copy is missing or was made from another file or other settings.

Implementation

bool isStale(String path) {
  if (!hasSettings(path) && !isCooked(path)) return false;
  final source = _file(path);
  if (!source.existsSync()) return false;
  final cooked = _file(ModelImportSettings.cookedOf(path));
  if (!cooked.existsSync()) return true;
  final stamp = CookedModel.stampOf(readCookedHead(cooked.path));
  return stamp != cookStamp(source.readAsBytesSync(), settingsOf(path));
}