FilesService class
A service to read and write to the file system.
The dashboard reads and writes to files in outputDir.
Constructors
Properties
-
batchedLogs
↔ Map<
String, List< WrappedMessage> > -
Holds data to be logged by logData when dataLogger fires.
getter/setter pair
- dataLogger ↔ Timer
-
Saves all the data in batchedLogs to a file by calling logAllData.
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
- jsonEncoder → JsonEncoder
-
The encoder to convert a Map<> to a json string with a nice indent
final
- loggingDir ↔ Directory
-
The directory where all logging data is outputted
latefinal
- outputDir ↔ Directory
-
The directory where the dashboard keeps its files.
latefinal
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- screenshotsDir → Directory
-
The directory where screenshots are stored.
no setter
- settingsFile → File
-
The file containing the user's Settings, in JSON form.
no setter
Methods
-
dispose(
) → Future< void> - Cleans up any resources used by the service.
-
init(
) → Future< void> - Ensure that files and directories that are expected to be present actually exist on the system. If not, create them.
-
logAllData(
Timer timer) → Future< void> - Logs all the data saved in batchedLogs and resets it.
-
logData(
Message message) → Future< void> - Outputs log data to the correct file based on message
-
logError(
Object error, StackTrace stack) → Future< void> - Outputs error to log file
-
logMessage(
BurtLog log) → Future< void> - Outputs a log to its device's respective log file.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
readLogs(
File file) → Future< List< WrappedMessage> > - Reads logs from the given file.
-
readSettings(
{bool retry = true}) → Future< Settings> - Reads the user's settings from the settingsFile.
-
toString(
) → String -
A string representation of this object.
inherited
-
writeImage(
List< int> image, String cameraName) → Future<void> - Saves the current frame in the feed to the camera's output directory.
-
writeSettings(
Settings? value) → Future< void> - Saves the Settings object to the settingsFile, as JSON.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited