aagarwal1012 / Animated-Text-Kit

🔔 A flutter package to create cool and beautiful text animations. [Flutter Favorite Package]
https://animated-text-kit.web.app
MIT License
1.65k stars 305 forks source link

Wavy problem #271

Open 309791679 opened 2 years ago

309791679 commented 2 years ago

Container( height: 100.r, child: AnimatedTextKit( animatedTexts: [ WavyAnimatedText('Hello World',textStyle: TextStyle( fontSize: 20.0, color: Colors.black ), textAlign : TextAlign.center, ),

                      WavyAnimatedText('Hello World',textStyle: TextStyle(
                          fontSize: 20.0,
                          color: Colors.black
                      ), textAlign : TextAlign.center,
                      ),

                    ],
                    repeatForever: true,
                  ),
                ),

After the animation is completed, the text box returns to its original position

Just repeat forever, the effect will be very strange

309791679 commented 2 years ago

Solved, the required package Center is what I did not expect

309791679 commented 2 years ago
  Container(

                      height: 100.0,
                      width: 300.0,
                      child: Center( //Very important

                        child:AnimatedTextKit(
                          repeatForever: true,
                          animatedTexts: [
                            WavyAnimatedText(
                              'Hello World',
                              textStyle: const TextStyle(
                                fontSize: 24.0,
                                fontWeight: FontWeight.bold,
                              ),
                            ),

                          ],

                        ),
                      ),
                    ),
309791679 commented 2 years ago

Not good for Chinese support

Container(

                      height: 30.0,
                      width: 300.0,
                      alignment: Alignment.center,
                      child: Center(
                        child: AnimatedTextKit(

                          repeatForever: true,
                          animatedTexts: [
                            WavyAnimatedText(

                              '这是一段中文的例子',
                              textStyle:  TextStyle(
                                fontSize: 12.0,
                                fontWeight: FontWeight.bold,
                              ),

                              textAlign: TextAlign.center,
                            ),

                          ],

                        ),
                      ),
                    ),

After the animation is complete, move the text box up a bit

309791679 commented 2 years ago

The example seems to have moved slightly


   Container(

                      height: 30.0,
                      width: 300.0,
                      alignment: Alignment.center,
                      child: Center(
                        child: AnimatedTextKit(

                          repeatForever: true,
                          animatedTexts: [
                            WavyAnimatedText(

                              'Hello World',
                              textStyle:  TextStyle(
                                fontSize: 24.0,
                                fontWeight: FontWeight.bold,
                              ),

                              textAlign: TextAlign.center,
                            ),

                          ],

                        ),
                      ),
                    ),