crime 0.1.3 copy "crime: ^0.1.3" to clipboard
crime: ^0.1.3 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.

example/main.dart

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 CrimeRawIncidents 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);
  }
}
1
likes
130
pub points
6%
popularity

Publisher

verified publisherimanol.dev

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.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

http, intl

More

Packages that depend on crime