Adding proper accommodation for textScaleFactor in chips, and StadiumBorder border. (#12533)

In order to allow chips to be properly drawn when they expand in size (without
using IntrinsicHeight), I needed a BoxDecoration shape that would be dependent
upon the rendered height of the widget. This seemed to be pretty generally
useful, so I added a new ShapeDecoration called StadiumBorder. It uses the
minimum dimension to adjust the BorderRadius of a rounded rect in the shape
decoration.

I also converted some uses of BoxShape to be case statements, updated the
chips to use the StadiumBorder decoration, and updated some of the metrics to match
the Material spec, as well as implementing lerping to and from StadiumBorder.
This commit is contained in:
Greg Spencer
2017-11-01 19:37:02 -07:00
committed by GitHub
parent 5c1320e5b9
commit 05e10633f2
15 changed files with 835 additions and 75 deletions

View File

@@ -28,7 +28,7 @@ class _ChipDemoState extends State<ChipDemo> {
),
const Chip(
avatar: const CircleAvatar(child: const Text('B')),
label: const Text('Blueberry')
label: const Text('Blueberry'),
),
];