From 99346d00c15e92ab7278f7fb0451761ad331d308 Mon Sep 17 00:00:00 2001 From: Collin Jackson Date: Thu, 16 Jul 2015 17:39:36 -0700 Subject: [PATCH] abarth feedback --- packages/flutter/lib/widgets/navigator.dart | 28 +++++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/packages/flutter/lib/widgets/navigator.dart b/packages/flutter/lib/widgets/navigator.dart index 4096c7d05d..03d8c3bf91 100644 --- a/packages/flutter/lib/widgets/navigator.dart +++ b/packages/flutter/lib/widgets/navigator.dart @@ -63,9 +63,11 @@ class Transition extends AnimatedComponent { AnimationPerformance _performance; void initState() { - _position = new AnimatedType(_kTransitionStartPoint) - ..end = Point.origin - ..curve = easeOut; + _position = new AnimatedType( + _kTransitionStartPoint, + end: Point.origin, + curve: easeOut + ); _opacity = new AnimatedType(0.0, end: 1.0) ..curve = easeOut; _performance = new AnimationPerformance() @@ -96,6 +98,7 @@ class Transition extends AnimatedComponent { direction = source.direction; _start(); } + interactive = source.interactive; onDismissed = source.onDismissed; super.syncFields(source); } @@ -222,14 +225,17 @@ class Navigator extends StatefulComponent { if (content == null) continue; String key = historyEntry.route.key; - Transition transition = new Transition(content: content, key: key) - ..direction = (i <= state.historyIndex) ? TransitionDirection.forward : TransitionDirection.reverse - ..interactive = (i == state.historyIndex) - ..onDismissed = () { - setState(() { - state.history.remove(historyEntry); - }); - }; + Transition transition = new Transition( + key: key, + content: content, + direction: (i <= state.historyIndex) ? TransitionDirection.forward : TransitionDirection.reverse, + interactive: (i == state.historyIndex), + onDismissed: () { + setState(() { + state.history.remove(historyEntry); + }); + } + ); visibleRoutes.add(transition); } return new Stack(visibleRoutes);