Repository navigation
Closed
Labels
P2Important issues not at the top of the work lista: typographyText rendering, possibly libtxtfound in release: 3.47Found to occur in 3.47frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onteam-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team
Description
Steps to reproduce
- Create an app with Flutter 3.47.9.
- Define one TextStyle whose background is opaque red.
- Render that style on three text rows using TextStyle.lerp(redStyle, null, t). Set t to 0, 0.5, and 1 respectively, and label each row with its value. These rows represent the start, midpoint, and end of a transition from the red style toward null.
- Run the app with flutter run -d chrome and compare the red background behind each row.
Additional context
In the b == null branch, TextStyle.lerp currently uses Color.lerp(null, a.backgroundColor, t), reversing the fade direction. The adjacent color and decorationColor fields interpolate from their value toward null. A regression test fails on unchanged 3.47.9 and passes when the backgroundColor arguments are reversed. The proposed fix is in this commit.
Expected results
The background fades out: opaque red at t = 0, half transparent at t = 0.5, and transparent at t = 1.
Actual results
The background fades in: transparent at t = 0, half transparent at t = 0.5, and opaque red at t = 1.
Code sample
Code sample
import 'package:flutter/material.dart';
void main() {
const redStyle = TextStyle(backgroundColor: Colors.red);
runApp(MaterialApp(
home: Scaffold(
body: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
for (final t in [0.0, 0.5, 1.0])
Padding(
padding: const EdgeInsets.all(8),
child: Text(
't = $t highlighted text',
style: TextStyle.lerp(redStyle, null, t),
),
),
],
),
),
),
));
}Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
[Paste your logs here]Flutter Doctor output
Doctor output
[√] Flutter (Channel stable, 3.47.9, on Microsoft Windows [Version 10.0.26200.9711], locale en-US) [292ms]
• Flutter version 3.47.9 on channel stable at E:\projects\flutter\sdk-stable
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision c197ca5199 (8 days ago), 2026-10-29 10:10:20 -0400
• Engine revision 89c39edfdf
• Dart version 3.13.7
• DevTools version 2.60.0
• Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, no-enable-windows-desktop, no-enable-android, enable-ios, cli-animations, enable-native-assets, enable-record-use, enable-swift-package-manager, omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration
[√] Windows Version (Windows 11 or higher, 25H2, 2009) [749ms]
[√] Chrome - develop for the web [8ms]
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Connected device (2 available) [124ms]
• Chrome (web) • chrome • web-javascript • Google Chrome 156.0.8078.81
• Edge (web) • edge • web-javascript • Microsoft Edge 156.0.4314.58
[√] Network resources [253ms]
• All expected network resources are available.
• No issues found!```
</details>Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work lista: typographyText rendering, possibly libtxtfound in release: 3.47Found to occur in 3.47frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onteam-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team
Activity
mbcorona commentedon Nov 9, 2026
Thanks for the report and the fix @hangy233.
Confirmed from source: in the b == null branch of TextStyle.lerp, backgroundColor lerps from null toward a.backgroundColor while color and decorationColor lerp the other way. PR #196153 is up with the one-line fix and a regression test.
Routing to the framework team to review the PR.
justinmc commentedon Nov 10, 2026
Sounds like a bug we should fix, thanks for the report.
Fix TextStyle background color fade-out when lerping to null (flutter…