I am passing an IconData
object as a parameter to a Widget
, but I am getting the following error: Type 'Icon' is not a subtype of type 'IconData' in type case
. I have attempted to find solutions to this issue on StackOverflow, but have not been able to resolve the error.
The following code is an example of what I am trying to do:
// gradientCardSample("کلی", 12, context, IconData(Icon(Icons.ac_unit) as int)),
gradientCardSample("عشق", 12, context, const Icon(Icons.book, size: 20, color: Colors.blue,) as IconData),