I have this code for my dark mode color theme. And I want to changed the color of all modalBottomSheets globally using this code. However I can't figure out what I use to change that part of the theme.
var kDarkColorScheme = ColorScheme.fromSeed(seedColor: Colors.grey);
void main() {
runApp(
MaterialApp(
darkTheme: ThemeData.dark().copyWith(
useMaterial3: true,
colorScheme: kDarkColorScheme,
cardTheme: CardTheme().copyWith(
color: kDarkColorScheme.secondaryContainer,
margin: EdgeInsets.symmetric(
horizontal: 16,
vertical: 8),
),
appBarTheme: AppBarTheme().copyWith(
backgroundColor: Color.fromARGB(137, 0, 0, 0),
foregroundColor: Color.fromARGB(255, 122, 122, 122),
),
),
This is my modalBottomSheet's code:
void _openAddExpenseOverlay() {
showModalBottomSheet(
isScrollControlled: true,
context: context,
builder: (ctx) => NewExpense(onAddExpense: _addExpense),
);
}
I tried adding popupMenuTheme: PopupMenuThemeData(color: Colors.red),
to the ThemeData. However this doesn't change anything on my modalBottomSheet. I know I need to set something that's same type of value in the same place I set this popupMenuTheme: There is no modalBottomSheet: on the autofill list though. Sorry if this last bit is confusing, I'm only in the beginning of learning flutter and I don't remember the names of stuff well (What is it? parameter, operator, function, idk I get these words mixed up).