LocalConfigService<T> class abstract

LocalConfigService is an abstract class designed to manage local configuration files. It provides a generic interface for loading and saving configuration data of type T.

This class leverages AppDirService to determine the directory where the configuration file should be stored.

Example:

class MyConfigService extends LocalConfigService<MyConfig> {
  MyConfigService(AppDirService appDirService) : super(appDirService, "my_config.json");
  // Implement loadConfig and saveConfig methods
}
Implementers

Constructors

LocalConfigService(AppDirService appDirService, String fileName)
LocalConfigService is an abstract class designed to manage local configuration files. It provides a generic interface for loading and saving configuration data of type T.

Properties

appDirService → AppDirService
An instance of AppDirService used to determine the directory for storing the configuration file.
final
fileName → String
The name of the configuration file.
final
hashCode → int
The hash code for this object.
read-onlyinherited
runtimeType → Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

canLoadConfig() → Future<bool>
Returns a Future that resolves to true if the configuration can be loaded and false otherwise.
deleteConfig() → Future<void>
Deletes the configuration file.
loadConfig() → Future<T>
Abstract method to load the configuration data.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolveConfigFile() → Future<File>
Returns a Future that resolves to a File object representing the configuration file.
saveConfig(T config) → Future<void>
Abstract method to save the configuration data.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited