1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-08 22:09:06 +00:00

Samples maintenance (#435)

This commit is contained in:
Brett Morgan
2020-05-13 09:18:26 +10:00
committed by GitHub
parent 941ebebfad
commit baa1f976b2
94 changed files with 492 additions and 349 deletions

View File

@@ -8,6 +8,7 @@ class TypewriterTween extends Tween<String> {
TypewriterTween({String begin = '', String end})
: super(begin: begin, end: end);
@override
String lerp(double t) {
var cutoff = (end.length * t).round();
return end.substring(0, cutoff);
@@ -17,6 +18,7 @@ class TypewriterTween extends Tween<String> {
class CustomTweenDemo extends StatefulWidget {
static const String routeName = '/basics/custom_tweens';
@override
_CustomTweenDemoState createState() => _CustomTweenDemoState();
}
@@ -27,6 +29,7 @@ class _CustomTweenDemoState extends State<CustomTweenDemo>
AnimationController controller;
Animation<String> animation;
@override
void initState() {
super.initState();
@@ -34,11 +37,13 @@ class _CustomTweenDemoState extends State<CustomTweenDemo>
animation = TypewriterTween(end: message).animate(controller);
}
@override
void dispose() {
controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(