fetchArtCrimes function

Future<ArtCrimeResultSet> fetchArtCrimes({
  1. int pageSize = 50,
  2. int page = 1,
  3. ArtCrimeSortOn sortOn = ArtCrimeSortOn.modified,
  4. ArtCrimeSortDirection sortDirection = ArtCrimeSortDirection.descending,
  5. String? title,
  6. String? crimeCategory,
  7. String? maker,
  8. String? referenceNumber,
})

Fetches art crimes with the given parameters.

pageSize is the number of items to return per page. The FBI API does not specify a maximum value, but it appears to be 50.

page is the page number to return.

sortOn is the field to sort on. Note: The FBI API does not specify this, but it appears ArtCrimeSortOn.publication is deprecated.

sortDirection is the direction to sort in.

title is the title of the art piece involved in the desired crimes.

crimeCategory is the category the art piece involved in the desired crimes fall into.

maker is the maker of the art piece involved in the desired crimes.

referenceNumber is the reference number of the art piece involved in the desired crimes.

Implementation

Future<ArtCrimeResultSet> fetchArtCrimes({
  int pageSize = 50,
  int page = 1,
  ArtCrimeSortOn sortOn = ArtCrimeSortOn.modified,
  ArtCrimeSortDirection sortDirection = ArtCrimeSortDirection.descending,
  String? title,
  String? crimeCategory,
  String? maker,
  String? referenceNumber,
}) async {
  return await ArtCrimeService.fetchArtCrimes(
    pageSize: pageSize,
    page: page,
    sortOn: sortOn.value,
    sortOrder: sortDirection.value,
    title: title,
    crimeCategory: crimeCategory,
    maker: maker,
    referenceNumber: referenceNumber,
  );
}