TogleButton Flutter

Viewed 29

enter image description here

                 Padding(
          padding:
              const EdgeInsets.only(top: 15.0, left: 10.0, right: 10.0),
          child: Center(
            child: ClipRRect(
              borderRadius: BorderRadius.circular(25.0),
              child: Container(
                height: 50,
                width: screenWidth * 0.92,
                color: Constants.colorGrisNuevo,
                child: Stack(
                  children: <Widget>[
                    Positioned(
                        left: 100.0,
                        child: Container(
                            color: Colors.blue,
                            height: 50,
                            width: screenWidth * 0.80)), //atras
                    ClipRRect(
                      borderRadius: BorderRadius.circular(25.0),
                      child: Container(
                        color: Colors.red,
                        height: 50.0,
                        width: screenWidth * 0.60,
                      ),
                    ),
                  ],
                ),
              ),
            ),
          ),
        ),

I am trying to recreate this pair of buttons, but the truth is that the animation I will not be able to do, is there a pub dev plugin already? What to solve this ?, Eye all my code is not completed, some details were missing with the containers.

(Edit) I managed to replicate the widget, is there a way to make an animation for the color change? Or is this a horizontal gesture with the finger?

0 Answers
Related