isGooglePayAvailable method

Future<bool> isGooglePayAvailable()

Implementation

Future<bool> isGooglePayAvailable() async {
  final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
    MFConstants.channelGPayName.googlePayAvailable,
    codec,
    binaryMessenger: _binaryMessenger,
  );
  final List<Object?>? replyList = await channel
      .send(<Object?>[]).timeout(quickOperationTimeout, onTimeout: () {
    throw TimeoutException(
      'Google Pay availability check timed out after ${quickOperationTimeout.inSeconds} seconds',
      quickOperationTimeout,
    );
  }) as List<Object?>?;
  return modelParser<bool>(replyList);
}