executeSession method

Future<void> executeSession(
  1. String sessionId, [
  2. Map<String, String>? variables,
  3. Network? network,
  4. List<UssdDialogOverride>? overrides,
])

Executes a session matching the specified in your app.

Implementation

Future<void> executeSession(
  String sessionId, [
  Map<String, String>? variables,
  Network? network,
  List<UssdDialogOverride>? overrides,
]) async {
  final args = {
    "sessionId": sessionId,
    "variables": variables,
  };

  if (network != null) {
    args["network"] = network.toMap();
  }

  if (overrides != null) {
    args["overrides"] = overrides.map((o) {
      return o.toMap();
    }).toList(growable: false);
  }

  await _methodChannel.invokeMethod(
    _executeSessionMethodName,
    args,
  );
}