update<R> method

  1. @override
Future<Response<T>> update<R>(
  1. String id,
  2. Map<String, dynamic> data, {
  3. R? source(
    1. R parent
    )?,
})
override

Implementation

@override
Future<Response<T>> update<R>(
  String id,
  Map<String, dynamic> data, {
  R? Function(R parent)? source,
}) async {
  final response = Response<T>();
  try {
    await _source(source).child(id).update(data);
    return response.copy(isSuccessful: true);
  } catch (_) {
    return response.copy(error: _.toString());
  }
}