简体   繁体   中英

How to change SearchDelegate StatusBarIcons Color or buildSuggestions body Color in flutter?

In my AppBar the color of my StatusBarIcons is white, just because auf "Brightness.dark" If i use that in my SearchDelegate Window the the body color is dark too. If i just change the primaryColor to grey, then the StatusBarIcons are still black. Has anyone an idea to solve one of these cases?

PLUS: how to change the blue icon/bubble below the cursor and the two underlines white and green, picture 4?

文本

文本

文本

文本

To change Status bar color just use:

SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(statusBarColor: Colors.white));

To change the color of the blue bubble of cursor use inside your ThemeData:

textSelectionHandleColor: Colors.green,

still open: blue icon/bubble below the cursor

but for the rest my current solution, see code comments:

  @override
  ThemeData appBarTheme(BuildContext context) {
    return ThemeData(
      accentColor: Color(0xFF323232), // for the green line
      scaffoldBackgroundColor: Colors.white, // for the body color
      brightness: Brightness.dark, // to get white statusbar icons
      primaryColor: Color(0xFF323232), // set background color of SearchBar
      textSelectionTheme: TextSelectionThemeData(cursorColor: Colors.white), // cursor color
      textTheme: TextTheme(
        headline6: TextStyle(
          decorationColor: Color(0xFF323232), // color of text underline
        ),
      ),
    );
  }

If someone wants to test all ThemeData Colors:

      backgroundColor: Colors.red,
      bottomAppBarColor: Colors.red,
      canvasColor: Colors.red,
      cardColor: Colors.red,
      buttonColor: Colors.red,
      dialogBackgroundColor: Colors.red,
      disabledColor: Colors.red,
      dividerColor: Colors.red,
      errorColor: Colors.red,
      focusColor: Colors.red,
      highlightColor: Colors.red,
      hintColor: Colors.red,
      hoverColor: Colors.red,
      indicatorColor: Colors.red,
      primaryColorDark: Colors.red,
      primaryColorLight: Colors.red,
      secondaryHeaderColor: Colors.red,
      selectedRowColor: Colors.red,
      shadowColor: Colors.red,
      splashColor: Colors.red,
      toggleableActiveColor: Colors.red,
      unselectedWidgetColor: Colors.red,
      accentColor: Colors.red,
      scaffoldBackgroundColor: Colors.white,
      primaryColor: Colors.red,

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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