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
74a14d2a
Commit
74a14d2a
authored
Aug 17, 2015
by
Eric Seidel
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #659 from eseidelGoogle/analyzer
Fix analyzer warnings
parents
91a783bf
d5fe622a
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
31 additions
and
31 deletions
+31
-31
hello_world.dart
examples/raw/hello_world.dart
+1
-1
painting_node.dart
examples/raw/painting_node.dart
+1
-1
shadow.dart
examples/raw/shadow.dart
+5
-5
spinning_image.dart
examples/raw/spinning_image.dart
+3
-3
align_items.dart
examples/rendering/align_items.dart
+4
-4
baseline.dart
examples/rendering/baseline.dart
+4
-4
interactive_flex.dart
examples/rendering/interactive_flex.dart
+3
-3
justify_content.dart
examples/rendering/justify_content.dart
+1
-1
render_paragraph.dart
examples/rendering/render_paragraph.dart
+2
-2
touch_demo.dart
examples/rendering/touch_demo.dart
+2
-2
progress_indicator.dart
examples/widgets/progress_indicator.dart
+5
-5
No files found.
examples/raw/hello_world.dart
View file @
74a14d2a
...
@@ -8,7 +8,7 @@ Picture draw(int a, int r, int g, int b) {
...
@@ -8,7 +8,7 @@ Picture draw(int a, int r, int g, int b) {
Size
size
=
new
Size
(
view
.
width
,
view
.
height
);
Size
size
=
new
Size
(
view
.
width
,
view
.
height
);
PictureRecorder
recorder
=
new
PictureRecorder
();
PictureRecorder
recorder
=
new
PictureRecorder
();
final
double
devicePixelRatio
=
sky
.
view
.
devicePixelRatio
;
final
double
devicePixelRatio
=
view
.
devicePixelRatio
;
Canvas
canvas
=
new
Canvas
(
recorder
,
Point
.
origin
&
(
size
*
devicePixelRatio
));
Canvas
canvas
=
new
Canvas
(
recorder
,
Point
.
origin
&
(
size
*
devicePixelRatio
));
canvas
.
scale
(
devicePixelRatio
,
devicePixelRatio
);
canvas
.
scale
(
devicePixelRatio
,
devicePixelRatio
);
double
radius
=
size
.
shortestSide
*
0.45
;
double
radius
=
size
.
shortestSide
*
0.45
;
...
...
examples/raw/painting_node.dart
View file @
74a14d2a
...
@@ -21,7 +21,7 @@ Picture draw(int a, int r, int g, int b) {
...
@@ -21,7 +21,7 @@ Picture draw(int a, int r, int g, int b) {
paintingNode
=
new
PaintingNode
();
paintingNode
=
new
PaintingNode
();
Paint
innerPaint
=
new
Paint
()..
color
=
new
Color
.
fromARGB
(
a
,
255
-
r
,
255
-
g
,
255
-
b
);
Paint
innerPaint
=
new
Paint
()..
color
=
new
Color
.
fromARGB
(
a
,
255
-
r
,
255
-
g
,
255
-
b
);
PictureRecorder
innerRecorder
=
new
PictureRecorder
();
PictureRecorder
innerRecorder
=
new
PictureRecorder
();
Canvas
innerCanvas
=
new
Canvas
(
innerRecorder
,
Point
.
origin
&
bounds
);
Canvas
innerCanvas
=
new
Canvas
(
innerRecorder
,
Point
.
origin
&
size
);
innerCanvas
.
drawCircle
(
size
.
center
(
Point
.
origin
),
radius
*
0.5
,
innerPaint
);
innerCanvas
.
drawCircle
(
size
.
center
(
Point
.
origin
),
radius
*
0.5
,
innerPaint
);
paintingNode
.
setBackingDrawable
(
innerRecorder
.
endRecordingAsDrawable
());
paintingNode
.
setBackingDrawable
(
innerRecorder
.
endRecordingAsDrawable
());
...
...
examples/raw/shadow.dart
View file @
74a14d2a
...
@@ -21,11 +21,11 @@ void beginFrame(double timeStamp) {
...
@@ -21,11 +21,11 @@ void beginFrame(double timeStamp) {
..
setPaintBits
(
PaintBits
.
all
)
..
setPaintBits
(
PaintBits
.
all
)
..
setOffset
(
const
Offset
(
5.0
,
5.0
))
..
setOffset
(
const
Offset
(
5.0
,
5.0
))
..
setColorMode
(
TransferMode
.
src
),
..
setColorMode
(
TransferMode
.
src
),
(
Paint
layerPaint
)
{
new
Paint
()
layerPaint
.
color
=
const
Color
.
fromARGB
(
128
,
55
,
55
,
55
);
..
color
=
const
Color
.
fromARGB
(
128
,
55
,
55
,
55
)
layerPaint
.
setMaskFilter
(
.
.
setMaskFilter
(
new
MaskFilter
.
blur
(
BlurStyle
.
normal
,
5.0
,
highQuality:
true
));
new
MaskFilter
.
blur
(
BlurStyle
.
normal
,
5.0
,
highQuality:
true
))
}
)
)
// Main layer.
// Main layer.
..
addLayerOnTop
(
new
DrawLooperLayerInfo
(),
new
Paint
());
..
addLayerOnTop
(
new
DrawLooperLayerInfo
(),
new
Paint
());
paint
.
setDrawLooper
(
builder
.
build
());
paint
.
setDrawLooper
(
builder
.
build
());
...
...
examples/raw/spinning_image.dart
View file @
74a14d2a
...
@@ -20,7 +20,7 @@ void beginFrame(double timeStamp) {
...
@@ -20,7 +20,7 @@ void beginFrame(double timeStamp) {
PictureRecorder
recorder
=
new
PictureRecorder
();
PictureRecorder
recorder
=
new
PictureRecorder
();
final
double
devicePixelRatio
=
view
.
devicePixelRatio
;
final
double
devicePixelRatio
=
view
.
devicePixelRatio
;
Canvas
canvas
=
new
Canvas
(
recorder
,
Point
.
origin
&
new
Size
(
view
.
width
*
devicePixelRatio
,
view
.
height
*
devicePixelRatio
));
Canvas
canvas
=
new
Canvas
(
recorder
,
Point
.
origin
&
new
Size
(
view
.
width
*
devicePixelRatio
,
view
.
height
*
devicePixelRatio
));
ca
vn
as
.
scale
(
devicePixelRatio
,
devicePixelRatio
);
ca
nv
as
.
scale
(
devicePixelRatio
,
devicePixelRatio
);
canvas
.
translate
(
view
.
width
/
2.0
,
view
.
height
/
2.0
);
canvas
.
translate
(
view
.
width
/
2.0
,
view
.
height
/
2.0
);
canvas
.
rotate
(
math
.
PI
*
delta
/
1800
);
canvas
.
rotate
(
math
.
PI
*
delta
/
1800
);
canvas
.
scale
(
0.2
,
0.2
);
canvas
.
scale
(
0.2
,
0.2
);
...
@@ -61,7 +61,7 @@ bool handleEvent(Event event) {
...
@@ -61,7 +61,7 @@ bool handleEvent(Event event) {
}
}
if
(
event
.
type
==
"pointerup"
)
{
if
(
event
.
type
==
"pointerup"
)
{
image_cache
.
load
(
url2
).
then
(
handleImageLoad
);
image_cache
.
load
(
url2
).
first
.
then
(
handleImageLoad
);
return
true
;
return
true
;
}
}
...
@@ -69,7 +69,7 @@ bool handleEvent(Event event) {
...
@@ -69,7 +69,7 @@ bool handleEvent(Event event) {
}
}
void
main
(
)
{
void
main
(
)
{
image_cache
.
load
(
url1
).
then
(
handleImageLoad
);
image_cache
.
load
(
url1
).
first
.
then
(
handleImageLoad
);
view
.
setEventCallback
(
handleEvent
);
view
.
setEventCallback
(
handleEvent
);
view
.
setFrameCallback
(
beginFrame
);
view
.
setFrameCallback
(
beginFrame
);
}
}
examples/rendering/align_items.dart
View file @
74a14d2a
...
@@ -18,25 +18,25 @@ void main() {
...
@@ -18,25 +18,25 @@ void main() {
for
(
FlexAlignItems
alignItems
in
FlexAlignItems
.
values
)
{
for
(
FlexAlignItems
alignItems
in
FlexAlignItems
.
values
)
{
TextStyle
style
=
const
TextStyle
(
color:
const
Color
(
0xFF000000
));
TextStyle
style
=
const
TextStyle
(
color:
const
Color
(
0xFF000000
));
RenderParagraph
paragraph
=
new
RenderParagraph
(
new
RenderStyled
(
style
,
[
new
RenderText
(
"
${alignItems}
"
)]));
RenderParagraph
paragraph
=
new
RenderParagraph
(
new
StyledTextSpan
(
style
,
[
new
PlainTextSpan
(
"
${alignItems}
"
)]));
table
.
add
(
new
RenderPadding
(
child:
paragraph
,
padding:
new
EdgeDims
.
only
(
top:
20.0
)));
table
.
add
(
new
RenderPadding
(
child:
paragraph
,
padding:
new
EdgeDims
.
only
(
top:
20.0
)));
var
row
=
new
RenderFlex
(
alignItems:
alignItems
,
textBaseline:
TextBaseline
.
alphabetic
);
var
row
=
new
RenderFlex
(
alignItems:
alignItems
,
textBaseline:
TextBaseline
.
alphabetic
);
style
=
new
TextStyle
(
fontSize:
15.0
,
color:
const
Color
(
0xFF000000
));
style
=
new
TextStyle
(
fontSize:
15.0
,
color:
const
Color
(
0xFF000000
));
row
.
add
(
new
RenderDecoratedBox
(
row
.
add
(
new
RenderDecoratedBox
(
decoration:
new
BoxDecoration
(
backgroundColor:
const
Color
(
0x7FFFCCCC
)),
decoration:
new
BoxDecoration
(
backgroundColor:
const
Color
(
0x7FFFCCCC
)),
child:
new
RenderParagraph
(
new
RenderStyled
(
style
,
[
new
RenderText
(
'foo foo foo'
)]))
child:
new
RenderParagraph
(
new
StyledTextSpan
(
style
,
[
new
PlainTextSpan
(
'foo foo foo'
)]))
));
));
style
=
new
TextStyle
(
fontSize:
10.0
,
color:
const
Color
(
0xFF000000
));
style
=
new
TextStyle
(
fontSize:
10.0
,
color:
const
Color
(
0xFF000000
));
row
.
add
(
new
RenderDecoratedBox
(
row
.
add
(
new
RenderDecoratedBox
(
decoration:
new
BoxDecoration
(
backgroundColor:
const
Color
(
0x7FCCFFCC
)),
decoration:
new
BoxDecoration
(
backgroundColor:
const
Color
(
0x7FCCFFCC
)),
child:
new
RenderParagraph
(
new
RenderStyled
(
style
,
[
new
RenderText
(
'foo foo foo'
)]))
child:
new
RenderParagraph
(
new
StyledTextSpan
(
style
,
[
new
PlainTextSpan
(
'foo foo foo'
)]))
));
));
var
subrow
=
new
RenderFlex
(
alignItems:
alignItems
,
textBaseline:
TextBaseline
.
alphabetic
);
var
subrow
=
new
RenderFlex
(
alignItems:
alignItems
,
textBaseline:
TextBaseline
.
alphabetic
);
style
=
new
TextStyle
(
fontSize:
25.0
,
color:
const
Color
(
0xFF000000
));
style
=
new
TextStyle
(
fontSize:
25.0
,
color:
const
Color
(
0xFF000000
));
subrow
.
add
(
new
RenderDecoratedBox
(
subrow
.
add
(
new
RenderDecoratedBox
(
decoration:
new
BoxDecoration
(
backgroundColor:
const
Color
(
0x7FCCCCFF
)),
decoration:
new
BoxDecoration
(
backgroundColor:
const
Color
(
0x7FCCCCFF
)),
child:
new
RenderParagraph
(
new
RenderStyled
(
style
,
[
new
RenderText
(
'foo foo foo foo'
)]))
child:
new
RenderParagraph
(
new
StyledTextSpan
(
style
,
[
new
PlainTextSpan
(
'foo foo foo foo'
)]))
));
));
subrow
.
add
(
new
RenderSolidColorBox
(
const
Color
(
0x7FCCFFFF
),
desiredSize:
new
Size
(
30.0
,
40.0
)));
subrow
.
add
(
new
RenderSolidColorBox
(
const
Color
(
0x7FCCFFFF
),
desiredSize:
new
Size
(
30.0
,
40.0
)));
row
.
add
(
subrow
);
row
.
add
(
subrow
);
...
...
examples/rendering/baseline.dart
View file @
74a14d2a
...
@@ -13,19 +13,19 @@ import 'package:sky/rendering/sky_binding.dart';
...
@@ -13,19 +13,19 @@ import 'package:sky/rendering/sky_binding.dart';
RenderBox
getBox
(
double
lh
)
{
RenderBox
getBox
(
double
lh
)
{
RenderParagraph
paragraph
=
new
RenderParagraph
(
RenderParagraph
paragraph
=
new
RenderParagraph
(
new
RenderStyled
(
new
StyledTextSpan
(
new
TextStyle
(
new
TextStyle
(
color:
const
Color
(
0xFF0000A0
)
color:
const
Color
(
0xFF0000A0
)
),
),
[
[
new
RenderText
(
'test'
),
new
PlainTextSpan
(
'test'
),
new
RenderStyled
(
new
StyledTextSpan
(
new
TextStyle
(
new
TextStyle
(
fontFamily:
'serif'
,
fontFamily:
'serif'
,
fontSize:
50.0
,
fontSize:
50.0
,
height:
lh
height:
lh
),
),
[
new
RenderText
(
'مرحبا Hello'
)]
[
new
PlainTextSpan
(
'مرحبا Hello'
)]
)
)
]
]
)
)
...
...
examples/rendering/interactive_flex.dart
View file @
74a14d2a
...
@@ -65,7 +65,7 @@ void main() {
...
@@ -65,7 +65,7 @@ void main() {
// Resizeable image
// Resizeable image
image
=
new
RenderImageGrow
(
null
,
new
Size
(
100.0
,
null
));
image
=
new
RenderImageGrow
(
null
,
new
Size
(
100.0
,
null
));
image_cache
.
load
(
"https://www.dartlang.org/logos/dart-logo.png"
).
then
((
Image
dartLogo
)
{
image_cache
.
load
(
"https://www.dartlang.org/logos/dart-logo.png"
).
first
.
then
((
Image
dartLogo
)
{
image
.
image
=
dartLogo
;
image
.
image
=
dartLogo
;
});
});
...
@@ -84,9 +84,9 @@ porchetta bacon kevin meatball meatloaf pig beef ribs chicken. Brisket ribeye
...
@@ -84,9 +84,9 @@ porchetta bacon kevin meatball meatloaf pig beef ribs chicken. Brisket ribeye
andouille leberkas capicola meatloaf. Chicken pig ball tip pork picanha bresaola
andouille leberkas capicola meatloaf. Chicken pig ball tip pork picanha bresaola
alcatra. Pork pork belly alcatra, flank chuck drumstick biltong doner jowl.
alcatra. Pork pork belly alcatra, flank chuck drumstick biltong doner jowl.
Pancetta meatball tongue tenderloin rump tail jowl boudin."""
;
Pancetta meatball tongue tenderloin rump tail jowl boudin."""
;
var
text
=
new
RenderStyled
(
var
text
=
new
StyledTextSpan
(
new
TextStyle
(
color:
const
Color
(
0xFF009900
)),
new
TextStyle
(
color:
const
Color
(
0xFF009900
)),
[
new
RenderText
(
meatyString
)]);
[
new
PlainTextSpan
(
meatyString
)]);
padding
=
new
RenderPadding
(
padding
=
new
RenderPadding
(
padding:
const
EdgeDims
.
all
(
10.0
),
padding:
const
EdgeDims
.
all
(
10.0
),
child:
new
RenderParagraph
(
text
));
child:
new
RenderParagraph
(
text
));
...
...
examples/rendering/justify_content.dart
View file @
74a14d2a
...
@@ -21,7 +21,7 @@ void main() {
...
@@ -21,7 +21,7 @@ void main() {
var
table
=
new
RenderFlex
(
direction:
FlexDirection
.
vertical
);
var
table
=
new
RenderFlex
(
direction:
FlexDirection
.
vertical
);
void
addRow
(
FlexJustifyContent
justify
)
{
void
addRow
(
FlexJustifyContent
justify
)
{
RenderParagraph
paragraph
=
new
RenderParagraph
(
new
RenderStyled
(
style
,
[
new
RenderText
(
"
${justify}
"
)]));
RenderParagraph
paragraph
=
new
RenderParagraph
(
new
StyledTextSpan
(
style
,
[
new
PlainTextSpan
(
"
${justify}
"
)]));
table
.
add
(
new
RenderPadding
(
child:
paragraph
,
padding:
new
EdgeDims
.
only
(
top:
20.0
)));
table
.
add
(
new
RenderPadding
(
child:
paragraph
,
padding:
new
EdgeDims
.
only
(
top:
20.0
)));
var
row
=
new
RenderFlex
(
direction:
FlexDirection
.
horizontal
);
var
row
=
new
RenderFlex
(
direction:
FlexDirection
.
horizontal
);
row
.
add
(
new
RenderSolidColorBox
(
const
Color
(
0xFFFFCCCC
),
desiredSize:
new
Size
(
80.0
,
60.0
)));
row
.
add
(
new
RenderSolidColorBox
(
const
Color
(
0xFFFFCCCC
),
desiredSize:
new
Size
(
80.0
,
60.0
)));
...
...
examples/rendering/render_paragraph.dart
View file @
74a14d2a
...
@@ -32,9 +32,9 @@ andouille leberkas capicola meatloaf. Chicken pig ball tip pork picanha bresaola
...
@@ -32,9 +32,9 @@ andouille leberkas capicola meatloaf. Chicken pig ball tip pork picanha bresaola
alcatra. Pork pork belly alcatra, flank chuck drumstick biltong doner jowl.
alcatra. Pork pork belly alcatra, flank chuck drumstick biltong doner jowl.
Pancetta meatball tongue tenderloin rump tail jowl boudin."""
;
Pancetta meatball tongue tenderloin rump tail jowl boudin."""
;
var
text
=
new
RenderStyled
(
var
text
=
new
StyledTextSpan
(
new
TextStyle
(
color:
const
Color
(
0xFF009900
)),
new
TextStyle
(
color:
const
Color
(
0xFF009900
)),
[
new
RenderText
(
meatyString
)]);
[
new
PlainTextSpan
(
meatyString
)]);
child
=
new
RenderDecoratedBox
(
child
=
new
RenderDecoratedBox
(
decoration:
new
BoxDecoration
(
backgroundColor:
const
Color
(
0xFFFFFFFF
)),
decoration:
new
BoxDecoration
(
backgroundColor:
const
Color
(
0xFFFFFFFF
)),
child:
new
RenderParagraph
(
text
)
child:
new
RenderParagraph
(
text
)
...
...
examples/rendering/touch_demo.dart
View file @
74a14d2a
...
@@ -76,12 +76,12 @@ class RenderTouchDemo extends RenderBox {
...
@@ -76,12 +76,12 @@ class RenderTouchDemo extends RenderBox {
..
color
=
const
Color
(
0xFFFFFFFF
);
..
color
=
const
Color
(
0xFFFFFFFF
);
canvas
.
drawRect
(
offset
&
size
,
white
);
canvas
.
drawRect
(
offset
&
size
,
white
);
for
(
Dot
dot
in
dots
.
values
)
for
(
Dot
dot
in
dots
.
values
)
dot
.
paint
(
c
anvas
,
offset
);
dot
.
paint
(
c
ontext
,
offset
);
}
}
}
}
void
main
(
)
{
void
main
(
)
{
var
paragraph
=
new
RenderParagraph
(
new
RenderText
(
"Touch me!"
));
var
paragraph
=
new
RenderParagraph
(
new
PlainTextSpan
(
"Touch me!"
));
var
stack
=
new
RenderStack
(
children:
[
var
stack
=
new
RenderStack
(
children:
[
new
RenderTouchDemo
(),
new
RenderTouchDemo
(),
paragraph
,
paragraph
,
...
...
examples/widgets/progress_indicator.dart
View file @
74a14d2a
...
@@ -20,12 +20,12 @@ import 'package:sky/widgets/transitions.dart';
...
@@ -20,12 +20,12 @@ import 'package:sky/widgets/transitions.dart';
class
ProgressIndicatorApp
extends
App
{
class
ProgressIndicatorApp
extends
App
{
AnimationPerformance
valueAnimation
;
ValueAnimation
<
double
>
valueAnimation
;
Direction
valueAnimationDirection
=
Direction
.
forward
;
Direction
valueAnimationDirection
=
Direction
.
forward
;
void
initState
()
{
void
initState
()
{
super
.
initState
();
super
.
initState
();
valueAnimation
=
new
AnimationPerformance
()
valueAnimation
=
new
ValueAnimation
<
double
>
()
..
duration
=
const
Duration
(
milliseconds:
1500
)
..
duration
=
const
Duration
(
milliseconds:
1500
)
..
variable
=
new
AnimatedValue
<
double
>(
..
variable
=
new
AnimatedValue
<
double
>(
0.0
,
0.0
,
...
@@ -59,17 +59,17 @@ class ProgressIndicatorApp extends App {
...
@@ -59,17 +59,17 @@ class ProgressIndicatorApp extends App {
),
),
new
LinearProgressIndicator
(),
new
LinearProgressIndicator
(),
new
LinearProgressIndicator
(),
new
LinearProgressIndicator
(),
new
LinearProgressIndicator
(
value:
valueAnimation
.
va
riable
.
va
lue
),
new
LinearProgressIndicator
(
value:
valueAnimation
.
value
),
new
CircularProgressIndicator
(),
new
CircularProgressIndicator
(),
new
SizedBox
(
new
SizedBox
(
width:
20.0
,
width:
20.0
,
height:
20.0
,
height:
20.0
,
child:
new
CircularProgressIndicator
(
value:
valueAnimation
.
va
riable
.
va
lue
)
child:
new
CircularProgressIndicator
(
value:
valueAnimation
.
value
)
),
),
new
SizedBox
(
new
SizedBox
(
width:
50.0
,
width:
50.0
,
height:
30.0
,
height:
30.0
,
child:
new
CircularProgressIndicator
(
value:
valueAnimation
.
va
riable
.
va
lue
)
child:
new
CircularProgressIndicator
(
value:
valueAnimation
.
value
)
)
)
];
];
return
new
Flex
(
return
new
Flex
(
...
...
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