Unverified Commit 17f0d2e5 authored by nt4f04uNd's avatar nt4f04uNd Committed by GitHub

init (#88391)

parent deacb8d4
...@@ -485,7 +485,7 @@ class _BoxDecorationPainter extends BoxPainter { ...@@ -485,7 +485,7 @@ class _BoxDecorationPainter extends BoxPainter {
canvas, canvas,
rect, rect,
shape: _decoration.shape, shape: _decoration.shape,
borderRadius: _decoration.borderRadius as BorderRadius?, borderRadius: _decoration.borderRadius?.resolve(textDirection),
textDirection: configuration.textDirection, textDirection: configuration.textDirection,
); );
} }
......
...@@ -391,7 +391,7 @@ Future<void> main() async { ...@@ -391,7 +391,7 @@ Future<void> main() async {
itemsTapped = <int>[]; itemsTapped = <int>[];
return Align( return Align(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child:GestureDetector( child: GestureDetector(
behavior: HitTestBehavior.deferToChild, behavior: HitTestBehavior.deferToChild,
child: Container( child: Container(
key: key, key: key,
...@@ -424,16 +424,16 @@ Future<void> main() async { ...@@ -424,16 +424,16 @@ Future<void> main() async {
const Offset fartherBorderRadiusPoint = Offset(borderDiagonalOffset,borderDiagonalOffset); const Offset fartherBorderRadiusPoint = Offset(borderDiagonalOffset,borderDiagonalOffset);
await tester.tapAt(topLeft); await tester.tapAt(topLeft);
expect(itemsTapped, isEmpty,reason: 'top left tapped'); expect(itemsTapped, isEmpty, reason: 'top left tapped');
await tester.tapAt(borderTopTangent); await tester.tapAt(borderTopTangent);
expect(itemsTapped, isEmpty,reason: 'border top tapped'); expect(itemsTapped, isEmpty, reason: 'border top tapped');
await tester.tapAt(borderLeftTangent); await tester.tapAt(borderLeftTangent);
expect(itemsTapped, isEmpty,reason: 'border left tapped'); expect(itemsTapped, isEmpty, reason: 'border left tapped');
await tester.tapAt(fartherBorderRadiusPoint); await tester.tapAt(fartherBorderRadiusPoint);
expect(itemsTapped, isEmpty,reason: 'border center tapped'); expect(itemsTapped, isEmpty, reason: 'border center tapped');
await tester.tap(find.byKey(key)); await tester.tap(find.byKey(key));
expect(itemsTapped, <int>[1]); expect(itemsTapped, <int>[1]);
...@@ -451,7 +451,7 @@ Future<void> main() async { ...@@ -451,7 +451,7 @@ Future<void> main() async {
itemsTapped = <int>[]; itemsTapped = <int>[];
return Align( return Align(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child:GestureDetector( child: GestureDetector(
behavior: HitTestBehavior.deferToChild, behavior: HitTestBehavior.deferToChild,
child: Container( child: Container(
key: key, key: key,
...@@ -476,13 +476,13 @@ Future<void> main() async { ...@@ -476,13 +476,13 @@ Future<void> main() async {
const Offset fartherBorderRadiusPoint = Offset(borderDiagonalOffset+1,borderDiagonalOffset+1); const Offset fartherBorderRadiusPoint = Offset(borderDiagonalOffset+1,borderDiagonalOffset+1);
await tester.tapAt(borderTopTangent); await tester.tapAt(borderTopTangent);
expect(itemsTapped, <int>[1],reason: 'border Top not tapped'); expect(itemsTapped, <int>[1], reason: 'border Top not tapped');
await tester.tapAt(borderLeftTangent); await tester.tapAt(borderLeftTangent);
expect(itemsTapped, <int>[1,1],reason: 'border Left not tapped'); expect(itemsTapped, <int>[1,1], reason: 'border Left not tapped');
await tester.tapAt(fartherBorderRadiusPoint); await tester.tapAt(fartherBorderRadiusPoint);
expect(itemsTapped, <int>[1,1,1],reason: 'border center not tapped'); expect(itemsTapped, <int>[1,1,1], reason: 'border center not tapped');
await tester.tap(find.byKey(key)); await tester.tap(find.byKey(key));
expect(itemsTapped, <int>[1,1,1,1]); expect(itemsTapped, <int>[1,1,1,1]);
...@@ -499,7 +499,7 @@ Future<void> main() async { ...@@ -499,7 +499,7 @@ Future<void> main() async {
itemsTapped = <int>[]; itemsTapped = <int>[];
return Align( return Align(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child:GestureDetector( child: GestureDetector(
behavior: HitTestBehavior.deferToChild, behavior: HitTestBehavior.deferToChild,
child: Container( child: Container(
key: key, key: key,
...@@ -532,27 +532,45 @@ Future<void> main() async { ...@@ -532,27 +532,45 @@ Future<void> main() async {
const Offset topLeftInside = Offset(radius, radius); const Offset topLeftInside = Offset(radius, radius);
await tester.tapAt(topRightInside); await tester.tapAt(topRightInside);
expect(itemsTapped, <int>[1,1],reason: 'top right not tapped'); expect(itemsTapped, <int>[1,1], reason: 'top right not tapped');
await tester.tapAt(topRightOutside); await tester.tapAt(topRightOutside);
expect(itemsTapped, <int>[1,1],reason: 'top right tapped'); expect(itemsTapped, <int>[1,1], reason: 'top right tapped');
await tester.tapAt(bottomRightInside); await tester.tapAt(bottomRightInside);
expect(itemsTapped, <int>[1,1,1],reason: 'bottom right not tapped'); expect(itemsTapped, <int>[1,1,1], reason: 'bottom right not tapped');
await tester.tapAt(bottomRightOutside); await tester.tapAt(bottomRightOutside);
expect(itemsTapped, <int>[1,1,1],reason: 'bottom right tapped'); expect(itemsTapped, <int>[1,1,1], reason: 'bottom right tapped');
await tester.tapAt(bottomLeftInside); await tester.tapAt(bottomLeftInside);
expect(itemsTapped, <int>[1,1,1,1],reason: 'bottom left not tapped'); expect(itemsTapped, <int>[1,1,1,1], reason: 'bottom left not tapped');
await tester.tapAt(bottomLeftOutside); await tester.tapAt(bottomLeftOutside);
expect(itemsTapped, <int>[1,1,1,1],reason: 'bottom left tapped'); expect(itemsTapped, <int>[1,1,1,1], reason: 'bottom left tapped');
await tester.tapAt(topLeftInside); await tester.tapAt(topLeftInside);
expect(itemsTapped, <int>[1,1,1,1,1],reason: 'top left not tapped'); expect(itemsTapped, <int>[1,1,1,1,1], reason: 'top left not tapped');
await tester.tapAt(topLeftOutside); await tester.tapAt(topLeftOutside);
expect(itemsTapped, <int>[1,1,1,1,1],reason: 'top left tapped'); expect(itemsTapped, <int>[1,1,1,1,1], reason: 'top left tapped');
});
testWidgets("BoxDecoration doesn't crash with BorderRadiusDirectional", (WidgetTester tester) async {
// Regression test for https://github.com/flutter/flutter/issues/88039
await tester.pumpWidget(
Directionality(
textDirection: TextDirection.ltr,
child: Container(
decoration: BoxDecoration(
border: Border.all(),
borderRadius: const BorderRadiusDirectional.all(
Radius.circular(1.0),
),
),
),
),
);
}); });
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment