簡體   English   中英

Flutter SearchDelegate:如何刪除文本下方的文本下划線和藍線(顏色)?

[英]Flutter SearchDelegate: How to remove text underline and blue line (color) below text?

關於 Flutter 搜索委托:

How to remove text underline and blue line (color) below text?

要么

to set transparent or to change color?

我不想用新的文本字段等更改完整的小部件,因為 SearchDelegate 已經很好或者是一個完成的小部件。

在此處輸入圖片說明

我的代碼在 Flutter 的 SearchDelegate 小部件中:

  @override
  ThemeData appBarTheme(BuildContext context) {
    return ThemeData(
      dividerTheme: DividerThemeData(
        color: Colors.white,
      ),
      primaryIconTheme: IconThemeData(color: Colors.white),

      scaffoldBackgroundColor: Colors.white, // for the body color
      brightness: Brightness.dark, // to get white statusbar icons
      primaryColor: glovar.getColor(farbnr), // set background color of SearchBar
      textSelectionTheme: TextSelectionThemeData(
        cursorColor: Colors.white,
      ), // cursor color

    );
  }

您可以為TextField添加裝飾:

                decoration: InputDecoration(
                    focusedBorder: UnderlineInputBorder(
                        borderSide:
                            BorderSide(color: Color(0xFFE6C58C))), // your color

白線的這個解決方案怎么樣:“decorationThickness:0.0000001,”

在此處輸入圖片說明

  @override
  ThemeData appBarTheme(BuildContext context) {
    return ThemeData(
      dividerTheme: DividerThemeData(
        color: Colors.white,
      ),
      primaryIconTheme: IconThemeData(color: Colors.white),

      inputDecorationTheme: InputDecorationTheme(
        focusedBorder: UnderlineInputBorder(borderSide: BorderSide(color: Colors.red)),
      ),
      accentColor: Colors.white, // for the green line
      scaffoldBackgroundColor: Colors.white, // for the body color
      brightness: Brightness.dark, // to get white statusbar icons
      primaryColor: glovar.getColor(farbnr), // set background color of SearchBar
      textSelectionTheme: TextSelectionThemeData(
        cursorColor: Colors.white,
      ), // cursor color
      textTheme: TextTheme(
        headline6: TextStyle(
          //decoration:TextDecoration.none,
          decorationThickness: 0.0000001,
          //decorationColor: Colors.transparent, // color of text underline
        ),
      ),
    );
  }



暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM