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
17389244
Commit
17389244
authored
Jan 27, 2017
by
Hans Muller
Committed by
GitHub
Jan 27, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix BorderSide rendering (#7705)
parent
743be674
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
1 deletion
+51
-1
box_painter.dart
packages/flutter/lib/src/painting/box_painter.dart
+1
-1
box_decoration_test.dart
packages/flutter/test/widgets/box_decoration_test.dart
+50
-0
No files found.
packages/flutter/lib/src/painting/box_painter.dart
View file @
17389244
...
...
@@ -433,7 +433,7 @@ class Border {
path
=
new
Path
();
path
.
moveTo
(
rect
.
left
,
rect
.
bottom
);
path
.
lineTo
(
rect
.
left
,
rect
.
top
);
if
(
righ
t
.
width
==
0.0
)
{
if
(
lef
t
.
width
==
0.0
)
{
paint
.
style
=
PaintingStyle
.
stroke
;
}
else
{
paint
.
style
=
PaintingStyle
.
fill
;
...
...
packages/flutter/test/widgets/box_decoration_test.dart
View file @
17389244
...
...
@@ -6,6 +6,8 @@ import 'package:flutter_test/flutter_test.dart';
import
'package:flutter/material.dart'
;
import
'package:flutter/widgets.dart'
;
import
'../rendering/mock_canvas.dart'
;
void
main
(
)
{
testWidgets
(
'Circles can have uniform borders'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
...
...
@@ -36,4 +38,52 @@ void main() {
);
expect
(
tester
.
getSize
(
find
.
byKey
(
key
)),
equals
(
const
Size
(
45.0
,
45.0
)));
});
testWidgets
(
'BoxDecoration paints its border correctly'
,
(
WidgetTester
tester
)
async
{
// Regression test for https://github.com/flutter/flutter/issues/7672
final
Key
key
=
new
Key
(
'Container with BoxDecoration'
);
Widget
buildFrame
(
Border
border
)
{
return
new
Center
(
child:
new
Container
(
key:
key
,
width:
100.0
,
height:
50.0
,
decoration:
new
BoxDecoration
(
border:
border
),
),
);
}
final
Color
black
=
const
Color
(
0xFF000000
);
await
tester
.
pumpWidget
(
buildFrame
(
new
Border
.
all
()));
expect
(
find
.
byKey
(
key
),
paints
..
path
(
color:
black
,
style:
PaintingStyle
.
fill
)
..
path
(
color:
black
,
style:
PaintingStyle
.
fill
)
..
path
(
color:
black
,
style:
PaintingStyle
.
fill
)
..
path
(
color:
black
,
style:
PaintingStyle
.
fill
));
await
tester
.
pumpWidget
(
buildFrame
(
new
Border
.
all
(
width:
0.0
)));
expect
(
find
.
byKey
(
key
),
paints
..
path
(
color:
black
,
style:
PaintingStyle
.
stroke
)
..
path
(
color:
black
,
style:
PaintingStyle
.
stroke
)
..
path
(
color:
black
,
style:
PaintingStyle
.
stroke
)
..
path
(
color:
black
,
style:
PaintingStyle
.
stroke
));
final
Color
green
=
const
Color
(
0xFF000000
);
final
BorderSide
greenSide
=
new
BorderSide
(
color:
green
,
width:
10.0
);
await
tester
.
pumpWidget
(
buildFrame
(
new
Border
(
top:
greenSide
)));
expect
(
find
.
byKey
(
key
),
paints
..
path
(
color:
green
,
style:
PaintingStyle
.
fill
));
await
tester
.
pumpWidget
(
buildFrame
(
new
Border
(
left:
greenSide
)));
expect
(
find
.
byKey
(
key
),
paints
..
path
(
color:
green
,
style:
PaintingStyle
.
fill
));
await
tester
.
pumpWidget
(
buildFrame
(
new
Border
(
right:
greenSide
)));
expect
(
find
.
byKey
(
key
),
paints
..
path
(
color:
green
,
style:
PaintingStyle
.
fill
));
await
tester
.
pumpWidget
(
buildFrame
(
new
Border
(
bottom:
greenSide
)));
expect
(
find
.
byKey
(
key
),
paints
..
path
(
color:
green
,
style:
PaintingStyle
.
fill
));
});
}
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