From 7ad5ec40aae62e57bbdf3e9f6ca09dc8785019bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Drago=C8=99=20Tiselice?= Date: Wed, 21 Sep 2016 10:58:49 -0700 Subject: [PATCH] Changed Pesto logotype's position. (#5970) * Changed Pesto logotype's position. This commit changes Pesto's logotype position so that its curve aligns with the curve of the image size. * Added clamping to Pesto logo animation. --- examples/flutter_gallery/lib/demo/pesto_demo.dart | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/flutter_gallery/lib/demo/pesto_demo.dart b/examples/flutter_gallery/lib/demo/pesto_demo.dart index 0670653ac3..6aae355689 100644 --- a/examples/flutter_gallery/lib/demo/pesto_demo.dart +++ b/examples/flutter_gallery/lib/demo/pesto_demo.dart @@ -128,7 +128,7 @@ class _RecipeGridPageState extends State { bottom: extraPadding ), child: new Center( - child: new PestoLogo(height: logoHeight, t: t) + child: new PestoLogo(height: logoHeight, t: t.clamp(0.0, 1.0)) ) ); } @@ -193,7 +193,10 @@ class _PestoLogoState extends State { static const double kImageHeight = 108.0; static const double kTextHeight = 48.0; final TextStyle titleStyle = const PestoStyle(fontSize: kTextHeight, fontWeight: FontWeight.w900, color: Colors.white, letterSpacing: 3.0); - final Rect textRect = new Rect.fromLTWH(0.0, kImageHeight, kLogoWidth, kTextHeight); + final RectTween _textRectTween = new RectTween( + begin: new Rect.fromLTWH(0.0, kLogoHeight, kLogoWidth, kTextHeight), + end: new Rect.fromLTWH(0.0, kImageHeight, kLogoWidth, kTextHeight) + ); final Curve _textOpacity = const Interval(0.3, 1.0, curve: Curves.easeInOut); final RectTween _imageRectTween = new RectTween( begin: new Rect.fromLTWH(0.0, 0.0, kLogoWidth, kLogoHeight), @@ -215,7 +218,7 @@ class _PestoLogoState extends State { child: new Image.asset(_kSmallLogoImage, fit: ImageFit.contain) ), new Positioned.fromRect( - rect: textRect, + rect: _textRectTween.lerp(config.t), child: new Opacity( opacity: _textOpacity.transform(config.t), child: new Text('PESTO', style: titleStyle, textAlign: TextAlign.center),