Open 309791679 opened 2 years ago
Solved, the required package Center is what I did not expect
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,
),
),
],
),
),
),
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
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,
),
],
),
),
),
Container( height: 100.r, child: AnimatedTextKit( animatedTexts: [ WavyAnimatedText('Hello World',textStyle: TextStyle( fontSize: 20.0, color: Colors.black ), textAlign : TextAlign.center, ),
After the animation is completed, the text box returns to its original position
Just repeat forever, the effect will be very strange