We can define secondaryColor
in ThemeData like this:
theme: ThemeData(
primaryColor: Colors.black,
colorScheme: ColorScheme.fromSwatch().copyWith(
secondary: Colors.pinkAccent,
),
How to apply it in the following snippet?
ListTile(
trailing: Icon(
Icons.edit,
color: ... , // secondary color here
),
CodePudding user response:
Try with this
color: Theme.of(context).colorScheme.secondary