crime 0.1.1 crime: ^0.1.1 copied to clipboard
Package to make requests to the Crime API crimeometer. It exposes four methods to gather information about crime stats and crime reports around the world.
import 'package:crime/crime.dart';
void main() async {
try {
const String API_KEY = "XXXXXXXXXXXXXXX"; // Your private API Key.
final Crime crime = Crime(apiKey: API_KEY);
final CrimeIncidents crimeIncidents = await crime.getCrimeIncidents(
37.773972,
-122.431297,
"50mi",
DateTime(2021, 1, 1),
DateTime(2021, 2, 7),
);
crimeIncidents.incidents?.forEach((CrimeRawData crimeData) {
print(
"Crime incident [${crimeData.incidentOffense}] at [${crimeData.cityKey}]");
});
} catch (e) {
print(e);
}
}