lastModified property
When the file was last modified
Implementation
@override
DateTime get lastModified {
try {
// For VM platforms with IO file
final ioFile = _ioFile;
if (ioFile != null) {
return ioFile.lastModifiedSync();
}
// For web, XFile.lastModified returns a Future<DateTime>, but we need
// sync access. We return the current time as a fallback.
// Users should use lastModifiedAsync() for web compatibility.
return DateTime.now();
} catch (e) {
return DateTime.now();
}
}