toJson method

Map<String, dynamic> toJson({
  1. Map<String, dynamic> toJson(
    1. T
    )?,
})

Implementation

Map<String, dynamic> toJson({
  Map<String, dynamic> Function(T)? toJson,
}) {
  return {
    if (data != null) 'data': toJson != null ? toJson(data!) : data,
    if (error != null) 'error': error,
    if (message != null) 'message': message,
  };
}