Jaimin Modi
Jaimin Modi

Reputation: 1667

SlideAction Icon color need to change - Flutter

Using below package in Flutter : https://pub.dev/packages/flutter_slidable/example

There in code you will find below widget:

SlidableAction(
                onPressed: doNothing,
                backgroundColor: Color(0xFF0392CF),
                foregroundColor: Colors.white,
                icon: Icons.save,
                label: 'Save',
              ),

Now Please note that icon property has Icons.save which is inbuilt and coming from flutter inbuilt sdk package.

Now, I want to change the color of that Icon. I have tried using Icons() widget but it only accept Icons.any_inbuild_icon name as a value.

How can I change the color of that Slidable Icon? Thanks in advance.

Upvotes: 0

Views: 953

Answers (2)

SAT77
SAT77

Reputation: 21

I found a workaround for this issue: Check the workaround . It seems that the problem occurs in the latest version of Flutter 3.27

Upvotes: 0

iamrishan
iamrishan

Reputation: 104

foregroundColor is the color of the icon. so change the value of foreground and it works for me.

foregroundColor: Colors.white,

CHANGE TO WHATEVER COLOR YOU WANT example: Colors.red or pass hex value Color(0xDE00FF00)

VIEW CODE

VIEW RESULT

Upvotes: 1

Related Questions