2

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?

Text

Text

Text

Text

AlexF1
  • 365
  • 3
  • 13

2 Answers2

2

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,
      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,
      colorScheme: ColorScheme.fromSwatch().copyWith(secondary: Colors.red),
      scaffoldBackgroundColor: Colors.white,
      primaryColor: Colors.red,
AlexF1
  • 365
  • 3
  • 13
  • accentColor doesn't seem to work anymore, now the line is blue, maybe after updating flutter – AlexF1 Jun 13 '21 at 08:41
  • solution for the blue line and white underline: https://stackoverflow.com/questions/68546112/flutter-searchdelegate-how-to-remove-text-underline-and-blue-line-color-below – AlexF1 Jul 30 '21 at 17:23
1

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,
  • hi, the first one makes the statusbar white, but i just need white icons/symbols. At the moment i'm using Colors.transparant in the main.dart. the second doesn't work in old and new position: 'textSelectionHandleColor' is deprecated and shouldn't be used. Use TextSelectionThemeData.selectionHandleColor instead. This feature was deprecated after v1.23.0-4.0.pre.. – AlexF1 Mar 24 '21 at 18:18
  • with "brightness: Brightness.dark," i can set "scaffoldBackgroundColor: Colors.white," – AlexF1 Mar 24 '21 at 18:56