Search code examples
flutterdartflutter-layout

How to change splash color of outlined button?


Latest outlined button doesn’t have any splash color property. How to change the splash color? Anyone have any idea

                  OutlinedButton(
                      style: OutlinedButton.styleFrom(
                        onSurface: Colors.green,
                        side: BorderSide(color: alertColor, width: 1),
                      ),
                      onPressed: () {},
                      child: Row(
                        children: [
                          FaIcon(
                            FontAwesomeIcons.trash,
                            size: 14,
                            color: alertColor,
                          ),
                          SizedBox(
                            width: 10,
                          ),
                          Text(
                            'Delete',
                            style: getFont(14, FontWeight.w500, alertColor),
                          )
                        ],
                      ),
                    )

Solution

  • Okay my mistakes. The primary properties in OutlinedButton.styleFrom() can change the splash color.