PMProgressHandler constructor

PMProgressHandler()

Creates a new PMProgressHandler object.

Throws an error if used on a platform other than iOS or macOS.

Implementation

PMProgressHandler() : _channelIndex = _incrementalIndex {
  assert(
    Platform.isIOS || Platform.isMacOS,
    '$runtimeType should only be used on iOS or macOS.',
  );
  _channel = OptionalMethodChannel(
    '${PMConstants.channelPrefix}/progress/$_channelIndex',
  );
  _channel.setMethodCallHandler(_onProgress);
  _incrementalIndex++;
}