Emir Bolat
Emir Bolat

Reputation: 1049

How to add presence animation to button in Flutter?

I have a TextButton. I want to add an animation to this TextButton. I want to add presence animation. So instead of suddenly existing without animation, it will slowly exist. How can I do that?

Codes:

  TextButton(
    child: Text('Example text button'),
    onPressed: () {
      print('Clicked');
    }
  )

Upvotes: 0

Views: 138

Answers (1)

Samuel Olufemi
Samuel Olufemi

Reputation: 1055

You can use these package argon_buttons to add animation to a button.

flutter_spinkit

ArgonButton(
  height: 50,
  width: 350,
  borderRadius: 5.0,
  color: Color(0xFF7866FE),
  child: Text(
    "Continue",
    style: TextStyle(
        color: Colors.white,
        fontSize: 18,
        fontWeight: FontWeight.w700
    ),
  ),
  loader: Container(
    padding: EdgeInsets.all(10),
    child: SpinKitRotatingCircle(
      color: Colors.white,
      // size: loaderWidth ,
    ),
  ),
  onTap: (startLoading, stopLoading, btnState) {
  },
)

Upvotes: 1

Related Questions