translate animation to outside from right of screen

Issue

in this implementation of ui in flutter i want to i want to make translate to move container to outside from right of screen after click on IconButton, unfortunately my implementation is not work

enter image description here

class _Login extends State<Login> {
  var _alignment = Alignment.center;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Stack(
        children: <Widget>[
          AnimatedContainer(
            duration: Duration(seconds: 2),
            alignment: _alignment,
            child: Container(
                margin: EdgeInsets.only(
                    left: 25, top: MediaQuery.of(context).size.height * 0.25),
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: <Widget>[
                    SizedBox(
                      height: 20,
                    ),
                    Row(
                      children: <Widget>[
                        Container(
                          decoration: BoxDecoration(
                              color: Colors.indigo[600].withOpacity(0.6),
                              borderRadius: BorderRadius.only(
                                  topLeft: Radius.circular(10.0),
                                  bottomLeft: Radius.circular(10.0))),
                          height: 75,
                          width: MediaQuery.of(context).size.width * 0.73,
                          child: Row(
                            mainAxisAlignment: MainAxisAlignment.spaceBetween,
                            children: <Widget>[
                              Row(
                                children: <Widget>[
                                  SizedBox(
                                    width: 15,
                                  ),
                                ],
                              ),
                            ],
                          ),
                        ),
                        SizedBox(
                          width: 2.5,
                        ),
                        Container(
                          decoration: BoxDecoration(
                              color: Colors.indigo[600].withOpacity(0.6)),
                          height: 75,
                          width: MediaQuery.of(context).size.width -
                              ((MediaQuery.of(context).size.width * 0.73) +
                                  25 +
                                  2.5),
                          child: Row(
                            mainAxisAlignment: MainAxisAlignment.center,
                            children: <Widget>[
                              IconButton(
                                icon: new Icon(Icons.account_circle),
                                onPressed: () {
                                  print('ddddddddd');
                                    setState(() {
                                       _alignment = Alignment.centerRight;
                                    });
                                },
                                iconSize: 40.0,
                                color: Colors.white,
                              ),
                            ],
                          ),
                        ),
                      ],
                    )
                  ],
                )),
          )
        ],
      ),
    );
  }
}

Solution

problem resolved

i used this library and can be help me to make simple animations

Answered By – DolDurma

Answer Checked By – Marie Seifert (FlutterFixes Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *