Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
17f0d2e5
Unverified
Commit
17f0d2e5
authored
Aug 20, 2021
by
nt4f04uNd
Committed by
GitHub
Aug 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init (#88391)
parent
deacb8d4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
19 deletions
+37
-19
box_decoration.dart
packages/flutter/lib/src/painting/box_decoration.dart
+1
-1
box_decoration_test.dart
packages/flutter/test/widgets/box_decoration_test.dart
+36
-18
No files found.
packages/flutter/lib/src/painting/box_decoration.dart
View file @
17f0d2e5
...
...
@@ -485,7 +485,7 @@ class _BoxDecorationPainter extends BoxPainter {
canvas
,
rect
,
shape:
_decoration
.
shape
,
borderRadius:
_decoration
.
borderRadius
as
BorderRadius
?
,
borderRadius:
_decoration
.
borderRadius
?.
resolve
(
textDirection
)
,
textDirection:
configuration
.
textDirection
,
);
}
...
...
packages/flutter/test/widgets/box_decoration_test.dart
View file @
17f0d2e5
...
...
@@ -391,7 +391,7 @@ Future<void> main() async {
itemsTapped
=
<
int
>[];
return
Align
(
alignment:
Alignment
.
topLeft
,
child:
GestureDetector
(
child:
GestureDetector
(
behavior:
HitTestBehavior
.
deferToChild
,
child:
Container
(
key:
key
,
...
...
@@ -424,16 +424,16 @@ Future<void> main() async {
const
Offset
fartherBorderRadiusPoint
=
Offset
(
borderDiagonalOffset
,
borderDiagonalOffset
);
await
tester
.
tapAt
(
topLeft
);
expect
(
itemsTapped
,
isEmpty
,
reason:
'top left tapped'
);
expect
(
itemsTapped
,
isEmpty
,
reason:
'top left tapped'
);
await
tester
.
tapAt
(
borderTopTangent
);
expect
(
itemsTapped
,
isEmpty
,
reason:
'border top tapped'
);
expect
(
itemsTapped
,
isEmpty
,
reason:
'border top tapped'
);
await
tester
.
tapAt
(
borderLeftTangent
);
expect
(
itemsTapped
,
isEmpty
,
reason:
'border left tapped'
);
expect
(
itemsTapped
,
isEmpty
,
reason:
'border left tapped'
);
await
tester
.
tapAt
(
fartherBorderRadiusPoint
);
expect
(
itemsTapped
,
isEmpty
,
reason:
'border center tapped'
);
expect
(
itemsTapped
,
isEmpty
,
reason:
'border center tapped'
);
await
tester
.
tap
(
find
.
byKey
(
key
));
expect
(
itemsTapped
,
<
int
>[
1
]);
...
...
@@ -451,7 +451,7 @@ Future<void> main() async {
itemsTapped
=
<
int
>[];
return
Align
(
alignment:
Alignment
.
topLeft
,
child:
GestureDetector
(
child:
GestureDetector
(
behavior:
HitTestBehavior
.
deferToChild
,
child:
Container
(
key:
key
,
...
...
@@ -476,13 +476,13 @@ Future<void> main() async {
const
Offset
fartherBorderRadiusPoint
=
Offset
(
borderDiagonalOffset
+
1
,
borderDiagonalOffset
+
1
);
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
);
expect
(
itemsTapped
,
<
int
>[
1
,
1
],
reason:
'border Left not tapped'
);
expect
(
itemsTapped
,
<
int
>[
1
,
1
],
reason:
'border Left not tapped'
);
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
));
expect
(
itemsTapped
,
<
int
>[
1
,
1
,
1
,
1
]);
...
...
@@ -499,7 +499,7 @@ Future<void> main() async {
itemsTapped
=
<
int
>[];
return
Align
(
alignment:
Alignment
.
topLeft
,
child:
GestureDetector
(
child:
GestureDetector
(
behavior:
HitTestBehavior
.
deferToChild
,
child:
Container
(
key:
key
,
...
...
@@ -532,27 +532,45 @@ Future<void> main() async {
const
Offset
topLeftInside
=
Offset
(
radius
,
radius
);
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
);
expect
(
itemsTapped
,
<
int
>[
1
,
1
],
reason:
'top right tapped'
);
expect
(
itemsTapped
,
<
int
>[
1
,
1
],
reason:
'top right tapped'
);
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
);
expect
(
itemsTapped
,
<
int
>[
1
,
1
,
1
],
reason:
'bottom right tapped'
);
expect
(
itemsTapped
,
<
int
>[
1
,
1
,
1
],
reason:
'bottom right tapped'
);
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
);
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
);
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
);
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
),
),
),
),
),
);
});
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment