Skip to content

Commit

Permalink
T? for result
Browse files Browse the repository at this point in the history
  • Loading branch information
vporton committed Feb 9, 2023
1 parent 7b10f46 commit cf455db
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions example/places_autocomplete.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ Future<void> main() async {
);

print('\nDetails :');
print(details.result.formattedAddress);
print(details.result.formattedPhoneNumber);
print(details.result.url);
print(details.result!.formattedAddress);
print(details.result!.formattedPhoneNumber);
print(details.result!.url);
} else {
print(res.errorMessage);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/core.dart
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ abstract class GoogleResponseList<T> extends GoogleResponseStatus {
}

abstract class GoogleResponse<T> extends GoogleResponseStatus {
final T result;
final T? result;

GoogleResponse(String status, String? errorMessage, this.result)
: super(status: status, errorMessage: errorMessage);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/places.dart
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ enum PriceLevel {

@JsonSerializable()
class PlacesDetailsResponse extends GoogleResponseStatus {
final PlaceDetails result;
final PlaceDetails? result;

/// JSON html_attributions
@JsonKey(defaultValue: <String>[])
Expand Down
2 changes: 1 addition & 1 deletion lib/src/places.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cf455db

Please sign in to comment.