fix typo in computeMaxIntrinsicWidth implementation (#69812)

This commit is contained in:
LongCatIsLooong 2020-11-04 16:19:04 -08:00 committed by GitHub
parent b26970b143
commit 319722997c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -2488,7 +2488,7 @@ class _RenderChip extends RenderBox {
@override
double computeMaxIntrinsicWidth(double height) {
final double overallPadding = theme.padding.vertical +
final double overallPadding = theme.padding.horizontal +
theme.labelPadding.horizontal;
return overallPadding +
_maxWidth(avatar, height) +

View File

@ -2916,6 +2916,18 @@ void main() {
await tapGesture.up();
});
testWidgets('intrinsicHeight implementation meets constraints', (WidgetTester tester) async {
// Regression text for https://github.com/flutter/flutter/issues/49478.
await tester.pumpWidget(_wrapForChip(
child: const Chip(
label: Text('text'),
padding: EdgeInsets.symmetric(horizontal: 20),
),
));
expect(tester.takeException(), isNull);
});
}
class _MaterialStateOutlinedBorder extends StadiumBorder implements MaterialStateOutlinedBorder {