commandStatus function Null safety

Future<String> commandStatus(
  1. 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'];
}