getServerCorrelationHeaders method Null safety

Future<Map<String, String>> getServerCorrelationHeaders()

Generates headers used to correlate requests with business transactions.

Usage: Retrieve the list of headers and set those header values on each outgoing HTTP request. Also, ensure that you are passing all response headers to the RequestTracker object itself via setRequestHeaders.

Method might throw Exception.

Implementation

static Future<Map<String, String>> getServerCorrelationHeaders() async {
  try {
    var response = await channel
        .invokeMethod<Map<dynamic, dynamic>>('getServerCorrelationHeaders');
    return Map<String, String>.from(response!);
  } on PlatformException catch (e) {
    throw Exception(e.details);
  }
}