Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
236 views
in Technique[技术] by (71.8m points)

flutter - how to create animations with 3 container

I want to create a simple animation. When I click one of this elements, the selected item must grow larger maybe with an animation, and the others they will have to decrease.

enter image description here

I use a GestureDetector()

                          GestureDetector(
                              onTap: () => {},
                              child: Column(children: <Widget>[
                                Image(
                                  image: AssetImage('images/one.png'),
                                  height: 80,
                                ),
                                Text(
                                  "One",
                                  textAlign: TextAlign.center,
                                  style: TextStyle(
                                      color: kBlueColor,
                                      fontWeight: FontWeight.bold,
                                      fontSize: 30),
                                ),
                              ]),
                            ),
question from:https://stackoverflow.com/questions/65943557/how-to-create-animations-with-3-container

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Check out this tutorial on animation. You are going to want to create an animation controller. The animation controller will let you play an animation. You will also want to use the transform widget. This will allow the picture that you are using to expand or move when the animation controller is activated. Also check out this tutorial. It's from flutter Europe and it goes in depth on animations.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...