From 5c5948bb810d54fcc0a7b06b698c29a82f9cff30 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Fri, 25 Mar 2016 13:55:10 -0700 Subject: [PATCH] Fix app bar padding without leading widget If there's no leading widget, we just want 8.0 pixels of padding instead of all the padding to get over to the 72.0 pixel key line. Fixes #2912 --- .../flutter/lib/src/material/app_bar.dart | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/packages/flutter/lib/src/material/app_bar.dart b/packages/flutter/lib/src/material/app_bar.dart index 460d29f66e..40c76eba51 100644 --- a/packages/flutter/lib/src/material/app_bar.dart +++ b/packages/flutter/lib/src/material/app_bar.dart @@ -134,16 +134,18 @@ class AppBar extends StatelessWidget { } final List toolBarRow = []; - if (leading != null) - toolBarRow.add(leading); - toolBarRow.add( - new Flexible( - child: new Padding( - padding: new EdgeInsets.only(left: 24.0), - child: title != null ? new DefaultTextStyle(style: centerStyle, child: title) : null - ) + if (leading != null) { + toolBarRow.add(new Padding( + padding: new EdgeInsets.only(right: 16.0), + child: leading + )); + } + toolBarRow.add(new Flexible( + child: new Padding( + padding: new EdgeInsets.only(left: 8.0), + child: title != null ? new DefaultTextStyle(style: centerStyle, child: title) : null ) - ); + )); if (actions != null) toolBarRow.addAll(actions);