From 2ac2653da8352834b9559f69ef97cefdfa97a590 Mon Sep 17 00:00:00 2001 From: Hans Muller Date: Thu, 20 Aug 2015 11:25:59 -0700 Subject: [PATCH] Workaround for Drawer.initState() fails --- sky/packages/sky/lib/widgets/drawer.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sky/packages/sky/lib/widgets/drawer.dart b/sky/packages/sky/lib/widgets/drawer.dart index 1db7e33ed35fb..8bb184da2d54d 100644 --- a/sky/packages/sky/lib/widgets/drawer.dart +++ b/sky/packages/sky/lib/widgets/drawer.dart @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'dart:async'; import 'dart:sky' as sky; import 'package:sky/animation/animated_value.dart'; @@ -68,7 +69,9 @@ class Drawer extends StatefulComponent { _performance.attachedForce = kDefaultSpringForce; if (navigator != null) { - navigator.pushState(this, (_) => _performance.reverse()); + scheduleMicrotask(() { + navigator.pushState(this, (_) => _performance.reverse()); + }); } }