ui improvements
This commit is contained in:
parent
28cd64aaee
commit
f5d2e991a8
6 changed files with 184 additions and 199 deletions
|
@ -2,11 +2,22 @@ import 'package:flutter/material.dart';
|
|||
import 'package:simple_animations/simple_animations.dart';
|
||||
|
||||
class AnimatedBackground extends StatelessWidget {
|
||||
final List<Color> animateColors;
|
||||
final Color lastColor;
|
||||
final Alignment begin, end;
|
||||
|
||||
AnimatedBackground(
|
||||
this.animateColors,
|
||||
this.lastColor,
|
||||
this.begin,
|
||||
this.end,
|
||||
);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final tween = MultiTrackTween([
|
||||
Track("color1").add(Duration(seconds: 4),
|
||||
ColorTween(begin: Colors.lightBlue, end: Colors.lightBlue[300])),
|
||||
ColorTween(begin: this.animateColors[0], end: this.animateColors[1])),
|
||||
]);
|
||||
|
||||
return ControlledAnimation(
|
||||
|
@ -17,9 +28,9 @@ class AnimatedBackground extends StatelessWidget {
|
|||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [animation["color1"], Colors.lightBlue])),
|
||||
begin: this.begin,
|
||||
end: this.end,
|
||||
colors: [animation["color1"], this.lastColor])),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
|
Reference in a new issue