Skip to content

Commit

Permalink
FIX initial release patches
Browse files Browse the repository at this point in the history
  • Loading branch information
imvalient committed Apr 6, 2021
1 parent 2696e35 commit 35ce678
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.1.1
- Dart static analysis fixes.
- Fix exception class not being exposed.

# 0.1.0
Initial commit.
- getCrimeCoverageData
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ It has a FREE API key for testing purposes that can be found in the previous lin

```yaml
dependencies:
crime: 0.1.0
crime: 0.1.1
```
## Example
Expand Down
1 change: 1 addition & 0 deletions lib/crime.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ export 'src/model/crime_coverage.dart';
export 'src/model/crime_incidents.dart';
export 'src/model/crime_raw_data.dart';
export 'src/model/crime_stats.dart';
export 'src/exception/crime_exception.dart';
12 changes: 8 additions & 4 deletions lib/src/crime.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ class Crime {
Future<List<CrimeCoverage>> getCrimeCoverageData() {
final String? apiKey = this.apiKey;

if (apiKey == null)
if (apiKey == null) {
throw MandatoryApiKeyException("API Key it's a mandatory field", "001");
}

return _client
.getCrimeCoverageData(apiKey, http.Client())
Expand All @@ -35,8 +36,9 @@ class Crime {
{int page = 1}) {
final String? apiKey = this.apiKey;

if (apiKey == null)
if (apiKey == null) {
throw MandatoryApiKeyException("API Key it's a mandatory field", "001");
}

return _client
.getCrimeIncidents(latitude, longitude, distance, startDateTime,
Expand All @@ -53,8 +55,9 @@ class Crime {
{int source = 1}) {
final String? apiKey = this.apiKey;

if (apiKey == null)
if (apiKey == null) {
throw MandatoryApiKeyException("API Key it's a mandatory field", "001");
}

return _client
.getCrimeStats(latitude, longitude, distance, startDateTime,
Expand All @@ -76,8 +79,9 @@ class Crime {
{int page = 1}) {
final String? apiKey = this.apiKey;

if (apiKey == null)
if (apiKey == null) {
throw MandatoryApiKeyException("API Key it's a mandatory field", "001");
}

return _client
.getCrowdsourcedCrimeIncidents(latitude, longitude, distance,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: crime
version: 0.1.0
version: 0.1.1
homepage: https://github.com/imvalient/crime
repository: https://github.com/imvalient/crime
description: >-
Expand Down

0 comments on commit 35ce678

Please sign in to comment.