getSurveys method
Implementation
@override
Future<void> getSurveys(
void Function(List<Survey>) onResponse,
void Function(Exception) onFailure,
) async {
try {
final List result = await methodChannel.invokeMethod('getSurveys');
final surveys = result.map((item) => Survey.fromJson(item)).toList();
onResponse(surveys);
} on PlatformException catch (e) {
onFailure(Exception(e.message));
} catch (e) {
onFailure(Exception(e));
}
}