install method
Installs the snap with the given name
.
Returns the change ID for this operation, use getChange to get the status of this operation.
Implementation
Future<String> install(String name,
{String? channel,
String? revision,
bool classic = false,
bool dangerous = false,
bool devmode = false,
bool jailmode = false}) async {
var request = <String, dynamic>{'action': 'install'};
if (channel != null) {
request['channel'] = channel;
}
if (revision != null) {
request['revision'] = revision;
}
if (classic) {
request['classic'] = true;
}
if (dangerous) {
request['dangerous'] = true;
}
if (devmode) {
request['devmode'] = true;
}
if (jailmode) {
request['jailmode'] = true;
}
var encodedName = Uri.encodeComponent(name);
return await _postAsync('/v2/snaps/$encodedName', request);
}