flutter - 更改 TextField 颤动的选定文本颜色
解决方案
使用TextSpan
小部件,完美再现您的示例图像
RichText(
text: TextSpan(
// set the default style for the children TextSpans
style: Theme.of(context).textTheme.body1.copyWith(fontSize: 30),
children: [
TextSpan(
text: 'Hello, ',
),
TextSpan(
text: 'Wor',
style: TextStyle(
color: Colors.blue
)
),
TextSpan(
text: 'ld',
),
]
)
)
推荐阅读
- tensorflow - 用于 Microsoft Cognitive CNTK/TensorFlow 的 VGA 卡 (GPU)
- jenkins - 将多个节点添加到 Jenkins master
- c# - C# SOAP 响应格式错误
- opencart - 如何在所有页面上添加商店名称?
- jquery - 无法使用 ajax 将复选框值保存到数据库中
- android - 如何在 Android Studio 和 IntelliJ 中安装颤振和飞镖?
- networking - 将 DHT 用于八卦协议?
- spring - Spring ResourceBundleMessageSource 多个属性文件配置在 spring xml 文件中?
- audiokit - 是否可以将输入重置为 AudioKit AKNode?
- angular - 在 Visual Studio 2017 中使用 Angular 2 设置 Angular 材质类型