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
abce29f1
Commit
abce29f1
authored
Feb 11, 2016
by
Ian Hickson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1774 from Hixie/exports
Clean up imports and exports.
parents
265fc9e8
a94999ba
Changes
123
Hide whitespace changes
Inline
Side-by-side
Showing
123 changed files
with
346 additions
and
492 deletions
+346
-492
main.dart
examples/fitness/lib/main.dart
+0
-1
progress_indicator_demo.dart
...es/material_gallery/lib/demo/progress_indicator_demo.dart
+0
-1
weathers_demo.dart
examples/material_gallery/lib/demo/weathers_demo.dart
+1
-1
main.dart
examples/mine_digger/lib/main.dart
+0
-3
baseline.dart
examples/rendering/baseline.dart
+2
-4
borders.dart
examples/rendering/borders.dart
+9
-11
flex.dart
examples/rendering/flex.dart
+8
-10
interactive_flex.dart
examples/rendering/interactive_flex.dart
+1
-1
spinning_flex.dart
examples/rendering/spinning_flex.dart
+4
-6
transform.dart
examples/rendering/transform.dart
+2
-4
main.dart
examples/stocks/lib/main.dart
+8
-19
stock_arrow.dart
examples/stocks/lib/stock_arrow.dart
+5
-3
stock_home.dart
examples/stocks/lib/stock_home.dart
+11
-1
stock_list.dart
examples/stocks/lib/stock_list.dart
+4
-1
stock_menu.dart
examples/stocks/lib/stock_menu.dart
+5
-1
stock_row.dart
examples/stocks/lib/stock_row.dart
+4
-1
stock_settings.dart
examples/stocks/lib/stock_settings.dart
+3
-1
stock_strings.dart
examples/stocks/lib/stock_strings.dart
+6
-1
stock_symbol_viewer.dart
examples/stocks/lib/stock_symbol_viewer.dart
+5
-1
stock_types.dart
examples/stocks/lib/stock_types.dart
+0
-2
card_collection.dart
examples/widgets/card_collection.dart
+2
-5
drag_and_drop.dart
examples/widgets/drag_and_drop.dart
+1
-4
hero_under.dart
examples/widgets/hero_under.dart
+1
-1
mimic_demo.dart
examples/widgets/mimic_demo.dart
+0
-1
nine_patch.dart
examples/widgets/nine_patch.dart
+0
-1
overlay_geometry.dart
examples/widgets/overlay_geometry.dart
+1
-3
pageable_list.dart
examples/widgets/pageable_list.dart
+0
-1
resolution_awareness.dart
examples/widgets/resolution_awareness.dart
+2
-1
smooth_resize.dart
examples/widgets/smooth_resize.dart
+0
-2
spinning_mixed.dart
examples/widgets/spinning_mixed.dart
+3
-5
animation.dart
packages/flutter/lib/animation.dart
+0
-1
painting.dart
packages/flutter/lib/painting.dart
+0
-1
scheduler.dart
packages/flutter/lib/scheduler.dart
+1
-0
animation.dart
packages/flutter/lib/src/animation/animation.dart
+1
-1
animation_controller.dart
packages/flutter/lib/src/animation/animation_controller.dart
+4
-4
animations.dart
packages/flutter/lib/src/animation/animations.dart
+5
-5
listener_helpers.dart
packages/flutter/lib/src/animation/listener_helpers.dart
+4
-4
tween.dart
packages/flutter/lib/src/animation/tween.dart
+2
-2
binding.dart
packages/flutter/lib/src/gestures/binding.dart
+1
-1
bottom_sheet.dart
packages/flutter/lib/src/material/bottom_sheet.dart
+0
-3
checkbox.dart
packages/flutter/lib/src/material/checkbox.dart
+15
-16
circle_avatar.dart
packages/flutter/lib/src/material/circle_avatar.dart
+0
-1
dialog.dart
packages/flutter/lib/src/material/dialog.dart
+0
-1
drawer.dart
packages/flutter/lib/src/material/drawer.dart
+0
-1
dropdown.dart
packages/flutter/lib/src/material/dropdown.dart
+0
-3
flexible_space_bar.dart
packages/flutter/lib/src/material/flexible_space_bar.dart
+0
-1
floating_action_button.dart
...ages/flutter/lib/src/material/floating_action_button.dart
+0
-1
icon_theme_data.dart
packages/flutter/lib/src/material/icon_theme_data.dart
+3
-2
input.dart
packages/flutter/lib/src/material/input.dart
+0
-3
material.dart
packages/flutter/lib/src/material/material.dart
+0
-2
material_app.dart
packages/flutter/lib/src/material/material_app.dart
+6
-4
page.dart
packages/flutter/lib/src/material/page.dart
+0
-1
popup_menu.dart
packages/flutter/lib/src/material/popup_menu.dart
+0
-1
progress_indicator.dart
packages/flutter/lib/src/material/progress_indicator.dart
+2
-4
radio.dart
packages/flutter/lib/src/material/radio.dart
+2
-4
scaffold.dart
packages/flutter/lib/src/material/scaffold.dart
+0
-2
scrollbar_painter.dart
packages/flutter/lib/src/material/scrollbar_painter.dart
+0
-2
slider.dart
packages/flutter/lib/src/material/slider.dart
+0
-2
snack_bar.dart
packages/flutter/lib/src/material/snack_bar.dart
+0
-1
switch.dart
packages/flutter/lib/src/material/switch.dart
+3
-6
tabs.dart
packages/flutter/lib/src/material/tabs.dart
+0
-1
theme.dart
packages/flutter/lib/src/material/theme.dart
+0
-1
time_picker.dart
packages/flutter/lib/src/material/time_picker.dart
+1
-4
tooltip.dart
packages/flutter/lib/src/material/tooltip.dart
+0
-3
two_level_list.dart
packages/flutter/lib/src/material/two_level_list.dart
+0
-1
basic_types.dart
packages/flutter/lib/src/painting/basic_types.dart
+30
-0
box_painter.dart
packages/flutter/lib/src/painting/box_painter.dart
+23
-23
decoration.dart
packages/flutter/lib/src/painting/decoration.dart
+5
-6
edge_dims.dart
packages/flutter/lib/src/painting/edge_dims.dart
+6
-5
shadows.dart
packages/flutter/lib/src/painting/shadows.dart
+0
-29
text_painter.dart
packages/flutter/lib/src/painting/text_painter.dart
+4
-4
text_style.dart
packages/flutter/lib/src/painting/text_style.dart
+1
-1
basic_types.dart
packages/flutter/lib/src/rendering/basic_types.dart
+0
-13
binding.dart
packages/flutter/lib/src/rendering/binding.dart
+1
-1
box.dart
packages/flutter/lib/src/rendering/box.dart
+3
-7
debug.dart
packages/flutter/lib/src/rendering/debug.dart
+9
-10
editable_line.dart
packages/flutter/lib/src/rendering/editable_line.dart
+2
-3
image.dart
packages/flutter/lib/src/rendering/image.dart
+1
-3
layer.dart
packages/flutter/lib/src/rendering/layer.dart
+5
-6
object.dart
packages/flutter/lib/src/rendering/object.dart
+6
-6
paragraph.dart
packages/flutter/lib/src/rendering/paragraph.dart
+0
-14
proxy_box.dart
packages/flutter/lib/src/rendering/proxy_box.dart
+3
-6
shifted_box.dart
packages/flutter/lib/src/rendering/shifted_box.dart
+1
-4
view.dart
packages/flutter/lib/src/rendering/view.dart
+1
-2
viewport.dart
packages/flutter/lib/src/rendering/viewport.dart
+1
-1
scheduler.dart
packages/flutter/lib/src/scheduler/scheduler.dart
+6
-3
ticker.dart
packages/flutter/lib/src/scheduler/ticker.dart
+1
-1
image_decoder.dart
packages/flutter/lib/src/services/image_decoder.dart
+1
-1
image_resource.dart
packages/flutter/lib/src/services/image_resource.dart
+1
-1
basic.dart
packages/flutter/lib/src/widgets/basic.dart
+16
-42
binding.dart
packages/flutter/lib/src/widgets/binding.dart
+8
-5
checked_mode_banner.dart
packages/flutter/lib/src/widgets/checked_mode_banner.dart
+1
-5
dismissable.dart
packages/flutter/lib/src/widgets/dismissable.dart
+2
-6
editable.dart
packages/flutter/lib/src/widgets/editable.dart
+1
-2
enter_exit_transition.dart
packages/flutter/lib/src/widgets/enter_exit_transition.dart
+0
-2
framework.dart
packages/flutter/lib/src/widgets/framework.dart
+1
-1
heroes.dart
packages/flutter/lib/src/widgets/heroes.dart
+0
-2
implicit_animations.dart
packages/flutter/lib/src/widgets/implicit_animations.dart
+0
-2
mimic.dart
packages/flutter/lib/src/widgets/mimic.dart
+4
-3
modal_barrier.dart
packages/flutter/lib/src/widgets/modal_barrier.dart
+0
-2
pageable_list.dart
packages/flutter/lib/src/widgets/pageable_list.dart
+1
-2
pages.dart
packages/flutter/lib/src/widgets/pages.dart
+1
-2
routes.dart
packages/flutter/lib/src/widgets/routes.dart
+0
-2
scrollable.dart
packages/flutter/lib/src/widgets/scrollable.dart
+2
-3
semantics_debugger.dart
packages/flutter/lib/src/widgets/semantics_debugger.dart
+3
-5
status_transitions.dart
packages/flutter/lib/src/widgets/status_transitions.dart
+1
-2
transitions.dart
packages/flutter/lib/src/widgets/transitions.dart
+0
-2
canvas_test_disabled.dart
packages/flutter/test/engine/canvas_test_disabled.dart
+3
-3
image_test.dart
packages/flutter/test/rendering/image_test.dart
+1
-1
page_forward_transitions_test.dart
...es/flutter/test/widget/page_forward_transitions_test.dart
+0
-1
positioned_test.dart
packages/flutter/test/widget/positioned_test.dart
+0
-1
shader_mask_test.dart
packages/flutter/test/widget/shader_mask_test.dart
+2
-3
flutter_sprites.dart
packages/flutter_sprites/lib/flutter_sprites.dart
+1
-3
effect_line.dart
packages/flutter_sprites/lib/src/effect_line.dart
+4
-4
layer.dart
packages/flutter_sprites/lib/src/layer.dart
+1
-1
particle_system.dart
packages/flutter_sprites/lib/src/particle_system.dart
+6
-6
physics_debug.dart
packages/flutter_sprites/lib/src/physics_debug.dart
+1
-1
sprite.dart
packages/flutter_sprites/lib/src/sprite.dart
+3
-3
textured_line.dart
packages/flutter_sprites/lib/src/textured_line.dart
+4
-4
virtual_joystick.dart
packages/flutter_sprites/lib/src/virtual_joystick.dart
+1
-1
widget_tester.dart
packages/flutter_test/lib/src/widget_tester.dart
+2
-2
playfair.dart
packages/playfair/lib/playfair.dart
+1
-8
base.dart
packages/playfair/lib/src/base.dart
+26
-23
No files found.
examples/fitness/lib/main.dart
View file @
abce29f1
...
...
@@ -6,7 +6,6 @@ library fitness;
import
'package:playfair/playfair.dart'
as
playfair
;
import
'package:flutter/material.dart'
;
import
'package:flutter/painting.dart'
;
import
'package:gcm/gcm.dart'
as
gcm
;
import
'user_data.dart'
;
...
...
examples/material_gallery/lib/demo/progress_indicator_demo.dart
View file @
abce29f1
...
...
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter/animation.dart'
;
import
'package:flutter/material.dart'
;
class
ProgressIndicatorDemo
extends
StatefulComponent
{
...
...
examples/material_gallery/lib/demo/weathers_demo.dart
View file @
abce29f1
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'dart:async'
;
import
'dart:ui'
as
ui
;
import
'dart:ui'
as
ui
show
Image
;
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter_sprites/flutter_sprites.dart'
;
...
...
examples/mine_digger/lib/main.dart
View file @
abce29f1
...
...
@@ -3,10 +3,7 @@
import
'dart:math'
;
import
'package:flutter/gestures.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/painting.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/services.dart'
;
// Classic minesweeper-inspired game. The mouse controls are standard
...
...
examples/rendering/baseline.dart
View file @
abce29f1
...
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
as
ui
;
import
'package:flutter/rendering.dart'
;
class
_BaselinePainter
extends
CustomPainter
{
...
...
@@ -29,7 +27,7 @@ class _BaselinePainter extends CustomPainter {
path
.
lineTo
(
w
,
h
);
paint
=
new
Paint
()
..
color
=
const
Color
(
0xFFFF9000
)
..
style
=
ui
.
PaintingStyle
.
stroke
..
style
=
PaintingStyle
.
stroke
..
strokeWidth
=
1.5
;
canvas
.
drawPath
(
path
,
paint
);
...
...
@@ -39,7 +37,7 @@ class _BaselinePainter extends CustomPainter {
path
.
lineTo
(
w
,
baseline
);
paint
=
new
Paint
()
..
color
=
const
Color
(
0xFF00FF90
)
..
style
=
ui
.
PaintingStyle
.
stroke
..
style
=
PaintingStyle
.
stroke
..
strokeWidth
=
1.5
;
canvas
.
drawPath
(
path
,
paint
);
}
...
...
examples/rendering/borders.dart
View file @
abce29f1
...
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
as
ui
;
import
'package:flutter/rendering.dart'
;
void
main
(
)
{
...
...
@@ -15,7 +13,7 @@ void main() {
additionalConstraints:
new
BoxConstraints
.
tightFor
(
height:
100.0
),
child:
new
RenderDecoratedBox
(
decoration:
new
BoxDecoration
(
backgroundColor:
new
ui
.
Color
(
0xFFFFFF00
)
backgroundColor:
const
Color
(
0xFFFFFF00
)
)
)
)
...
...
@@ -27,12 +25,12 @@ void main() {
child:
new
RenderDecoratedBox
(
decoration:
new
BoxDecoration
(
border:
new
Border
(
top:
new
BorderSide
(
color:
new
ui
.
Color
(
0xFFF00000
),
width:
5.0
),
right:
new
BorderSide
(
color:
new
ui
.
Color
(
0xFFFF9000
),
width:
10.0
),
bottom:
new
BorderSide
(
color:
new
ui
.
Color
(
0xFFFFF000
),
width:
15.0
),
left:
new
BorderSide
(
color:
new
ui
.
Color
(
0xFF00FF00
),
width:
20.0
)
top:
new
BorderSide
(
color:
const
Color
(
0xFFF00000
),
width:
5.0
),
right:
new
BorderSide
(
color:
const
Color
(
0xFFFF9000
),
width:
10.0
),
bottom:
new
BorderSide
(
color:
const
Color
(
0xFFFFF000
),
width:
15.0
),
left:
new
BorderSide
(
color:
const
Color
(
0xFF00FF00
),
width:
20.0
)
),
backgroundColor:
new
ui
.
Color
(
0xFFDDDDDD
)
backgroundColor:
const
Color
(
0xFFDDDDDD
)
)
)
)
...
...
@@ -43,7 +41,7 @@ void main() {
additionalConstraints:
new
BoxConstraints
.
tightFor
(
height:
100.0
),
child:
new
RenderDecoratedBox
(
decoration:
new
BoxDecoration
(
backgroundColor:
new
ui
.
Color
(
0xFFFFFF00
)
backgroundColor:
const
Color
(
0xFFFFFF00
)
)
)
)
...
...
@@ -54,7 +52,7 @@ void main() {
additionalConstraints:
new
BoxConstraints
.
tightFor
(
height:
100.0
),
child:
new
RenderDecoratedBox
(
decoration:
new
BoxDecoration
(
backgroundColor:
new
ui
.
Color
(
0xFFFFFF00
)
backgroundColor:
const
Color
(
0xFFFFFF00
)
)
)
)
...
...
@@ -65,7 +63,7 @@ void main() {
additionalConstraints:
new
BoxConstraints
.
tightFor
(
height:
100.0
),
child:
new
RenderDecoratedBox
(
decoration:
new
BoxDecoration
(
backgroundColor:
new
ui
.
Color
(
0xFFFFFF00
)
backgroundColor:
const
Color
(
0xFFFFFF00
)
)
)
)
...
...
examples/rendering/flex.dart
View file @
abce29f1
...
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
as
ui
;
import
'package:flutter/rendering.dart'
;
import
'lib/solid_color_box.dart'
;
...
...
@@ -11,11 +9,11 @@ RenderBox buildFlexExample() {
RenderFlex
flexRoot
=
new
RenderFlex
(
direction:
FlexDirection
.
vertical
);
RenderDecoratedBox
root
=
new
RenderDecoratedBox
(
decoration:
new
BoxDecoration
(
backgroundColor:
const
ui
.
Color
(
0xFF000000
)),
decoration:
new
BoxDecoration
(
backgroundColor:
const
Color
(
0xFF000000
)),
child:
flexRoot
);
void
addFlexChildSolidColor
(
RenderFlex
parent
,
ui
.
Color
backgroundColor
,
{
int
flex:
0
})
{
void
addFlexChildSolidColor
(
RenderFlex
parent
,
Color
backgroundColor
,
{
int
flex:
0
})
{
RenderSolidColorBox
child
=
new
RenderSolidColorBox
(
backgroundColor
);
parent
.
add
(
child
);
final
FlexParentData
childParentData
=
child
.
parentData
;
...
...
@@ -23,13 +21,13 @@ RenderBox buildFlexExample() {
}
// Yellow bar at top
addFlexChildSolidColor
(
flexRoot
,
const
ui
.
Color
(
0xFFFFFF00
),
flex:
1
);
addFlexChildSolidColor
(
flexRoot
,
const
Color
(
0xFFFFFF00
),
flex:
1
);
// Turquoise box
flexRoot
.
add
(
new
RenderSolidColorBox
(
const
ui
.
Color
(
0x7700FFFF
),
desiredSize:
new
ui
.
Size
(
100.0
,
100.0
)));
flexRoot
.
add
(
new
RenderSolidColorBox
(
const
Color
(
0x7700FFFF
),
desiredSize:
new
Size
(
100.0
,
100.0
)));
var
renderDecoratedBlock
=
new
RenderDecoratedBox
(
decoration:
new
BoxDecoration
(
backgroundColor:
const
ui
.
Color
(
0xFFFFFFFF
))
decoration:
new
BoxDecoration
(
backgroundColor:
const
Color
(
0xFFFFFFFF
))
);
flexRoot
.
add
(
new
RenderPadding
(
padding:
const
EdgeDims
.
all
(
10.0
),
child:
renderDecoratedBlock
));
...
...
@@ -37,11 +35,11 @@ RenderBox buildFlexExample() {
var
row
=
new
RenderFlex
(
direction:
FlexDirection
.
horizontal
);
// Purple and blue cells
addFlexChildSolidColor
(
row
,
const
ui
.
Color
(
0x77FF00FF
),
flex:
1
);
addFlexChildSolidColor
(
row
,
const
ui
.
Color
(
0xFF0000FF
),
flex:
2
);
addFlexChildSolidColor
(
row
,
const
Color
(
0x77FF00FF
),
flex:
1
);
addFlexChildSolidColor
(
row
,
const
Color
(
0xFF0000FF
),
flex:
2
);
var
decoratedRow
=
new
RenderDecoratedBox
(
decoration:
new
BoxDecoration
(
backgroundColor:
const
ui
.
Color
(
0xFF333333
)),
decoration:
new
BoxDecoration
(
backgroundColor:
const
Color
(
0xFF333333
)),
child:
row
);
...
...
examples/rendering/interactive_flex.dart
View file @
abce29f1
...
...
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
as
ui
;
import
'dart:ui'
as
ui
show
Image
,
window
;
import
'dart:math'
as
math
;
import
'dart:typed_data'
;
...
...
examples/rendering/spinning_flex.dart
View file @
abce29f1
...
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
as
ui
;
import
'package:flutter/rendering.dart'
;
import
'lib/solid_color_box.dart'
;
...
...
@@ -14,16 +12,16 @@ RenderTransform transformBox;
void
main
(
)
{
RenderFlex
flexRoot
=
new
RenderFlex
(
direction:
FlexDirection
.
vertical
);
void
addFlexChildSolidColor
(
RenderFlex
parent
,
ui
.
Color
backgroundColor
,
{
int
flex:
0
})
{
void
addFlexChildSolidColor
(
RenderFlex
parent
,
Color
backgroundColor
,
{
int
flex:
0
})
{
RenderSolidColorBox
child
=
new
RenderSolidColorBox
(
backgroundColor
);
parent
.
add
(
child
);
final
FlexParentData
childParentData
=
child
.
parentData
;
childParentData
.
flex
=
flex
;
}
addFlexChildSolidColor
(
flexRoot
,
const
ui
.
Color
(
0xFFFF00FF
),
flex:
1
);
addFlexChildSolidColor
(
flexRoot
,
const
ui
.
Color
(
0xFFFFFF00
),
flex:
2
);
addFlexChildSolidColor
(
flexRoot
,
const
ui
.
Color
(
0xFF00FFFF
),
flex:
1
);
addFlexChildSolidColor
(
flexRoot
,
const
Color
(
0xFFFF00FF
),
flex:
1
);
addFlexChildSolidColor
(
flexRoot
,
const
Color
(
0xFFFFFF00
),
flex:
2
);
addFlexChildSolidColor
(
flexRoot
,
const
Color
(
0xFF00FFFF
),
flex:
1
);
transformBox
=
new
RenderTransform
(
child:
flexRoot
,
transform:
new
Matrix4
.
identity
());
...
...
examples/rendering/transform.dart
View file @
abce29f1
...
...
@@ -2,16 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
as
ui
;
import
'package:flutter/rendering.dart'
;
void
main
(
)
{
RenderDecoratedBox
green
=
new
RenderDecoratedBox
(
decoration:
new
BoxDecoration
(
backgroundColor:
const
ui
.
Color
(
0xFF00FF00
))
decoration:
new
BoxDecoration
(
backgroundColor:
const
Color
(
0xFF00FF00
))
);
RenderConstrainedBox
box
=
new
RenderConstrainedBox
(
additionalConstraints:
new
BoxConstraints
.
tight
(
const
ui
.
Size
(
200.0
,
200.0
)),
additionalConstraints:
new
BoxConstraints
.
tight
(
const
Size
(
200.0
,
200.0
)),
child:
green
);
...
...
examples/stocks/lib/main.dart
View file @
abce29f1
...
...
@@ -5,29 +5,18 @@
library
stocks
;
import
'dart:async'
;
import
'dart:collection'
;
import
'dart:math'
as
math
;
import
'dart:ui'
as
ui
;
import
'package:flutter/gestures.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/painting.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/scheduler.dart'
;
import
'package:flutter/rendering.dart'
show
debugPaintSizeEnabled
;
import
'package:intl/intl.dart'
;
import
'stock_data.dart'
;
import
'i18n/stock_messages_all.dart'
;
part
'stock_arrow.dart'
;
part
'stock_home.dart'
;
part
'stock_list.dart'
;
part
'stock_menu.dart'
;
part
'stock_row.dart'
;
part
'stock_settings.dart'
;
part
'stock_strings.dart'
;
part
'stock_symbol_viewer.dart'
;
part
'stock_types.dart'
;
import
'stock_data.dart'
;
import
'stock_home.dart'
;
import
'stock_settings.dart'
;
import
'stock_strings.dart'
;
import
'stock_symbol_viewer.dart'
;
import
'stock_types.dart'
;
class
StocksApp
extends
StatefulComponent
{
StocksAppState
createState
()
=>
new
StocksAppState
();
...
...
@@ -94,7 +83,7 @@ class StocksAppState extends State<StocksApp> {
return
null
;
}
Future
<
LocaleQueryData
>
_onLocaleChanged
(
ui
.
Locale
locale
)
async
{
Future
<
LocaleQueryData
>
_onLocaleChanged
(
Locale
locale
)
async
{
String
localeString
=
locale
.
toString
();
await
initializeMessages
(
localeString
);
Intl
.
defaultLocale
=
localeString
;
...
...
examples/stocks/lib/stock_arrow.dart
View file @
abce29f1
...
...
@@ -2,7 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
part of
stocks
;
import
'dart:math'
as
math
;
import
'package:flutter/material.dart'
;
class
StockArrowPainter
extends
CustomPainter
{
StockArrowPainter
({
this
.
color
,
this
.
percentChange
});
...
...
@@ -34,11 +36,11 @@ class StockArrowPainter extends CustomPainter {
path
.
lineTo
(
centerX
+
w
,
arrowY
+
h
);
path
.
lineTo
(
centerX
-
w
,
arrowY
+
h
);
path
.
close
();
paint
.
style
=
ui
.
PaintingStyle
.
fill
;
paint
.
style
=
PaintingStyle
.
fill
;
canvas
.
drawPath
(
path
,
paint
);
// Draw a circle that circumscribes the arrow.
paint
.
style
=
ui
.
PaintingStyle
.
stroke
;
paint
.
style
=
PaintingStyle
.
stroke
;
canvas
.
drawCircle
(
new
Point
(
centerX
,
centerY
),
r
,
paint
);
}
...
...
examples/stocks/lib/stock_home.dart
View file @
abce29f1
...
...
@@ -2,7 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
part of
stocks
;
import
'dart:collection'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/rendering.dart'
show
debugDumpRenderTree
,
debugDumpLayerTree
,
debugDumpSemanticsTree
;
import
'stock_data.dart'
;
import
'stock_list.dart'
;
import
'stock_menu.dart'
;
import
'stock_strings.dart'
;
import
'stock_symbol_viewer.dart'
;
import
'stock_types.dart'
;
typedef
void
ModeUpdater
(
StockMode
mode
);
...
...
examples/stocks/lib/stock_list.dart
View file @
abce29f1
...
...
@@ -2,7 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
part of
stocks
;
import
'package:flutter/material.dart'
;
import
'stock_data.dart'
;
import
'stock_row.dart'
;
class
StockList
extends
StatelessComponent
{
StockList
({
Key
key
,
this
.
keySalt
,
this
.
stocks
,
this
.
onOpen
,
this
.
onShow
,
this
.
onAction
})
:
super
(
key:
key
);
...
...
examples/stocks/lib/stock_menu.dart
View file @
abce29f1
...
...
@@ -2,7 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
part of
stocks
;
import
'dart:async'
;
import
'dart:ui'
as
ui
show
window
;
import
'package:flutter/material.dart'
;
import
'package:flutter/scheduler.dart'
show
timeDilation
;
enum
_MenuItems
{
autorefresh
,
autorefreshCheckbox
,
refresh
,
speedUp
,
speedDown
}
...
...
examples/stocks/lib/stock_row.dart
View file @
abce29f1
...
...
@@ -2,7 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
part of
stocks
;
import
'package:flutter/material.dart'
;
import
'stock_data.dart'
;
import
'stock_arrow.dart'
;
enum
StockRowPartKind
{
arrow
}
...
...
examples/stocks/lib/stock_settings.dart
View file @
abce29f1
...
...
@@ -2,7 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
part of
stocks
;
import
'package:flutter/material.dart'
;
import
'stock_types.dart'
;
class
StockSettings
extends
StatefulComponent
{
const
StockSettings
(
this
.
configuration
,
this
.
updater
);
...
...
examples/stocks/lib/stock_strings.dart
View file @
abce29f1
part of
stocks
;
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:intl/intl.dart'
;
import
'package:flutter/widgets.dart'
;
// Wrappers for strings that are shown in the UI. The strings can be
// translated for different locales using the Dart intl package.
...
...
examples/stocks/lib/stock_symbol_viewer.dart
View file @
abce29f1
...
...
@@ -2,7 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
part of
stocks
;
import
'package:flutter/material.dart'
;
import
'stock_data.dart'
;
import
'stock_arrow.dart'
;
import
'stock_row.dart'
;
class
StockSymbolView
extends
StatelessComponent
{
StockSymbolView
({
this
.
stock
});
...
...
examples/stocks/lib/stock_types.dart
View file @
abce29f1
...
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
part of
stocks
;
enum
StockMode
{
optimistic
,
pessimistic
}
enum
BackupMode
{
enabled
,
disabled
}
...
...
examples/widgets/card_collection.dart
View file @
abce29f1
...
...
@@ -2,11 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
as
ui
;
import
'package:flutter/material.dart'
;
import
'package:flutter/painting.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/rendering.dart'
show
debugDumpRenderTree
;
class
CardModel
{
CardModel
(
this
.
value
,
this
.
height
)
{
...
...
@@ -394,7 +391,7 @@ class CardCollectionState extends State<CardCollection> {
});
}
ui
.
Shader
_createShader
(
Rect
bounds
)
{
Shader
_createShader
(
Rect
bounds
)
{
return
new
LinearGradient
(
begin:
bounds
.
topLeft
,
end:
bounds
.
bottomLeft
,
...
...
examples/widgets/drag_and_drop.dart
View file @
abce29f1
...
...
@@ -3,11 +3,8 @@
// found in the LICENSE file.
import
'dart:math'
as
math
;
import
'dart:ui'
as
ui
;
import
'package:flutter/material.dart'
;
import
'package:flutter/painting.dart'
;
import
'package:flutter/rendering.dart'
;
class
ExampleDragTarget
extends
StatefulComponent
{
ExampleDragTargetState
createState
()
=>
new
ExampleDragTargetState
();
...
...
@@ -144,7 +141,7 @@ class DashOutlineCirclePainter extends CustomPainter {
final
double
radius
=
size
.
shortestSide
/
2.0
;
final
Paint
paint
=
new
Paint
()
..
color
=
const
Color
(
0xFF000000
)
..
style
=
ui
.
PaintingStyle
.
stroke
..
style
=
PaintingStyle
.
stroke
..
strokeWidth
=
radius
/
10.0
;
final
Path
path
=
new
Path
();
final
Rect
box
=
Point
.
origin
&
size
;
...
...
examples/widgets/hero_under.dart
View file @
abce29f1
...
...
@@ -2,7 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import
'dart:ui'
as
ui
;
import
'dart:ui'
as
ui
show
window
;
import
'package:flutter/widgets.dart'
;
import
'package:flutter/material.dart'
;
...
...
examples/widgets/mimic_demo.dart
View file @
abce29f1
...
...
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter/animation.dart'
;
import
'package:flutter/material.dart'
;
const
double
_kHeight
=
150.0
;
...
...
examples/widgets/nine_patch.dart
View file @
abce29f1
...
...
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter/painting.dart'
;
import
'package:flutter/material.dart'
;
void
main
(
)
{
...
...
examples/widgets/overlay_geometry.dart
View file @
abce29f1
...
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
as
ui
;
import
'package:flutter/gestures.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/rendering.dart'
;
...
...
@@ -36,7 +34,7 @@ class _MarkerPainter extends CustomPainter {
paint
..
color
=
const
Color
(
0xFFFFFFFF
)
..
style
=
ui
.
PaintingStyle
.
stroke
..
style
=
PaintingStyle
.
stroke
..
strokeWidth
=
1.0
;
if
(
type
==
MarkerType
.
topLeft
)
{
canvas
.
drawLine
(
new
Point
(
r
,
r
),
new
Point
(
r
+
r
-
1.0
,
r
),
paint
);
...
...
examples/widgets/pageable_list.dart
View file @
abce29f1
...
...
@@ -3,7 +3,6 @@
// found in the LICENSE file.
import
'package:flutter/material.dart'
;
import
'package:flutter/painting.dart'
;
class
CardModel
{
CardModel
(
this
.
value
,
this
.
size
,
this
.
color
);
...
...
examples/widgets/resolution_awareness.dart
View file @
abce29f1
// Copyright (c) 2016, the Flutter project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import
'dart:ui'
as
ui
;
import
'dart:ui'
as
ui
show
window
;
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
...
...
examples/widgets/smooth_resize.dart
View file @
abce29f1
...
...
@@ -2,9 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter/animation.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/rendering.dart'
;
final
List
<
Map
<
int
,
Color
>>
_kColors
=
<
Map
<
int
,
Color
>>[
Colors
.
amber
,
...
...
examples/widgets/spinning_mixed.dart
View file @
abce29f1
...
...
@@ -2,15 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
as
ui
;
import
'package:flutter/material.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter_rendering_examples/solid_color_box.dart'
;
// Solid colour, RenderObject version
void
addFlexChildSolidColor
(
RenderFlex
parent
,
ui
.
Color
backgroundColor
,
{
int
flex:
0
})
{
void
addFlexChildSolidColor
(
RenderFlex
parent
,
Color
backgroundColor
,
{
int
flex:
0
})
{
RenderSolidColorBox
child
=
new
RenderSolidColorBox
(
backgroundColor
);
parent
.
add
(
child
);
FlexParentData
childParentData
=
child
.
parentData
;
...
...
@@ -92,9 +90,9 @@ void main() {
attachWidgetTreeToRenderTree
(
proxy
);
RenderFlex
flexRoot
=
new
RenderFlex
(
direction:
FlexDirection
.
vertical
);
addFlexChildSolidColor
(
flexRoot
,
const
ui
.
Color
(
0xFFFF00FF
),
flex:
1
);
addFlexChildSolidColor
(
flexRoot
,
const
Color
(
0xFFFF00FF
),
flex:
1
);
flexRoot
.
add
(
proxy
);
addFlexChildSolidColor
(
flexRoot
,
const
ui
.
Color
(
0xFF0000FF
),
flex:
1
);
addFlexChildSolidColor
(
flexRoot
,
const
Color
(
0xFF0000FF
),
flex:
1
);
transformBox
=
new
RenderTransform
(
child:
flexRoot
,
transform:
new
Matrix4
.
identity
());
RenderPadding
root
=
new
RenderPadding
(
padding:
new
EdgeDims
.
all
(
80.0
),
child:
transformBox
);
...
...
packages/flutter/lib/animation.dart
View file @
abce29f1
...
...
@@ -15,5 +15,4 @@ export 'src/animation/animations.dart';
export
'src/animation/curves.dart'
;
export
'src/animation/forces.dart'
;
export
'src/animation/listener_helpers.dart'
;
export
'src/animation/ticker.dart'
;
export
'src/animation/tween.dart'
;
packages/flutter/lib/painting.dart
View file @
abce29f1
...
...
@@ -17,7 +17,6 @@ export 'src/painting/box_painter.dart';
export
'src/painting/colors.dart'
;
export
'src/painting/decoration.dart'
;
export
'src/painting/edge_dims.dart'
;
export
'src/painting/shadows.dart'
;
export
'src/painting/text_editing.dart'
;
export
'src/painting/text_painter.dart'
;
export
'src/painting/text_style.dart'
;
...
...
packages/flutter/lib/scheduler.dart
View file @
abce29f1
...
...
@@ -12,3 +12,4 @@
library
scheduler
;
export
'src/scheduler/scheduler.dart'
;
export
'src/scheduler/ticker.dart'
;
packages/flutter/lib/src/animation/animation.dart
View file @
abce29f1
...
...
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
show
Color
,
Size
,
Rect
,
VoidCallback
,
lerpDouble
;
import
'dart:ui'
show
Color
,
Size
,
Rect
,
VoidCallback
;
/// The direction in which an animation is running.
enum
AnimationDirection
{
...
...
packages/flutter/lib/src/animation/animation_controller.dart
View file @
abce29f1
...
...
@@ -3,15 +3,15 @@
// found in the LICENSE file.
import
'dart:async'
;
import
'dart:ui'
show
VoidCallback
,
lerpDouble
;
import
'dart:ui'
as
ui
show
lerpDouble
;
import
'package:flutter/scheduler.dart'
;
import
'package:newton/newton.dart'
;
import
'animation.dart'
;
import
'curves.dart'
;
import
'forces.dart'
;
import
'listener_helpers.dart'
;
import
'ticker.dart'
;
/// A controller for an animation.
///
...
...
@@ -20,7 +20,7 @@ import 'ticker.dart';
/// bounds of the animation and can drive an animation using a physics
/// simulation.
class
AnimationController
extends
Animation
<
double
>
with
EagerListenerMixin
,
LocalListenersMixin
,
LocalAnimation
StatusListenersMixin
{
with
AnimationEagerListenerMixin
,
AnimationLocalListenersMixin
,
AnimationLocal
StatusListenersMixin
{
/// Creates an animation controller.
///
...
...
@@ -257,7 +257,7 @@ class _RepeatingSimulation extends Simulation {
double
x
(
double
timeInSeconds
)
{
assert
(
timeInSeconds
>=
0.0
);
final
double
t
=
(
timeInSeconds
/
_periodInSeconds
)
%
1.0
;
return
lerpDouble
(
min
,
max
,
t
);
return
ui
.
lerpDouble
(
min
,
max
,
t
);
}
double
dx
(
double
timeInSeconds
)
=>
1.0
;
...
...
packages/flutter/lib/src/animation/animations.dart
View file @
abce29f1
...
...
@@ -63,7 +63,7 @@ class AlwaysStoppedAnimation extends Animation<double> {
/// Implements most of the [Animation] interface, by deferring its behavior to a
/// given [parent] Animation. To implement an [Animation] that proxies to a
/// parent, this class plus implementing "T get value" is all that is necessary.
abstract
class
ProxyAnimated
Mixin
<
T
>
{
abstract
class
AnimationWithParent
Mixin
<
T
>
{
/// The animation whose value this animation will proxy.
///
/// This animation must remain the same for the lifetime of this object. If
...
...
@@ -87,7 +87,7 @@ abstract class ProxyAnimatedMixin<T> {
/// object, and then later change the animation from which the proxy receieves
/// its value.
class
ProxyAnimation
extends
Animation
<
double
>
with
LazyListenerMixin
,
LocalListenersMixin
,
LocalAnimation
StatusListenersMixin
{
with
AnimationLazyListenerMixin
,
AnimationLocalListenersMixin
,
AnimationLocal
StatusListenersMixin
{
ProxyAnimation
([
Animation
<
double
>
animation
])
{
_parent
=
animation
;
if
(
_parent
==
null
)
{
...
...
@@ -158,7 +158,7 @@ class ProxyAnimation extends Animation<double>
/// 0.0 because the tween does not change the status or direction of the
/// animation.
class
ReverseAnimation
extends
Animation
<
double
>
with
LazyListenerMixin
,
LocalAnimation
StatusListenersMixin
{
with
AnimationLazyListenerMixin
,
AnimationLocal
StatusListenersMixin
{
ReverseAnimation
(
this
.
parent
);
/// The animation whose value and direction this animation is reversing.
...
...
@@ -211,7 +211,7 @@ class ReverseAnimation extends Animation<double>
/// [CurvedAnimation] is useful when you wish to apply a [Curve] and you already
/// have the underlying animation object. If you don't yet have an animation and
/// want to apply a [Curve] to a [Tween], consider using [CurveTween].
class
CurvedAnimation
extends
Animation
<
double
>
with
ProxyAnimated
Mixin
<
double
>
{
class
CurvedAnimation
extends
Animation
<
double
>
with
AnimationWithParent
Mixin
<
double
>
{
CurvedAnimation
({
this
.
parent
,
this
.
curve
:
Curves
.
linear
,
...
...
@@ -283,7 +283,7 @@ enum _TrainHoppingMode { minimize, maximize }
/// removed, it exposes a [dispose()] method. Call this method to shut this
/// object down.
class
TrainHoppingAnimation
extends
Animation
<
double
>
with
EagerListenerMixin
,
LocalListenersMixin
,
LocalAnimation
StatusListenersMixin
{
with
AnimationEagerListenerMixin
,
AnimationLocalListenersMixin
,
AnimationLocal
StatusListenersMixin
{
TrainHoppingAnimation
(
this
.
_currentTrain
,
this
.
_nextTrain
,
{
this
.
onSwitchedTrain
})
{
assert
(
_currentTrain
!=
null
);
if
(
_nextTrain
!=
null
)
{
...
...
packages/flutter/lib/src/animation/listener_helpers.dart
View file @
abce29f1
...
...
@@ -12,7 +12,7 @@ abstract class _ListenerMixin {
}
/// A mixin that helps listen to another object only when this object has registered listeners.
abstract
class
LazyListenerMixin
implements
_ListenerMixin
{
abstract
class
Animation
LazyListenerMixin
implements
_ListenerMixin
{
int
_listenerCounter
=
0
;
void
didRegisterListener
()
{
assert
(
_listenerCounter
>=
0
);
...
...
@@ -33,7 +33,7 @@ abstract class LazyListenerMixin implements _ListenerMixin {
/// A mixin that replaces the didRegisterListener/didUnregisterListener contract
/// with a dispose contract.
abstract
class
EagerListenerMixin
implements
_ListenerMixin
{
abstract
class
Animation
EagerListenerMixin
implements
_ListenerMixin
{
void
didRegisterListener
()
{
}
void
didUnregisterListener
()
{
}
...
...
@@ -43,7 +43,7 @@ abstract class EagerListenerMixin implements _ListenerMixin {
/// A mixin that implements the addListener/removeListener protocol and notifies
/// all the registered listeners when notifyListeners is invoked.
abstract
class
LocalListenersMixin
extends
_ListenerMixin
{
abstract
class
Animation
LocalListenersMixin
extends
_ListenerMixin
{
final
List
<
VoidCallback
>
_listeners
=
<
VoidCallback
>[];
void
addListener
(
VoidCallback
listener
)
{
didRegisterListener
();
...
...
@@ -63,7 +63,7 @@ abstract class LocalListenersMixin extends _ListenerMixin {
/// A mixin that implements the addStatusListener/removeStatusListener protocol
/// and notifies all the registered listeners when notifyStatusListeners is
/// invoked.
abstract
class
LocalAnimation
StatusListenersMixin
extends
_ListenerMixin
{
abstract
class
AnimationLocal
StatusListenersMixin
extends
_ListenerMixin
{
final
List
<
AnimationStatusListener
>
_statusListeners
=
<
AnimationStatusListener
>[];
void
addStatusListener
(
AnimationStatusListener
listener
)
{
didRegisterListener
();
...
...
packages/flutter/lib/src/animation/tween.dart
View file @
abce29f1
...
...
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
show
Color
,
Size
,
Rect
,
VoidCallback
,
lerpDouble
;
import
'dart:ui'
show
Color
,
Size
,
Rect
,
VoidCallback
;
import
'animation.dart'
;
import
'animations.dart'
;
...
...
@@ -28,7 +28,7 @@ abstract class Animatable<T> {
}
}
class
_AnimatedEvaluation
<
T
>
extends
Animation
<
T
>
with
ProxyAnimated
Mixin
<
double
>
{
class
_AnimatedEvaluation
<
T
>
extends
Animation
<
T
>
with
AnimationWithParent
Mixin
<
double
>
{
_AnimatedEvaluation
(
this
.
parent
,
this
.
_evaluatable
);
/// The animation from which this value is derived.
...
...
packages/flutter/lib/src/gestures/binding.dart
View file @
abce29f1
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'dart:typed_data'
;
import
'dart:ui'
as
ui
;
import
'dart:ui'
as
ui
show
window
;
import
'package:flutter/services.dart'
;
import
'package:mojo/bindings.dart'
as
mojo_bindings
;
...
...
packages/flutter/lib/src/material/bottom_sheet.dart
View file @
abce29f1
...
...
@@ -4,9 +4,6 @@
import
'dart:async'
;
import
'package:flutter/animation.dart'
;
import
'package:flutter/painting.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/widgets.dart'
;
import
'colors.dart'
;
...
...
packages/flutter/lib/src/material/checkbox.dart
View file @
abce29f1
...
...
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
as
ui
;
import
'dart:ui'
as
ui
show
Gradient
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/widgets.dart'
;
...
...
@@ -122,23 +122,24 @@ class _RenderCheckbox extends RenderToggleable {
// Create an inner rectangle to cover inside of rectangle. This is needed to avoid
// painting artefacts caused by overlayed paintings.
Rect
innerRect
=
rect
.
deflate
(
1.0
);
ui
.
RRect
rrect
=
new
ui
.
RRect
.
fromRectXY
(
rect
,
_kEdgeRadius
,
_kEdgeRadius
);
RRect
rrect
=
new
RRect
.
fromRectXY
(
rect
,
_kEdgeRadius
,
_kEdgeRadius
);
// Outline of the empty rrect
paint
.
style
=
ui
.
PaintingStyle
.
stroke
;
paint
.
style
=
PaintingStyle
.
stroke
;
canvas
.
drawRRect
(
rrect
,
paint
);
// Radial gradient that changes size
if
(!
position
.
isDismissed
)
{
paint
..
style
=
ui
.
PaintingStyle
.
fill
..
style
=
PaintingStyle
.
fill
..
shader
=
new
ui
.
Gradient
.
radial
(
new
Point
(
_kEdgeSize
/
2.0
,
_kEdgeSize
/
2.0
),
_kEdgeSize
*
(
_kMidpoint
-
position
.
value
)
*
8.0
,
<
Color
>[
const
Color
(
0x00000000
),
inactiveColor
]);
_kEdgeSize
*
(
_kMidpoint
-
position
.
value
)
*
8.0
,
<
Color
>[
const
Color
(
0x00000000
),
inactiveColor
]
);
canvas
.
drawRect
(
innerRect
,
paint
);
}
...
...
@@ -149,24 +150,22 @@ class _RenderCheckbox extends RenderToggleable {
// First draw a rounded rect outline then fill inner rectangle with the active color
paint
..
color
=
activeColor
.
withAlpha
((
t
*
255
).
floor
())
..
style
=
ui
.
PaintingStyle
.
stroke
;
..
style
=
PaintingStyle
.
stroke
;
canvas
.
drawRRect
(
rrect
,
paint
);
paint
.
style
=
ui
.
PaintingStyle
.
fill
;
paint
.
style
=
PaintingStyle
.
fill
;
canvas
.
drawRect
(
innerRect
,
paint
);
}
// White inner check
paint
..
color
=
const
Color
(
0xFFFFFFFF
)
..
style
=
ui
.
PaintingStyle
.
stroke
;
..
style
=
PaintingStyle
.
stroke
;
Path
path
=
new
Path
();
Point
start
=
new
Point
(
_kEdgeSize
*
0.15
,
_kEdgeSize
*
0.45
);
Point
mid
=
new
Point
(
_kEdgeSize
*
0.4
,
_kEdgeSize
*
0.7
);
Point
end
=
new
Point
(
_kEdgeSize
*
0.85
,
_kEdgeSize
*
0.25
);
Point
lerp
(
Point
p1
,
Point
p2
,
double
t
)
=>
new
Point
(
p1
.
x
*
(
1.0
-
t
)
+
p2
.
x
*
t
,
p1
.
y
*
(
1.0
-
t
)
+
p2
.
y
*
t
);
Point
drawStart
=
lerp
(
start
,
mid
,
1.0
-
t
);
Point
drawEnd
=
lerp
(
mid
,
end
,
t
);
Point
drawStart
=
Point
.
lerp
(
start
,
mid
,
1.0
-
t
);
Point
drawEnd
=
Point
.
lerp
(
mid
,
end
,
t
);
path
.
moveTo
(
offsetX
+
drawStart
.
x
,
offsetY
+
drawStart
.
y
);
path
.
lineTo
(
offsetX
+
mid
.
x
,
offsetY
+
mid
.
y
);
path
.
lineTo
(
offsetX
+
drawEnd
.
x
,
offsetY
+
drawEnd
.
y
);
...
...
packages/flutter/lib/src/material/circle_avatar.dart
View file @
abce29f1
...
...
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter/painting.dart'
;
import
'package:flutter/widgets.dart'
;
import
'constants.dart'
;
...
...
packages/flutter/lib/src/material/dialog.dart
View file @
abce29f1
...
...
@@ -4,7 +4,6 @@
import
'dart:async'
;
import
'package:flutter/animation.dart'
;
import
'package:flutter/widgets.dart'
;
import
'colors.dart'
;
...
...
packages/flutter/lib/src/material/drawer.dart
View file @
abce29f1
...
...
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter/animation.dart'
;
import
'package:flutter/widgets.dart'
;
import
'colors.dart'
;
...
...
packages/flutter/lib/src/material/dropdown.dart
View file @
abce29f1
...
...
@@ -4,9 +4,6 @@
import
'dart:async'
;
import
'package:flutter/animation.dart'
;
import
'package:flutter/painting.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/widgets.dart'
;
import
'debug.dart'
;
...
...
packages/flutter/lib/src/material/flexible_space_bar.dart
View file @
abce29f1
...
...
@@ -4,7 +4,6 @@
import
'dart:math'
as
math
;
import
'package:flutter/animation.dart'
;
import
'package:flutter/widgets.dart'
;
import
'debug.dart'
;
...
...
packages/flutter/lib/src/material/floating_action_button.dart
View file @
abce29f1
...
...
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter/animation.dart'
;
import
'package:flutter/widgets.dart'
;
import
'icon_theme.dart'
;
...
...
packages/flutter/lib/src/material/icon_theme_data.dart
View file @
abce29f1
...
...
@@ -2,7 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
as
ui
;
import
'dart:ui'
as
ui
show
lerpDouble
;
import
'dart:ui'
show
hashValues
;
enum
IconThemeColor
{
white
,
black
}
...
...
@@ -28,7 +29,7 @@ class IconThemeData {
return
color
==
typedOther
.
color
&&
opacity
==
typedOther
.
opacity
;
}
int
get
hashCode
=>
ui
.
hashValues
(
color
,
opacity
);
int
get
hashCode
=>
hashValues
(
color
,
opacity
);
String
toString
()
=>
'
$color
'
;
}
packages/flutter/lib/src/material/input.dart
View file @
abce29f1
...
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter/animation.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter/widgets.dart'
;
import
'package:sky_services/editing/editing.mojom.dart'
as
mojom
;
...
...
@@ -13,7 +11,6 @@ import 'debug.dart';
import
'icon.dart'
;
import
'theme.dart'
;
export
'package:flutter/rendering.dart'
show
ValueChanged
;
export
'package:sky_services/editing/editing.mojom.dart'
show
KeyboardType
;
/// A material design text input field.
...
...
packages/flutter/lib/src/material/material.dart
View file @
abce29f1
...
...
@@ -4,8 +4,6 @@
import
'dart:math'
as
math
;
import
'package:flutter/animation.dart'
;
import
'package:flutter/painting.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/widgets.dart'
;
import
'package:vector_math/vector_math_64.dart'
;
...
...
packages/flutter/lib/src/material/material_app.dart
View file @
abce29f1
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'dart:async'
;
import
'dart:ui'
as
ui
;
import
'dart:ui'
as
ui
show
WindowPadding
,
window
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/services.dart'
;
...
...
@@ -12,6 +12,8 @@ import 'package:flutter/widgets.dart';
import
'page.dart'
;
import
'theme.dart'
;
export
'dart:ui'
show
Locale
;
const
TextStyle
_errorTextStyle
=
const
TextStyle
(
color:
const
Color
(
0xD0FF0000
),
fontFamily:
'monospace'
,
...
...
@@ -38,7 +40,7 @@ class RouteArguments {
}
typedef
Widget
RouteBuilder
(
RouteArguments
args
);
typedef
Future
<
LocaleQueryData
>
LocaleChangedCallback
(
ui
.
Locale
locale
);
typedef
Future
<
LocaleQueryData
>
LocaleChangedCallback
(
Locale
locale
);
class
MaterialApp
extends
StatefulComponent
{
MaterialApp
({
...
...
@@ -152,7 +154,7 @@ class _MaterialAppState extends State<MaterialApp> implements BindingObserver {
});
}
void
didChangeLocale
(
ui
.
Locale
locale
)
{
void
didChangeLocale
(
Locale
locale
)
{
if
(
config
.
onLocaleChanged
!=
null
)
{
config
.
onLocaleChanged
(
locale
).
then
((
LocaleQueryData
data
)
{
if
(
mounted
)
...
...
@@ -161,7 +163,7 @@ class _MaterialAppState extends State<MaterialApp> implements BindingObserver {
}
}
void
didChangeAppLifecycleState
(
ui
.
AppLifecycleState
state
)
{
}
void
didChangeAppLifecycleState
(
AppLifecycleState
state
)
{
}
final
HeroController
_heroController
=
new
HeroController
();
...
...
packages/flutter/lib/src/material/page.dart
View file @
abce29f1
...
...
@@ -4,7 +4,6 @@
import
'dart:async'
;
import
'package:flutter/animation.dart'
;
import
'package:flutter/widgets.dart'
;
class
_MaterialPageTransition
extends
AnimatedComponent
{
...
...
packages/flutter/lib/src/material/popup_menu.dart
View file @
abce29f1
...
...
@@ -4,7 +4,6 @@
import
'dart:async'
;
import
'package:flutter/animation.dart'
;
import
'package:flutter/widgets.dart'
;
import
'ink_well.dart'
;
...
...
packages/flutter/lib/src/material/progress_indicator.dart
View file @
abce29f1
...
...
@@ -3,9 +3,7 @@
// found in the LICENSE file.
import
'dart:math'
as
math
;
import
'dart:ui'
as
ui
;
import
'package:flutter/animation.dart'
;
import
'package:flutter/widgets.dart'
;
import
'theme.dart'
;
...
...
@@ -86,7 +84,7 @@ class _LinearProgressIndicatorPainter extends CustomPainter {
void
paint
(
Canvas
canvas
,
Size
size
)
{
Paint
paint
=
new
Paint
()
..
color
=
backgroundColor
..
style
=
ui
.
PaintingStyle
.
fill
;
..
style
=
PaintingStyle
.
fill
;
canvas
.
drawRect
(
Point
.
origin
&
size
,
paint
);
paint
.
color
=
valueColor
;
...
...
@@ -155,7 +153,7 @@ class _CircularProgressIndicatorPainter extends CustomPainter {
Paint
paint
=
new
Paint
()
..
color
=
valueColor
..
strokeWidth
=
_kCircularProgressIndicatorStrokeWidth
..
style
=
ui
.
PaintingStyle
.
stroke
;
..
style
=
PaintingStyle
.
stroke
;
if
(
value
!=
null
)
{
double
angle
=
value
.
clamp
(
0.0
,
1.0
)
*
_kSweep
;
...
...
packages/flutter/lib/src/material/radio.dart
View file @
abce29f1
...
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
as
ui
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/widgets.dart'
;
...
...
@@ -116,13 +114,13 @@ class _RenderRadio extends RenderToggleable {
// Outer circle
Paint
paint
=
new
Paint
()
..
color
=
Color
.
lerp
(
inactiveColor
,
radioColor
,
position
.
value
)
..
style
=
ui
.
PaintingStyle
.
stroke
..
style
=
PaintingStyle
.
stroke
..
strokeWidth
=
2.0
;
canvas
.
drawCircle
(
center
,
_kOuterRadius
,
paint
);
// Inner circle
if
(!
position
.
isDismissed
)
{
paint
.
style
=
ui
.
PaintingStyle
.
fill
;
paint
.
style
=
PaintingStyle
.
fill
;
canvas
.
drawCircle
(
center
,
_kInnerRadius
*
position
.
value
,
paint
);
}
}
...
...
packages/flutter/lib/src/material/scaffold.dart
View file @
abce29f1
...
...
@@ -6,8 +6,6 @@ import 'dart:async';
import
'dart:collection'
;
import
'dart:math'
as
math
;
import
'package:flutter/animation.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/widgets.dart'
;
import
'bottom_sheet.dart'
;
...
...
packages/flutter/lib/src/material/scrollbar_painter.dart
View file @
abce29f1
...
...
@@ -4,8 +4,6 @@
import
'dart:async'
;
import
'package:flutter/animation.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/widgets.dart'
;
const
double
_kMinScrollbarThumbLength
=
18.0
;
...
...
packages/flutter/lib/src/material/slider.dart
View file @
abce29f1
...
...
@@ -2,9 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter/animation.dart'
;
import
'package:flutter/gestures.dart'
;
import
'package:flutter/painting.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/widgets.dart'
;
...
...
packages/flutter/lib/src/material/snack_bar.dart
View file @
abce29f1
...
...
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter/animation.dart'
;
import
'package:flutter/widgets.dart'
;
import
'flat_button.dart'
;
...
...
packages/flutter/lib/src/material/switch.dart
View file @
abce29f1
...
...
@@ -2,10 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
as
ui
;
import
'package:flutter/gestures.dart'
;
import
'package:flutter/painting.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/widgets.dart'
;
...
...
@@ -194,13 +191,13 @@ class _RenderSwitch extends RenderToggleable {
size
.
width
-
2.0
*
trackHorizontalPadding
,
_kTrackHeight
);
ui
.
RRect
trackRRect
=
new
ui
.
RRect
.
fromRectXY
(
trackRect
,
_kTrackRadius
,
_kTrackRadius
);
RRect
trackRRect
=
new
RRect
.
fromRectXY
(
trackRect
,
_kTrackRadius
,
_kTrackRadius
);
canvas
.
drawRRect
(
trackRRect
,
paint
);
Offset
thumbOffset
=
new
Offset
(
offset
.
dx
+
kRadialReactionRadius
+
position
.
value
*
_trackInnerLength
,
offset
.
dy
+
size
.
height
/
2.0
);
offset
.
dy
+
size
.
height
/
2.0
);
paintRadialReaction
(
canvas
,
thumbOffset
);
...
...
packages/flutter/lib/src/material/tabs.dart
View file @
abce29f1
...
...
@@ -6,7 +6,6 @@ import 'dart:async';
import
'dart:math'
as
math
;
import
'package:newton/newton.dart'
;
import
'package:flutter/animation.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/widgets.dart'
;
...
...
packages/flutter/lib/src/material/theme.dart
View file @
abce29f1
...
...
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter/animation.dart'
;
import
'package:flutter/widgets.dart'
;
import
'theme_data.dart'
;
...
...
packages/flutter/lib/src/material/time_picker.dart
View file @
abce29f1
...
...
@@ -4,10 +4,7 @@
import
'dart:math'
as
math
;
import
'package:flutter/animation.dart'
;
import
'package:flutter/painting.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter/services.dart'
show
HapticFeedbackType
,
userFeedback
;
import
'package:flutter/widgets.dart'
;
import
'colors.dart'
;
...
...
packages/flutter/lib/src/material/tooltip.dart
View file @
abce29f1
...
...
@@ -5,9 +5,6 @@
import
'dart:async'
;
import
'dart:math'
as
math
;
import
'package:flutter/animation.dart'
;
import
'package:flutter/painting.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/widgets.dart'
;
import
'colors.dart'
;
...
...
packages/flutter/lib/src/material/two_level_list.dart
View file @
abce29f1
...
...
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter/animation.dart'
;
import
'package:flutter/widgets.dart'
;
import
'colors.dart'
;
...
...
packages/flutter/lib/src/painting/basic_types.dart
View file @
abce29f1
...
...
@@ -3,21 +3,51 @@
// found in the LICENSE file.
export
'dart:ui'
show
BlurStyle
,
Canvas
,
Color
,
ColorFilter
,
FilterQuality
,
FontStyle
,
FontWeight
,
ImageShader
,
LayerDrawLooperBuilder
,
MaskFilter
,
Offset
,
Paint
,
PaintingStyle
,
Path
,
Point
,
RRect
,
RSTransform
,
Rect
,
Shader
,
Size
,
StrokeCap
,
TextAlign
,
TextBaseline
,
TextDecoration
,
TextDecorationStyle
,
TextDirection
,
TileMode
,
TransferMode
,
VertexMode
,
VoidCallback
,
hashValues
,
hashList
;
// Intentionally not exported:
// - Image, decodeImageFromDataPipe, decodeImageFromList:
// We use ui.* to make it very explicit that these are low-level image APIs.
// Generally, higher layers provide more reasonable APIs around images.
// - lerpDouble:
// Hopefully this will eventually become Double.lerp.
// - Paragraph, ParagraphBuilder, ParagraphStyle, TextBox:
// These are low-level text primitives. Use this package's TextPainter API.
// - Picture, PictureRecorder, Scene, SceneBuilder:
// These are low-level primitives. Generally, the rendering layer makes these moot.
// - Gradient:
// Use this package's higher-level Gradient API instead.
// - window, WindowPadding
// These are generally wrapped by other APIs so we always refer to them directly
// as ui.* to avoid making them seem like high-level APIs.
packages/flutter/lib/src/painting/box_painter.dart
View file @
abce29f1
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'dart:math'
as
math
;
import
'dart:ui'
as
ui
;
import
'dart:ui'
as
ui
show
Image
,
Gradient
,
lerpDouble
;
import
'package:flutter/services.dart'
;
...
...
@@ -238,7 +238,7 @@ class BoxShadow {
/// A 2D gradient.
abstract
class
Gradient
{
const
Gradient
();
ui
.
Shader
createShader
();
Shader
createShader
();
}
/// A 2D linear gradient.
...
...
@@ -248,7 +248,7 @@ class LinearGradient extends Gradient {
this
.
end
,
this
.
colors
,
this
.
stops
,
this
.
tileMode
:
ui
.
TileMode
.
clamp
this
.
tileMode
:
TileMode
.
clamp
});
/// The point at which stop 0.0 of the gradient is placed.
...
...
@@ -269,9 +269,9 @@ class LinearGradient extends Gradient {
final
List
<
double
>
stops
;
/// How this gradient should tile the plane.
final
ui
.
TileMode
tileMode
;
final
TileMode
tileMode
;
ui
.
Shader
createShader
()
{
Shader
createShader
()
{
return
new
ui
.
Gradient
.
linear
(<
Point
>[
begin
,
end
],
this
.
colors
,
this
.
stops
,
this
.
tileMode
);
}
...
...
@@ -320,7 +320,7 @@ class RadialGradient extends Gradient {
this
.
radius
,
this
.
colors
,
this
.
stops
,
this
.
tileMode
:
ui
.
TileMode
.
clamp
this
.
tileMode
:
TileMode
.
clamp
});
/// The center of the gradient.
...
...
@@ -343,9 +343,9 @@ class RadialGradient extends Gradient {
final
List
<
double
>
stops
;
/// How this gradient should tile the plane.
final
ui
.
TileMode
tileMode
;
final
TileMode
tileMode
;
ui
.
Shader
createShader
()
{
Shader
createShader
()
{
return
new
ui
.
Gradient
.
radial
(
center
,
radius
,
colors
,
stops
,
tileMode
);
}
...
...
@@ -869,7 +869,7 @@ class BoxDecoration extends Decoration {
double
shortestSide
=
rect
.
shortestSide
;
// In principle, we should use shortestSide / 2.0, but we don't want to
// run into floating point rounding errors. Instead, we just use
// shortestSide and let
ui.
Canvas do any remaining clamping.
// shortestSide and let Canvas do any remaining clamping.
return
borderRadius
>
shortestSide
?
shortestSide
:
borderRadius
;
}
...
...
@@ -879,7 +879,7 @@ class BoxDecoration extends Decoration {
switch
(
shape
)
{
case
BoxShape
.
rectangle
:
if
(
borderRadius
!=
null
)
{
ui
.
RRect
bounds
=
new
ui
.
RRect
.
fromRectXY
(
Point
.
origin
&
size
,
borderRadius
,
borderRadius
);
RRect
bounds
=
new
RRect
.
fromRectXY
(
Point
.
origin
&
size
,
borderRadius
,
borderRadius
);
return
bounds
.
contains
(
position
);
}
return
true
;
...
...
@@ -938,7 +938,7 @@ class _BoxDecorationPainter extends BoxPainter {
return
hasUniformWidth
;
}
void
_paintBox
(
ui
.
Canvas
canvas
,
Rect
rect
,
Paint
paint
)
{
void
_paintBox
(
Canvas
canvas
,
Rect
rect
,
Paint
paint
)
{
switch
(
_decoration
.
shape
)
{
case
BoxShape
.
circle
:
assert
(
_decoration
.
borderRadius
==
null
);
...
...
@@ -951,30 +951,30 @@ class _BoxDecorationPainter extends BoxPainter {
canvas
.
drawRect
(
rect
,
paint
);
}
else
{
double
radius
=
_decoration
.
getEffectiveBorderRadius
(
rect
);
canvas
.
drawRRect
(
new
ui
.
RRect
.
fromRectXY
(
rect
,
radius
,
radius
),
paint
);
canvas
.
drawRRect
(
new
RRect
.
fromRectXY
(
rect
,
radius
,
radius
),
paint
);
}
break
;
}
}
void
_paintShadows
(
ui
.
Canvas
canvas
,
Rect
rect
)
{
void
_paintShadows
(
Canvas
canvas
,
Rect
rect
)
{
if
(
_decoration
.
boxShadow
==
null
)
return
;
for
(
BoxShadow
boxShadow
in
_decoration
.
boxShadow
)
{
final
Paint
paint
=
new
Paint
()
..
color
=
boxShadow
.
color
..
maskFilter
=
new
ui
.
MaskFilter
.
blur
(
ui
.
BlurStyle
.
normal
,
boxShadow
.
_blurSigma
);
..
maskFilter
=
new
MaskFilter
.
blur
(
BlurStyle
.
normal
,
boxShadow
.
_blurSigma
);
final
Rect
bounds
=
rect
.
shift
(
boxShadow
.
offset
).
inflate
(
boxShadow
.
spreadRadius
);
_paintBox
(
canvas
,
bounds
,
paint
);
}
}
void
_paintBackgroundColor
(
ui
.
Canvas
canvas
,
Rect
rect
)
{
void
_paintBackgroundColor
(
Canvas
canvas
,
Rect
rect
)
{
if
(
_decoration
.
backgroundColor
!=
null
||
_decoration
.
gradient
!=
null
)
_paintBox
(
canvas
,
rect
,
_backgroundPaint
);
}
void
_paintBackgroundImage
(
ui
.
Canvas
canvas
,
Rect
rect
)
{
void
_paintBackgroundImage
(
Canvas
canvas
,
Rect
rect
)
{
final
BackgroundImage
backgroundImage
=
_decoration
.
backgroundImage
;
if
(
backgroundImage
==
null
)
return
;
...
...
@@ -993,7 +993,7 @@ class _BoxDecorationPainter extends BoxPainter {
);
}
void
_paintBorder
(
ui
.
Canvas
canvas
,
Rect
rect
)
{
void
_paintBorder
(
Canvas
canvas
,
Rect
rect
)
{
if
(
_decoration
.
border
==
null
)
return
;
...
...
@@ -1056,19 +1056,19 @@ class _BoxDecorationPainter extends BoxPainter {
canvas
.
drawPath
(
path
,
paint
);
}
void
_paintBorderWithRadius
(
ui
.
Canvas
canvas
,
Rect
rect
)
{
void
_paintBorderWithRadius
(
Canvas
canvas
,
Rect
rect
)
{
assert
(
_hasUniformBorder
);
assert
(
_decoration
.
shape
==
BoxShape
.
rectangle
);
Color
color
=
_decoration
.
border
.
top
.
color
;
double
width
=
_decoration
.
border
.
top
.
width
;
double
radius
=
_decoration
.
getEffectiveBorderRadius
(
rect
);
ui
.
RRect
outer
=
new
ui
.
RRect
.
fromRectXY
(
rect
,
radius
,
radius
);
ui
.
RRect
inner
=
new
ui
.
RRect
.
fromRectXY
(
rect
.
deflate
(
width
),
radius
-
width
,
radius
-
width
);
RRect
outer
=
new
RRect
.
fromRectXY
(
rect
,
radius
,
radius
);
RRect
inner
=
new
RRect
.
fromRectXY
(
rect
.
deflate
(
width
),
radius
-
width
,
radius
-
width
);
canvas
.
drawDRRect
(
outer
,
inner
,
new
Paint
()..
color
=
color
);
}
void
_paintBorderWithCircle
(
ui
.
Canvas
canvas
,
Rect
rect
)
{
void
_paintBorderWithCircle
(
Canvas
canvas
,
Rect
rect
)
{
assert
(
_hasUniformBorder
);
assert
(
_decoration
.
shape
==
BoxShape
.
circle
);
assert
(
_decoration
.
borderRadius
==
null
);
...
...
@@ -1078,14 +1078,14 @@ class _BoxDecorationPainter extends BoxPainter {
Paint
paint
=
new
Paint
()
..
color
=
_decoration
.
border
.
top
.
color
..
strokeWidth
=
width
..
style
=
ui
.
PaintingStyle
.
stroke
;
..
style
=
PaintingStyle
.
stroke
;
Point
center
=
rect
.
center
;
double
radius
=
(
rect
.
shortestSide
-
width
)
/
2.0
;
canvas
.
drawCircle
(
center
,
radius
,
paint
);
}
/// Paint the box decoration into the given location on the given canvas
void
paint
(
ui
.
Canvas
canvas
,
Rect
rect
)
{
void
paint
(
Canvas
canvas
,
Rect
rect
)
{
_paintShadows
(
canvas
,
rect
);
_paintBackgroundColor
(
canvas
,
rect
);
_paintBackgroundImage
(
canvas
,
rect
);
...
...
packages/flutter/lib/src/painting/decoration.dart
View file @
abce29f1
...
...
@@ -2,8 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
as
ui
;
import
'basic_types.dart'
;
import
'edge_dims.dart'
;
export
'edge_dims.dart'
show
EdgeDims
;
...
...
@@ -16,14 +15,14 @@ abstract class Decoration {
EdgeDims
get
padding
=>
null
;
Decoration
lerpFrom
(
Decoration
a
,
double
t
)
=>
this
;
Decoration
lerpTo
(
Decoration
b
,
double
t
)
=>
b
;
bool
hitTest
(
ui
.
Size
size
,
ui
.
Point
position
)
=>
true
;
bool
hitTest
(
Size
size
,
Point
position
)
=>
true
;
bool
get
needsListeners
=>
false
;
void
addChangeListener
(
ui
.
VoidCallback
listener
)
{
assert
(
false
);
}
void
removeChangeListener
(
ui
.
VoidCallback
listener
)
{
assert
(
false
);
}
void
addChangeListener
(
VoidCallback
listener
)
{
assert
(
false
);
}
void
removeChangeListener
(
VoidCallback
listener
)
{
assert
(
false
);
}
BoxPainter
createBoxPainter
();
String
toString
([
String
prefix
=
''
])
=>
'
$prefix$runtimeType
'
;
}
abstract
class
BoxPainter
{
void
paint
(
ui
.
Canvas
canvas
,
ui
.
Rect
rect
);
void
paint
(
Canvas
canvas
,
Rect
rect
);
}
packages/flutter/lib/src/painting/edge_dims.dart
View file @
abce29f1
...
...
@@ -2,8 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
as
ui
;
import
'dart:ui'
show
hashValues
;
import
'dart:ui'
as
ui
show
lerpDouble
;
import
'basic_types.dart'
;
/// An immutable set of offsets in each of the four cardinal directions.
///
...
...
@@ -50,13 +51,13 @@ class EdgeDims {
double
get
vertical
=>
top
+
bottom
;
/// The size that this EdgeDims would occupy with an empty interior.
ui
.
Size
get
collapsedSize
=>
new
ui
.
Size
(
horizontal
,
vertical
);
Size
get
collapsedSize
=>
new
Size
(
horizontal
,
vertical
);
/// An EdgeDims with top and bottom as well as left and right flipped.
EdgeDims
get
flipped
=>
new
EdgeDims
.
TRBL
(
bottom
,
left
,
top
,
right
);
ui
.
Rect
inflateRect
(
ui
.
Rect
rect
)
{
return
new
ui
.
Rect
.
fromLTRB
(
rect
.
left
-
left
,
rect
.
top
-
top
,
rect
.
right
+
right
,
rect
.
bottom
+
bottom
);
Rect
inflateRect
(
Rect
rect
)
{
return
new
Rect
.
fromLTRB
(
rect
.
left
-
left
,
rect
.
top
-
top
,
rect
.
right
+
right
,
rect
.
bottom
+
bottom
);
}
EdgeDims
operator
-(
EdgeDims
other
)
{
...
...
packages/flutter/lib/src/painting/shadows.dart
deleted
100644 → 0
View file @
265fc9e8
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
as
ui
;
/// A helper class to build a [ui.DrawLooper] for drawing shadows
class
ShadowDrawLooperBuilder
{
ui
.
LayerDrawLooperBuilder
_builder
=
new
ui
.
LayerDrawLooperBuilder
();
/// Adds a shadow with the given parameters.
void
addShadow
(
ui
.
Offset
offset
,
ui
.
Color
color
,
double
blur
)
{
_builder
.
addLayerOnTop
(
new
ui
.
DrawLooperLayerInfo
()
..
setPaintBits
(
ui
.
PaintBits
.
all
)
..
setOffset
(
offset
)
..
setColorMode
(
ui
.
TransferMode
.
src
),
new
ui
.
Paint
()
..
color
=
color
..
maskFilter
=
new
ui
.
MaskFilter
.
blur
(
ui
.
BlurStyle
.
normal
,
blur
)
);
}
/// Returns the draw looper built for the added shadows
ui
.
DrawLooper
build
()
{
_builder
.
addLayerOnTop
(
new
ui
.
DrawLooperLayerInfo
(),
new
ui
.
Paint
());
return
_builder
.
build
();
}
}
packages/flutter/lib/src/painting/text_painter.dart
View file @
abce29f1
...
...
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
as
ui
;
import
'dart:ui'
as
ui
show
Paragraph
,
ParagraphBuilder
,
ParagraphStyle
,
TextBox
;
import
'basic_types.dart'
;
import
'text_editing.dart'
;
...
...
@@ -212,7 +212,7 @@ class TextPainter {
}
/// Paints the text onto the given canvas at the given offset.
void
paint
(
ui
.
Canvas
canvas
,
ui
.
Offset
offset
)
{
void
paint
(
Canvas
canvas
,
Offset
offset
)
{
assert
(!
_needsLayout
&&
"Please call layout() before paint() to position the text before painting it."
is
String
);
_paragraph
.
paint
(
canvas
,
offset
);
}
...
...
@@ -223,7 +223,7 @@ class TextPainter {
return
null
;
ui
.
TextBox
box
=
boxes
[
0
];
double
caretEnd
=
box
.
end
;
double
dx
=
box
.
direction
==
ui
.
TextDirection
.
rtl
?
caretEnd
:
caretEnd
-
caretPrototype
.
width
;
double
dx
=
box
.
direction
==
TextDirection
.
rtl
?
caretEnd
:
caretEnd
-
caretPrototype
.
width
;
return
new
Offset
(
dx
,
0.0
);
}
...
...
@@ -233,7 +233,7 @@ class TextPainter {
return
null
;
ui
.
TextBox
box
=
boxes
[
0
];
double
caretStart
=
box
.
start
;
double
dx
=
box
.
direction
==
ui
.
TextDirection
.
rtl
?
caretStart
-
caretPrototype
.
width
:
caretStart
;
double
dx
=
box
.
direction
==
TextDirection
.
rtl
?
caretStart
-
caretPrototype
.
width
:
caretStart
;
return
new
Offset
(
dx
,
0.0
);
}
...
...
packages/flutter/lib/src/painting/text_style.dart
View file @
abce29f1
...
...
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
as
ui
;
import
'dart:ui'
as
ui
show
ParagraphStyle
,
TextStyle
,
lerpDouble
;
import
'basic_types.dart'
;
...
...
packages/flutter/lib/src/rendering/basic_types.dart
View file @
abce29f1
...
...
@@ -2,19 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
export
'dart:ui'
show
Canvas
,
Color
,
ColorFilter
,
Offset
,
Paint
,
Path
,
Point
,
Rect
,
Size
,
TransferMode
,
VoidCallback
;
typedef
void
ValueChanged
<
T
>(
T
value
);
/// A BitField over an enum (or other class whose values implement "index").
...
...
packages/flutter/lib/src/rendering/binding.dart
View file @
abce29f1
...
...
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
as
ui
;
import
'dart:ui'
as
ui
show
window
;
import
'package:flutter/gestures.dart'
;
import
'package:flutter/scheduler.dart'
;
...
...
packages/flutter/lib/src/rendering/box.dart
View file @
abce29f1
...
...
@@ -3,19 +3,15 @@
// found in the LICENSE file.
import
'dart:math'
as
math
;
import
'dart:ui'
as
ui
;
import
'dart:ui'
show
hashValues
;
import
'dart:ui'
as
ui
show
lerpDouble
;
import
'package:flutter/animation.dart'
;
import
'package:flutter/gestures.dart'
;
import
'package:flutter/painting.dart'
;
import
'package:vector_math/vector_math_64.dart'
;
import
'debug.dart'
;
import
'object.dart'
;
export
'package:flutter/painting.dart'
show
EdgeDims
,
FractionalOffset
,
TextBaseline
;
// This class should only be used in debug builds
class
_DebugSize
extends
Size
{
_DebugSize
(
Size
source
,
this
.
_owner
,
this
.
_canBeUsedByParent
):
super
.
copy
(
source
);
...
...
@@ -837,7 +833,7 @@ abstract class RenderBox extends RenderObject {
void
debugPaintSize
(
PaintingContext
context
,
Offset
offset
)
{
assert
(()
{
Paint
paint
=
new
Paint
()
..
style
=
ui
.
PaintingStyle
.
stroke
..
style
=
PaintingStyle
.
stroke
..
strokeWidth
=
1.0
..
color
=
debugPaintSizeColor
;
context
.
canvas
.
drawRect
((
offset
&
size
).
deflate
(
0.5
),
paint
);
...
...
@@ -847,7 +843,7 @@ abstract class RenderBox extends RenderObject {
void
debugPaintBaselines
(
PaintingContext
context
,
Offset
offset
)
{
assert
(()
{
Paint
paint
=
new
Paint
()
..
style
=
ui
.
PaintingStyle
.
stroke
..
style
=
PaintingStyle
.
stroke
..
strokeWidth
=
0.25
;
Path
path
;
// ideographic baseline
...
...
packages/flutter/lib/src/rendering/debug.dart
View file @
abce29f1
...
...
@@ -5,7 +5,6 @@
import
'dart:async'
;
import
'dart:convert'
show
JSON
;
import
'dart:developer'
as
developer
;
import
'dart:ui'
as
ui
;
import
'package:flutter/painting.dart'
;
import
'package:flutter/rendering.dart'
;
...
...
@@ -18,35 +17,35 @@ export 'package:flutter/services.dart' show debugPrint;
bool
debugPaintSizeEnabled
=
false
;
/// The color to use when painting RenderObject bounds.
ui
.
Color
debugPaintSizeColor
=
const
ui
.
Color
(
0xFF00FFFF
);
Color
debugPaintSizeColor
=
const
Color
(
0xFF00FFFF
);
/// The color to use when painting some boxes that just add space (e.g. an empty
/// RenderConstrainedBox or RenderPadding).
ui
.
Color
debugPaintSpacingColor
=
const
ui
.
Color
(
0x90909090
);
Color
debugPaintSpacingColor
=
const
Color
(
0x90909090
);
/// The color to use when painting RenderPadding edges.
ui
.
Color
debugPaintPaddingColor
=
const
ui
.
Color
(
0x900090FF
);
Color
debugPaintPaddingColor
=
const
Color
(
0x900090FF
);
/// The color to use when painting RenderPadding edges.
ui
.
Color
debugPaintPaddingInnerEdgeColor
=
const
ui
.
Color
(
0xFF0090FF
);
Color
debugPaintPaddingInnerEdgeColor
=
const
Color
(
0xFF0090FF
);
/// The color to use when painting the arrows used to show RenderPositionedBox alignment.
ui
.
Color
debugPaintArrowColor
=
const
ui
.
Color
(
0xFFFFFF00
);
Color
debugPaintArrowColor
=
const
Color
(
0xFFFFFF00
);
/// Causes each RenderBox to paint a line at each of its baselines.
bool
debugPaintBaselinesEnabled
=
false
;
/// The color to use when painting alphabetic baselines.
ui
.
Color
debugPaintAlphabeticBaselineColor
=
const
ui
.
Color
(
0xFF00FF00
);
Color
debugPaintAlphabeticBaselineColor
=
const
Color
(
0xFF00FF00
);
/// The color ot use when painting ideographic baselines.
ui
.
Color
debugPaintIdeographicBaselineColor
=
const
ui
.
Color
(
0xFFFFD000
);
Color
debugPaintIdeographicBaselineColor
=
const
Color
(
0xFFFFD000
);
/// Causes each Layer to paint a box around its bounds.
bool
debugPaintLayerBordersEnabled
=
false
;
/// The color to use when painting Layer borders.
ui
.
Color
debugPaintLayerBordersColor
=
const
ui
.
Color
(
0xFFFF9800
);
Color
debugPaintLayerBordersColor
=
const
Color
(
0xFFFF9800
);
/// Causes RenderBox objects to flash while they are being tapped.
bool
debugPaintPointersEnabled
=
false
;
...
...
@@ -55,7 +54,7 @@ bool debugPaintPointersEnabled = false;
int
debugPaintPointersColorValue
=
0x00BBBB
;
/// The color to use when painting RenderError boxes in checked mode.
ui
.
Color
debugErrorBoxColor
=
const
ui
.
Color
(
0xFFFF0000
);
Color
debugErrorBoxColor
=
const
Color
(
0xFFFF0000
);
/// Overlay a rotating set of colors when repainting layers in checked mode.
bool
debugEnableRepaintRainbox
=
false
;
...
...
packages/flutter/lib/src/rendering/editable_line.dart
View file @
abce29f1
...
...
@@ -2,14 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
as
ui
;
import
'dart:ui'
as
ui
show
Paragraph
,
ParagraphBuilder
,
ParagraphStyle
,
TextBox
;
import
'package:flutter/gestures.dart'
;
import
'package:flutter/painting.dart'
;
import
'basic_types.dart'
;
import
'box.dart'
;
import
'object.dart'
;
import
'paragraph.dart'
;
const
_kCaretGap
=
1.0
;
// pixels
const
_kCaretHeightOffset
=
2.0
;
// pixels
...
...
packages/flutter/lib/src/rendering/image.dart
View file @
abce29f1
...
...
@@ -2,9 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
as
ui
;
import
'package:flutter/painting.dart'
;
import
'dart:ui'
as
ui
show
Image
;
import
'box.dart'
;
import
'object.dart'
;
...
...
packages/flutter/lib/src/rendering/layer.dart
View file @
abce29f1
...
...
@@ -2,16 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
as
ui
;
import
'dart:ui'
as
ui
show
Picture
,
SceneBuilder
;
import
'dart:ui'
show
Offset
;
import
'package:flutter/painting.dart'
;
import
'package:vector_math/vector_math_64.dart'
;
import
'package:mojo_services/mojo/ui/layouts.mojom.dart'
as
mojom
;
import
'basic_types.dart'
;
import
'debug.dart'
;
export
'basic_types.dart'
;
/// A composited layer
///
/// During painting, the render tree generates a tree of composited layers that
...
...
@@ -317,7 +316,7 @@ class ClipRRectLayer extends ContainerLayer {
ClipRRectLayer
({
this
.
clipRRect
});
/// The rounded-rect to clip in the parent's coordinate system
ui
.
RRect
clipRRect
;
RRect
clipRRect
;
// TODO(abarth): Why is the rounded-rect in the parent's coordinate system
// instead of in the coordinate system of this layer?
...
...
@@ -403,7 +402,7 @@ class ShaderMaskLayer extends ContainerLayer {
ShaderMaskLayer
({
this
.
shader
,
this
.
maskRect
,
this
.
transferMode
});
/// The shader to apply to the children.
ui
.
Shader
shader
;
Shader
shader
;
/// The size of the shader.
Rect
maskRect
;
...
...
packages/flutter/lib/src/rendering/object.dart
View file @
abce29f1
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'dart:developer'
;
import
'dart:ui'
as
ui
;
import
'dart:ui'
as
ui
show
PictureRecorder
;
import
'package:flutter/gestures.dart'
;
import
'package:flutter/painting.dart'
;
...
...
@@ -18,8 +18,8 @@ import 'node.dart';
import
'semantics.dart'
;
import
'binding.dart'
;
export
'layer.dart'
;
export
'package:flutter/gestures.dart'
show
HitTestEntry
,
HitTestResult
;
export
'package:flutter/painting.dart'
;
/// Base class for data associated with a [RenderObject] by its parent.
///
...
...
@@ -163,7 +163,7 @@ class PaintingContext {
canvas
.
drawRect
(
_paintBounds
,
new
Paint
()..
color
=
debugCurrentRepaintColor
.
toColor
());
if
(
debugPaintLayerBordersEnabled
)
{
Paint
paint
=
new
Paint
()
..
style
=
ui
.
PaintingStyle
.
stroke
..
style
=
PaintingStyle
.
stroke
..
strokeWidth
=
1.0
..
color
=
debugPaintLayerBordersColor
;
canvas
.
drawRect
(
_paintBounds
,
paint
);
...
...
@@ -223,9 +223,9 @@ class PaintingContext {
/// This function will call painter synchronously with a painting context that
/// is clipped by the given clip. The given clip should not incorporate the
/// painting offset.
void
pushClipRRect
(
bool
needsCompositing
,
Offset
offset
,
Rect
bounds
,
ui
.
RRect
clipRRect
,
PaintingContextCallback
painter
)
{
void
pushClipRRect
(
bool
needsCompositing
,
Offset
offset
,
Rect
bounds
,
RRect
clipRRect
,
PaintingContextCallback
painter
)
{
Rect
offsetBounds
=
bounds
.
shift
(
offset
);
ui
.
RRect
offsetClipRRect
=
clipRRect
.
shift
(
offset
);
RRect
offsetClipRRect
=
clipRRect
.
shift
(
offset
);
if
(
needsCompositing
)
{
_stopRecordingIfNeeded
();
ClipRRectLayer
clipLayer
=
new
ClipRRectLayer
(
clipRRect:
offsetClipRRect
);
...
...
@@ -305,7 +305,7 @@ class PaintingContext {
///
/// This function will call painter synchronously with a painting context that
/// will be masked with the given shader.
void
pushShaderMask
(
Offset
offset
,
ui
.
Shader
shader
,
Rect
maskRect
,
TransferMode
transferMode
,
PaintingContextCallback
painter
)
{
void
pushShaderMask
(
Offset
offset
,
Shader
shader
,
Rect
maskRect
,
TransferMode
transferMode
,
PaintingContextCallback
painter
)
{
_stopRecordingIfNeeded
();
ShaderMaskLayer
shaderLayer
=
new
ShaderMaskLayer
(
shader:
shader
,
...
...
packages/flutter/lib/src/rendering/paragraph.dart
View file @
abce29f1
...
...
@@ -2,24 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter/painting.dart'
;
import
'box.dart'
;
import
'object.dart'
;
import
'semantics.dart'
;
export
'package:flutter/painting.dart'
show
FontStyle
,
FontWeight
,
PlainTextSpan
,
StyledTextSpan
,
TextAlign
,
TextBaseline
,
TextDecoration
,
TextDecorationStyle
,
TextSpan
,
TextStyle
;
/// A render object that displays a paragraph of text
class
RenderParagraph
extends
RenderBox
{
...
...
packages/flutter/lib/src/rendering/proxy_box.dart
View file @
abce29f1
...
...
@@ -2,12 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
as
ui
;
import
'package:flutter/painting.dart'
;
import
'package:flutter/gestures.dart'
;
import
'package:vector_math/vector_math_64.dart'
;
import
'basic_types.dart'
;
import
'box.dart'
;
import
'debug.dart'
;
import
'object.dart'
;
...
...
@@ -19,7 +17,6 @@ export 'package:flutter/gestures.dart' show
PointerMoveEvent
,
PointerUpEvent
,
PointerCancelEvent
;
export
'package:flutter/painting.dart'
show
Decoration
,
BoxDecoration
;
/// A base class for render objects that resemble their children.
///
...
...
@@ -642,7 +639,7 @@ class RenderOpacity extends RenderProxyBox {
}
}
typedef
ui
.
Shader
ShaderCallback
(
Rect
bounds
);
typedef
Shader
ShaderCallback
(
Rect
bounds
);
class
RenderShaderMask
extends
RenderProxyBox
{
RenderShaderMask
({
RenderBox
child
,
ShaderCallback
shaderCallback
,
TransferMode
transferMode
})
...
...
@@ -805,7 +802,7 @@ class RenderClipRRect extends RenderProxyBox {
void
paint
(
PaintingContext
context
,
Offset
offset
)
{
if
(
child
!=
null
)
{
Rect
rect
=
Point
.
origin
&
size
;
ui
.
RRect
rrect
=
new
ui
.
RRect
.
fromRectXY
(
rect
,
xRadius
,
yRadius
);
RRect
rrect
=
new
RRect
.
fromRectXY
(
rect
,
xRadius
,
yRadius
);
context
.
pushClipRRect
(
needsCompositing
,
offset
,
rect
,
rrect
,
super
.
paint
);
}
}
...
...
packages/flutter/lib/src/rendering/shifted_box.dart
View file @
abce29f1
...
...
@@ -3,9 +3,6 @@
// found in the LICENSE file.
import
'dart:math'
as
math
;
import
'dart:ui'
as
ui
;
import
'package:flutter/painting.dart'
;
import
'box.dart'
;
import
'debug.dart'
;
...
...
@@ -300,7 +297,7 @@ class RenderPositionedBox extends RenderShiftedBox {
if
(
child
!=
null
&&
!
child
.
size
.
isEmpty
)
{
Path
path
;
paint
=
new
Paint
()
..
style
=
ui
.
PaintingStyle
.
stroke
..
style
=
PaintingStyle
.
stroke
..
strokeWidth
=
1.0
..
color
=
debugPaintArrowColor
;
path
=
new
Path
();
...
...
packages/flutter/lib/src/rendering/view.dart
View file @
abce29f1
...
...
@@ -3,9 +3,8 @@
// found in the LICENSE file.
import
'dart:developer'
;
import
'dart:ui'
as
ui
;
import
'dart:ui'
as
ui
show
Scene
,
SceneBuilder
,
window
;
import
'package:flutter/painting.dart'
;
import
'package:flutter/scheduler.dart'
;
import
'package:vector_math/vector_math_64.dart'
;
...
...
packages/flutter/lib/src/rendering/viewport.dart
View file @
abce29f1
...
...
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
as
ui
;
import
'dart:ui'
as
ui
show
window
;
import
'package:vector_math/vector_math_64.dart'
;
...
...
packages/flutter/lib/src/scheduler/scheduler.dart
View file @
abce29f1
...
...
@@ -5,11 +5,14 @@
import
'dart:async'
;
import
'dart:collection'
;
import
'dart:developer'
;
import
'dart:ui'
as
ui
;
import
'dart:ui'
as
ui
show
window
;
import
'dart:ui'
show
VoidCallback
;
import
'package:collection/collection.dart'
;
import
'package:flutter/services.dart'
;
export
'dart:ui'
show
VoidCallback
;
/// Slows down animations by this factor to help in development.
double
timeDilation
=
1.0
;
...
...
@@ -32,7 +35,7 @@ SchedulerExceptionHandler debugSchedulerExceptionHandler;
///
/// Combines the task and its priority.
class
_TaskEntry
{
final
ui
.
VoidCallback
task
;
final
VoidCallback
task
;
final
int
priority
;
const
_TaskEntry
(
this
.
task
,
this
.
priority
);
...
...
@@ -110,7 +113,7 @@ abstract class Scheduler extends BindingBase {
bool
_hasRequestedABeginFrameCallback
=
false
;
/// Schedules the given [task] with the given [priority].
void
scheduleTask
(
ui
.
VoidCallback
task
,
Priority
priority
)
{
void
scheduleTask
(
VoidCallback
task
,
Priority
priority
)
{
bool
isFirstTask
=
_taskQueue
.
isEmpty
;
_taskQueue
.
add
(
new
_TaskEntry
(
task
,
priority
.
_value
));
if
(
isFirstTask
)
...
...
packages/flutter/lib/src/
animation
/ticker.dart
→
packages/flutter/lib/src/
scheduler
/ticker.dart
View file @
abce29f1
...
...
@@ -4,7 +4,7 @@
import
'dart:async'
;
import
'
package:flutter/
scheduler.dart'
;
import
'scheduler.dart'
;
typedef
TickerCallback
(
Duration
elapsed
);
...
...
packages/flutter/lib/src/services/image_decoder.dart
View file @
abce29f1
...
...
@@ -4,7 +4,7 @@
import
'dart:async'
;
import
'dart:typed_data'
;
import
'dart:ui'
as
ui
;
import
'dart:ui'
as
ui
show
Image
,
decodeImageFromDataPipe
,
decodeImageFromList
;
import
'package:mojo/core.dart'
show
MojoDataPipeConsumer
;
...
...
packages/flutter/lib/src/services/image_resource.dart
View file @
abce29f1
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'dart:async'
;
import
'dart:ui'
as
ui
;
import
'dart:ui'
as
ui
show
Image
;
import
'print.dart'
;
...
...
packages/flutter/lib/src/widgets/basic.dart
View file @
abce29f1
...
...
@@ -2,72 +2,46 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
as
ui
;
import
'dart:ui'
as
ui
show
Image
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/services.dart'
;
import
'framework.dart'
;
export
'package:flutter/animation.dart'
;
export
'package:flutter/painting.dart'
;
export
'package:flutter/rendering.dart'
show
BackgroundImage
,
Border
,
BorderSide
,
Axis
,
BoxConstraints
,
BoxDecoration
,
BoxShadow
,
BoxShape
,
Canvas
,
Color
,
ColorFilter
,
CustomClipper
,
CustomPainter
,
Decoration
,
DecorationPosition
,
EdgeDims
,
FixedColumnCountGridDelegate
,
FlexAlignItems
,
FlexDirection
,
FlexJustifyContent
,
FixedColumnCountGridDelegate
,
FontStyle
,
FontWeight
,
FractionalOffset
,
Gradient
,
FractionalOffsetTween
,
GridDelegate
,
HitTestBehavior
,
ImageFit
,
ImageRepeat
,
InputEvent
,
LinearGradient
,
Matrix4
,
MaxTileWidthGridDelegate
,
Offset
,
MultiChildLayoutDelegate
,
OneChildLayoutDelegate
,
Paint
,
Pa
th
,
Paint
er
,
Pa
intingContext
,
PlainTextSpan
,
Point
,
PointerCancelEvent
,
PointerCancelEventListener
,
PointerDownEvent
,
PointerDownEventListener
,
PointerEvent
,
PointerMoveEvent
,
PointerMoveEventListener
,
PointerUpEvent
,
RadialGradient
,
Rect
,
Axis
,
Size
,
StyledTextSpan
,
TextAlign
,
TextBaseline
,
TextDecoration
,
TextDecorationStyle
,
TextSpan
,
TextStyle
,
TransferMode
,
PointerUpEventListener
,
RelativeRect
,
ShaderCallback
,
ValueChanged
,
ViewportAnchor
,
VoidCallback
;
ViewportAnchor
;
// PAINTING NODES
...
...
packages/flutter/lib/src/widgets/binding.dart
View file @
abce29f1
...
...
@@ -2,8 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
as
ui
;
import
'dart:developer'
;
import
'dart:ui'
as
ui
show
window
;
import
'dart:ui'
show
AppLifecycleState
,
Locale
;
import
'package:flutter/gestures.dart'
;
import
'package:flutter/rendering.dart'
;
...
...
@@ -12,11 +13,13 @@ import 'package:flutter/services.dart';
import
'framework.dart'
;
export
'dart:ui'
show
AppLifecycleState
,
Locale
;
class
BindingObserver
{
bool
didPopRoute
()
=>
false
;
void
didChangeMetrics
()
{
}
void
didChangeLocale
(
ui
.
Locale
locale
)
{
}
void
didChangeAppLifecycleState
(
ui
.
AppLifecycleState
state
)
{
}
void
didChangeLocale
(
Locale
locale
)
{
}
void
didChangeAppLifecycleState
(
AppLifecycleState
state
)
{
}
}
/// A concrete binding for applications based on the Widgets framework.
...
...
@@ -69,7 +72,7 @@ class WidgetFlutterBinding extends BindingBase with Scheduler, Gesturer, MojoShe
dispatchLocaleChanged
(
ui
.
window
.
locale
);
}
void
dispatchLocaleChanged
(
ui
.
Locale
locale
)
{
void
dispatchLocaleChanged
(
Locale
locale
)
{
for
(
BindingObserver
observer
in
_observers
)
observer
.
didChangeLocale
(
locale
);
}
...
...
@@ -82,7 +85,7 @@ class WidgetFlutterBinding extends BindingBase with Scheduler, Gesturer, MojoShe
activity
.
finishCurrentActivity
();
}
void
handleAppLifecycleStateChanged
(
ui
.
AppLifecycleState
state
)
{
void
handleAppLifecycleStateChanged
(
AppLifecycleState
state
)
{
for
(
BindingObserver
observer
in
_observers
)
observer
.
didChangeAppLifecycleState
(
state
);
}
...
...
packages/flutter/lib/src/widgets/checked_mode_banner.dart
View file @
abce29f1
...
...
@@ -3,10 +3,6 @@
// found in the LICENSE file.
import
'dart:math'
as
math
;
import
'dart:ui'
as
ui
;
import
'package:flutter/painting.dart'
;
import
'package:flutter/rendering.dart'
;
import
'basic.dart'
;
import
'framework.dart'
;
...
...
@@ -37,7 +33,7 @@ class _CheckedModeBannerPainter extends CustomPainter {
void
paint
(
Canvas
canvas
,
Size
size
)
{
final
Paint
paintShadow
=
new
Paint
()
..
color
=
const
Color
(
0x7F000000
)
..
maskFilter
=
new
ui
.
MaskFilter
.
blur
(
ui
.
BlurStyle
.
normal
,
kShadowBlur
);
..
maskFilter
=
new
MaskFilter
.
blur
(
BlurStyle
.
normal
,
kShadowBlur
);
final
Paint
paintBanner
=
new
Paint
()
..
color
=
kColor
;
canvas
...
...
packages/flutter/lib/src/widgets/dismissable.dart
View file @
abce29f1
...
...
@@ -2,10 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
as
ui
;
import
'package:flutter/animation.dart'
;
import
'basic.dart'
;
import
'transitions.dart'
;
import
'framework.dart'
;
...
...
@@ -186,7 +182,7 @@ class _DismissableState extends State<Dismissable> {
_dismissController
.
value
=
_dragExtent
.
abs
()
/
_size
.
width
;
}
bool
_isFlingGesture
(
ui
.
Offset
velocity
)
{
bool
_isFlingGesture
(
Offset
velocity
)
{
double
vx
=
velocity
.
dx
;
double
vy
=
velocity
.
dy
;
if
(
_directionIsYAxis
)
{
...
...
@@ -215,7 +211,7 @@ class _DismissableState extends State<Dismissable> {
return
false
;
}
void
_handleDragEnd
(
ui
.
Offset
velocity
)
{
void
_handleDragEnd
(
Offset
velocity
)
{
if
(!
_isActive
||
_dismissController
.
isAnimating
)
return
;
setState
(()
{
...
...
packages/flutter/lib/src/widgets/editable.dart
View file @
abce29f1
...
...
@@ -4,9 +4,8 @@
import
'dart:async'
;
import
'package:flutter/rendering.dart'
show
RenderEditableLine
;
import
'package:sky_services/editing/editing.mojom.dart'
as
mojom
;
import
'package:flutter/painting.dart'
;
import
'package:flutter/rendering.dart'
;
import
'basic.dart'
;
import
'framework.dart'
;
...
...
packages/flutter/lib/src/widgets/enter_exit_transition.dart
View file @
abce29f1
...
...
@@ -4,8 +4,6 @@
import
'dart:async'
;
import
'package:flutter/animation.dart'
;
import
'basic.dart'
;
import
'framework.dart'
;
...
...
packages/flutter/lib/src/widgets/framework.dart
View file @
abce29f1
...
...
@@ -8,7 +8,7 @@ import 'dart:collection';
import
'package:flutter/rendering.dart'
;
export
'dart:ui'
show
hashValues
,
hashList
;
export
'package:flutter/rendering.dart'
show
debugPrint
;
export
'package:flutter/rendering.dart'
show
RenderObject
,
RenderBox
,
debugPrint
;
// KEYS
...
...
packages/flutter/lib/src/widgets/heroes.dart
View file @
abce29f1
...
...
@@ -4,8 +4,6 @@
import
'dart:collection'
;
import
'package:flutter/animation.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/scheduler.dart'
;
import
'basic.dart'
;
...
...
packages/flutter/lib/src/widgets/implicit_animations.dart
View file @
abce29f1
...
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter/animation.dart'
;
import
'basic.dart'
;
import
'framework.dart'
;
...
...
packages/flutter/lib/src/widgets/mimic.dart
View file @
abce29f1
...
...
@@ -4,8 +4,7 @@
import
'dart:async'
;
import
'package:flutter/animation.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/rendering.dart'
show
RenderStack
;
import
'basic.dart'
;
import
'framework.dart'
;
...
...
@@ -110,7 +109,9 @@ class MimicOverlayEntry {
RenderBox
stack
=
context
.
ancestorRenderObjectOfType
(
const
TypeMatcher
<
RenderStack
>());
// TODO(abarth): Handle the case where the transform here isn't just a translation.
Point
localPosition
=
stack
==
null
?
globalPosition:
stack
.
globalToLocal
(
globalPosition
);
// TODO(ianh): We should probably be getting the overlay's render object rather than looking for a RenderStack.
assert
(
stack
!=
null
);
Point
localPosition
=
stack
.
globalToLocal
(
globalPosition
);
return
new
Positioned
(
left:
localPosition
.
x
,
top:
localPosition
.
y
,
...
...
packages/flutter/lib/src/widgets/modal_barrier.dart
View file @
abce29f1
...
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter/animation.dart'
;
import
'basic.dart'
;
import
'framework.dart'
;
import
'gesture_detector.dart'
;
...
...
packages/flutter/lib/src/widgets/pageable_list.dart
View file @
abce29f1
...
...
@@ -4,8 +4,7 @@
import
'dart:async'
;
import
'package:flutter/animation.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/rendering.dart'
show
RenderList
,
ViewportDimensions
;
import
'basic.dart'
;
import
'framework.dart'
;
...
...
packages/flutter/lib/src/widgets/pages.dart
View file @
abce29f1
...
...
@@ -4,8 +4,7 @@
import
'dart:async'
;
import
'package:flutter/animation.dart'
;
import
'basic.dart'
;
import
'navigator.dart'
;
import
'overlay.dart'
;
import
'routes.dart'
;
...
...
packages/flutter/lib/src/widgets/routes.dart
View file @
abce29f1
...
...
@@ -4,8 +4,6 @@
import
'dart:async'
;
import
'package:flutter/animation.dart'
;
import
'basic.dart'
;
import
'focus.dart'
;
import
'framework.dart'
;
...
...
packages/flutter/lib/src/widgets/scrollable.dart
View file @
abce29f1
...
...
@@ -4,12 +4,11 @@
import
'dart:async'
;
import
'dart:math'
as
math
;
import
'dart:ui'
as
ui
;
import
'dart:ui'
as
ui
show
window
;
import
'package:newton/newton.dart'
;
import
'package:flutter/animation.dart'
;
import
'package:flutter/gestures.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/rendering.dart'
show
HasScrollDirection
;
import
'basic.dart'
;
import
'framework.dart'
;
...
...
packages/flutter/lib/src/widgets/semantics_debugger.dart
View file @
abce29f1
...
...
@@ -3,9 +3,7 @@
// found in the LICENSE file.
import
'dart:math'
as
math
;
import
'dart:ui'
as
ui
;
import
'package:flutter/painting.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:sky_services/semantics/semantics.mojom.dart'
as
mojom
;
...
...
@@ -193,17 +191,17 @@ class _SemanticsDebuggerEntry {
if
(
innerRect
.
isEmpty
)
{
Paint
fill
=
new
Paint
()
..
color
=
lineColor
..
style
=
ui
.
PaintingStyle
.
fill
;
..
style
=
PaintingStyle
.
fill
;
canvas
.
drawRect
(
rect
,
fill
);
}
else
{
Paint
fill
=
new
Paint
()
..
color
=
const
Color
(
0xFFFFFFFF
)
..
style
=
ui
.
PaintingStyle
.
fill
;
..
style
=
PaintingStyle
.
fill
;
canvas
.
drawRect
(
rect
,
fill
);
Paint
line
=
new
Paint
()
..
strokeWidth
=
rank
*
2.0
..
color
=
lineColor
..
style
=
ui
.
PaintingStyle
.
stroke
;
..
style
=
PaintingStyle
.
stroke
;
canvas
.
drawRect
(
innerRect
,
line
);
}
if
(
textPainter
!=
null
)
{
...
...
packages/flutter/lib/src/widgets/status_transitions.dart
View file @
abce29f1
...
...
@@ -2,8 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter/animation.dart'
;
import
'basic.dart'
;
import
'framework.dart'
;
/// A component that rebuilds when the given animation changes status.
...
...
packages/flutter/lib/src/widgets/transitions.dart
View file @
abce29f1
...
...
@@ -4,8 +4,6 @@
import
'dart:math'
as
math
;
import
'package:flutter/animation.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:vector_math/vector_math_64.dart'
show
Matrix4
;
import
'basic.dart'
;
...
...
packages/flutter/test/engine/canvas_test_disabled.dart
View file @
abce29f1
...
...
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
as
ui
;
import
'dart:ui'
show
Rect
,
Color
,
Paint
;
import
'dart:ui'
as
ui
show
PictureRecorder
;
import
'dart:ui'
show
Rect
,
Color
,
Paint
,
Canvas
;
import
'package:test/test.dart'
;
import
'package:vector_math/vector_math_64.dart'
;
...
...
@@ -11,7 +11,7 @@ import 'package:vector_math/vector_math_64.dart';
void
main
(
)
{
ui
.
PictureRecorder
recorder
=
new
ui
.
PictureRecorder
();
ui
.
Canvas
canvas
=
new
ui
.
Canvas
(
recorder
,
new
Rect
.
fromLTRB
(
0.0
,
0.0
,
100.0
,
100.0
));
Canvas
canvas
=
new
Canvas
(
recorder
,
new
Rect
.
fromLTRB
(
0.0
,
0.0
,
100.0
,
100.0
));
test
(
"matrix access should work"
,
()
{
// Matrix equality doesn't work!
...
...
packages/flutter/test/rendering/image_test.dart
View file @
abce29f1
...
...
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
as
ui
;
import
'dart:ui'
as
ui
show
Image
;
import
'package:flutter/rendering.dart'
;
import
'package:test/test.dart'
;
...
...
packages/flutter/test/widget/page_forward_transitions_test.dart
View file @
abce29f1
...
...
@@ -3,7 +3,6 @@
// found in the LICENSE file.
import
'package:flutter_test/flutter_test.dart'
;
import
'package:flutter/animation.dart'
;
import
'package:flutter/material.dart'
;
import
'package:test/test.dart'
hide
TypeMatcher
;
...
...
packages/flutter/test/widget/positioned_test.dart
View file @
abce29f1
...
...
@@ -3,7 +3,6 @@
// found in the LICENSE file.
import
'package:flutter_test/flutter_test.dart'
;
import
'package:flutter/animation.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/widgets.dart'
;
import
'package:test/test.dart'
;
...
...
packages/flutter/test/widget/shader_mask_test.dart
View file @
abce29f1
...
...
@@ -2,14 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
as
ui
;
import
'dart:ui'
show
Shader
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:flutter/painting.dart'
;
import
'package:flutter/widgets.dart'
;
import
'package:test/test.dart'
;
ui
.
Shader
createShader
(
Rect
bounds
)
{
Shader
createShader
(
Rect
bounds
)
{
return
new
LinearGradient
(
begin:
bounds
.
topLeft
,
end:
bounds
.
bottomLeft
,
...
...
packages/flutter_sprites/lib/flutter_sprites.dart
View file @
abce29f1
...
...
@@ -10,12 +10,10 @@ import 'dart:collection';
import
'dart:convert'
;
import
'dart:math'
as
math
;
import
'dart:typed_data'
;
import
'dart:ui'
as
ui
;
import
'dart:ui'
as
ui
show
Image
;
import
'package:box2d/box2d.dart'
as
box2d
;
import
'package:flutter/animation.dart'
;
import
'package:flutter/gestures.dart'
;
import
'package:flutter/painting.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/scheduler.dart'
;
import
'package:flutter/services.dart'
;
...
...
packages/flutter_sprites/lib/src/effect_line.dart
View file @
abce29f1
...
...
@@ -15,7 +15,7 @@ class EffectLine extends Node {
EffectLine
({
this
.
texture
:
null
,
this
.
transferMode
:
ui
.
TransferMode
.
dstOver
,
this
.
transferMode
:
TransferMode
.
dstOver
,
List
<
Point
>
points
,
this
.
widthMode
:
EffectLineWidthMode
.
linear
,
this
.
minWidth
:
10.0
,
...
...
@@ -38,8 +38,8 @@ class EffectLine extends Node {
_colorSequence
=
colorSequence
;
if
(
_colorSequence
==
null
)
{
_colorSequence
=
new
ColorSequence
.
fromStartAndEndColor
(
new
Color
(
0xffffffff
),
new
Color
(
0xffffffff
)
const
Color
(
0xffffffff
),
const
Color
(
0xffffffff
)
);
}
...
...
@@ -51,7 +51,7 @@ class EffectLine extends Node {
final
Texture
texture
;
final
ui
.
TransferMode
transferMode
;
final
TransferMode
transferMode
;
final
EffectLineWidthMode
widthMode
;
final
double
minWidth
;
...
...
packages/flutter_sprites/lib/src/layer.dart
View file @
abce29f1
...
...
@@ -22,7 +22,7 @@ class Layer extends Node with SpritePaint {
Layer
([
this
.
layerRect
=
null
]);
Paint
_cachedPaint
=
new
Paint
()
..
filterQuality
=
ui
.
FilterQuality
.
low
..
filterQuality
=
FilterQuality
.
low
..
isAntiAlias
=
false
;
void
_prePaint
(
Canvas
canvas
,
Matrix4
matrix
)
{
...
...
packages/flutter_sprites/lib/src/particle_system.dart
View file @
abce29f1
...
...
@@ -144,7 +144,7 @@ class ParticleSystem extends Node {
/// The transfer mode used to draw the particle system. Default is
/// [TransferMode.plus].
ui
.
TransferMode
transferMode
;
TransferMode
transferMode
;
List
<
_Particle
>
_particles
;
...
...
@@ -154,7 +154,7 @@ class ParticleSystem extends Node {
double
opacity
=
1.0
;
static
Paint
_paint
=
new
Paint
()
..
filterQuality
=
ui
.
FilterQuality
.
low
..
filterQuality
=
FilterQuality
.
low
..
isAntiAlias
=
false
;
ParticleSystem
(
this
.
texture
,
...
...
@@ -186,7 +186,7 @@ class ParticleSystem extends Node {
this
.
redVar
:
0
,
this
.
greenVar
:
0
,
this
.
blueVar
:
0
,
this
.
transferMode
:
ui
.
TransferMode
.
plus
,
this
.
transferMode
:
TransferMode
.
plus
,
this
.
numParticlesToEmit
:
0
,
this
.
autoRemoveOnFinish
:
true
})
{
_particles
=
new
List
<
_Particle
>();
...
...
@@ -362,7 +362,7 @@ class ParticleSystem extends Node {
void
paint
(
Canvas
canvas
)
{
if
(
opacity
==
0.0
)
return
;
List
<
ui
.
RSTransform
>
transforms
=
<
ui
.
RSTransform
>[];
List
<
RSTransform
>
transforms
=
<
RSTransform
>[];
List
<
Rect
>
rects
=
<
Rect
>[];
List
<
Color
>
colors
=
<
Color
>[];
...
...
@@ -391,7 +391,7 @@ class ParticleSystem extends Node {
double
ay
=
rect
.
height
/
2
;
double
tx
=
particle
.
pos
[
0
]
+
-
scos
*
ax
+
ssin
*
ay
;
double
ty
=
particle
.
pos
[
1
]
+
-
ssin
*
ax
-
scos
*
ay
;
ui
.
RSTransform
transform
=
new
ui
.
RSTransform
(
scos
,
ssin
,
tx
,
ty
);
RSTransform
transform
=
new
RSTransform
(
scos
,
ssin
,
tx
,
ty
);
transforms
.
add
(
transform
);
// Color
...
...
@@ -417,7 +417,7 @@ class ParticleSystem extends Node {
}
canvas
.
drawAtlas
(
texture
.
image
,
transforms
,
rects
,
colors
,
ui
.
TransferMode
.
modulate
,
null
,
_paint
);
TransferMode
.
modulate
,
null
,
_paint
);
}
}
...
...
packages/flutter_sprites/lib/src/physics_debug.dart
View file @
abce29f1
...
...
@@ -43,7 +43,7 @@ class _PhysicsDebugDraw extends box2d.DebugDraw {
void
drawCircle
(
Vector2
center
,
num
radius
,
box2d
.
Color3i
color
,
[
Vector2
axis
])
{
Paint
paint
=
new
Paint
()
..
color
=
_toColor
(
color
)
..
style
=
ui
.
PaintingStyle
.
stroke
..
style
=
PaintingStyle
.
stroke
..
strokeWidth
=
1.0
;
canvas
.
drawCircle
(
_toPoint
(
center
),
_scale
(
radius
),
paint
);
...
...
packages/flutter_sprites/lib/src/sprite.dart
View file @
abce29f1
...
...
@@ -17,7 +17,7 @@ class Sprite extends NodeWithSize with SpritePaint {
bool
constrainProportions
=
false
;
Paint
_cachedPaint
=
new
Paint
()
..
filterQuality
=
ui
.
FilterQuality
.
low
..
filterQuality
=
FilterQuality
.
low
..
isAntiAlias
=
false
;
/// Creates a new sprite from the provided [texture].
...
...
@@ -107,13 +107,13 @@ abstract class SpritePaint {
///
/// // Add the colors of the sprite with the colors of the background
/// mySprite.transferMode = TransferMode.plusMode;
ui
.
TransferMode
transferMode
;
TransferMode
transferMode
;
void
_updatePaint
(
Paint
paint
)
{
paint
.
color
=
new
Color
.
fromARGB
((
255.0
*
_opacity
).
toInt
(),
255
,
255
,
255
);
if
(
colorOverlay
!=
null
)
{
paint
.
colorFilter
=
new
ColorFilter
.
mode
(
colorOverlay
,
ui
.
TransferMode
.
srcATop
);
paint
.
colorFilter
=
new
ColorFilter
.
mode
(
colorOverlay
,
TransferMode
.
srcATop
);
}
if
(
transferMode
!=
null
)
{
...
...
packages/flutter_sprites/lib/src/textured_line.dart
View file @
abce29f1
...
...
@@ -38,8 +38,8 @@ class TexturedLinePainter {
_cachedPaint
=
new
Paint
();
}
else
{
Matrix4
matrix
=
new
Matrix4
.
identity
();
ui
.
ImageShader
shader
=
new
ui
.
ImageShader
(
texture
.
image
,
ui
.
TileMode
.
repeated
,
ui
.
TileMode
.
repeated
,
matrix
.
storage
);
ImageShader
shader
=
new
ImageShader
(
texture
.
image
,
TileMode
.
repeated
,
TileMode
.
repeated
,
matrix
.
storage
);
_cachedPaint
=
new
Paint
()
..
shader
=
shader
;
...
...
@@ -77,7 +77,7 @@ class TexturedLinePainter {
bool
removeArtifacts
=
true
;
ui
.
TransferMode
transferMode
=
ui
.
TransferMode
.
srcOver
;
TransferMode
transferMode
=
TransferMode
.
srcOver
;
Paint
_cachedPaint
=
new
Paint
();
...
...
@@ -169,7 +169,7 @@ class TexturedLinePainter {
lastMiter
=
currentMiter
;
}
canvas
.
drawVertices
(
ui
.
VertexMode
.
triangles
,
vertices
,
textureCoordinates
,
verticeColors
,
ui
.
TransferMode
.
modulate
,
indicies
,
_cachedPaint
);
canvas
.
drawVertices
(
VertexMode
.
triangles
,
vertices
,
textureCoordinates
,
verticeColors
,
TransferMode
.
modulate
,
indicies
,
_cachedPaint
);
}
double
_xPosForStop
(
double
stop
)
{
...
...
packages/flutter_sprites/lib/src/virtual_joystick.dart
View file @
abce29f1
...
...
@@ -14,7 +14,7 @@ class VirtualJoystick extends NodeWithSize {
_paintControl
=
new
Paint
()
..
color
=
new
Color
(
0xffffffff
)
..
strokeWidth
=
1.0
..
style
=
ui
.
PaintingStyle
.
stroke
;
..
style
=
PaintingStyle
.
stroke
;
}
Point
_value
=
Point
.
origin
;
...
...
packages/flutter_test/lib/src/widget_tester.dart
View file @
abce29f1
...
...
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
as
ui
;
import
'dart:ui'
as
ui
show
window
;
import
'package:quiver/testing/async.dart'
;
import
'package:quiver/time.dart'
;
...
...
@@ -35,7 +35,7 @@ class WidgetTester extends Instrumentation {
}
void
setLocale
(
String
languageCode
,
String
countryCode
)
{
ui
.
Locale
locale
=
new
ui
.
Locale
(
languageCode
,
countryCode
);
Locale
locale
=
new
Locale
(
languageCode
,
countryCode
);
binding
.
dispatchLocaleChanged
(
locale
);
async
.
flushMicrotasks
();
}
...
...
packages/playfair/lib/playfair.dart
View file @
abce29f1
...
...
@@ -5,11 +5,4 @@
/// A simple charting library for Flutter.
library
playfair
;
import
'dart:ui'
as
ui
;
import
'dart:math'
as
math
;
import
'package:flutter/material.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/painting.dart'
;
part
'src/base.dart'
;
export
'src/base.dart'
;
packages/playfair/lib/src/base.dart
View file @
abce29f1
...
...
@@ -2,7 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
part of
playfair
;
import
'dart:math'
as
math
;
import
'package:flutter/material.dart'
;
import
'package:flutter/rendering.dart'
;
class
ChartData
{
const
ChartData
({
...
...
@@ -54,17 +57,17 @@ class _ChartWrapper extends LeafRenderObjectWidget {
final
TextTheme
textTheme
;
final
ChartData
data
;
RenderChart
createRenderObject
()
=>
new
RenderChart
(
textTheme:
textTheme
,
data:
data
);
_RenderChart
createRenderObject
()
=>
new
_
RenderChart
(
textTheme:
textTheme
,
data:
data
);
void
updateRenderObject
(
RenderChart
renderObject
,
_ChartWrapper
oldWidget
)
{
renderObject
.
textTheme
=
textTheme
;
renderObject
.
data
=
data
;
void
updateRenderObject
(
_RenderChart
renderObject
,
_ChartWrapper
oldWidget
)
{
renderObject
..
textTheme
=
textTheme
..
data
=
data
;
}
}
class
RenderChart
extends
RenderConstrainedBox
{
RenderChart
({
class
_RenderChart
extends
RenderConstrainedBox
{
_RenderChart
({
TextTheme
textTheme
,
ChartData
data
})
:
_painter
=
new
ChartPainter
(
textTheme:
textTheme
,
data:
data
),
...
...
@@ -98,7 +101,7 @@ class RenderChart extends RenderConstrainedBox {
}
}
class
Gridline
{
class
_
Gridline
{
double
value
;
TextPainter
labelPainter
;
Point
labelPosition
;
...
...
@@ -106,7 +109,7 @@ class Gridline {
Point
end
;
}
class
Indicator
{
class
_
Indicator
{
Point
start
;
Point
end
;
TextPainter
labelPainter
;
...
...
@@ -148,18 +151,18 @@ class ChartPainter {
Rect
_rect
;
// These are updated by _layout()
List
<
Gridline
>
_horizontalGridlines
;
List
<
_
Gridline
>
_horizontalGridlines
;
List
<
Point
>
_markers
;
Indicator
_indicator
;
_
Indicator
_indicator
;
void
_layout
()
{
// Create the scale labels
double
yScaleWidth
=
0.0
;
_horizontalGridlines
=
new
List
<
Gridline
>();
_horizontalGridlines
=
new
List
<
_
Gridline
>();
assert
(
data
.
numHorizontalGridlines
>
1
);
double
stepSize
=
(
data
.
endY
-
data
.
startY
)
/
(
data
.
numHorizontalGridlines
-
1
);
for
(
int
i
=
0
;
i
<
data
.
numHorizontalGridlines
;
i
++)
{
Gridline
gridline
=
new
Gridline
()
_Gridline
gridline
=
new
_
Gridline
()
..
value
=
_roundToPlaces
(
data
.
startY
+
stepSize
*
i
,
data
.
roundToPlaces
);
if
(
gridline
.
value
<
data
.
startY
||
gridline
.
value
>
data
.
endY
)
continue
;
// TODO(jackson): Align things so this doesn't ever happen
...
...
@@ -185,7 +188,7 @@ class ChartPainter {
);
// Left align and vertically center the labels on the right side
for
(
Gridline
gridline
in
_horizontalGridlines
)
{
for
(
_
Gridline
gridline
in
_horizontalGridlines
)
{
gridline
.
start
=
_convertPointToRectSpace
(
new
Point
(
data
.
startX
,
gridline
.
value
),
markerRect
);
gridline
.
end
=
_convertPointToRectSpace
(
new
Point
(
data
.
endX
,
gridline
.
value
),
markerRect
);
gridline
.
labelPosition
=
new
Point
(
...
...
@@ -206,13 +209,13 @@ class ChartPainter {
if
(
data
.
indicatorLine
!=
null
&&
data
.
indicatorLine
>=
data
.
startY
&&
data
.
indicatorLine
<=
data
.
endY
)
{
_indicator
=
new
Indicator
()
_indicator
=
new
_
Indicator
()
..
start
=
_convertPointToRectSpace
(
new
Point
(
data
.
startX
,
data
.
indicatorLine
),
markerRect
)
..
end
=
_convertPointToRectSpace
(
new
Point
(
data
.
endX
,
data
.
indicatorLine
),
markerRect
);
if
(
data
.
indicatorText
!=
null
)
{
TextSpan
text
=
new
StyledTextSpan
(
_textTheme
.
body1
,
[
new
PlainTextSpan
(
"
${data.indicatorText}
"
)]
<
TextSpan
>
[
new
PlainTextSpan
(
"
${data.indicatorText}
"
)]
);
_indicator
.
labelPainter
=
new
TextPainter
(
text
)
..
maxWidth
=
markerRect
.
width
...
...
@@ -236,17 +239,17 @@ class ChartPainter {
return
new
Point
(
x
,
y
);
}
void
_paintGrid
(
ui
.
Canvas
canvas
)
{
void
_paintGrid
(
Canvas
canvas
)
{
Paint
paint
=
new
Paint
()
..
strokeWidth
=
kGridStrokeWidth
..
color
=
kGridColor
;
for
(
Gridline
gridline
in
_horizontalGridlines
)
{
for
(
_
Gridline
gridline
in
_horizontalGridlines
)
{
gridline
.
labelPainter
.
paint
(
canvas
,
gridline
.
labelPosition
.
toOffset
());
canvas
.
drawLine
(
gridline
.
start
,
gridline
.
end
,
paint
);
}
}
void
_paintChart
(
ui
.
Canvas
canvas
)
{
void
_paintChart
(
Canvas
canvas
)
{
Paint
paint
=
new
Paint
()
..
strokeWidth
=
kMarkerStrokeWidth
..
color
=
kMarkerColor
;
...
...
@@ -256,11 +259,11 @@ class ChartPainter {
canvas
.
drawCircle
(
marker
,
kMarkerRadius
,
paint
);
path
.
lineTo
(
marker
.
x
,
marker
.
y
);
}
paint
.
style
=
ui
.
PaintingStyle
.
stroke
;
paint
.
style
=
PaintingStyle
.
stroke
;
canvas
.
drawPath
(
path
,
paint
);
}
void
_paintIndicator
(
ui
.
Canvas
canvas
)
{
void
_paintIndicator
(
Canvas
canvas
)
{
if
(
_indicator
==
null
)
return
;
Paint
paint
=
new
Paint
()
...
...
@@ -271,7 +274,7 @@ class ChartPainter {
_indicator
.
labelPainter
.
paint
(
canvas
,
_indicator
.
labelPosition
.
toOffset
());
}
void
paint
(
ui
.
Canvas
canvas
,
Rect
rect
)
{
void
paint
(
Canvas
canvas
,
Rect
rect
)
{
if
(
rect
!=
_rect
)
_needsLayout
=
true
;
_rect
=
rect
;
...
...
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