简体   繁体   English

Flutter - 如何更改 cursor 选择的文本颜色?

[英]Flutter - How to change the color of the text being selected by the cursor?

I need to change the color of the text being highlighted by the cursor.我需要更改 cursor 突出显示的文本的颜色。 I am able to chagne the color of cursor, its selction and handler using textSelectionTheme .我可以使用textSelectionTheme更改 cursor 的颜色,它的选择和处理程序。 But, how can I change the color of the highlighted text?但是,如何更改突出显示文本的颜色?

ThemeData so far. ThemeData的主题数据。

get _lightTheme => ThemeData(
      disabledColor: Colors.grey.shade400,
      textSelectionTheme: TextSelectionThemeData(
        cursorColor: AppPalette.primaryColorLight,
        selectionColor: AppPalette.primaryColorLight.withOpacity(0.5),
        selectionHandleColor: AppPalette.primaryColorLight,
      ),
);

This is not possible as of now.目前这是不可能的。 You can track this link in github您可以在 github 中跟踪此链接

https://github.com/flutter/flutter/issues/99231 https://github.com/flutter/flutter/issues/99231

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM