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
96958b20
Commit
96958b20
authored
Jan 18, 2016
by
Ian Hickson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1255 from Hixie/random-fixes
Include BoxDecoration description in Container toString
parents
a9bf6ec9
8c44c382
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
7 deletions
+15
-7
shadowed_box.dart
examples/rendering/shadowed_box.dart
+8
-5
box_painter.dart
packages/flutter/lib/src/painting/box_painter.dart
+5
-0
basic.dart
packages/flutter/lib/src/widgets/basic.dart
+2
-2
No files found.
examples/rendering/shadowed_box.dart
View file @
96958b20
...
...
@@ -8,16 +8,19 @@ import 'package:flutter/rendering.dart';
import
'package:flutter/material.dart'
;
void
main
(
)
{
var
coloredBox
=
new
RenderDecoratedBox
(
RenderBox
coloredBox
=
new
RenderDecoratedBox
(
decoration:
new
BoxDecoration
(
gradient:
new
RadialGradient
(
center:
Point
.
origin
,
radius:
500.0
,
colors:
<
Color
>[
Colors
.
yellow
[
500
],
Colors
.
blue
[
500
]]),
boxShadow:
elevationToShadow
[
8
])
colors:
<
Color
>[
Colors
.
yellow
[
500
],
Colors
.
blue
[
500
]]
),
boxShadow:
elevationToShadow
[
8
]
)
);
var
paddedBox
=
new
RenderPadding
(
RenderBox
paddedBox
=
new
RenderPadding
(
padding:
const
EdgeDims
.
all
(
50.0
),
child:
coloredBox
);
child:
coloredBox
);
new
RenderingFlutterBinding
(
root:
new
RenderDecoratedBox
(
decoration:
const
BoxDecoration
(
backgroundColor:
const
Color
(
0xFFFFFFFF
)
...
...
packages/flutter/lib/src/painting/box_painter.dart
View file @
96958b20
...
...
@@ -787,6 +787,9 @@ class BoxDecoration extends Decoration {
);
}
/// Stringifies the BoxDecoration. By default, the output will be on one line.
/// If the method is passed a non-empty string argument, then the output will
/// span multiple lines, each prefixed by that argument.
String
toString
([
String
prefix
=
''
])
{
List
<
String
>
result
=
<
String
>[];
if
(
backgroundColor
!=
null
)
...
...
@@ -803,6 +806,8 @@ class BoxDecoration extends Decoration {
result
.
add
(
'
${prefix}
gradient:
$gradient
'
);
if
(
shape
!=
BoxShape
.
rectangle
)
result
.
add
(
'
${prefix}
shape:
$shape
'
);
if
(
prefix
==
''
)
return
'
$runtimeType
(
${result.join(', ')}
)'
;
if
(
result
.
isEmpty
)
return
'
$prefix
<no decorations specified>'
;
return
result
.
join
(
'
\n
'
);
...
...
packages/flutter/lib/src/widgets/basic.dart
View file @
96958b20
...
...
@@ -908,9 +908,9 @@ class Container extends StatelessComponent {
if
(
constraints
!=
null
)
description
.
add
(
'
$constraints
'
);
if
(
decoration
!=
null
)
description
.
add
(
'
has background
'
);
description
.
add
(
'
bg:
$decoration
'
);
if
(
foregroundDecoration
!=
null
)
description
.
add
(
'
has foreground
'
);
description
.
add
(
'
fg:
$foregroundDecoration
'
);
if
(
margin
!=
null
)
description
.
add
(
'margin:
$margin
'
);
if
(
padding
!=
null
)
...
...
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