commandStatus function Null safety
- String id
status of command. Returns "done", "inProgress", or "error" example of use:
while (await theta.commandStatus(id) != 'done') {
await theta.commandStatus(id);
Implementation
Future<String> commandStatus(String id) async {
var response = await ThetaBase.post('commands/status', body: {'id': id});
await Future.delayed(Duration(milliseconds: 100));
Map<String, dynamic> responseMap = jsonDecode(response);
return responseMap['state'];
}