flutter_settings_screens
flutter_settings_screens copied to clipboard
SwitchSettingsTile background color
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 )
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,
),
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.
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 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(),
);