Baseflow / flutter-geocoding

A Geocoding plugin for Flutter
https://baseflow.com
MIT License
134 stars 69 forks source link

[Bug][Doc]: Documentation for `isPresent` is wrong #218

Closed lukehutch closed 4 months ago

lukehutch commented 4 months ago

Please check the following before submitting a new issue.

Please select affected platform(s)

Steps to reproduce

The documentation for isPresent was copied and pasted from locationFromAddress, and is incorrect.

/// Returns a list of [Location] instances found for the supplied address.
///
/// In most situations the returned list should only contain one entry.
/// However in some situations where the supplied address could not be
/// resolved into a single [Location], multiple [Location] instances may be
/// returned.
Future<List<Location>> locationFromAddress(String address) =>
    GeocodingPlatform.instance!.locationFromAddress(
      address,
    );

/// Returns a list of [Placemark] instances found for the supplied
/// coordinates.
///
/// In most situations the returned list should only contain one entry.
/// However in some situations where the supplied coordinates could not be
/// resolved into a single [Placemark], multiple [Placemark] instances may be
/// returned.
Future<List<Placemark>> placemarkFromCoordinates(
        double latitude, double longitude) =>
    GeocodingPlatform.instance!.placemarkFromCoordinates(
      latitude,
      longitude,
    );

/// Overrides default locale
///
/// Optionally you can specify a locale in which the results are returned.
/// When not supplied the currently active locale of the device will be used.
/// The `localeIdentifier` should be formatted using the syntax:
/// [languageCode]_[countryCode] (eg. en_US or nl_NL).
Future<void> setLocaleIdentifier(
  String localeIdentifier,
) =>
    GeocodingPlatform.instance!.setLocaleIdentifier(
      localeIdentifier,
    );

/// Returns a list of [Location] instances found for the supplied address.
///
/// In most situations the returned list should only contain one entry.
/// However in some situations where the supplied address could not be
/// resolved into a single [Location], multiple [Location] instances may be
/// returned.
Future<bool> isPresent({
  String? localeIdentifier,
}) =>
    GeocodingPlatform.instance!.isPresent();

Expected results

Doc needs to be rewritten

Actual results

Doc is wrong

Code sample

N/A

Screenshots or video

N/A

Version

2.2.1

Flutter Doctor output

N/A

TimHoogstrate commented 4 months ago

Is fixed in (https://github.com/Baseflow/flutter-geocoding/pull/222)