act method

Future act(
  1. String action, {
  2. Map<String, dynamic> args = const {},
  3. String? responseAction,
})

wrapper to send an 'action' to ProPresenter along with arguments set response action to '' to ignore responses or when no response is expected

Implementation

Future act(String action, {Map<String, dynamic> args = const {}, String? responseAction}) async {
  loading = true;
  print('sending $action');
  notify('action sent');
  var result = await _send({"action": action, ...args}, responseAction: responseAction);
  loading = false;
  print('completed $action');
  notify('action completed');
  return result;
}