Change BottomSheet backgroundColor (Modifying component theme properties not currently supported by FlexColorScheme) #85
-
Please I'd like to know how to change the background color of a modal bottom sheet using FlexSubThemesData. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hi @superakabo, Thank you for your question. You are right there is no built-in option in current version of FCS to set its background color directly. FCS does not try to replace everything you can do with A key thing to remember is that This is explained and shown here too: #41 (comment) It would be equivalent to do it for the All this said, it is of course much more convenient when key props like this can be set directly in FCS too. I might be adding this and few other colors in some minor step release before next major release. A bit off topic and background talkMostly I see In Material 2 that means it is In Material3 it should both in light and dark mode get Meanwhile yes, giving it some color that separates it a bit from the background is often needed. In FCS when you use surface blends, and a blend mode where surface, background and scaffoldBackground all have a bit different blend strength relation to each other, it accomplishes this automatically in both M2 and M3 mode as well. Still those blends are not everybody's cup of tea, so a custom color may be needed and called for for the Just out of curiosity, are you using a completely custom color for it, ie something not in the app's Just thinking that this might be a case that if I add support for it, it would be nice to be able to do both, quick pick a Mostly I tend to only offer what you have in the I'm marking this as answered, but if you need more guidance, don't hesitate to follow with more questions in the comments. |
Beta Was this translation helpful? Give feedback.
Hi @superakabo,
Thank you for your question. You are right there is no built-in option in current version of FCS to set its background color directly. FCS does not try to replace everything you can do with
ThemeData
, trying to replace everything is not really the goal, it focuses on things that are tedious or tricky to do.A key thing to remember is that
FlexColorScheme.toTheme
orFlexThemeData.light/dark
just return a fancy configuration of standardThemeData
. You can get and store thisThemeData
data object and further modify it anyway you want withcopyWith
on the returnedThemeData
, before you apply it as the theme in yourMaterialApp
.This is explained and shown here too: #41 (comment)
…