start static method

Future<DeveloperPactStatus> start({
  1. Uri? endpoint,
})

Starts the reporter. Returns after one method-channel round trip; the native side replies at once with the current state and does all I/O on its own thread. Never throws.

endpoint overrides the server and exists only for testing the SDK against a staging deployment; leave it null in real apps.

Implementation

static Future<DeveloperPactStatus> start({Uri? endpoint}) async {
  if (!isSupported) {
    return DeveloperPactStatus.unsupported;
  }
  try {
    final reply = await _channel.invokeMethod<String>('start', {
      'endpoint': endpoint?.toString(),
    });
    return reply == 'paired'
        ? DeveloperPactStatus.paired
        : DeveloperPactStatus.notPaired;
  } catch (_) {
    // MissingPluginException in a host without the Android plugin
    // registered, or anything else: the host must never see it.
    return DeveloperPactStatus.notPaired;
  }
}