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
d04ab2e0
Commit
d04ab2e0
authored
Mar 04, 2016
by
Hans Muller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BoxDecoration borders define padding
parent
9b7ee3b7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
4 deletions
+28
-4
two_level_list.dart
packages/flutter/lib/src/material/two_level_list.dart
+2
-2
box_painter.dart
packages/flutter/lib/src/painting/box_painter.dart
+3
-0
basic.dart
packages/flutter/lib/src/widgets/basic.dart
+1
-0
box_decoration_test.dart
packages/flutter/test/widget/box_decoration_test.dart
+19
-0
two_level_list_test.dart
packages/flutter/test/widget/two_level_list_test.dart
+3
-2
No files found.
packages/flutter/lib/src/material/two_level_list.dart
View file @
d04ab2e0
...
...
@@ -110,7 +110,7 @@ class _TwoLevelSublistState extends State<TwoLevelSublist> {
onTap:
_handleOnTap
,
left:
config
.
left
,
center:
new
DefaultTextStyle
(
style:
Theme
.
of
(
context
).
text
.
body1
.
copyWith
(
color:
_headerColor
.
evaluate
(
_easeInAnimation
)),
style:
Theme
.
of
(
context
).
text
.
subhead
.
copyWith
(
color:
_headerColor
.
evaluate
(
_easeInAnimation
)),
child:
config
.
center
),
right:
new
RotationTransition
(
...
...
@@ -136,7 +136,7 @@ class _TwoLevelSublistState extends State<TwoLevelSublist> {
final
ThemeData
theme
=
Theme
.
of
(
context
);
_borderColor
.
end
=
theme
.
dividerColor
;
_headerColor
..
begin
=
theme
.
text
.
body1
.
color
..
begin
=
theme
.
text
.
subhead
.
color
..
end
=
theme
.
accentColor
;
_iconColor
..
begin
=
theme
.
unselectedColor
...
...
packages/flutter/lib/src/painting/box_painter.dart
View file @
d04ab2e0
...
...
@@ -793,6 +793,9 @@ class BoxDecoration extends Decoration {
/// The shape to fill the background color into and to cast as a shadow.
final
BoxShape
shape
;
/// The inset space occupied by the border.
EdgeDims
get
padding
=>
border
?.
dimensions
;
/// Returns a new box decoration that is scaled by the given factor.
BoxDecoration
scale
(
double
factor
)
{
// TODO(abarth): Scale ALL the things.
...
...
packages/flutter/lib/src/widgets/basic.dart
View file @
d04ab2e0
...
...
@@ -109,6 +109,7 @@ class ShaderMask extends OneChildRenderObjectWidget {
}
/// Paints a [Decoration] either before or after its child paints.
/// Container insets its child by the widths of the borders, this Widget does not.
///
/// Commonly used with [BoxDecoration].
class
DecoratedBox
extends
OneChildRenderObjectWidget
{
...
...
packages/flutter/test/widget/box_decoration_test.dart
View file @
d04ab2e0
...
...
@@ -22,4 +22,23 @@ void main() {
);
});
});
test
(
'Bordered Container insets its child'
,
()
{
testWidgets
((
WidgetTester
tester
)
{
Key
key
=
new
Key
(
'outerContainer'
);
tester
.
pumpWidget
(
new
Center
(
child:
new
Container
(
key:
key
,
decoration:
new
BoxDecoration
(
border:
new
Border
.
all
(
width:
10.0
)),
child:
new
Container
(
width:
25.0
,
height:
25.0
)
)
)
);
expect
(
tester
.
getSize
(
tester
.
findElementByKey
(
key
)),
equals
(
const
Size
(
45.0
,
45.0
)));
});
});
}
packages/flutter/test/widget/two_level_list_test.dart
View file @
d04ab2e0
...
...
@@ -49,8 +49,9 @@ void main() {
expect
(
getY
(
topKey
),
lessThan
(
getY
(
sublistKey
)));
expect
(
getY
(
sublistKey
),
lessThan
(
getY
(
bottomKey
)));
expect
(
getHeight
(
topKey
),
equals
(
getHeight
(
sublistKey
)));
expect
(
getHeight
(
sublistKey
),
equals
(
getHeight
(
bottomKey
)));
// The sublist has a one pixel border above and below.
expect
(
getHeight
(
topKey
),
equals
(
getHeight
(
sublistKey
)
-
2.0
));
expect
(
getHeight
(
bottomKey
),
equals
(
getHeight
(
sublistKey
)
-
2.0
));
tester
.
tap
(
tester
.
findText
(
'Sublist'
));
tester
.
pump
(
const
Duration
(
seconds:
1
));
...
...
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