getSurveysForPlacement method

  1. @override
Future<List<TRSurvey>?> getSurveysForPlacement(
  1. String placementTag,
  2. TRErrorCallback errorCallback
)
override

Implementation

@override
Future<List<TRSurvey>?> getSurveysForPlacement(
    String placementTag, TRErrorCallback errorCallback) async {
  final callId = _newCallId();
  _errorCallbacks[callId] = errorCallback;
  final result = await methodChannel.invokeMethod<List<dynamic>>(
      'getSurveysForPlacement', {'callId': callId, 'placementTag': placementTag});
  _errorCallbacks.remove(callId);
  return result
      ?.map((e) => TRSurvey.fromJson(Map<String, dynamic>.from(e as Map)))
      .toList();
}