SnapdClient class

Manages a connection to the snapd server.

Constructors

SnapdClient({String userAgent = 'snapd.dart', dynamic socketPath = '/var/run/snapd.socket'})

Properties

allowInteraction bool
True if snapd operations are allowed to interact with the user. This affects operations that use polkit authorisation.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
userAgent String?
Sets the user agent sent in requests to snapd.
no getter

Methods

abortChange(String id) Future<SnapdChange>
Aborts the change with the given id.
close() → void
Terminates all active connections. If a client remains unclosed, the Dart process may not terminate.
connect(String snap, String plug, String slotSnap, String slot) Future<String>
Connects a plug to a slot. Returns the change ID for this operation, use getChange to get the status of this operation.
disable(String name) Future<String>
Returns the change ID for this operation, use getChange to get the status of this operation.
disconnect(String plugSnap, String plug, String slotSnap, String slot) Future<String>
Disonnects a plug from a slot. Returns the change ID for this operation, use getChange to get the status of this operation.
enable(String name) Future<String>
Returns the change ID for this operation, use getChange to get the status of this operation.
find({String? query, String? name, String? category, String? section, SnapFindFilter? filter, SnapFindScope? scope}) Future<List<Snap>>
Searches for snaps in the store.
getApps({List<String>? names, SnapdAppFilter? filter}) Future<List<SnapApp>>
Gets information on all installed apps.
getCategories() Future<List<SnapdCategoryDetails>>
Gets all the store categories available.
getChange(String id) Future<SnapdChange>
Gets the status the change with the given id.
getChanges({SnapdChangeFilter? filter, String? name}) Future<List<SnapdChange>>
Get changes that have occurred / are occurring on the snap daemon. Use filter to choose which changes to receive. Use name to return only changes to the snap with that name.
getConnections({String? snap, String? interface, SnapdConnectionFilter? filter}) Future<SnapdConnectionsResponse>
Gets the connections, plugs and slots used on this system.
getSnap(String name) Future<Snap>
Gets information on an installed snap with the given name.
getSnaps() Future<List<Snap>>
Gets informtion on all installed snaps.
install(String name, {String? channel, String? revision, bool classic = false, bool dangerous = false, bool devmode = false, bool jailmode = false}) Future<String>
Installs the snap with the given name. Returns the change ID for this operation, use getChange to get the status of this operation.
installMany(List<String> names, {bool classic = false}) Future<String>
Installs the snaps given by names. Returns the change ID for this operation, use getChange to get the status of this operation.
loadAuthorization({String? path}) Future<void>
Loads the saved authorization for this user.
login(String email, String password, {String? otp}) Future<SnapdLoginResponse>
Logs into the snap store.
logout(int id) Future
Logs out acccount with id from the snap store.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refresh(String name, {String? channel, bool classic = false}) Future<String>
Refreshes the snap with the given name. Returns the change ID for this operation, use getChange to get the status of this operation.
refreshMany(List<String> names) Future<String>
Refreshes the snaps given by names. Returns the change ID for this operation, use getChange to get the status of this operation.
remove(String name, {bool purge = false}) Future<String>
Removes the snap with the given name. Returns the change ID for this operation, use getChange to get the status of this operation.
setAuthorization(String macaroon, List<String> discharges) → void
Sets the authorization used in the connection to snapd.
systemInfo() Future<SnapdSystemInfoResponse>
Gets information about the system that snapd is running on.
toString() String
A string representation of this object.
inherited

Operators

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