Wanted to use accent color for Card and since accentColor is deprecated I used colorScheme instead .Described colorScheme in themeData of MaterialApp. But in the end couldnt use that for card. Showing error: "The argument type 'ColorScheme' can't be assigned to the parameter type 'Color'"
here is themeData from MaterialApp
theme: ThemeData(
primarySwatch: Colors.green,
colorScheme: ColorScheme.fromSwatch().copyWith(secondary: Colors.red),
canvasColor: Color.fromRGBO(255, 245, 224, 1),
fontFamily: 'Raleway',
textTheme: ThemeData.light().textTheme.copyWith(
bodyText1: TextStyle(
color: Color.fromRGBO(23, 45, 23, 1),
),
bodyText2: TextStyle(
color: Color.fromRGBO(23, 45, 23, 1),
),
headline6: TextStyle(
fontSize: 20,
fontFamily: 'RobotoCondensed',
fontWeight: FontWeight.bold,
),
),
),
and here is the card where is use it
Card(
child: Text(selectedMeal.ingredients[i]),
color: Theme.of(context).colorScheme,//error shows here
),