Skip to content

Expose structured address components #49

Description

@developerjamiu

Apple returns structured address components, and the plugin throws all of them away, keeping one arbitrary value.

Available keys, from NSTextCheckingResult.h:

NSTextCheckingNameKey, NSTextCheckingJobTitleKey, NSTextCheckingOrganizationKey,
NSTextCheckingStreetKey, NSTextCheckingCityKey, NSTextCheckingStateKey,
NSTextCheckingZIPKey, NSTextCheckingCountryKey, NSTextCheckingPhoneKey

The same components dictionary carries NSTextCheckingAirlineKey and NSTextCheckingFlightKey for transit matches, so this lands naturally alongside flight support.

Proposed:

/// Structured detail for the span, where the platform provides it.
/// Populated on Apple platforms; null elsewhere.
final Map<String, String>? components;

Every other Flutter package highlights an address. None of them hand back a parsed one. This is a stronger claim to being the leading detection package than the type count is.

Depends on fixing the address rawValue issue first, which currently consumes this same dictionary incorrectly.

Found during the v0.4.0 codebase audit.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiPublic API shapeenhancementNew feature or requestplatform: iosAffects the iOS or macOS implementation

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions