mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
This reverts commit 599566177736e6b30af922a8f06e8a260acafc36.
This commit is contained in:
parent
5995661777
commit
04ce9d288c
@ -561,7 +561,7 @@ class _OutlineBorder extends ShapeBorder implements MaterialStateProperty<ShapeB
|
||||
case BorderStyle.none:
|
||||
break;
|
||||
case BorderStyle.solid:
|
||||
canvas.drawPath(shape.getOuterPath(rect.deflate(side.width / 2.0), textDirection: textDirection), side.toPaint());
|
||||
canvas.drawPath(shape.getOuterPath(rect, textDirection: textDirection), side.toPaint());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -867,39 +867,6 @@ void main() {
|
||||
);
|
||||
});
|
||||
|
||||
testWidgets('OutlineButton uses borderSide width to paint', (WidgetTester tester) async {
|
||||
final GlobalKey buttonKey = GlobalKey();
|
||||
const double thickness = 12.5;
|
||||
await tester.pumpWidget(
|
||||
Directionality(
|
||||
textDirection: TextDirection.ltr,
|
||||
child: Material(
|
||||
child: Align(
|
||||
alignment: Alignment.topLeft,
|
||||
child: OutlineButton(
|
||||
key: buttonKey,
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.black12,
|
||||
width: thickness),
|
||||
onPressed: () {},
|
||||
child: const SizedBox(
|
||||
width: 120,
|
||||
height: 50,
|
||||
child: Text('ABC'),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
final Finder outlineButton = find.byType(OutlineButton);
|
||||
expect(outlineButton, paints..path(
|
||||
includes: const <Offset>[Offset(60, thickness / 2.0)],
|
||||
excludes: const <Offset>[Offset(60, thickness / 3.0)],
|
||||
));
|
||||
});
|
||||
|
||||
testWidgets('OutlineButton contributes semantics', (WidgetTester tester) async {
|
||||
final SemanticsTester semantics = SemanticsTester(tester);
|
||||
await tester.pumpWidget(
|
||||
|
||||
@ -1163,15 +1163,13 @@ class _PathPaintPredicate extends _DrawCommandPaintPredicate {
|
||||
if (includes != null) {
|
||||
for (final Offset offset in includes) {
|
||||
if (!pathArgument.contains(offset))
|
||||
throw 'It called $methodName with a path that unexpectedly did not '
|
||||
'contain $offset. Path bounds = ${pathArgument.getBounds()}';
|
||||
throw 'It called $methodName with a path that unexpectedly did not contain $offset.';
|
||||
}
|
||||
}
|
||||
if (excludes != null) {
|
||||
for (final Offset offset in excludes) {
|
||||
if (pathArgument.contains(offset))
|
||||
throw 'It called $methodName with a path that unexpectedly '
|
||||
'contained $offset. . Path bounds = ${pathArgument.getBounds()}';
|
||||
throw 'It called $methodName with a path that unexpectedly contained $offset.';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user