Skip to content

iOS and Android disagree on text with no links #31

Open

Description

@developerjamiu
// ios/smart_text_flutter/Sources/smart_text_flutter/TextClassifier.swift:28-30
if links.isEmpty {
    return text.isEmpty ? [ItemSpan(text: text, type: "text", rawValue: text)] : []
}

The condition is inverted relative to Android (TextClassifier.kt:82-88):

Input iOS returns Android returns
Non-empty text, no links [] one text span
Empty text one span with empty text []

Confirmed at runtime during the audit: classifying "Hey, are we still on for later?" on iOS returns 0 spans.

The widgets hide this by falling back to plain Text when the list is empty, so it looks correct on screen. Anyone calling the documented public SmartTextFlutter.classifyText gets platform-dependent results.

Fix: match Android. Non-empty text with no links returns one text span; empty text returns [].

Found during the v0.4.0 codebase audit.

Activity

  1. added
    bug
    platform: ios
    api
    on Sep 17, 2026
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

    apibugplatform: ios

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions