contentsFromFile property

TimestampedData<String> get contentsFromFile

Get and return the contents and timestamp of the underlying file.

Clients should consider using the method AnalysisContext.getContents because contexts can have local overrides of the content of a source that the source is not aware of.

Throws an exception if the contents of this source could not be accessed. See contents.

Implementation

TimestampedData<String> get contentsFromFile {
  return TimestampedData<String>(
    file.modificationStamp,
    // ignore:deprecated_member_use_from_same_package
    fileReadMode(file.readAsStringSync()),
  );
}