Skip to content

Commit

Permalink
Merge pull request #79 from blackmann/nullsafety
Browse files Browse the repository at this point in the history
Bump to 0.10.0
  • Loading branch information
blackmann authored Oct 9, 2022
2 parents ff7bf33 + 28f9c37 commit 71cd5e6
Show file tree
Hide file tree
Showing 12 changed files with 429 additions and 162 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
## [0.9.19] - 18 Jan 2022
## [0.10.0] - 07 Oct 2022
Dependencies updated
Changed `location` dependency to `geolocator` for current location
NullPointerException fix for android devices
fixes #39 #75

## [0.9.20-nullsafety] - 18 Jan 2022
Change `body1` to `bodyText1`

## [0.9.18-nullsafety] - 22 March 2021
Upgrade to nullsafety

## [0.9.18] - 2 Nov 2020
Upgraded http package

Expand Down
2 changes: 1 addition & 1 deletion example/example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class PickerDemoState extends State<PickerDemo> {
}

void showPlacePicker() async {
LocationResult result = await Navigator.of(context).push(
LocationResult? result = await Navigator.of(context).push(
MaterialPageRoute(builder: (context) => PlacePicker("YOUR API KEY")));

// Handle the result in your way
Expand Down
4 changes: 2 additions & 2 deletions lib/entities/address_component.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class AddressComponent {
String name;
String shortName;
String? name;
String? shortName;

AddressComponent({this.name, this.shortName});

Expand Down
8 changes: 4 additions & 4 deletions lib/entities/auto_complete_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
/// into this model.
class AutoCompleteItem {
/// The id of the place. This helps to fetch the lat,lng of the place.
String id;
String? id;

/// The text (name of place) displayed in the autocomplete suggestions list.
String text;
String? text;

/// Assistive index to begin highlight of matched part of the [text] with
/// the original query
int offset;
int? offset;

/// Length of matched part of the [text]
int length;
int? length;
}
24 changes: 12 additions & 12 deletions lib/entities/location_result.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,30 @@ class LocationResult {
/// The human readable name of the location. This is primarily the
/// name of the road. But in cases where the place was selected from Nearby
/// places list, we use the <b>name</b> provided on the list item.
String name; // or road
String? name; // or road

/// The human readable locality of the location.
String locality;
String? locality;

/// Latitude/Longitude of the selected location.
LatLng latLng;
LatLng? latLng;

/// Formatted address suggested by Google
String formattedAddress;
String? formattedAddress;

AddressComponent country;
AddressComponent? country;

AddressComponent city;
AddressComponent? city;

AddressComponent administrativeAreaLevel1;
AddressComponent? administrativeAreaLevel1;

AddressComponent administrativeAreaLevel2;
AddressComponent? administrativeAreaLevel2;

AddressComponent subLocalityLevel1;
AddressComponent? subLocalityLevel1;

AddressComponent subLocalityLevel2;
AddressComponent? subLocalityLevel2;

String postalCode;
String? postalCode;

String placeId;
String? placeId;
}
6 changes: 3 additions & 3 deletions lib/entities/near_by_place.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import 'package:google_maps_flutter/google_maps_flutter.dart';
class NearbyPlace {
/// The human-readable name of the location provided. This value is provided
/// for [LocationResult.name] when the user selects this nearby place.
String name;
String? name;

/// The icon identifying the kind of place provided. Eg. lodging, chapel,
/// hospital, etc.
String icon;
String? icon;

// Latitude/Longitude of the provided location.
LatLng latLng;
LatLng? latLng;
}
2 changes: 1 addition & 1 deletion lib/widgets/near_by_place_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class NearbyPlaceItem extends StatelessWidget {
padding: EdgeInsets.symmetric(horizontal: 24, vertical: 16),
child: Row(
children: <Widget>[
Image.network(nearbyPlace.icon, width: 16),
Image.network(nearbyPlace.icon!, width: 16),
SizedBox(width: 24),
Expanded(child: Text("${nearbyPlace.name}", style: TextStyle(fontSize: 16)))
],
Expand Down
Loading

0 comments on commit 71cd5e6

Please sign in to comment.