oobMessageFromUrl function

OutOfBandMessage oobMessageFromUrl(
  1. String url
)

Converts Out-of-band message url url to OutOfBand message object.

Implementation

OutOfBandMessage oobMessageFromUrl(String url) {
  var asUri = Uri.parse(url);
  if (asUri.queryParameters.containsKey('_oob')) {
    return OutOfBandMessage.fromJson(utf8.decode(
        base64Decode(addPaddingToBase64(asUri.queryParameters['_oob']!))));
  } else {
    throw Exception('No Out-Of-Band Message found');
  }
}