dart-google-maps icon indicating copy to clipboard operation
dart-google-maps copied to clipboard

StructuredFormatting._secondaryText has non-nullable-type, but actual value can be null

Open matanshukry opened this issue 2 months ago • 2 comments

I am playing around with the google maps and as part of the search I have received an error, since I tried to use the secondaryText getter.

DartError: TypeError: null: type 'Null' is not a subtype of type 'String'
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 274:3                     throw_
dart-sdk/lib/_internal/js_shared/lib/rti.dart 1717:3                                            _asString
dart-sdk/lib/_internal/js_shared/lib/js_util_patch.dart 82:5                                    getProperty
package:google_maps/src/generated/places_autocomplete_service/structured_formatting.dart 35:31  StructuredFormatting.get$35secondaryText

Line 35 is: String get secondaryText => _secondaryText;

This was received as a response from the AutocompleteService.getPlacePredictions method.

matanshukry avatar Oct 03 '25 22:10 matanshukry

An example where documentation lies about nullability as it's not marked optional 🫤

a14n avatar Oct 04 '25 13:10 a14n

An example where documentation lies about nullability as it's not marked optional 🫤

To be fair though, I don't think the documentation is null-safety xd

That is, they didn't say it was required either.

matanshukry avatar Oct 04 '25 14:10 matanshukry