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
646d2b01
Unverified
Commit
646d2b01
authored
Feb 28, 2020
by
Dan Field
Committed by
GitHub
Feb 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
properties (#51650)
parent
515027a9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
2 deletions
+19
-2
basic.dart
packages/flutter/lib/src/widgets/basic.dart
+6
-0
container.dart
packages/flutter/lib/src/widgets/container.dart
+4
-1
basic_test.dart
packages/flutter/test/widgets/basic_test.dart
+9
-1
No files found.
packages/flutter/lib/src/widgets/basic.dart
View file @
646d2b01
...
...
@@ -7094,6 +7094,12 @@ class ColoredBox extends SingleChildRenderObjectWidget {
void
updateRenderObject
(
BuildContext
context
,
_RenderColoredBox
renderObject
)
{
renderObject
.
color
=
color
;
}
@override
void
debugFillProperties
(
DiagnosticPropertiesBuilder
properties
)
{
super
.
debugFillProperties
(
properties
);
properties
.
add
(
DiagnosticsProperty
<
Color
>(
'color'
,
color
));
}
}
class
_RenderColoredBox
extends
RenderProxyBoxWithHitTestBehavior
{
...
...
packages/flutter/lib/src/widgets/container.dart
View file @
646d2b01
...
...
@@ -473,7 +473,10 @@ class Container extends StatelessWidget {
properties
.
add
(
DiagnosticsProperty
<
AlignmentGeometry
>(
'alignment'
,
alignment
,
showName:
false
,
defaultValue:
null
));
properties
.
add
(
DiagnosticsProperty
<
EdgeInsetsGeometry
>(
'padding'
,
padding
,
defaultValue:
null
));
properties
.
add
(
DiagnosticsProperty
<
Clip
>(
'clipBehavior'
,
clipBehavior
,
defaultValue:
Clip
.
none
));
properties
.
add
(
DiagnosticsProperty
<
Decoration
>(
'bg'
,
decoration
,
defaultValue:
null
));
if
(
color
!=
null
)
properties
.
add
(
DiagnosticsProperty
<
Color
>(
'bg'
,
color
));
else
properties
.
add
(
DiagnosticsProperty
<
Decoration
>(
'bg'
,
decoration
,
defaultValue:
null
));
properties
.
add
(
DiagnosticsProperty
<
Decoration
>(
'fg'
,
foregroundDecoration
,
defaultValue:
null
));
properties
.
add
(
DiagnosticsProperty
<
BoxConstraints
>(
'constraints'
,
constraints
,
defaultValue:
null
));
properties
.
add
(
DiagnosticsProperty
<
EdgeInsetsGeometry
>(
'margin'
,
margin
,
defaultValue:
null
));
...
...
packages/flutter/test/widgets/basic_test.dart
View file @
646d2b01
...
...
@@ -361,7 +361,15 @@ void main() {
expect
(
drawRect
[
0
],
const
Rect
.
fromLTWH
(
0
,
0
,
800
,
600
));
expect
(
drawRect
[
1
].
color
,
colorToPaint
);
verify
(
mockContext
.
paintChild
(
renderSizedBox
,
Offset
.
zero
)).
called
(
1
);
});
});
testWidgets
(
'ColoredBox - properties'
,
(
WidgetTester
tester
)
async
{
const
ColoredBox
box
=
ColoredBox
(
color:
colorToPaint
);
final
DiagnosticPropertiesBuilder
properties
=
DiagnosticPropertiesBuilder
();
box
.
debugFillProperties
(
properties
);
expect
(
properties
.
properties
.
first
.
value
,
colorToPaint
);
});
});
}
...
...
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