flutter-settings-ui
flutter-settings-ui copied to clipboard
How to get settingsListBackground from built SettingsList
I'm currently putting the SettingsList inside a Column with some other stuff. I want everything to have the same background color. I do not want to provide the background color via SettingsThemeData because I think the behavior in lib/src/utils/theme_provider.dart
is great. How do I get the color from a built SettingsList? If I make an instance of SettingsThemeData()
, the color is different from the built version, presumably because of the behavior from getTheme
. Could we expose a buildThemeData
method on SettingsThemeData / expose the theme data from SettingsList?
Try this
lightTheme: const SettingsThemeData(settingsListBackground: Colors.white),
Hey @banool, if I understand you correctly, you want to get the SettingsList background color? If so, here is the code for an example of how to do it :
- Get themeData
final themeData = ThemeProvider.getTheme( context: context, platform: platform, brightness: brightness)
- Now to get the background color, you can use
themeData.settingsListBackground
P.S. If that's what you need, but I didn't explain it well, or it's not at all, tell me about it, and I'll try to help you.
Hey so very late response here but I'm finding that what you suggest doesn't work @M-ixai-L.
First I get the themeData:
final themeData = Theme.of(context);
However there is no settingsListBackground
field on it.