[英]how to change the color of the cursor in flutter search delegate?
我已經在 flutter 應用程序中實現了 flutter 搜索委托功能。現在我想更改 cursor 的顏色,因為它是白色,搜索欄的背景也是白色。 我需要將 cursor 顏色突出顯示為黑色。
我在 searchDelegate class 中嘗試了 appbarTheme,但它不起作用。
在 MaterialApp 中添加這個(它將為所有屏幕更改 cursor 顏色)
theme: ThemeData(
textSelectionTheme: const TextSelectionThemeData(
cursorColor: Colors.black,
),
),
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.