fromMap static method
Parses the bridge reply. Returns null when native has no session to
decide for (not initialized, or init failed) or the reply is malformed.
Implementation
static CxNetworkRequestSampling? fromMap(Map<Object?, Object?>? map) {
final isSampled = map?['isSampled'];
final sessionId = map?['sessionId'];
if (isSampled is! bool || sessionId is! String || sessionId.isEmpty) {
return null;
}
return CxNetworkRequestSampling(isSampled: isSampled, sessionId: sessionId);
}