flutter_settings_screens icon indicating copy to clipboard operation
flutter_settings_screens copied to clipboard

SwitchSettingsTile background color

Open azazadev opened this issue 4 years ago • 3 comments

I'm using this lightTheme and darkTheme, and I would like to have the same background color for the SwitchSettingsTile ( white SwitchSettingsTile background for lightTheme theme and RGB(27, 39, 55, 1.0) SwitchSettingsTile background for darkTheme )

image

  lightTheme: ThemeData(
        primarySwatch: Colors.grey,
        primaryColor: Colors.white,
        brightness: Brightness.light,
        backgroundColor: const Color(0xFFE5E5E5),
        scaffoldBackgroundColor: Colors.white,
        accentColor: Colors.blueAccent,
        accentIconTheme: IconThemeData(color: Colors.white),
        dividerColor: Colors.white54,
      ),
      darkTheme: ThemeData(
        brightness: Brightness.dark,
        primarySwatch: Colors.grey,
        primaryColor: Color.fromRGBO(27, 39, 55, 1.0),
        backgroundColor: const Color(0xFF212121),
        scaffoldBackgroundColor: Color.fromRGBO(27, 39, 55, 1.0),
        accentColor: Colors.blueAccent,
        accentIconTheme: IconThemeData(color: Colors.black),
        dividerColor: Colors.black12,
      ),

azazadev avatar Jan 03 '21 13:01 azazadev

I am planning to add a theme based customization to in the library. It will be either a color property in each widget or a complete custom theme implementation.

In any case, I'll make sure to make changes that adapts the color of settings widgets based on the Theme data of the Material App Widget.

GAM3RG33K avatar May 29 '21 13:05 GAM3RG33K

Wouldn't it already help here to drop the Material Widget from the SettingsContainer Widget? That way the color behind the widget should be applied. At that seems to work for me when having a SettingsContainer on an elevated card in dark mode, where the Material widget has the wrong color as its missing the ElevationOverlay.

maltemedocs avatar Feb 10 '22 13:02 maltemedocs

@maltemedocs you can set theme like with this sample code:

return MaterialApp(
  title: 'Flutter Demo',
  debugShowCheckedModeBanner: false,
  theme: ThemeData(
    primarySwatch: Colors.blue,
    listTileTheme: ListTileThemeData(
      tileColor: Colors.redAccent,
    ),
  ),
  home: MyHomePage(),
);

pishguy avatar Jan 06 '23 05:01 pishguy