findById method

Future<DocumentDto> findById(
  1. String collection,
  2. String id
)

Implementation

Future<DocumentDto> findById(String collection, String id) async {
  String baseUrl = config.getDatabaseUrl();
  String url = '$baseUrl/$collection/$id';
  Map<String, dynamic> json = await http.get(url);
  return DocumentDto.fromJson(json);
}