Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

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

animation - flutter rotate only one character of my text

I am using WavyAnimatedTextKit() from the animated_text_kit package to write the word "BROKEN" on my app's welcome screen.

                Container(
                  margin: EdgeInsets.only(bottom: 60, top: 30),
                  height: 40,
                  child: WavyAnimatedTextKit(
                    isRepeatingAnimation: false,
                    text: ["BROKEN"],
                    textStyle: TextStyle(
                      fontSize: 35.0,
                      fontWeight: FontWeight.w700,
                      color: Colors.white,
                    ),
                  ),
                ),

After it's written on the screen, I would like to rotate animate the "K" by 180 degrees to the right.

I couldn't find a solution so far to rotate only a single character. Most solutions I found would only rotate the entire widget / Text.

Any ideas / solutions to animate a rotating character after the word is written on screen?

Thanks

question from:https://stackoverflow.com/questions/65884063/flutter-rotate-only-one-character-of-my-text

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

1 Reply

0 votes
by (71.8m points)

Try to split the text into 3 part side by side:

Row(children:[
WavyAnimatedTextKit(
                    isRepeatingAnimation: false,
                    text: ["BRO"],
                    textStyle: TextStyle(
                      fontSize: 35.0,
                      fontWeight: FontWeight.w700,
                      color: Colors.white,
                    ),
                  ),
RotatedBox(
  quarterTurns: 2,
  child:
WavyAnimatedTextKit(
                    isRepeatingAnimation: false,
                    text: ["K"],
                    textStyle: TextStyle(
                      fontSize: 35.0,
                      fontWeight: FontWeight.w700,
                      color: Colors.white,
                    ),
                  ),
),
WavyAnimatedTextKit(
                    isRepeatingAnimation: false,
                    text: ["EN"],
                    textStyle: TextStyle(
                      fontSize: 35.0,
                      fontWeight: FontWeight.w700,
                      color: Colors.white,
                    ),
                  ),
],),

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...