ExtensionEvent.fromJson constructor

ExtensionEvent.fromJson(
  1. List jsonList
)

Implementation

factory ExtensionEvent.fromJson(List<dynamic> jsonList) {
  final firstElement = jsonList.isEmpty ? null : jsonList.first;
  final json = listToMap(jsonList, type: firstElement == type ? type : null);
  final params = json['params'];
  return ExtensionEvent(
    params: params is String ? params : jsonEncode(params),
    method: json['method'] as String,
  );
}