I have used card widget and container both in one screen and set the white color in both and it's display correct in container but not correct in card widget. I have attache the screenshot. in this screenshot code and emulator both are show for compared.
Thank you in advanced Note I have used the App them for Light theme and dark theme.
ThemeData lightTheme(){
return ThemeData.light(useMaterial3: true).copyWith(
scaffoldBackgroundColor: Colors.white,
primaryColor: Colors.black,
primaryColorDark: Colors.white,
appBarTheme: AppBarTheme(
backgroundColor: Colors.white,
shadowColor: Colors.black,
elevation: 15,
foregroundColor: Colors.black,
titleTextStyle:TextStyle().copyWith(color: Colors.black,fontFamily: EAFontName.Muli,fontWeight: EAFontWeight.muliMedium),
),
textTheme: TextTheme(
titleSmall: TextStyle().copyWith(color: Colors.black,fontFamily: EAFontName.Muli,fontWeight: EAFontWeight.muliRegular,fontSize: EAFontSize.size10),
titleMedium: TextStyle().copyWith(color: Colors.black,fontFamily: EAFontName.Muli,fontWeight: EAFontWeight.muliSemiBold,fontSize: EAFontSize.size12),
titleLarge: TextStyle().copyWith(color: Colors.black,fontFamily: EAFontName.Muli,fontWeight: EAFontWeight.muliBold,fontSize: EAFontSize.size16),
),
bottomNavigationBarTheme: BottomNavigationBarThemeData(
backgroundColor: Colors.white54,
selectedItemColor: Colors.black,
unselectedItemColor: Colors.black54,
elevation: 16,
),
cardColor: Colors.white,
cardTheme: CardTheme(
color: Colors.white,
shadowColor: Colors.black,
elevation: 6,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16),
// side: BorderSide(color: Colors.black,width: 1)
),
),
);
}
ThemeData darkTheme(){
return ThemeData.light(useMaterial3: true).copyWith(
scaffoldBackgroundColor: Colors.black,
primaryColor: Colors.white,
primaryColorDark: Colors.black,
appBarTheme: AppBarTheme(
backgroundColor: Colors.black,
shadowColor: Colors.white,
elevation: 15,
foregroundColor: Colors.white,
titleTextStyle: TextStyle().copyWith(color: Colors.white,fontFamily: EAFontName.Muli,fontWeight: EAFontWeight.muliMedium),
),
textTheme: TextTheme(
titleSmall: TextStyle().copyWith(color: Colors.white,fontFamily: EAFontName.Muli,fontWeight: EAFontWeight.muliRegular,fontSize: EAFontSize.size10),
titleMedium: TextStyle().copyWith(color: Colors.white,fontFamily: EAFontName.Muli,fontWeight: EAFontWeight.muliSemiBold,fontSize: EAFontSize.size12),
titleLarge: TextStyle().copyWith(color: Colors.white,fontFamily: EAFontName.Muli,fontWeight: EAFontWeight.muliBold,fontSize: EAFontSize.size16),
),
bottomNavigationBarTheme: BottomNavigationBarThemeData(
backgroundColor: Colors.black54,
selectedItemColor: Colors.white,
unselectedItemColor: Colors.white54,
elevation: 16,
),
cardColor: Colors.black,
cardTheme: CardTheme(
color: Colors.black,
shadowColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16),
// side: BorderSide(color: Colors.white,width: 1)
),
elevation: 8
),
);
}
I have also try add Theme color to card widegts but same result getting.
Thank in advanced