Skip to content

Support macOS, Windows, Linux and web in one package #46

Description

@developerjamiu

Goal: go from two supported platforms to six, in one package, without federating.

Verified shape, matching what package_info_plus ships today:

Platform Mechanism Work
iOS existing pluginClass none
Android existing pluginClass none
macOS pluginClass + sharedDarwinSource: true reuses the iOS Swift, no second copy
Windows dartPluginClass shares one Dart implementation
Linux dartPluginClass shares one Dart implementation
Web pluginClass + fileName shares the same Dart implementation

Two implementations get from two platforms to six: the Darwin source already written, plus one Dart detector serving Windows, Linux and web.

macOS is close to free. Checked against MacOSX26.5.sdk: NSDataDetector and every checking type the plugin uses are available with the same availability as iOS, and a grep for UIKit symbols across all three Swift files returns nothing, so the classification code is pure Foundation. The work is renaming ios/ to darwin/, a podspec per platform, example/macos/, and the conditional FlutterMacOS import.

Windows, Linux and web have no system entity detector. A Dart implementation caps them at URLs, emails and phone numbers, plus the Dart-side types (hashtag, mention, custom).

Blocked by the platform instance caching issue, since Dart-only platforms register by assigning SmartTextFlutterPlatform.instance.

Also depends on removing the dart:io import for web.

README wording: "macOS full parity; Windows, Linux and web detect links, emails and phone numbers only." Do not advertise flat "desktop support" while address and date are missing on two of the three desktops.

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

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions