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
59956617
Unverified
Commit
59956617
authored
Jun 19, 2020
by
Ferhat
Committed by
GitHub
Jun 19, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix outline button solid path when BorderSize.width is used (#51581)
parent
a732652b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
3 deletions
+38
-3
outline_button.dart
packages/flutter/lib/src/material/outline_button.dart
+1
-1
outline_button_test.dart
packages/flutter/test/material/outline_button_test.dart
+33
-0
mock_canvas.dart
packages/flutter/test/rendering/mock_canvas.dart
+4
-2
No files found.
packages/flutter/lib/src/material/outline_button.dart
View file @
59956617
...
...
@@ -561,7 +561,7 @@ class _OutlineBorder extends ShapeBorder implements MaterialStateProperty<ShapeB
case
BorderStyle
.
none
:
break
;
case
BorderStyle
.
solid
:
canvas
.
drawPath
(
shape
.
getOuterPath
(
rect
,
textDirection:
textDirection
),
side
.
toPaint
());
canvas
.
drawPath
(
shape
.
getOuterPath
(
rect
.
deflate
(
side
.
width
/
2.0
)
,
textDirection:
textDirection
),
side
.
toPaint
());
}
}
...
...
packages/flutter/test/material/outline_button_test.dart
View file @
59956617
...
...
@@ -867,6 +867,39 @@ 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
(
...
...
packages/flutter/test/rendering/mock_canvas.dart
View file @
59956617
...
...
@@ -1163,13 +1163,15 @@ 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
.'
;
throw
'It called
$methodName
with a path that unexpectedly did not '
'contain
$offset
. Path bounds =
${pathArgument.getBounds()}
'
;
}
}
if
(
excludes
!=
null
)
{
for
(
final
Offset
offset
in
excludes
)
{
if
(
pathArgument
.
contains
(
offset
))
throw
'It called
$methodName
with a path that unexpectedly contained
$offset
.'
;
throw
'It called
$methodName
with a path that unexpectedly '
'contained
$offset
. . Path bounds =
${pathArgument.getBounds()}
'
;
}
}
}
...
...
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