Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
animated_text_kit
import 'package:animated_text_kit/animated_text_kit.dart';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: MyHomePage(),
);
}
}
class MyHomePage extends StatelessWidget {
nextAnimation() {}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Hello"),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Spacer(flex: 1),
RotateAnimatedTextKit(
onTap: () {
print("Tap Event");
},
totalRepeatCount: 200,
duration: Duration(seconds: 1),
text: [
"Rotate",
"Animated",
"TextKit",
"RotateAnimatedTextKit"
],
textStyle: TextStyle(fontSize: 30.0),
textAlign: TextAlign.center,
alignment:
AlignmentDirectional.topCenter // or Alignment.topLeft
),
Spacer(flex: 1),
TextLiquidFill(
text: 'TextLiquidFill',
waveColor: Colors.blueAccent,
loadDuration: Duration(seconds: 10),
boxBackgroundColor: Colors.redAccent,
textStyle: TextStyle(
fontSize: 30.0,
fontWeight: FontWeight.bold,
),
boxHeight: 120.0,
),
Spacer(flex: 1),
ColorizeAnimatedTextKit(
onTap: () {
print("Tap Event");
},
totalRepeatCount: 20,
text: [
"Colorize",
"Animated",
"TextKit",
"ColorizeAnimatedTextKit",
],
textStyle: TextStyle(fontSize: 30.0),
colors: [
Colors.yellow,
Colors.red,
Colors.purple,
],
textAlign: TextAlign.start,
alignment: AlignmentDirectional.topStart // or Alignment.topLeft
),
Spacer(flex: 1),
TyperAnimatedTextKit(
onTap: () {
print("Tap Event");
},
speed: Duration(milliseconds: 60),
text: [
"Typer",
"Animated",
"TextKit",
"TyperAnimatedTextKit",
],
textStyle: TextStyle(fontSize: 30.0),
textAlign: TextAlign.start,
alignment: AlignmentDirectional.topStart // or Alignment.topLeft
),
Spacer(flex: 1),
Image.network(
"https://pbs.twimg.com/media/EYCNkglUEAAVR4f?format=jpg&name=medium"),
Spacer(flex: 1),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: nextAnimation(),
tooltip: 'Next Animation',
child: Icon(Icons.add),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment