Skip to content

feat: add spans support to Text widget for inline rich text and widget embedding#2161

Merged
TheNoumanDev merged 1 commit intomainfrom
text_update
Feb 6, 2026
Merged

feat: add spans support to Text widget for inline rich text and widget embedding#2161
TheNoumanDev merged 1 commit intomainfrom
text_update

Conversation

@TheNoumanDev
Copy link
Member

Summary

  • Extends the existing Text widget with a new spans property that enables rich text rendering with mixed styling and inline widgets (e.g., Icons, Images) within a single text flow
  • When spans is provided, the widget internally uses Text.rich() with TextSpan and WidgetSpan children; existing text: usage remains fully unchanged
  • Adds span_definition.dart as a lightweight data class for parsing span entries from raw YAML

YAML Syntax

Text:
  spans:
    - text: "Read our "
    - text: "Terms of Service"
      textStyle:
        color: 0xff4b93e7
        decoration: underline
      onTap:
        navigateScreen:
          name: HelpScreen
    - widget:
        Icon:
          name: info
          size: 18
  styles:
    textStyle:
      fontSize: 16

Span Types

  • Text spanstext, optional textStyle override, optional onTap action
  • Widget spans — any Ensemble widget (Icon, Image, etc.) rendered inline via WidgetSpan

@TheNoumanDev TheNoumanDev self-assigned this Feb 5, 2026
@TheNoumanDev TheNoumanDev linked an issue Feb 5, 2026 that may be closed by this pull request
@TheNoumanDev TheNoumanDev merged commit e588e0a into main Feb 6, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add RichText/spans support to Text widget for inline widgets

2 participants