Skip to content

[rfw] Coerce numeric values in core Text widget#11138

Open
ciriousjoker wants to merge 4 commits intoflutter:mainfrom
ciriousjoker:rfw_coerce_numbers_in_texts
Open

[rfw] Coerce numeric values in core Text widget#11138
ciriousjoker wants to merge 4 commits intoflutter:mainfrom
ciriousjoker:rfw_coerce_numbers_in_texts

Conversation

@ciriousjoker
Copy link

This PR fixes numeric rendering in RFW core Text widgets.

Before:

  • Text(text: data.value) rendered empty when data.value was int or double.
  • Text(text: [data.left, " / ", data.right]) only rendered string segments.

After:

  • int and double values are stringified in both code paths:
    • direct Text(text: data.value)
    • list segments Text(text: [...])
  • Other types are unchanged (no bool/object coercion).

Fixes

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2

@ciriousjoker ciriousjoker requested a review from Hixie as a code owner February 27, 2026 23:04
@github-actions github-actions bot added the p: rfw Remote Flutter Widgets label Feb 27, 2026
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly addresses an issue where numeric values were not rendered in Text widgets, by implementing proper coercion of int and double values to strings in core_widgets.dart. A security audit confirmed that type coercion is safe, data flow is controlled, and no security vulnerabilities were identified. The accompanying test cases in core_widgets_test.dart are thorough, and I've provided a suggestion to improve the conciseness of the implementation for list-based text segments.

ciriousjoker and others added 2 commits February 28, 2026 00:14
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p: rfw Remote Flutter Widgets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RemoteFlutterWidgets: Text doesn't render numbers

1 participant