From 52c7a123fc2e8adb05344b93c833fe7ef023c4f8 Mon Sep 17 00:00:00 2001 From: Hans Muller Date: Wed, 22 Feb 2017 11:06:31 -0800 Subject: [PATCH] Fixed "AppBar actions are vertically centered" test (#8333) --- packages/flutter/test/material/app_bar_test.dart | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/flutter/test/material/app_bar_test.dart b/packages/flutter/test/material/app_bar_test.dart index 4a4ce0cf1e..f10ea8c1c2 100644 --- a/packages/flutter/test/material/app_bar_test.dart +++ b/packages/flutter/test/material/app_bar_test.dart @@ -223,10 +223,7 @@ void main() { ); // The vertical center of the widget with key, in global coordinates. - double yCenter(Key key) { - RenderBox box = tester.renderObject(find.byKey(appBarKey)); - return box.localToGlobal(new Point(0.0, box.size.height / 2.0)).y; - } + double yCenter(Key key) => tester.getCenter(find.byKey(key)).y; expect(yCenter(appBarKey), equals(yCenter(leadingKey))); expect(yCenter(appBarKey), equals(yCenter(titleKey)));