Center Shrine demo title with centerTitle (#13586)

Rather than use a Center widget, center the title using AppBar's
centerTitle property. This ensures the title is horizontally centred
with respect to the screen rather than centred in the space between the
leading and trailing app bar widgets, which are asymmetrical in Shrine.
This commit is contained in:
Chris Bracken 2017-12-14 16:53:30 -08:00 committed by GitHub
parent 5bbcf6d4fc
commit 8a77036b35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -101,9 +101,8 @@ class ShrinePageState extends State<ShrinePage> {
)
)
),
title: new Center(
child: new Text('SHRINE', style: ShrineTheme.of(context).appBarTitleStyle)
),
title: new Text('SHRINE', style: ShrineTheme.of(context).appBarTitleStyle),
centerTitle: true,
actions: <Widget>[
new IconButton(
icon: const Icon(Icons.shopping_cart),