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
e71bd77e
Commit
e71bd77e
authored
Mar 12, 2016
by
Adam Barth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[rename fixit] EdgeDims -> EdgeInsets
Fixes #1382
parent
7ba19605
Changes
95
Hide whitespace changes
Inline
Side-by-side
Showing
95 changed files
with
317 additions
and
299 deletions
+317
-299
card_collection.dart
dev/manual_tests/card_collection.dart
+4
-4
drag_and_drop.dart
dev/manual_tests/drag_and_drop.dart
+1
-1
mozart.dart
dev/manual_tests/mozart.dart
+1
-1
overlay_geometry.dart
dev/manual_tests/overlay_geometry.dart
+2
-2
pageable_list.dart
dev/manual_tests/pageable_list.dart
+1
-1
flex_layout.dart
examples/layers/rendering/flex_layout.dart
+3
-3
media_service.dart
examples/layers/services/media_service.dart
+2
-2
gestures.dart
examples/layers/widgets/gestures.dart
+1
-1
media_query.dart
examples/layers/widgets/media_query.dart
+2
-2
sectors.dart
examples/layers/widgets/sectors.dart
+7
-7
spinning_mixed.dart
examples/layers/widgets/spinning_mixed.dart
+3
-3
styled_text.dart
examples/layers/widgets/styled_text.dart
+2
-2
buttons_demo.dart
examples/material_gallery/lib/demo/buttons_demo.dart
+5
-5
cards_demo.dart
examples/material_gallery/lib/demo/cards_demo.dart
+4
-4
colors_demo.dart
examples/material_gallery/lib/demo/colors_demo.dart
+1
-1
dialog_demo.dart
examples/material_gallery/lib/demo/dialog_demo.dart
+3
-3
fitness_demo.dart
examples/material_gallery/lib/demo/fitness_demo.dart
+3
-3
flexible_space_demo.dart
examples/material_gallery/lib/demo/flexible_space_demo.dart
+3
-3
full_screen_dialog_demo.dart
...es/material_gallery/lib/demo/full_screen_dialog_demo.dart
+7
-7
grid_list_demo.dart
examples/material_gallery/lib/demo/grid_list_demo.dart
+3
-3
icons_demo.dart
examples/material_gallery/lib/demo/icons_demo.dart
+1
-1
leave_behind_demo.dart
examples/material_gallery/lib/demo/leave_behind_demo.dart
+1
-1
list_demo.dart
examples/material_gallery/lib/demo/list_demo.dart
+1
-1
menu_demo.dart
examples/material_gallery/lib/demo/menu_demo.dart
+1
-1
modal_bottom_sheet_demo.dart
...es/material_gallery/lib/demo/modal_bottom_sheet_demo.dart
+1
-1
page_selector_demo.dart
examples/material_gallery/lib/demo/page_selector_demo.dart
+2
-2
persistent_bottom_sheet_demo.dart
...terial_gallery/lib/demo/persistent_bottom_sheet_demo.dart
+1
-1
progress_indicator_demo.dart
...es/material_gallery/lib/demo/progress_indicator_demo.dart
+2
-2
scrolling_techniques_demo.dart
.../material_gallery/lib/demo/scrolling_techniques_demo.dart
+4
-4
slider_demo.dart
examples/material_gallery/lib/demo/slider_demo.dart
+2
-2
snack_bar_demo.dart
examples/material_gallery/lib/demo/snack_bar_demo.dart
+2
-2
tabs_demo.dart
examples/material_gallery/lib/demo/tabs_demo.dart
+1
-1
tabs_fab_demo.dart
examples/material_gallery/lib/demo/tabs_fab_demo.dart
+2
-2
text_field_demo.dart
examples/material_gallery/lib/demo/text_field_demo.dart
+1
-1
tooltip_demo.dart
examples/material_gallery/lib/demo/tooltip_demo.dart
+1
-1
two_level_list_demo.dart
examples/material_gallery/lib/demo/two_level_list_demo.dart
+1
-1
typography_demo.dart
examples/material_gallery/lib/demo/typography_demo.dart
+1
-1
weather_demo.dart
examples/material_gallery/lib/demo/weather_demo.dart
+1
-1
home.dart
examples/material_gallery/lib/gallery/home.dart
+2
-2
section.dart
examples/material_gallery/lib/gallery/section.dart
+4
-4
stock_arrow.dart
examples/stocks/lib/stock_arrow.dart
+1
-1
stock_row.dart
examples/stocks/lib/stock_row.dart
+2
-2
stock_settings.dart
examples/stocks/lib/stock_settings.dart
+1
-1
stock_symbol_viewer.dart
examples/stocks/lib/stock_symbol_viewer.dart
+3
-3
painting.dart
packages/flutter/lib/painting.dart
+1
-1
button.dart
packages/flutter/lib/src/material/button.dart
+3
-3
card.dart
packages/flutter/lib/src/material/card.dart
+1
-1
chip.dart
packages/flutter/lib/src/material/chip.dart
+3
-3
constants.dart
packages/flutter/lib/src/material/constants.dart
+1
-1
date_picker.dart
packages/flutter/lib/src/material/date_picker.dart
+1
-1
date_picker_dialog.dart
packages/flutter/lib/src/material/date_picker_dialog.dart
+1
-1
dialog.dart
packages/flutter/lib/src/material/dialog.dart
+7
-7
divider.dart
packages/flutter/lib/src/material/divider.dart
+1
-1
drawer_header.dart
packages/flutter/lib/src/material/drawer_header.dart
+4
-4
drawer_item.dart
packages/flutter/lib/src/material/drawer_item.dart
+2
-2
dropdown.dart
packages/flutter/lib/src/material/dropdown.dart
+3
-3
flexible_space_bar.dart
packages/flutter/lib/src/material/flexible_space_bar.dart
+2
-2
grid_tile_bar.dart
packages/flutter/lib/src/material/grid_tile_bar.dart
+6
-6
icon_button.dart
packages/flutter/lib/src/material/icon_button.dart
+1
-1
input.dart
packages/flutter/lib/src/material/input.dart
+6
-6
list.dart
packages/flutter/lib/src/material/list.dart
+3
-3
list_item.dart
packages/flutter/lib/src/material/list_item.dart
+3
-3
popup_menu.dart
packages/flutter/lib/src/material/popup_menu.dart
+2
-2
scaffold.dart
packages/flutter/lib/src/material/scaffold.dart
+6
-6
snack_bar.dart
packages/flutter/lib/src/material/snack_bar.dart
+3
-3
tabs.dart
packages/flutter/lib/src/material/tabs.dart
+3
-3
time_picker.dart
packages/flutter/lib/src/material/time_picker.dart
+3
-3
time_picker_dialog.dart
packages/flutter/lib/src/material/time_picker_dialog.dart
+1
-1
tool_bar.dart
packages/flutter/lib/src/material/tool_bar.dart
+7
-7
tooltip.dart
packages/flutter/lib/src/material/tooltip.dart
+7
-7
box_painter.dart
packages/flutter/lib/src/painting/box_painter.dart
+6
-6
decoration.dart
packages/flutter/lib/src/painting/decoration.dart
+3
-3
edge_insets.dart
packages/flutter/lib/src/painting/edge_insets.dart
+33
-33
box.dart
packages/flutter/lib/src/rendering/box.dart
+1
-1
grid.dart
packages/flutter/lib/src/rendering/grid.dart
+7
-7
list.dart
packages/flutter/lib/src/rendering/list.dart
+4
-4
shifted_box.dart
packages/flutter/lib/src/rendering/shifted_box.dart
+4
-4
app.dart
packages/flutter/lib/src/widgets/app.dart
+2
-2
basic.dart
packages/flutter/lib/src/widgets/basic.dart
+10
-10
focus.dart
packages/flutter/lib/src/widgets/focus.dart
+2
-2
implicit_animations.dart
packages/flutter/lib/src/widgets/implicit_animations.dart
+10
-10
media_query.dart
packages/flutter/lib/src/widgets/media_query.dart
+1
-1
scrollable.dart
packages/flutter/lib/src/widgets/scrollable.dart
+1
-1
scrollable_list.dart
packages/flutter/lib/src/widgets/scrollable_list.dart
+6
-6
edge_insets_test.dart
packages/flutter/test/painting/edge_insets_test.dart
+18
-0
box_test.dart
packages/flutter/test/rendering/box_test.dart
+3
-3
asset_vendor_test.dart
packages/flutter/test/widget/asset_vendor_test.dart
+1
-1
bottom_sheet_test.dart
packages/flutter/test/widget/bottom_sheet_test.dart
+1
-1
box_decoration_test.dart
packages/flutter/test/widget/box_decoration_test.dart
+1
-1
dismissable_test.dart
packages/flutter/test/widget/dismissable_test.dart
+1
-1
scrollable_list_hit_testing_test.dart
...flutter/test/widget/scrollable_list_hit_testing_test.dart
+2
-2
scrollable_list_vertical_test.dart
...es/flutter/test/widget/scrollable_list_vertical_test.dart
+1
-1
tooltip_test.dart
packages/flutter/test/widget/tooltip_test.dart
+12
-12
markdown.dart
packages/flutter_markdown/lib/src/markdown.dart
+1
-1
markdown_raw.dart
packages/flutter_markdown/lib/src/markdown_raw.dart
+8
-8
No files found.
dev/manual_tests/card_collection.dart
View file @
e71bd77e
...
...
@@ -279,7 +279,7 @@ class CardCollectionState extends State<CardCollection> {
],
flexibleSpace:
(
_
)
{
return
new
Container
(
padding:
const
Edge
Dim
s
.
only
(
left:
72.0
),
padding:
const
Edge
Inset
s
.
only
(
left:
72.0
),
height:
128.0
,
child:
new
Align
(
alignment:
const
FractionalOffset
(
0.0
,
0.75
),
...
...
@@ -304,7 +304,7 @@ class CardCollectionState extends State<CardCollection> {
color:
_primaryColor
[
cardModel
.
color
],
child:
new
Container
(
height:
cardModel
.
height
,
padding:
const
Edge
Dim
s
.
all
(
kCardMargins
),
padding:
const
Edge
Inset
s
.
all
(
kCardMargins
),
child:
_editable
?
new
Center
(
child:
new
Input
(
...
...
@@ -367,7 +367,7 @@ class CardCollectionState extends State<CardCollection> {
bottom:
0.0
,
left:
0.0
,
child:
new
Container
(
margin:
const
Edge
Dim
s
.
all
(
4.0
),
margin:
const
Edge
Inset
s
.
all
(
4.0
),
child:
new
Viewport
(
child:
new
Container
(
height:
cardModel
.
height
,
...
...
@@ -428,7 +428,7 @@ class CardCollectionState extends State<CardCollection> {
}
Widget
body
=
new
Container
(
padding:
const
Edge
Dim
s
.
symmetric
(
vertical:
12.0
,
horizontal:
8.0
),
padding:
const
Edge
Inset
s
.
symmetric
(
vertical:
12.0
,
horizontal:
8.0
),
decoration:
new
BoxDecoration
(
backgroundColor:
_primaryColor
[
50
]),
child:
cardCollection
);
...
...
dev/manual_tests/drag_and_drop.dart
View file @
e71bd77e
...
...
@@ -25,7 +25,7 @@ class ExampleDragTargetState extends State<ExampleDragTarget> {
builder:
(
BuildContext
context
,
List
<
Color
>
data
,
List
<
Color
>
rejectedData
)
{
return
new
Container
(
height:
100.0
,
margin:
new
Edge
Dim
s
.
all
(
10.0
),
margin:
new
Edge
Inset
s
.
all
(
10.0
),
decoration:
new
BoxDecoration
(
border:
new
Border
.
all
(
width:
3.0
,
...
...
dev/manual_tests/mozart.dart
View file @
e71bd77e
...
...
@@ -143,7 +143,7 @@ class _WindowState extends State<Window> {
color:
Colors
.
blue
[
200
]
),
new
Container
(
padding:
const
Edge
Dim
s
.
all
(
_kWindowPadding
),
padding:
const
Edge
Inset
s
.
all
(
_kWindowPadding
),
child:
new
Material
(
elevation:
8
,
child:
new
ChildView
(
child:
config
.
child
)
...
...
dev/manual_tests/overlay_geometry.dart
View file @
e71bd77e
...
...
@@ -144,7 +144,7 @@ class OverlayGeometryAppState extends State<OverlayGeometryApp> {
color:
cardModel
.
color
,
child:
new
Container
(
height:
cardModel
.
height
,
padding:
const
Edge
Dim
s
.
all
(
8.0
),
padding:
const
Edge
Inset
s
.
all
(
8.0
),
child:
new
Center
(
child:
new
Text
(
cardModel
.
label
,
style:
cardLabelStyle
))
)
)
...
...
@@ -156,7 +156,7 @@ class OverlayGeometryAppState extends State<OverlayGeometryApp> {
new
Scaffold
(
toolBar:
new
ToolBar
(
center:
new
Text
(
'Tap a Card'
)),
body:
new
Container
(
padding:
const
Edge
Dim
s
.
symmetric
(
vertical:
12.0
,
horizontal:
8.0
),
padding:
const
Edge
Inset
s
.
symmetric
(
vertical:
12.0
,
horizontal:
8.0
),
child:
new
ScrollableMixedWidgetList
(
builder:
builder
,
token:
cardModels
.
length
,
...
...
dev/manual_tests/pageable_list.dart
View file @
e71bd77e
...
...
@@ -46,7 +46,7 @@ class PageableListAppState extends State<PageableListApp> {
child:
new
Container
(
width:
cardModel
.
size
.
width
,
height:
cardModel
.
size
.
height
,
padding:
const
Edge
Dim
s
.
all
(
8.0
),
padding:
const
Edge
Inset
s
.
all
(
8.0
),
child:
new
Center
(
child:
new
Text
(
cardModel
.
label
,
style:
cardLabelStyle
))
)
);
...
...
examples/layers/rendering/flex_layout.dart
View file @
e71bd77e
...
...
@@ -15,7 +15,7 @@ void main() {
void
addAlignmentRow
(
FlexAlignItems
alignItems
)
{
TextStyle
style
=
const
TextStyle
(
color:
const
Color
(
0xFF000000
));
RenderParagraph
paragraph
=
new
RenderParagraph
(
new
TextSpan
(
style:
style
,
text:
'
$alignItems
'
));
table
.
add
(
new
RenderPadding
(
child:
paragraph
,
padding:
new
Edge
Dim
s
.
only
(
top:
20.0
)));
table
.
add
(
new
RenderPadding
(
child:
paragraph
,
padding:
new
Edge
Inset
s
.
only
(
top:
20.0
)));
RenderFlex
row
=
new
RenderFlex
(
alignItems:
alignItems
,
textBaseline:
TextBaseline
.
alphabetic
);
style
=
new
TextStyle
(
fontSize:
15.0
,
color:
const
Color
(
0xFF000000
));
row
.
add
(
new
RenderDecoratedBox
(
...
...
@@ -49,7 +49,7 @@ void main() {
void
addJustificationRow
(
FlexJustifyContent
justify
)
{
const
TextStyle
style
=
const
TextStyle
(
color:
const
Color
(
0xFF000000
));
RenderParagraph
paragraph
=
new
RenderParagraph
(
new
TextSpan
(
style:
style
,
text:
'
$justify
'
));
table
.
add
(
new
RenderPadding
(
child:
paragraph
,
padding:
new
Edge
Dim
s
.
only
(
top:
20.0
)));
table
.
add
(
new
RenderPadding
(
child:
paragraph
,
padding:
new
Edge
Inset
s
.
only
(
top:
20.0
)));
RenderFlex
row
=
new
RenderFlex
(
direction:
FlexDirection
.
horizontal
);
row
.
add
(
new
RenderSolidColorBox
(
const
Color
(
0xFFFFCCCC
),
desiredSize:
new
Size
(
80.0
,
60.0
)));
row
.
add
(
new
RenderSolidColorBox
(
const
Color
(
0xFFCCFFCC
),
desiredSize:
new
Size
(
64.0
,
60.0
)));
...
...
@@ -68,7 +68,7 @@ void main() {
RenderDecoratedBox
root
=
new
RenderDecoratedBox
(
decoration:
new
BoxDecoration
(
backgroundColor:
const
Color
(
0xFFFFFFFF
)),
child:
new
RenderPadding
(
child:
table
,
padding:
new
Edge
Dim
s
.
symmetric
(
vertical:
50.0
))
child:
new
RenderPadding
(
child:
table
,
padding:
new
Edge
Inset
s
.
symmetric
(
vertical:
50.0
))
);
new
RenderingFlutterBinding
(
root:
root
);
...
...
examples/layers/services/media_service.dart
View file @
e71bd77e
...
...
@@ -105,8 +105,8 @@ Widget statusBox(Widget child) {
backgroundColor:
darkGray
),
height:
90.0
,
padding:
const
Edge
Dim
s
.
all
(
8.0
),
margin:
const
Edge
Dim
s
.
symmetric
(
horizontal:
50.0
),
padding:
const
Edge
Inset
s
.
all
(
8.0
),
margin:
const
Edge
Inset
s
.
symmetric
(
horizontal:
50.0
),
child:
new
Center
(
child:
child
)
)
);
...
...
examples/layers/widgets/gestures.dart
View file @
e71bd77e
...
...
@@ -161,7 +161,7 @@ class _GestureDemoState extends State<GestureDemo> {
left:
0.0
,
child:
new
Card
(
child:
new
Container
(
padding:
new
Edge
Dim
s
.
all
(
4.0
),
padding:
new
Edge
Inset
s
.
all
(
4.0
),
child:
new
Column
(
children:
<
Widget
>[
new
Row
(
...
...
examples/layers/widgets/media_query.dart
View file @
e71bd77e
...
...
@@ -15,7 +15,7 @@ class AdaptedListItem extends StatelessComponent {
new
Container
(
width:
32.0
,
height:
32.0
,
margin:
const
Edge
Dim
s
.
all
(
8.0
),
margin:
const
Edge
Inset
s
.
all
(
8.0
),
decoration:
new
BoxDecoration
(
backgroundColor:
Colors
.
lightBlueAccent
[
100
]
)
...
...
@@ -43,7 +43,7 @@ class AdaptedGridItem extends StatelessComponent {
)
),
new
Container
(
margin:
const
Edge
Dim
s
.
only
(
left:
8.0
),
margin:
const
Edge
Inset
s
.
only
(
left:
8.0
),
child:
new
Row
(
children:
<
Widget
>[
new
Flexible
(
...
...
examples/layers/widgets/sectors.dart
View file @
e71bd77e
...
...
@@ -92,7 +92,7 @@ class SectorAppState extends State<SectorApp> {
return
new
Column
(
children:
<
Widget
>[
new
Container
(
padding:
new
Edge
Dim
s
.
symmetric
(
horizontal:
8.0
,
vertical:
25.0
),
padding:
new
Edge
Inset
s
.
symmetric
(
horizontal:
8.0
,
vertical:
25.0
),
child:
new
Row
(
children:
<
Widget
>[
new
RaisedButton
(
...
...
@@ -101,8 +101,8 @@ class SectorAppState extends State<SectorApp> {
child:
new
Row
(
children:
<
Widget
>[
new
Container
(
padding:
new
Edge
Dim
s
.
all
(
4.0
),
margin:
new
Edge
Dim
s
.
only
(
right:
10.0
),
padding:
new
Edge
Inset
s
.
all
(
4.0
),
margin:
new
Edge
Inset
s
.
only
(
right:
10.0
),
child:
new
WidgetToRenderBoxAdapter
(
renderBox:
sectorAddIcon
)
),
new
Text
(
'ADD SECTOR'
),
...
...
@@ -116,8 +116,8 @@ class SectorAppState extends State<SectorApp> {
child:
new
Row
(
children:
<
Widget
>[
new
Container
(
padding:
new
Edge
Dim
s
.
all
(
4.0
),
margin:
new
Edge
Dim
s
.
only
(
right:
10.0
),
padding:
new
Edge
Inset
s
.
all
(
4.0
),
margin:
new
Edge
Inset
s
.
only
(
right:
10.0
),
child:
new
WidgetToRenderBoxAdapter
(
renderBox:
sectorRemoveIcon
)
),
new
Text
(
'REMOVE SECTOR'
),
...
...
@@ -131,11 +131,11 @@ class SectorAppState extends State<SectorApp> {
),
new
Flexible
(
child:
new
Container
(
margin:
new
Edge
Dim
s
.
all
(
8.0
),
margin:
new
Edge
Inset
s
.
all
(
8.0
),
decoration:
new
BoxDecoration
(
border:
new
Border
.
all
(
color:
new
Color
(
0xFF000000
))
),
padding:
new
Edge
Dim
s
.
all
(
8.0
),
padding:
new
Edge
Inset
s
.
all
(
8.0
),
child:
new
WidgetToRenderBoxAdapter
(
renderBox:
sectors
,
onBuild:
doUpdates
...
...
examples/layers/widgets/spinning_mixed.dart
View file @
e71bd77e
...
...
@@ -40,8 +40,8 @@ void attachWidgetTreeToRenderTree(RenderProxyBox container) {
new
Rectangle
(
const
Color
(
0xFF00FFFF
)),
new
Material
(
child:
new
Container
(
padding:
new
Edge
Dim
s
.
all
(
10.0
),
margin:
new
Edge
Dim
s
.
all
(
10.0
),
padding:
new
Edge
Inset
s
.
all
(
10.0
),
margin:
new
Edge
Inset
s
.
all
(
10.0
),
child:
new
Row
(
children:
<
Widget
>[
new
RaisedButton
(
...
...
@@ -95,7 +95,7 @@ void main() {
addFlexChildSolidColor
(
flexRoot
,
const
Color
(
0xFF0000FF
),
flex:
1
);
transformBox
=
new
RenderTransform
(
child:
flexRoot
,
transform:
new
Matrix4
.
identity
());
RenderPadding
root
=
new
RenderPadding
(
padding:
new
Edge
Dim
s
.
all
(
80.0
),
child:
transformBox
);
RenderPadding
root
=
new
RenderPadding
(
padding:
new
Edge
Inset
s
.
all
(
80.0
),
child:
transformBox
);
WidgetFlutterBinding
.
instance
.
renderView
.
child
=
root
;
WidgetFlutterBinding
.
instance
.
addPersistentFrameCallback
(
rotate
);
...
...
examples/layers/widgets/styled_text.dart
View file @
e71bd77e
...
...
@@ -61,7 +61,7 @@ class SpeakerSeparator extends StatelessComponent {
Widget
build
(
BuildContext
context
)
{
return
new
Container
(
constraints:
const
BoxConstraints
.
expand
(
height:
0.0
),
margin:
const
Edge
Dim
s
.
symmetric
(
vertical:
10.0
,
horizontal:
64.0
),
margin:
const
Edge
Inset
s
.
symmetric
(
vertical:
10.0
,
horizontal:
64.0
),
decoration:
const
BoxDecoration
(
border:
const
Border
(
bottom:
const
BorderSide
(
color:
const
Color
.
fromARGB
(
24
,
0
,
0
,
0
))
...
...
@@ -104,7 +104,7 @@ class _StyledTextDemoState extends State<StyledTextDemo> {
return
new
GestureDetector
(
onTap:
_handleTap
,
child:
new
Container
(
padding:
new
Edge
Dim
s
.
symmetric
(
horizontal:
8.0
),
padding:
new
Edge
Inset
s
.
symmetric
(
horizontal:
8.0
),
child:
new
Column
(
children:
children
,
justifyContent:
FlexJustifyContent
.
center
,
...
...
examples/material_gallery/lib/demo/buttons_demo.dart
View file @
e71bd77e
...
...
@@ -91,7 +91,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
Widget
buildRaisedButton
(
BuildContext
context
)
{
return
new
Container
(
margin:
const
Edge
Dim
s
.
symmetric
(
vertical:
16.0
),
margin:
const
Edge
Inset
s
.
symmetric
(
vertical:
16.0
),
child:
new
Column
(
children:
<
Widget
>[
new
RaisedButton
(
...
...
@@ -108,7 +108,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
]
.
map
((
Widget
child
)
{
return
new
Container
(
margin:
const
Edge
Dim
s
.
symmetric
(
vertical:
8.0
),
margin:
const
Edge
Inset
s
.
symmetric
(
vertical:
8.0
),
child:
child
);
})
...
...
@@ -119,7 +119,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
Widget
buildFlatButton
(
BuildContext
context
)
{
return
new
Container
(
margin:
const
Edge
Dim
s
.
symmetric
(
vertical:
16.0
),
margin:
const
Edge
Inset
s
.
symmetric
(
vertical:
16.0
),
child:
new
ButtonTheme
(
color:
ButtonColor
.
accent
,
child:
new
Column
(
...
...
@@ -138,7 +138,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
]
.
map
((
Widget
child
)
{
return
new
Container
(
margin:
const
Edge
Dim
s
.
symmetric
(
vertical:
8.0
),
margin:
const
Edge
Inset
s
.
symmetric
(
vertical:
8.0
),
child:
child
);
})
...
...
@@ -183,7 +183,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
children:
<
Widget
>[
demo
.
builder
(
context
),
new
Padding
(
padding:
const
Edge
Dim
s
.
symmetric
(
horizontal:
32.0
),
padding:
const
Edge
Inset
s
.
symmetric
(
horizontal:
32.0
),
child:
new
Text
(
demo
.
text
,
style:
textStyle
)
)
]
...
...
examples/material_gallery/lib/demo/cards_demo.dart
View file @
e71bd77e
...
...
@@ -80,7 +80,7 @@ class TravelDestinationItem extends StatelessComponent {
// description and share/expore buttons
new
Flexible
(
child:
new
Padding
(
padding:
const
Edge
Dim
s
.
all
(
16.0
),
padding:
const
Edge
Inset
s
.
all
(
16.0
),
child:
new
Column
(
justifyContent:
FlexJustifyContent
.
start
,
alignItems:
FlexAlignItems
.
start
,
...
...
@@ -96,7 +96,7 @@ class TravelDestinationItem extends StatelessComponent {
alignItems:
FlexAlignItems
.
end
,
children:
<
Widget
>[
new
Padding
(
padding:
const
Edge
Dim
s
.
only
(
right:
16.0
),
padding:
const
Edge
Inset
s
.
only
(
right:
16.0
),
child:
new
Text
(
'SHARE'
,
style:
buttonStyle
)
),
new
Text
(
'EXPLORE'
,
style:
buttonStyle
)
...
...
@@ -121,10 +121,10 @@ class CardsDemo extends StatelessComponent {
center:
new
Text
(
"Travel Stream"
)
),
body:
new
Block
(
padding:
const
Edge
Dim
s
.
only
(
top:
8.0
,
left:
8.0
,
right:
8.0
),
padding:
const
Edge
Inset
s
.
only
(
top:
8.0
,
left:
8.0
,
right:
8.0
),
children:
destinations
.
map
((
TravelDestination
destination
)
{
return
new
Container
(
margin:
const
Edge
Dim
s
.
only
(
bottom:
8.0
),
margin:
const
Edge
Inset
s
.
only
(
bottom:
8.0
),
child:
new
TravelDestinationItem
(
destination:
destination
)
);
})
...
...
examples/material_gallery/lib/demo/colors_demo.dart
View file @
e71bd77e
...
...
@@ -57,7 +57,7 @@ class ColorItem extends StatelessComponent {
Widget
build
(
BuildContext
context
)
{
return
new
Container
(
height:
kColorItemHeight
,
padding:
const
Edge
Dim
s
.
symmetric
(
horizontal:
16.0
),
padding:
const
Edge
Inset
s
.
symmetric
(
horizontal:
16.0
),
decoration:
new
BoxDecoration
(
backgroundColor:
color
),
child:
new
Row
(
justifyContent:
FlexJustifyContent
.
spaceBetween
,
...
...
examples/material_gallery/lib/demo/dialog_demo.dart
View file @
e71bd77e
...
...
@@ -32,7 +32,7 @@ class DialogDemoItem extends StatelessComponent {
return
new
InkWell
(
onTap:
onPressed
,
child:
new
Padding
(
padding:
const
Edge
Dim
s
.
symmetric
(
vertical:
8.0
),
padding:
const
Edge
Inset
s
.
symmetric
(
vertical:
8.0
),
child:
new
Row
(
justifyContent:
FlexJustifyContent
.
start
,
alignItems:
FlexAlignItems
.
center
,
...
...
@@ -43,7 +43,7 @@ class DialogDemoItem extends StatelessComponent {
color:
color
),
new
Padding
(
padding:
const
Edge
Dim
s
.
only
(
left:
16.0
),
padding:
const
Edge
Inset
s
.
only
(
left:
16.0
),
child:
new
Text
(
text
)
)
]
...
...
@@ -84,7 +84,7 @@ class DialogDemoState extends State<DialogDemo> {
center:
new
Text
(
'Dialogs'
)
),
body:
new
Block
(
padding:
const
Edge
Dim
s
.
symmetric
(
vertical:
24.0
,
horizontal:
72.0
),
padding:
const
Edge
Inset
s
.
symmetric
(
vertical:
24.0
,
horizontal:
72.0
),
children:
<
Widget
>[
new
RaisedButton
(
child:
new
Text
(
'ALERT'
),
...
...
examples/material_gallery/lib/demo/fitness_demo.dart
View file @
e71bd77e
...
...
@@ -102,11 +102,11 @@ class _FitnessDemoContentsState extends State<_FitnessDemoContents> {
)
),
new
Padding
(
padding:
new
Edge
Dim
s
.
only
(
top:
20.0
),
padding:
new
Edge
Inset
s
.
only
(
top:
20.0
),
child:
new
Text
(
"JUMPING JACKS"
,
style:
Theme
.
of
(
context
).
textTheme
.
title
)
),
new
Padding
(
padding:
new
Edge
Dim
s
.
only
(
top:
20.0
,
bottom:
20.0
),
padding:
new
Edge
Inset
s
.
only
(
top:
20.0
,
bottom:
20.0
),
child:
new
Row
(
justifyContent:
FlexJustifyContent
.
center
,
children:
<
Widget
>[
...
...
@@ -117,7 +117,7 @@ class _FitnessDemoContentsState extends State<_FitnessDemoContents> {
)
),
new
Padding
(
padding:
new
Edge
Dim
s
.
only
(
bottom:
16.0
),
padding:
new
Edge
Inset
s
.
only
(
bottom:
16.0
),
child:
new
SizedBox
(
width:
300.0
,
height:
72.0
,
...
...
examples/material_gallery/lib/demo/flexible_space_demo.dart
View file @
e71bd77e
...
...
@@ -13,7 +13,7 @@ class _ContactCategory extends StatelessComponent {
Widget
build
(
BuildContext
context
)
{
return
new
Container
(
padding:
const
Edge
Dim
s
.
symmetric
(
vertical:
16.0
),
padding:
const
Edge
Inset
s
.
symmetric
(
vertical:
16.0
),
decoration:
new
BoxDecoration
(
border:
new
Border
(
bottom:
new
BorderSide
(
color:
Theme
.
of
(
context
).
dividerColor
))
),
...
...
@@ -58,7 +58,7 @@ class _ContactItem extends StatelessComponent {
));
}
return
new
Padding
(
padding:
const
Edge
Dim
s
.
symmetric
(
vertical:
16.0
),
padding:
const
Edge
Inset
s
.
symmetric
(
vertical:
16.0
),
child:
new
Row
(
justifyContent:
FlexJustifyContent
.
spaceBetween
,
children:
rowChildren
...
...
@@ -109,7 +109,7 @@ class FlexibleSpaceDemoState extends State<FlexibleSpaceDemo> {
),
body:
new
Block
(
scrollableKey:
scrollableKey
,
padding:
new
Edge
Dim
s
.
only
(
top:
appBarHeight
),
padding:
new
Edge
Inset
s
.
only
(
top:
appBarHeight
),
children:
<
Widget
>[
new
_ContactCategory
(
icon:
Icons
.
call
,
...
...
examples/material_gallery/lib/demo/full_screen_dialog_demo.dart
View file @
e71bd77e
...
...
@@ -36,7 +36,7 @@ class DateTimeItem extends StatelessComponent {
children:
<
Widget
>[
new
Flexible
(
child:
new
Container
(
padding:
const
Edge
Dim
s
.
symmetric
(
vertical:
8.0
),
padding:
const
Edge
Inset
s
.
symmetric
(
vertical:
8.0
),
decoration:
new
BoxDecoration
(
border:
new
Border
(
bottom:
new
BorderSide
(
color:
theme
.
dividerColor
))
),
...
...
@@ -63,8 +63,8 @@ class DateTimeItem extends StatelessComponent {
)
),
new
Container
(
margin:
const
Edge
Dim
s
.
only
(
left:
8.0
),
padding:
const
Edge
Dim
s
.
symmetric
(
vertical:
8.0
),
margin:
const
Edge
Inset
s
.
only
(
left:
8.0
),
padding:
const
Edge
Inset
s
.
symmetric
(
vertical:
8.0
),
decoration:
new
BoxDecoration
(
border:
new
Border
(
bottom:
new
BorderSide
(
color:
theme
.
dividerColor
))
),
...
...
@@ -157,14 +157,14 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
]
),
body:
new
Padding
(
padding:
const
Edge
Dim
s
.
all
(
16.0
),
padding:
const
Edge
Inset
s
.
all
(
16.0
),
child:
new
ScrollableViewport
(
child:
new
Column
(
alignItems:
FlexAlignItems
.
stretch
,
justifyContent:
FlexJustifyContent
.
collapse
,
children:
<
Widget
>[
new
Container
(
padding:
const
Edge
Dim
s
.
symmetric
(
vertical:
8.0
),
padding:
const
Edge
Inset
s
.
symmetric
(
vertical:
8.0
),
decoration:
new
BoxDecoration
(
border:
new
Border
(
bottom:
new
BorderSide
(
color:
theme
.
dividerColor
))
),
...
...
@@ -174,7 +174,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
)
),
new
Container
(
padding:
const
Edge
Dim
s
.
symmetric
(
vertical:
8.0
),
padding:
const
Edge
Inset
s
.
symmetric
(
vertical:
8.0
),
decoration:
new
BoxDecoration
(
border:
new
Border
(
bottom:
new
BorderSide
(
color:
theme
.
dividerColor
))
),
...
...
@@ -237,7 +237,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
]
.
map
((
Widget
child
)
{
return
new
Container
(
padding:
const
Edge
Dim
s
.
symmetric
(
vertical:
8.0
),
padding:
const
Edge
Inset
s
.
symmetric
(
vertical:
8.0
),
height:
96.0
,
child:
child
);
...
...
examples/material_gallery/lib/demo/grid_list_demo.dart
View file @
e71bd77e
...
...
@@ -97,7 +97,7 @@ class GridListDemoGridDelegate extends FixedColumnCountGridDelegate {
this
.
columnCount
,
double
columnSpacing:
0.0
,
double
rowSpacing:
0.0
,
Edge
Dims
padding:
EdgeDim
s
.
zero
,
Edge
Insets
padding:
EdgeInset
s
.
zero
,
this
.
tileHeightFactor
:
2.75
})
:
super
(
columnSpacing:
columnSpacing
,
rowSpacing:
rowSpacing
,
padding:
padding
)
{
assert
(
columnCount
!=
null
&&
columnCount
>=
0
);
...
...
@@ -153,7 +153,7 @@ class GridListDemoState extends State<GridListDemo> {
)
];
final
Edge
Dim
s
padding
=
MediaQuery
.
of
(
context
).
padding
;
final
Edge
Inset
s
padding
=
MediaQuery
.
of
(
context
).
padding
;
final
ModalPosition
position
=
new
ModalPosition
(
right:
padding
.
right
+
16.0
,
top:
padding
.
top
+
16.0
...
...
@@ -187,7 +187,7 @@ class GridListDemoState extends State<GridListDemo> {
columnCount:
(
orientation
==
Orientation
.
portrait
)
?
2
:
3
,
rowSpacing:
4.0
,
columnSpacing:
4.0
,
padding:
const
Edge
Dim
s
.
all
(
4.0
),
padding:
const
Edge
Inset
s
.
all
(
4.0
),
tileHeightFactor:
(
orientation
==
Orientation
.
portrait
)
?
2.75
:
1.75
),
children:
photos
.
map
((
Photo
photo
)
{
...
...
examples/material_gallery/lib/demo/icons_demo.dart
View file @
e71bd77e
...
...
@@ -72,7 +72,7 @@ class IconsDemoState extends State<IconsDemo> {
body:
new
IconTheme
(
data:
new
IconThemeData
(
opacity:
iconOpacity
),
child:
new
Padding
(
padding:
const
Edge
Dim
s
.
all
(
24.0
),
padding:
const
Edge
Inset
s
.
all
(
24.0
),
child:
new
Column
(
children:
<
Widget
>[
new
Row
(
...
...
examples/material_gallery/lib/demo/leave_behind_demo.dart
View file @
e71bd77e
...
...
@@ -156,7 +156,7 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> {
]
),
body:
new
Block
(
padding:
new
Edge
Dim
s
.
all
(
4.0
),
padding:
new
Edge
Inset
s
.
all
(
4.0
),
children:
leaveBehindItems
.
map
(
buildItem
).
toList
()
)
);
...
...
examples/material_gallery/lib/demo/list_demo.dart
View file @
e71bd77e
...
...
@@ -195,7 +195,7 @@ class ListDemoState extends State<ListDemo> {
]
),
body:
new
Block
(
padding:
new
Edge
Dim
s
.
all
(
_dense
?
4.0
:
8.0
),
padding:
new
Edge
Inset
s
.
all
(
_dense
?
4.0
:
8.0
),
children:
listItems
.
toList
()
)
);
...
...
examples/material_gallery/lib/demo/menu_demo.dart
View file @
e71bd77e
...
...
@@ -79,7 +79,7 @@ class MenuDemoState extends State<MenuDemo> {
]
),
body:
new
Block
(
padding:
const
Edge
Dim
s
.
all
(
8.0
),
padding:
const
Edge
Inset
s
.
all
(
8.0
),
children:
<
Widget
>[
// Pressing the PopupMenuButton on the right of this item shows
// a simple menu with one disabled item. Typically the contents
...
...
examples/material_gallery/lib/demo/modal_bottom_sheet_demo.dart
View file @
e71bd77e
...
...
@@ -24,7 +24,7 @@ class ModalBottomSheetDemo extends StatelessComponent {
showModalBottomSheet
/*<Null>*/
(
context:
context
,
builder:
(
BuildContext
context
)
{
return
new
Container
(
child:
new
Padding
(
padding:
const
Edge
Dim
s
.
all
(
32.0
),
padding:
const
Edge
Inset
s
.
all
(
32.0
),
child:
new
Text
(
"This is the modal bottom sheet. Click anywhere to dismiss."
,
style:
textStyle
)
)
);
...
...
examples/material_gallery/lib/demo/page_selector_demo.dart
View file @
e71bd77e
...
...
@@ -32,7 +32,7 @@ class PageSelectorDemo extends StatelessComponent {
return
new
Column
(
children:
<
Widget
>[
new
Container
(
margin:
const
Edge
Dim
s
.
only
(
top:
16.0
),
margin:
const
Edge
Inset
s
.
only
(
top:
16.0
),
child:
new
Row
(
children:
<
Widget
>[
new
IconButton
(
...
...
@@ -57,7 +57,7 @@ class PageSelectorDemo extends StatelessComponent {
children:
icons
.
map
((
IconData
icon
)
{
return
new
Container
(
key:
new
ObjectKey
(
icon
),
padding:
const
Edge
Dim
s
.
all
(
12.0
),
padding:
const
Edge
Inset
s
.
all
(
12.0
),
child:
new
Card
(
child:
new
Center
(
child:
new
Icon
(
icon:
icon
,
size:
128.0
,
color:
color
)
...
...
examples/material_gallery/lib/demo/persistent_bottom_sheet_demo.dart
View file @
e71bd77e
...
...
@@ -19,7 +19,7 @@ class PersistentBottomSheetDemo extends StatelessComponent {
border:
new
Border
(
top:
new
BorderSide
(
color:
Colors
.
black26
,
width:
1.0
))
),
child:
new
Padding
(
padding:
const
Edge
Dim
s
.
all
(
32.0
),
padding:
const
Edge
Inset
s
.
all
(
32.0
),
child:
new
Text
(
"This is a Material persistent bottom sheet. Drag downwards to dismiss it."
,
style:
textStyle
)
)
);
...
...
examples/material_gallery/lib/demo/progress_indicator_demo.dart
View file @
e71bd77e
...
...
@@ -75,7 +75,7 @@ class _ProgressIndicatorDemoState extends State<ProgressIndicatorDemo> {
];
return
new
Column
(
children:
indicators
.
map
((
Widget
c
)
=>
new
Container
(
child:
c
,
margin:
const
Edge
Dim
s
.
symmetric
(
vertical:
15.0
,
horizontal:
20.0
)))
.
map
((
Widget
c
)
=>
new
Container
(
child:
c
,
margin:
const
Edge
Inset
s
.
symmetric
(
vertical:
15.0
,
horizontal:
20.0
)))
.
toList
(),
justifyContent:
FlexJustifyContent
.
center
);
...
...
@@ -90,7 +90,7 @@ class _ProgressIndicatorDemoState extends State<ProgressIndicatorDemo> {
onTap:
_handleTap
,
behavior:
HitTestBehavior
.
opaque
,
child:
new
Container
(
padding:
const
Edge
Dim
s
.
symmetric
(
vertical:
12.0
,
horizontal:
8.0
),
padding:
const
Edge
Inset
s
.
symmetric
(
vertical:
12.0
,
horizontal:
8.0
),
child:
new
AnimatedBuilder
(
animation:
animation
,
builder:
_buildIndicators
...
...
examples/material_gallery/lib/demo/scrolling_techniques_demo.dart
View file @
e71bd77e
...
...
@@ -23,7 +23,7 @@ class _BarGraphic extends StatelessComponent {
return
new
Container
(
height:
height
,
width:
200.0
,
padding:
const
Edge
Dim
s
.
symmetric
(
horizontal:
16.0
),
padding:
const
Edge
Inset
s
.
symmetric
(
horizontal:
16.0
),
decoration:
new
BoxDecoration
(
backgroundColor:
color
),
child:
new
DefaultTextStyle
(
style:
Theme
.
of
(
context
).
textTheme
.
body1
.
copyWith
(
color:
Colors
.
white
),
...
...
@@ -90,7 +90,7 @@ class _TechniqueItem extends StatelessComponent {
child:
new
InkWell
(
onTap:
()
{
showDemo
(
context
);
},
child:
new
Padding
(
padding:
const
Edge
Dim
s
.
all
(
16.0
),
padding:
const
Edge
Inset
s
.
all
(
16.0
),
child:
new
Row
(
justifyContent:
FlexJustifyContent
.
spaceBetween
,
children
:<
Widget
>[
...
...
@@ -115,11 +115,11 @@ class ScrollingTechniquesDemo extends StatelessComponent {
return
new
Scaffold
(
toolBar:
new
ToolBar
(
center:
new
Text
(
'Scrolling Techniques'
)),
body:
new
Padding
(
padding:
const
Edge
Dim
s
.
symmetric
(
horizontal:
16.0
),
padding:
const
Edge
Inset
s
.
symmetric
(
horizontal:
16.0
),
child:
new
Block
(
children:
<
Widget
>[
new
Padding
(
padding:
const
Edge
Dim
s
.
symmetric
(
horizontal:
16.0
,
vertical:
32.0
),
padding:
const
Edge
Inset
s
.
symmetric
(
horizontal:
16.0
,
vertical:
32.0
),
child:
new
Text
(
_introText
,
style:
Theme
.
of
(
context
).
textTheme
.
caption
)
),
new
_TechniqueItem
(
...
...
examples/material_gallery/lib/demo/slider_demo.dart
View file @
e71bd77e
...
...
@@ -31,7 +31,7 @@ class _SliderDemoState extends State<SliderDemo> {
}
),
new
Container
(
padding:
const
Edge
Dim
s
.
symmetric
(
horizontal:
16.0
),
padding:
const
Edge
Inset
s
.
symmetric
(
horizontal:
16.0
),
child:
new
Text
(
_value
.
round
().
toString
().
padLeft
(
3
,
'0'
))
),
],
...
...
@@ -47,7 +47,7 @@ class _SliderDemoState extends State<SliderDemo> {
// Disabled, but tracking the slider above.
new
Slider
(
value:
_value
/
100.0
),
new
Container
(
padding:
const
Edge
Dim
s
.
symmetric
(
horizontal:
16.0
),
padding:
const
Edge
Inset
s
.
symmetric
(
horizontal:
16.0
),
child:
new
Text
((
_value
/
100.0
).
toStringAsFixed
(
2
))
),
],
...
...
examples/material_gallery/lib/demo/snack_bar_demo.dart
View file @
e71bd77e
...
...
@@ -22,7 +22,7 @@ class SnackBarDemo extends StatelessComponent {
Widget
buildBody
(
BuildContext
context
)
{
return
new
Padding
(
padding:
const
Edge
Dim
s
.
all
(
24.0
),
padding:
const
Edge
Inset
s
.
all
(
24.0
),
child:
new
Column
(
children:
<
Widget
>[
new
Text
(
_text1
),
...
...
@@ -47,7 +47,7 @@ class SnackBarDemo extends StatelessComponent {
]
.
map
((
Widget
child
)
{
return
new
Container
(
margin:
const
Edge
Dim
s
.
symmetric
(
vertical:
12.0
),
margin:
const
Edge
Inset
s
.
symmetric
(
vertical:
12.0
),
child:
child
);
})
...
...
examples/material_gallery/lib/demo/tabs_demo.dart
View file @
e71bd77e
...
...
@@ -42,7 +42,7 @@ class TabsDemo extends StatelessComponent {
children:
icons
.
map
((
IconData
icon
)
{
return
new
Container
(
key:
new
ObjectKey
(
icon
),
padding:
const
Edge
Dim
s
.
all
(
12.0
),
padding:
const
Edge
Inset
s
.
all
(
12.0
),
child:
new
Card
(
child:
new
Center
(
child:
new
Icon
(
...
...
examples/material_gallery/lib/demo/tabs_fab_demo.dart
View file @
e71bd77e
...
...
@@ -59,7 +59,7 @@ class _TabsFabDemoState extends State<TabsFabDemo> {
border:
new
Border
(
top:
new
BorderSide
(
color:
Theme
.
of
(
context
).
dividerColor
))
),
child:
new
Padding
(
padding:
const
Edge
Dim
s
.
all
(
32.0
),
padding:
const
Edge
Inset
s
.
all
(
32.0
),
child:
new
Text
(
_explanatoryText
,
style:
Theme
.
of
(
context
).
textTheme
.
subhead
)
)
);
...
...
@@ -77,7 +77,7 @@ class _TabsFabDemoState extends State<TabsFabDemo> {
return
new
Container
(
key:
new
ValueKey
<
String
>(
page
.
label
),
padding:
const
Edge
Dim
s
.
TRBL
(
48.0
,
48.0
,
96.0
,
48.0
),
padding:
const
Edge
Inset
s
.
TRBL
(
48.0
,
48.0
,
96.0
,
48.0
),
child:
new
Card
(
child:
new
Center
(
child:
new
Text
(
page
.
label
,
style:
textStyle
)
...
...
examples/material_gallery/lib/demo/text_field_demo.dart
View file @
e71bd77e
...
...
@@ -66,7 +66,7 @@ class TextFieldDemoState extends State<TextFieldDemo> {
center:
new
Text
(
'Text Fields'
)
),
body:
new
Block
(
padding:
const
Edge
Dim
s
.
all
(
8.0
),
padding:
const
Edge
Inset
s
.
all
(
8.0
),
children:
<
Widget
>[
new
Input
(
hintText:
'What do people call you?'
,
...
...
examples/material_gallery/lib/demo/tooltip_demo.dart
View file @
e71bd77e
...
...
@@ -52,7 +52,7 @@ class TooltipDemo extends StatelessComponent {
]
.
map
((
Widget
widget
)
{
return
new
Padding
(
padding:
const
Edge
Dim
s
.
only
(
top:
16.0
,
left:
16.0
,
right:
16.0
),
padding:
const
Edge
Inset
s
.
only
(
top:
16.0
,
left:
16.0
,
right:
16.0
),
child:
widget
);
})
...
...
examples/material_gallery/lib/demo/two_level_list_demo.dart
View file @
e71bd77e
...
...
@@ -9,7 +9,7 @@ class TwoLevelListDemo extends StatelessComponent {
return
new
Scaffold
(
toolBar:
new
ToolBar
(
center:
new
Text
(
'Expand/Collapse List Control'
)),
body:
new
Padding
(
padding:
const
Edge
Dim
s
.
all
(
0.0
),
padding:
const
Edge
Inset
s
.
all
(
0.0
),
child:
new
TwoLevelList
(
type:
MaterialListType
.
oneLine
,
items:
<
Widget
>[
...
...
examples/material_gallery/lib/demo/typography_demo.dart
View file @
e71bd77e
...
...
@@ -20,7 +20,7 @@ class TextStyleItem extends StatelessComponent {
final
ThemeData
theme
=
Theme
.
of
(
context
);
final
TextStyle
nameStyle
=
theme
.
textTheme
.
body1
.
copyWith
(
color:
theme
.
textTheme
.
caption
.
color
);
return
new
Padding
(
padding:
const
Edge
Dim
s
.
symmetric
(
horizontal:
8.0
,
vertical:
16.0
),
padding:
const
Edge
Inset
s
.
symmetric
(
horizontal:
8.0
,
vertical:
16.0
),
child:
new
Row
(
alignItems:
FlexAlignItems
.
start
,
children:
<
Widget
>[
...
...
examples/material_gallery/lib/demo/weather_demo.dart
View file @
e71bd77e
...
...
@@ -140,7 +140,7 @@ class WeatherButton extends StatelessComponent {
color
=
const
Color
(
0x33000000
);
return
new
Padding
(
padding:
const
Edge
Dim
s
.
all
(
15.0
),
padding:
const
Edge
Inset
s
.
all
(
15.0
),
child:
new
Material
(
color:
color
,
type:
MaterialType
.
circle
,
...
...
examples/material_gallery/lib/gallery/home.dart
View file @
e71bd77e
...
...
@@ -53,7 +53,7 @@ class GalleryHomeState extends State<GalleryHome> {
toolBar:
new
ToolBar
(
flexibleSpace:
(
BuildContext
context
)
{
return
new
Container
(
padding:
const
Edge
Dim
s
.
only
(
left:
16.0
,
bottom:
24.0
),
padding:
const
Edge
Inset
s
.
only
(
left:
16.0
,
bottom:
24.0
),
height:
128.0
,
child:
new
Align
(
alignment:
const
FractionalOffset
(
0.0
,
1.0
),
...
...
@@ -63,7 +63,7 @@ class GalleryHomeState extends State<GalleryHome> {
}
),
body:
new
Block
(
padding:
const
Edge
Dim
s
.
all
(
4.0
),
padding:
const
Edge
Inset
s
.
all
(
4.0
),
children:
<
Widget
>[
new
Row
(
children:
<
Widget
>[
...
...
examples/material_gallery/lib/gallery/section.dart
View file @
e71bd77e
...
...
@@ -45,7 +45,7 @@ class GallerySection extends StatelessComponent {
body:
new
Material
(
child:
new
MaterialList
(
scrollableKey:
scrollableKey
,
scrollablePadding:
new
Edge
Dim
s
.
only
(
top:
appBarHeight
),
scrollablePadding:
new
Edge
Inset
s
.
only
(
top:
appBarHeight
),
type:
MaterialListType
.
oneLine
,
children:
(
demos
??
const
<
GalleryDemo
>[]).
map
((
GalleryDemo
demo
)
{
return
new
ListItem
(
...
...
@@ -75,13 +75,13 @@ class GallerySection extends StatelessComponent {
onTap:
()
{
showDemos
(
context
);
},
child:
new
Container
(
height:
256.0
,
margin:
const
Edge
Dim
s
.
all
(
4.0
),
margin:
const
Edge
Inset
s
.
all
(
4.0
),
decoration:
new
BoxDecoration
(
backgroundColor:
theme
.
primaryColor
),
child:
new
Column
(
children:
<
Widget
>[
new
Flexible
(
child:
new
Padding
(
padding:
const
Edge
Dim
s
.
symmetric
(
horizontal:
12.0
),
padding:
const
Edge
Inset
s
.
symmetric
(
horizontal:
12.0
),
child:
new
AssetImage
(
name:
image
,
alignment:
const
FractionalOffset
(
0.5
,
0.5
),
...
...
@@ -90,7 +90,7 @@ class GallerySection extends StatelessComponent {
)
),
new
Padding
(
padding:
const
Edge
Dim
s
.
all
(
16.0
),
padding:
const
Edge
Inset
s
.
all
(
16.0
),
child:
new
Align
(
alignment:
const
FractionalOffset
(
0.0
,
1.0
),
child:
new
Text
(
title
,
style:
titleTextStyle
)
...
...
examples/stocks/lib/stock_arrow.dart
View file @
e71bd77e
...
...
@@ -71,7 +71,7 @@ class StockArrow extends StatelessComponent {
return
new
Container
(
width:
40.0
,
height:
40.0
,
margin:
const
Edge
Dim
s
.
symmetric
(
horizontal:
5.0
),
margin:
const
Edge
Inset
s
.
symmetric
(
horizontal:
5.0
),
child:
new
CustomPaint
(
painter:
new
StockArrowPainter
(
// TODO(jackson): This should change colors with the theme
...
...
examples/stocks/lib/stock_row.dart
View file @
e71bd77e
...
...
@@ -64,7 +64,7 @@ class StockRow extends StatelessComponent {
onDoubleTap:
_getHandler
(
onDoubleTap
),
onLongPress:
_getHandler
(
onLongPressed
),
child:
new
Container
(
padding:
const
Edge
Dim
s
.
TRBL
(
16.0
,
16.0
,
20.0
,
16.0
),
padding:
const
Edge
Inset
s
.
TRBL
(
16.0
,
16.0
,
20.0
,
16.0
),
decoration:
new
BoxDecoration
(
border:
new
Border
(
bottom:
new
BorderSide
(
color:
Theme
.
of
(
context
).
dividerColor
)
...
...
@@ -73,7 +73,7 @@ class StockRow extends StatelessComponent {
child:
new
Row
(
children:
<
Widget
>[
new
Container
(
margin:
const
Edge
Dim
s
.
only
(
right:
5.0
),
margin:
const
Edge
Inset
s
.
only
(
right:
5.0
),
child:
new
Hero
(
tag:
StockRowPartKind
.
arrow
,
key:
_arrowKey
,
...
...
examples/stocks/lib/stock_settings.dart
View file @
e71bd77e
...
...
@@ -241,7 +241,7 @@ class StockSettingsState extends State<StockSettings> {
});
return
new
Block
(
children:
rows
,
padding:
const
Edge
Dim
s
.
symmetric
(
vertical:
20.0
)
padding:
const
Edge
Inset
s
.
symmetric
(
vertical:
20.0
)
);
}
...
...
examples/stocks/lib/stock_symbol_viewer.dart
View file @
e71bd77e
...
...
@@ -21,7 +21,7 @@ class StockSymbolView extends StatelessComponent {
TextStyle
headings
=
Theme
.
of
(
context
).
textTheme
.
body2
;
return
new
Container
(
padding:
new
Edge
Dim
s
.
all
(
20.0
),
padding:
new
Edge
Inset
s
.
all
(
20.0
),
child:
new
Column
(
children:
<
Widget
>[
new
Row
(
...
...
@@ -79,7 +79,7 @@ class StockSymbolPage extends StatelessComponent {
body:
new
Block
(
children:
<
Widget
>[
new
Container
(
margin:
new
Edge
Dim
s
.
all
(
20.0
),
margin:
new
Edge
Inset
s
.
all
(
20.0
),
child:
new
Card
(
child:
new
StockSymbolView
(
stock:
stock
))
)
]
...
...
@@ -95,7 +95,7 @@ class StockSymbolBottomSheet extends StatelessComponent {
Widget
build
(
BuildContext
context
)
{
return
new
Container
(
padding:
new
Edge
Dim
s
.
all
(
10.0
),
padding:
new
Edge
Inset
s
.
all
(
10.0
),
decoration:
new
BoxDecoration
(
border:
new
Border
(
top:
new
BorderSide
(
color:
Colors
.
black26
,
width:
1.0
))
),
...
...
packages/flutter/lib/painting.dart
View file @
e71bd77e
...
...
@@ -16,7 +16,7 @@ export 'src/painting/basic_types.dart';
export
'src/painting/box_painter.dart'
;
export
'src/painting/colors.dart'
;
export
'src/painting/decoration.dart'
;
export
'src/painting/edge_
dim
s.dart'
;
export
'src/painting/edge_
inset
s.dart'
;
export
'src/painting/text_editing.dart'
;
export
'src/painting/text_painter.dart'
;
export
'src/painting/text_style.dart'
;
...
...
packages/flutter/lib/src/material/button.dart
View file @
e71bd77e
...
...
@@ -116,7 +116,7 @@ abstract class MaterialButtonState<T extends MaterialButton> extends State<T> {
onTap:
config
.
onPressed
,
onHighlightChanged:
_handleHighlightChanged
,
child:
new
Container
(
padding:
new
Edge
Dim
s
.
symmetric
(
horizontal:
8.0
),
padding:
new
Edge
Inset
s
.
symmetric
(
horizontal:
8.0
),
child:
new
Center
(
widthFactor:
1.0
,
child:
config
.
child
...
...
@@ -143,8 +143,8 @@ abstract class MaterialButtonState<T extends MaterialButton> extends State<T> {
return
new
Container
(
height:
36.0
,
constraints:
new
BoxConstraints
(
minWidth:
88.0
),
padding:
const
Edge
Dim
s
.
symmetric
(
horizontal:
8.0
),
margin:
const
Edge
Dim
s
.
all
(
8.0
),
padding:
const
Edge
Inset
s
.
symmetric
(
horizontal:
8.0
),
margin:
const
Edge
Inset
s
.
all
(
8.0
),
child:
contents
);
}
...
...
packages/flutter/lib/src/material/card.dart
View file @
e71bd77e
...
...
@@ -6,7 +6,7 @@ import 'package:flutter/widgets.dart';
import
'material.dart'
;
const
Edge
Dims
_kCardMargins
=
const
EdgeDim
s
.
all
(
4.0
);
const
Edge
Insets
_kCardMargins
=
const
EdgeInset
s
.
all
(
4.0
);
/// A material design card
///
...
...
packages/flutter/lib/src/material/chip.dart
View file @
e71bd77e
...
...
@@ -45,7 +45,7 @@ class Chip extends StatelessComponent {
leftPadding
=
0.0
;
children
.
add
(
new
ExcludeSemantics
(
child:
new
Container
(
margin:
const
Edge
Dim
s
.
only
(
right:
8.0
),
margin:
const
Edge
Inset
s
.
only
(
right:
8.0
),
width:
_kAvatarDiamater
,
height:
_kAvatarDiamater
,
child:
avatar
...
...
@@ -65,7 +65,7 @@ class Chip extends StatelessComponent {
child:
new
Tooltip
(
message:
'Delete "
$label
"'
,
child:
new
Container
(
padding:
const
Edge
Dim
s
.
symmetric
(
horizontal:
4.0
),
padding:
const
Edge
Inset
s
.
symmetric
(
horizontal:
4.0
),
child:
new
Icon
(
icon:
Icons
.
cancel
,
size:
18.0
,
...
...
@@ -80,7 +80,7 @@ class Chip extends StatelessComponent {
container:
true
,
child:
new
Container
(
height:
_kChipHeight
,
padding:
new
Edge
Dim
s
.
only
(
left:
leftPadding
,
right:
rightPadding
),
padding:
new
Edge
Inset
s
.
only
(
left:
leftPadding
,
right:
rightPadding
),
decoration:
new
BoxDecoration
(
backgroundColor:
Colors
.
grey
[
300
],
borderRadius:
16.0
...
...
packages/flutter/lib/src/material/constants.dart
View file @
e71bd77e
...
...
@@ -33,7 +33,7 @@ const double kFadingEdgeLength = 12.0;
const
double
kPressedStateDuration
=
64.0
;
// units?
const
Duration
kThemeChangeDuration
=
const
Duration
(
milliseconds:
200
);
const
Edge
Dims
kDialogHeadingPadding
=
const
EdgeDim
s
.
TRBL
(
24.0
,
24.0
,
20.0
,
24.0
);
const
Edge
Insets
kDialogHeadingPadding
=
const
EdgeInset
s
.
TRBL
(
24.0
,
24.0
,
20.0
,
24.0
);
const
double
kRadialReactionRadius
=
24.0
;
// Pixels
const
Duration
kRadialReactionDuration
=
const
Duration
(
milliseconds:
200
);
...
...
packages/flutter/lib/src/material/date_picker.dart
View file @
e71bd77e
...
...
@@ -140,7 +140,7 @@ class _DatePickerHeader extends StatelessComponent {
TextStyle
yearStyle
=
headerTheme
.
headline
.
copyWith
(
color:
yearColor
,
height:
1.0
);
return
new
Container
(
padding:
new
Edge
Dim
s
.
all
(
10.0
),
padding:
new
Edge
Inset
s
.
all
(
10.0
),
decoration:
new
BoxDecoration
(
backgroundColor:
theme
.
primaryColor
),
child:
new
Column
(
children:
<
Widget
>[
...
...
packages/flutter/lib/src/material/date_picker_dialog.dart
View file @
e71bd77e
...
...
@@ -55,7 +55,7 @@ class _DatePickerDialogState extends State<_DatePickerDialog> {
lastDate:
config
.
lastDate
,
onChanged:
_handleDateChanged
),
contentPadding:
Edge
Dim
s
.
zero
,
contentPadding:
Edge
Inset
s
.
zero
,
actions:
<
Widget
>[
new
FlatButton
(
child:
new
Text
(
'CANCEL'
),
...
...
packages/flutter/lib/src/material/dialog.dart
View file @
e71bd77e
...
...
@@ -32,14 +32,14 @@ class Dialog extends StatelessComponent {
// Padding around the title; uses material design default if none is supplied
// If there is no title, no padding will be provided
final
Edge
Dim
s
titlePadding
;
final
Edge
Inset
s
titlePadding
;
/// The (optional) content of the dialog is displayed in the center of the
/// dialog in a lighter font.
final
Widget
content
;
// Padding around the content; uses material design default if none is supplied
final
Edge
Dim
s
contentPadding
;
final
Edge
Inset
s
contentPadding
;
/// The (optional) set of actions that are displayed at the bottom of the
/// dialog.
...
...
@@ -59,9 +59,9 @@ class Dialog extends StatelessComponent {
List
<
Widget
>
dialogBody
=
new
List
<
Widget
>();
if
(
title
!=
null
)
{
Edge
Dim
s
padding
=
titlePadding
;
Edge
Inset
s
padding
=
titlePadding
;
if
(
padding
==
null
)
padding
=
new
Edge
Dim
s
.
TRBL
(
24.0
,
24.0
,
content
==
null
?
20.0
:
0.0
,
24.0
);
padding
=
new
Edge
Inset
s
.
TRBL
(
24.0
,
24.0
,
content
==
null
?
20.0
:
0.0
,
24.0
);
dialogBody
.
add
(
new
Padding
(
padding:
padding
,
child:
new
DefaultTextStyle
(
...
...
@@ -72,9 +72,9 @@ class Dialog extends StatelessComponent {
}
if
(
content
!=
null
)
{
Edge
Dim
s
padding
=
contentPadding
;
Edge
Inset
s
padding
=
contentPadding
;
if
(
padding
==
null
)
padding
=
const
Edge
Dim
s
.
TRBL
(
20.0
,
24.0
,
24.0
,
24.0
);
padding
=
const
Edge
Inset
s
.
TRBL
(
20.0
,
24.0
,
24.0
,
24.0
);
dialogBody
.
add
(
new
Padding
(
padding:
padding
,
child:
new
DefaultTextStyle
(
...
...
@@ -98,7 +98,7 @@ class Dialog extends StatelessComponent {
return
new
Center
(
child:
new
Container
(
margin:
new
Edge
Dim
s
.
symmetric
(
horizontal:
40.0
,
vertical:
24.0
),
margin:
new
Edge
Inset
s
.
symmetric
(
horizontal:
40.0
,
vertical:
24.0
),
child:
new
ConstrainedBox
(
constraints:
new
BoxConstraints
(
minWidth:
280.0
),
child:
new
Material
(
...
...
packages/flutter/lib/src/material/divider.dart
View file @
e71bd77e
...
...
@@ -19,7 +19,7 @@ class Divider extends StatelessComponent {
final
double
bottom
=
(
height
~/
2.0
).
toDouble
();
return
new
Container
(
height:
0.0
,
margin:
new
Edge
Dim
s
.
only
(
margin:
new
Edge
Inset
s
.
only
(
top:
height
-
bottom
-
1.0
,
left:
indent
,
bottom:
bottom
...
...
packages/flutter/lib/src/material/drawer_header.dart
View file @
e71bd77e
...
...
@@ -18,7 +18,7 @@ class DrawerHeader extends StatelessComponent {
Widget
build
(
BuildContext
context
)
{
assert
(
debugCheckHasMaterial
(
context
));
final
double
statusBarHeight
=
(
MediaQuery
.
of
(
context
)?.
padding
??
Edge
Dim
s
.
zero
).
top
;
final
double
statusBarHeight
=
(
MediaQuery
.
of
(
context
)?.
padding
??
Edge
Inset
s
.
zero
).
top
;
return
new
Container
(
height:
statusBarHeight
+
kMaterialDrawerHeight
,
decoration:
new
BoxDecoration
(
...
...
@@ -30,13 +30,13 @@ class DrawerHeader extends StatelessComponent {
)
)
),
padding:
const
Edge
Dim
s
.
only
(
bottom:
7.0
),
margin:
const
Edge
Dim
s
.
only
(
bottom:
8.0
),
padding:
const
Edge
Inset
s
.
only
(
bottom:
7.0
),
margin:
const
Edge
Inset
s
.
only
(
bottom:
8.0
),
child:
new
Column
(
children:
<
Widget
>[
new
Flexible
(
child:
new
Container
()),
new
Container
(
padding:
const
Edge
Dim
s
.
symmetric
(
horizontal:
16.0
),
padding:
const
Edge
Inset
s
.
symmetric
(
horizontal:
16.0
),
child:
new
DefaultTextStyle
(
style:
Theme
.
of
(
context
).
textTheme
.
body2
,
child:
child
...
...
packages/flutter/lib/src/material/drawer_item.dart
View file @
e71bd77e
...
...
@@ -63,7 +63,7 @@ class DrawerItem extends StatelessComponent {
if
(
icon
!=
null
)
{
children
.
add
(
new
Padding
(
padding:
const
Edge
Dim
s
.
symmetric
(
horizontal:
16.0
),
padding:
const
Edge
Inset
s
.
symmetric
(
horizontal:
16.0
),
child:
new
Icon
(
icon:
icon
,
color:
_getIconColor
(
themeData
)
...
...
@@ -74,7 +74,7 @@ class DrawerItem extends StatelessComponent {
children
.
add
(
new
Flexible
(
child:
new
Padding
(
padding:
const
Edge
Dim
s
.
symmetric
(
horizontal:
16.0
),
padding:
const
Edge
Inset
s
.
symmetric
(
horizontal:
16.0
),
child:
new
DefaultTextStyle
(
style:
_getTextStyle
(
themeData
),
child:
child
...
...
packages/flutter/lib/src/material/dropdown.dart
View file @
e71bd77e
...
...
@@ -16,7 +16,7 @@ import 'material.dart';
const
Duration
_kDropDownMenuDuration
=
const
Duration
(
milliseconds:
300
);
const
double
_kMenuItemHeight
=
48.0
;
const
Edge
Dims
_kMenuHorizontalPadding
=
const
EdgeDim
s
.
only
(
left:
36.0
,
right:
36.0
);
const
Edge
Insets
_kMenuHorizontalPadding
=
const
EdgeInset
s
.
only
(
left:
36.0
,
right:
36.0
);
const
double
_kBaselineOffsetFromBottom
=
20.0
;
const
Border
_kDropDownUnderline
=
const
Border
(
bottom:
const
BorderSide
(
color:
const
Color
(
0xFFBDBDBD
),
width:
2.0
));
...
...
@@ -210,7 +210,7 @@ class DropDownMenuItem<T> extends StatelessComponent {
Widget
build
(
BuildContext
context
)
{
return
new
Container
(
height:
_kMenuItemHeight
,
padding:
const
Edge
Dim
s
.
only
(
left:
8.0
,
right:
8.0
,
top:
6.0
),
padding:
const
Edge
Inset
s
.
only
(
left:
8.0
,
right:
8.0
,
top:
6.0
),
child:
new
DefaultTextStyle
(
style:
Theme
.
of
(
context
).
textTheme
.
subhead
,
child:
new
Baseline
(
...
...
@@ -301,7 +301,7 @@ class _DropDownButtonState<T> extends State<DropDownButton<T>> {
),
new
Container
(
child:
new
Icon
(
icon:
Icons
.
arrow_drop_down
,
size:
36.0
),
padding:
const
Edge
Dim
s
.
only
(
top:
6.0
)
padding:
const
Edge
Inset
s
.
only
(
top:
6.0
)
)
],
justifyContent:
FlexJustifyContent
.
collapse
...
...
packages/flutter/lib/src/material/flexible_space_bar.dart
View file @
e71bd77e
...
...
@@ -26,7 +26,7 @@ class _FlexibleSpaceBarState extends State<FlexibleSpaceBar> {
assert
(
debugCheckHasScaffold
(
context
));
final
double
appBarHeight
=
Scaffold
.
of
(
context
).
appBarHeight
;
final
Animation
<
double
>
animation
=
Scaffold
.
of
(
context
).
appBarAnimation
;
final
Edge
Dims
toolBarPadding
=
MediaQuery
.
of
(
context
)?.
padding
??
EdgeDim
s
.
zero
;
final
Edge
Insets
toolBarPadding
=
MediaQuery
.
of
(
context
)?.
padding
??
EdgeInset
s
.
zero
;
final
double
toolBarHeight
=
kToolBarHeight
+
toolBarPadding
.
top
;
final
List
<
Widget
>
children
=
<
Widget
>[];
...
...
@@ -70,7 +70,7 @@ class _FlexibleSpaceBarState extends State<FlexibleSpaceBar> {
curve:
new
Interval
(
0.0
,
scaleAndAlignEnd
)
);
children
.
add
(
new
Padding
(
padding:
const
Edge
Dim
s
.
only
(
left:
72.0
,
bottom:
14.0
),
padding:
const
Edge
Inset
s
.
only
(
left:
72.0
,
bottom:
14.0
),
child:
new
Align
(
alignment:
new
Tween
<
FractionalOffset
>(
begin:
new
FractionalOffset
(
0.0
,
yAlignStart
),
...
...
packages/flutter/lib/src/material/grid_tile_bar.dart
View file @
e71bd77e
...
...
@@ -29,18 +29,18 @@ class GridTileBar extends StatelessComponent {
if
(
backgroundColor
!=
null
)
decoration
=
new
BoxDecoration
(
backgroundColor:
backgroundColor
);
Edge
Dim
s
padding
;
Edge
Inset
s
padding
;
if
(
left
!=
null
&&
right
!=
null
)
padding
=
const
Edge
Dim
s
.
symmetric
(
vertical:
16.0
,
horizontal:
8.0
);
padding
=
const
Edge
Inset
s
.
symmetric
(
vertical:
16.0
,
horizontal:
8.0
);
else
if
(
left
!=
null
)
padding
=
const
Edge
Dim
s
.
only
(
left:
8.0
,
right:
16.0
,
top:
16.0
,
bottom:
16.0
);
padding
=
const
Edge
Inset
s
.
only
(
left:
8.0
,
right:
16.0
,
top:
16.0
,
bottom:
16.0
);
else
// right != null || (left == null && right == null)
padding
=
const
Edge
Dim
s
.
only
(
left:
16.0
,
right:
8.0
,
top:
16.0
,
bottom:
16.0
);
padding
=
const
Edge
Inset
s
.
only
(
left:
16.0
,
right:
8.0
,
top:
16.0
,
bottom:
16.0
);
final
List
<
Widget
>
children
=
<
Widget
>[];
if
(
left
!=
null
)
children
.
add
(
new
Padding
(
padding:
const
Edge
Dim
s
.
only
(
right:
8.0
),
child:
left
));
children
.
add
(
new
Padding
(
padding:
const
Edge
Inset
s
.
only
(
right:
8.0
),
child:
left
));
if
(
title
!=
null
&&
caption
!=
null
)
{
children
.
add
(
...
...
@@ -72,7 +72,7 @@ class GridTileBar extends StatelessComponent {
}
if
(
right
!=
null
)
children
.
add
(
new
Padding
(
padding:
const
Edge
Dim
s
.
only
(
left:
8.0
),
child:
right
));
children
.
add
(
new
Padding
(
padding:
const
Edge
Inset
s
.
only
(
left:
8.0
),
child:
right
));
return
new
Container
(
padding:
padding
,
...
...
packages/flutter/lib/src/material/icon_button.dart
View file @
e71bd77e
...
...
@@ -56,7 +56,7 @@ class IconButton extends StatelessComponent {
Widget
build
(
BuildContext
context
)
{
assert
(
debugCheckHasMaterial
(
context
));
Widget
result
=
new
Padding
(
padding:
const
Edge
Dim
s
.
all
(
8.0
),
padding:
const
Edge
Inset
s
.
all
(
8.0
),
child:
new
Icon
(
size:
size
,
icon:
icon
,
...
...
packages/flutter/lib/src/material/input.dart
View file @
e71bd77e
...
...
@@ -132,8 +132,8 @@ class _InputState extends State<Input> {
));
}
Edge
Dims
margin
=
new
EdgeDim
s
.
only
(
bottom:
config
.
isDense
?
4.0
:
8.0
);
Edge
Dims
padding
=
new
EdgeDim
s
.
only
(
top:
topPadding
,
bottom:
8.0
);
Edge
Insets
margin
=
new
EdgeInset
s
.
only
(
bottom:
config
.
isDense
?
4.0
:
8.0
);
Edge
Insets
padding
=
new
EdgeInset
s
.
only
(
top:
topPadding
,
bottom:
8.0
);
Color
borderColor
=
activeColor
;
double
borderWidth
=
focused
?
2.0
:
1.0
;
...
...
@@ -141,8 +141,8 @@ class _InputState extends State<Input> {
borderColor
=
themeData
.
errorColor
;
borderWidth
=
2.0
;
if
(!
config
.
isDense
)
{
margin
=
const
Edge
Dim
s
.
only
(
bottom:
15.0
);
padding
=
new
Edge
Dim
s
.
only
(
top:
topPadding
,
bottom:
1.0
);
margin
=
const
Edge
Inset
s
.
only
(
bottom:
15.0
);
padding
=
new
Edge
Inset
s
.
only
(
top:
topPadding
,
bottom:
1.0
);
}
}
...
...
@@ -191,7 +191,7 @@ class _InputState extends State<Input> {
alignItems:
FlexAlignItems
.
start
,
children:
[
new
Container
(
margin:
new
Edge
Dim
s
.
only
(
right:
16.0
,
top:
iconTop
),
margin:
new
Edge
Inset
s
.
only
(
right:
16.0
,
top:
iconTop
),
width:
config
.
isDense
?
40.0
:
48.0
,
child:
new
Icon
(
icon:
config
.
icon
,
...
...
@@ -208,7 +208,7 @@ class _InputState extends State<Input> {
behavior:
HitTestBehavior
.
opaque
,
onTap:
()
=>
_rawInputLineKey
.
currentState
?.
requestKeyboard
(),
child:
new
Padding
(
padding:
const
Edge
Dim
s
.
symmetric
(
horizontal:
16.0
),
padding:
const
Edge
Inset
s
.
symmetric
(
horizontal:
16.0
),
child:
child
)
);
...
...
packages/flutter/lib/src/material/list.dart
View file @
e71bd77e
...
...
@@ -28,7 +28,7 @@ class MaterialList extends StatefulComponent {
this
.
onScroll
,
this
.
type
:
MaterialListType
.
twoLine
,
this
.
children
,
this
.
scrollablePadding
:
Edge
Dim
s
.
zero
,
this
.
scrollablePadding
:
Edge
Inset
s
.
zero
,
this
.
scrollableKey
})
:
super
(
key:
key
);
...
...
@@ -36,7 +36,7 @@ class MaterialList extends StatefulComponent {
final
ScrollListener
onScroll
;
final
MaterialListType
type
;
final
Iterable
<
Widget
>
children
;
final
Edge
Dim
s
scrollablePadding
;
final
Edge
Inset
s
scrollablePadding
;
final
Key
scrollableKey
;
_MaterialListState
createState
()
=>
new
_MaterialListState
();
...
...
@@ -52,7 +52,7 @@ class _MaterialListState extends State<MaterialList> {
scrollDirection:
Axis
.
vertical
,
onScroll:
config
.
onScroll
,
itemExtent:
kListItemExtent
[
config
.
type
],
padding:
const
Edge
Dim
s
.
symmetric
(
vertical:
8.0
)
+
config
.
scrollablePadding
,
padding:
const
Edge
Inset
s
.
symmetric
(
vertical:
8.0
)
+
config
.
scrollablePadding
,
scrollableListPainter:
_scrollbarPainter
,
children:
config
.
children
);
...
...
packages/flutter/lib/src/material/list_item.dart
View file @
e71bd77e
...
...
@@ -105,7 +105,7 @@ class ListItem extends StatelessComponent {
if
(
left
!=
null
)
{
children
.
add
(
new
Container
(
margin:
new
Edge
Dim
s
.
only
(
right:
16.0
,
top:
iconMarginTop
),
margin:
new
Edge
Inset
s
.
only
(
right:
16.0
,
top:
iconMarginTop
),
width:
40.0
,
child:
new
Align
(
alignment:
new
FractionalOffset
(
0.0
,
isThreeLine
?
0.0
:
0.5
),
...
...
@@ -138,7 +138,7 @@ class ListItem extends StatelessComponent {
if
(
right
!=
null
)
{
children
.
add
(
new
Container
(
margin:
new
Edge
Dim
s
.
only
(
left:
16.0
,
top:
iconMarginTop
),
margin:
new
Edge
Inset
s
.
only
(
left:
16.0
,
top:
iconMarginTop
),
child:
new
Align
(
alignment:
new
FractionalOffset
(
1.0
,
isThreeLine
?
0.0
:
0.5
),
child:
right
...
...
@@ -151,7 +151,7 @@ class ListItem extends StatelessComponent {
onLongPress:
enabled
?
onLongPress
:
null
,
child:
new
Container
(
height:
itemHeight
,
padding:
const
Edge
Dim
s
.
symmetric
(
horizontal:
16.0
),
padding:
const
Edge
Inset
s
.
symmetric
(
horizontal:
16.0
),
child:
new
Row
(
alignItems:
FlexAlignItems
.
center
,
children:
children
...
...
packages/flutter/lib/src/material/popup_menu.dart
View file @
e71bd77e
...
...
@@ -99,7 +99,7 @@ class _PopupMenuItemState<T extends PopupMenuItem<dynamic>> extends State<T> {
child:
new
MergeSemantics
(
child:
new
Container
(
height:
config
.
height
,
padding:
const
Edge
Dim
s
.
symmetric
(
horizontal:
_kMenuHorizontalPadding
),
padding:
const
Edge
Inset
s
.
symmetric
(
horizontal:
_kMenuHorizontalPadding
),
child:
item
)
)
...
...
@@ -204,7 +204,7 @@ class _PopupMenu<T> extends StatelessComponent {
stepWidth:
_kMenuWidthStep
,
child:
new
Block
(
children:
children
,
padding:
const
Edge
Dim
s
.
symmetric
(
padding:
const
Edge
Inset
s
.
symmetric
(
vertical:
_kMenuVerticalPadding
)
)
...
...
packages/flutter/lib/src/material/scaffold.dart
View file @
e71bd77e
...
...
@@ -37,7 +37,7 @@ enum _ScaffoldSlot {
class
_ScaffoldLayout
extends
MultiChildLayoutDelegate
{
_ScaffoldLayout
({
this
.
padding
});
final
Edge
Dim
s
padding
;
final
Edge
Inset
s
padding
;
void
performLayout
(
Size
size
)
{
BoxConstraints
looseConstraints
=
new
BoxConstraints
.
loose
(
size
);
...
...
@@ -375,11 +375,11 @@ class ScaffoldState extends State<Scaffold> {
bool
_shouldShowBackArrow
;
Widget
_getModifiedToolBar
({
Edge
Dim
s
padding
,
double
foregroundOpacity:
1.0
,
int
elevation
})
{
Widget
_getModifiedToolBar
({
Edge
Inset
s
padding
,
double
foregroundOpacity:
1.0
,
int
elevation
})
{
ToolBar
toolBar
=
config
.
toolBar
;
if
(
toolBar
==
null
)
return
null
;
Edge
Dims
toolBarPadding
=
new
EdgeDim
s
.
only
(
top:
padding
.
top
);
Edge
Insets
toolBarPadding
=
new
EdgeInset
s
.
only
(
top:
padding
.
top
);
Widget
left
=
toolBar
.
left
;
if
(
left
==
null
)
{
if
(
config
.
drawer
!=
null
)
{
...
...
@@ -431,7 +431,7 @@ class ScaffoldState extends State<Scaffold> {
}
Widget
_buildScrollableAppBar
(
BuildContext
context
)
{
final
Edge
Dims
toolBarPadding
=
MediaQuery
.
of
(
context
)?.
padding
??
EdgeDim
s
.
zero
;
final
Edge
Insets
toolBarPadding
=
MediaQuery
.
of
(
context
)?.
padding
??
EdgeInset
s
.
zero
;
final
double
toolBarHeight
=
kToolBarHeight
+
toolBarPadding
.
top
;
Widget
appBar
;
...
...
@@ -468,7 +468,7 @@ class ScaffoldState extends State<Scaffold> {
}
Widget
build
(
BuildContext
context
)
{
Edge
Dims
padding
=
MediaQuery
.
of
(
context
)?.
padding
??
EdgeDim
s
.
zero
;
Edge
Insets
padding
=
MediaQuery
.
of
(
context
)?.
padding
??
EdgeInset
s
.
zero
;
if
(
_snackBars
.
length
>
0
)
{
ModalRoute
<
dynamic
>
route
=
ModalRoute
.
of
(
context
);
...
...
@@ -538,7 +538,7 @@ class ScaffoldState extends State<Scaffold> {
new
CustomMultiChildLayout
(
children:
children
,
delegate:
new
_ScaffoldLayout
(
padding:
Edge
Dim
s
.
zero
padding:
Edge
Inset
s
.
zero
)
),
new
Positioned
(
...
...
packages/flutter/lib/src/material/snack_bar.dart
View file @
e71bd77e
...
...
@@ -51,7 +51,7 @@ class SnackBarAction extends StatelessComponent {
Widget
build
(
BuildContext
context
)
{
return
new
Container
(
margin:
const
Edge
Dim
s
.
only
(
left:
_kSideMargins
),
margin:
const
Edge
Inset
s
.
only
(
left:
_kSideMargins
),
child:
new
FlatButton
(
onPressed:
onPressed
,
textTheme:
ButtonColor
.
accent
,
...
...
@@ -91,7 +91,7 @@ class SnackBar extends StatelessComponent {
List
<
Widget
>
children
=
<
Widget
>[
new
Flexible
(
child:
new
Container
(
margin:
const
Edge
Dim
s
.
symmetric
(
vertical:
_kSingleLineVerticalPadding
),
margin:
const
Edge
Inset
s
.
symmetric
(
vertical:
_kSingleLineVerticalPadding
),
child:
new
DefaultTextStyle
(
style:
Typography
.
white
.
subhead
,
child:
content
...
...
@@ -120,7 +120,7 @@ class SnackBar extends StatelessComponent {
elevation:
6
,
color:
_kSnackBackground
,
child:
new
Container
(
margin:
const
Edge
Dim
s
.
symmetric
(
horizontal:
_kSideMargins
),
margin:
const
Edge
Inset
s
.
symmetric
(
horizontal:
_kSideMargins
),
child:
new
Theme
(
data:
new
ThemeData
(
brightness:
ThemeBrightness
.
dark
,
...
...
packages/flutter/lib/src/material/tabs.dart
View file @
e71bd77e
...
...
@@ -28,7 +28,7 @@ const double _kTextAndIconTabHeight = 72.0;
const
double
_kTabIndicatorHeight
=
2.0
;
const
double
_kMinTabWidth
=
72.0
;
const
double
_kMaxTabWidth
=
264.0
;
const
Edge
Dims
_kTabLabelPadding
=
const
EdgeDim
s
.
symmetric
(
horizontal:
12.0
);
const
Edge
Insets
_kTabLabelPadding
=
const
EdgeInset
s
.
symmetric
(
horizontal:
12.0
);
const
double
_kTabBarScrollDrag
=
0.025
;
const
Duration
_kTabBarScroll
=
const
Duration
(
milliseconds:
300
);
...
...
@@ -342,7 +342,7 @@ class _Tab extends StatelessComponent {
children:
<
Widget
>[
new
Container
(
child:
_buildLabelIcon
(
context
),
margin:
const
Edge
Dim
s
.
only
(
bottom:
10.0
)
margin:
const
Edge
Inset
s
.
only
(
bottom:
10.0
)
),
_buildLabelText
()
],
...
...
@@ -988,7 +988,7 @@ class TabPageSelector<T> extends StatelessComponent {
return
new
Container
(
width:
12.0
,
height:
12.0
,
margin:
new
Edge
Dim
s
.
all
(
4.0
),
margin:
new
Edge
Inset
s
.
all
(
4.0
),
decoration:
new
BoxDecoration
(
backgroundColor:
background
,
border:
new
Border
.
all
(
color:
selectedColor
.
end
),
...
...
packages/flutter/lib/src/material/time_picker.dart
View file @
e71bd77e
...
...
@@ -126,7 +126,7 @@ class _TimePickerState extends State<TimePicker> {
new
AspectRatio
(
aspectRatio:
1.0
,
child:
new
Container
(
margin:
const
Edge
Dim
s
.
all
(
12.0
),
margin:
const
Edge
Inset
s
.
all
(
12.0
),
child:
new
_Dial
(
mode:
_mode
,
selectedTime:
config
.
selectedTime
,
...
...
@@ -214,12 +214,12 @@ class _TimePickerHeader extends StatelessComponent {
onTap:
_handleChangeDayPeriod
,
behavior:
HitTestBehavior
.
opaque
,
child:
new
Container
(
padding:
const
Edge
Dim
s
.
only
(
left:
16.0
,
right:
24.0
),
padding:
const
Edge
Inset
s
.
only
(
left:
16.0
,
right:
24.0
),
child:
new
Column
(
children:
<
Widget
>[
new
Text
(
'AM'
,
style:
amStyle
),
new
Container
(
padding:
const
Edge
Dim
s
.
only
(
top:
4.0
),
padding:
const
Edge
Inset
s
.
only
(
top:
4.0
),
child:
new
Text
(
'PM'
,
style:
pmStyle
)
),
],
...
...
packages/flutter/lib/src/material/time_picker_dialog.dart
View file @
e71bd77e
...
...
@@ -49,7 +49,7 @@ class _TimePickerDialogState extends State<_TimePickerDialog> {
selectedTime:
_selectedTime
,
onChanged:
_handleTimeChanged
),
contentPadding:
Edge
Dim
s
.
zero
,
contentPadding:
Edge
Inset
s
.
zero
,
actions:
<
Widget
>[
new
FlatButton
(
child:
new
Text
(
'CANCEL'
),
...
...
packages/flutter/lib/src/material/tool_bar.dart
View file @
e71bd77e
...
...
@@ -23,7 +23,7 @@ class ToolBar extends StatelessComponent {
this
.
elevation
:
4
,
this
.
backgroundColor
,
this
.
textTheme
,
this
.
padding
:
Edge
Dim
s
.
zero
this
.
padding
:
Edge
Inset
s
.
zero
})
:
super
(
key:
key
)
{
assert
((
flexibleSpace
!=
null
)
?
tabBar
==
null
:
true
);
assert
((
tabBar
!=
null
)
?
flexibleSpace
==
null
:
true
);
...
...
@@ -38,7 +38,7 @@ class ToolBar extends StatelessComponent {
final
int
elevation
;
final
Color
backgroundColor
;
final
TextTheme
textTheme
;
final
Edge
Dim
s
padding
;
final
Edge
Inset
s
padding
;
ToolBar
copyWith
({
Key
key
,
...
...
@@ -50,7 +50,7 @@ class ToolBar extends StatelessComponent {
int
elevation
,
Color
backgroundColor
,
TextTheme
textTheme
,
Edge
Dim
s
padding
Edge
Inset
s
padding
})
{
return
new
ToolBar
(
key:
key
??
this
.
key
,
...
...
@@ -103,7 +103,7 @@ class ToolBar extends StatelessComponent {
toolBarRow
.
add
(
new
Flexible
(
child:
new
Padding
(
padding:
new
Edge
Dim
s
.
only
(
left:
24.0
),
padding:
new
Edge
Inset
s
.
only
(
left:
24.0
),
child:
center
!=
null
?
new
DefaultTextStyle
(
style:
centerStyle
,
child:
center
)
:
null
)
)
...
...
@@ -111,7 +111,7 @@ class ToolBar extends StatelessComponent {
if
(
right
!=
null
)
toolBarRow
.
addAll
(
right
);
Edge
Dims
combinedPadding
=
new
EdgeDim
s
.
symmetric
(
horizontal:
8.0
);
Edge
Insets
combinedPadding
=
new
EdgeInset
s
.
symmetric
(
horizontal:
8.0
);
if
(
padding
!=
null
)
combinedPadding
+=
padding
;
...
...
@@ -121,7 +121,7 @@ class ToolBar extends StatelessComponent {
final
Widget
toolBar
=
new
ConstrainedBox
(
constraints:
new
BoxConstraints
(
maxHeight:
toolBarHeight
),
child:
new
Padding
(
padding:
new
Edge
Dim
s
.
only
(
left:
combinedPadding
.
left
,
right:
combinedPadding
.
right
),
padding:
new
Edge
Inset
s
.
only
(
left:
combinedPadding
.
left
,
right:
combinedPadding
.
right
),
child:
new
ClipRect
(
child:
new
OverflowBox
(
alignment:
const
FractionalOffset
(
0.0
,
1.0
),
// bottom justify
...
...
@@ -130,7 +130,7 @@ class ToolBar extends StatelessComponent {
child:
new
DefaultTextStyle
(
style:
sideStyle
,
child:
new
Padding
(
padding:
new
Edge
Dim
s
.
only
(
top:
combinedPadding
.
top
,
bottom:
combinedPadding
.
bottom
),
padding:
new
Edge
Inset
s
.
only
(
top:
combinedPadding
.
top
,
bottom:
combinedPadding
.
bottom
),
child:
new
Row
(
children:
toolBarRow
)
)
)
...
...
packages/flutter/lib/src/material/tooltip.dart
View file @
e71bd77e
...
...
@@ -12,9 +12,9 @@ import 'theme.dart';
const
double
_kDefaultTooltipBorderRadius
=
2.0
;
const
double
_kDefaultTooltipHeight
=
32.0
;
const
Edge
Dims
_kDefaultTooltipPadding
=
const
EdgeDim
s
.
symmetric
(
horizontal:
16.0
);
const
Edge
Insets
_kDefaultTooltipPadding
=
const
EdgeInset
s
.
symmetric
(
horizontal:
16.0
);
const
double
_kDefaultVerticalTooltipOffset
=
24.0
;
const
Edge
Dims
_kDefaultTooltipScreenEdgeMargin
=
const
EdgeDim
s
.
all
(
10.0
);
const
Edge
Insets
_kDefaultTooltipScreenEdgeMargin
=
const
EdgeInset
s
.
all
(
10.0
);
const
Duration
_kDefaultTooltipFadeDuration
=
const
Duration
(
milliseconds:
200
);
const
Duration
_kDefaultTooltipShowDuration
=
const
Duration
(
seconds:
2
);
...
...
@@ -56,9 +56,9 @@ class Tooltip extends StatefulComponent {
final
double
opacity
;
final
double
borderRadius
;
final
double
height
;
final
Edge
Dim
s
padding
;
final
Edge
Inset
s
padding
;
final
double
verticalOffset
;
final
Edge
Dim
s
screenEdgeMargin
;
final
Edge
Inset
s
screenEdgeMargin
;
final
bool
preferBelow
;
final
Duration
fadeDuration
;
final
Duration
showDuration
;
...
...
@@ -198,7 +198,7 @@ class _TooltipPositionDelegate extends OneChildLayoutDelegate {
});
final
Point
target
;
final
double
verticalOffset
;
final
Edge
Dim
s
screenEdgeMargin
;
final
Edge
Inset
s
screenEdgeMargin
;
final
bool
preferBelow
;
BoxConstraints
getConstraintsForChild
(
BoxConstraints
constraints
)
=>
constraints
.
loosen
();
...
...
@@ -257,11 +257,11 @@ class _TooltipOverlay extends StatelessComponent {
final
double
opacity
;
final
double
borderRadius
;
final
double
height
;
final
Edge
Dim
s
padding
;
final
Edge
Inset
s
padding
;
final
Animation
<
double
>
animation
;
final
Point
target
;
final
double
verticalOffset
;
final
Edge
Dim
s
screenEdgeMargin
;
final
Edge
Inset
s
screenEdgeMargin
;
final
bool
preferBelow
;
Widget
build
(
BuildContext
context
)
{
...
...
packages/flutter/lib/src/painting/box_painter.dart
View file @
e71bd77e
...
...
@@ -9,9 +9,9 @@ import 'package:flutter/services.dart';
import
'basic_types.dart'
;
import
'decoration.dart'
;
import
'edge_
dim
s.dart'
;
import
'edge_
inset
s.dart'
;
export
'edge_
dims.dart'
show
EdgeDim
s
;
export
'edge_
insets.dart'
show
EdgeInset
s
;
/// A side of a border of a box.
class
BorderSide
{
...
...
@@ -93,9 +93,9 @@ class Border {
/// The left side of this border.
final
BorderSide
left
;
/// The widths of the sides of this border represented as an Edge
Dim
s.
Edge
Dim
s
get
dimensions
{
return
new
Edge
Dim
s
.
TRBL
(
top
.
width
,
right
.
width
,
bottom
.
width
,
left
.
width
);
/// The widths of the sides of this border represented as an Edge
Inset
s.
Edge
Inset
s
get
dimensions
{
return
new
Edge
Inset
s
.
TRBL
(
top
.
width
,
right
.
width
,
bottom
.
width
,
left
.
width
);
}
Border
scale
(
double
t
)
{
...
...
@@ -797,7 +797,7 @@ class BoxDecoration extends Decoration {
final
BoxShape
shape
;
/// The inset space occupied by the border.
Edge
Dim
s
get
padding
=>
border
?.
dimensions
;
Edge
Inset
s
get
padding
=>
border
?.
dimensions
;
/// Returns a new box decoration that is scaled by the given factor.
BoxDecoration
scale
(
double
factor
)
{
...
...
packages/flutter/lib/src/painting/decoration.dart
View file @
e71bd77e
...
...
@@ -3,16 +3,16 @@
// found in the LICENSE file.
import
'basic_types.dart'
;
import
'edge_
dim
s.dart'
;
import
'edge_
inset
s.dart'
;
export
'edge_
dims.dart'
show
EdgeDim
s
;
export
'edge_
insets.dart'
show
EdgeInset
s
;
// This group of classes is intended for painting in cartesian coordinates.
abstract
class
Decoration
{
const
Decoration
();
bool
debugAssertValid
()
=>
true
;
Edge
Dim
s
get
padding
=>
null
;
Edge
Inset
s
get
padding
=>
null
;
Decoration
lerpFrom
(
Decoration
a
,
double
t
)
=>
this
;
Decoration
lerpTo
(
Decoration
b
,
double
t
)
=>
b
;
bool
hitTest
(
Size
size
,
Point
position
)
=>
true
;
...
...
packages/flutter/lib/src/painting/edge_
dim
s.dart
→
packages/flutter/lib/src/painting/edge_
inset
s.dart
View file @
e71bd77e
...
...
@@ -10,22 +10,22 @@ import 'basic_types.dart';
///
/// Typically used for an offset from each of the four sides of a box. For
/// example, the padding inside a box can be represented using this class.
class
Edge
Dim
s
{
/// Constructs
an EdgeDim
s from offsets from the top, right, bottom and left.
const
Edge
Dim
s
.
TRBL
(
this
.
top
,
this
.
right
,
this
.
bottom
,
this
.
left
);
class
Edge
Inset
s
{
/// Constructs
inset
s from offsets from the top, right, bottom and left.
const
Edge
Inset
s
.
TRBL
(
this
.
top
,
this
.
right
,
this
.
bottom
,
this
.
left
);
/// Constructs
an EdgeDim
s where all the offsets are value.
const
Edge
Dim
s
.
all
(
double
value
)
/// Constructs
inset
s where all the offsets are value.
const
Edge
Inset
s
.
all
(
double
value
)
:
top
=
value
,
right
=
value
,
bottom
=
value
,
left
=
value
;
/// Constructs
an EdgeDim
s with only the given values non-zero.
const
Edge
Dim
s
.
only
({
this
.
top
:
0.0
,
/// Constructs
inset
s with only the given values non-zero.
const
Edge
Inset
s
.
only
({
this
.
top
:
0.0
,
this
.
right
:
0.0
,
this
.
bottom
:
0.0
,
this
.
left
:
0.0
});
/// Constructs
an EdgeDim
s with symmetrical vertical and horizontal offsets.
const
Edge
Dim
s
.
symmetric
({
double
vertical:
0.0
,
/// Constructs
inset
s with symmetrical vertical and horizontal offsets.
const
Edge
Inset
s
.
symmetric
({
double
vertical:
0.0
,
double
horizontal:
0.0
})
:
top
=
vertical
,
left
=
horizontal
,
bottom
=
vertical
,
right
=
horizontal
;
...
...
@@ -50,18 +50,18 @@ class EdgeDims {
/// The total offset in the horizontal direction.
double
get
vertical
=>
top
+
bottom
;
/// The size that this Edge
Dim
s would occupy with an empty interior.
/// The size that this Edge
Inset
s would occupy with an empty interior.
Size
get
collapsedSize
=>
new
Size
(
horizontal
,
vertical
);
/// An Edge
Dim
s with top and bottom as well as left and right flipped.
Edge
Dims
get
flipped
=>
new
EdgeDim
s
.
TRBL
(
bottom
,
left
,
top
,
right
);
/// An Edge
Inset
s with top and bottom as well as left and right flipped.
Edge
Insets
get
flipped
=>
new
EdgeInset
s
.
TRBL
(
bottom
,
left
,
top
,
right
);
Rect
inflateRect
(
Rect
rect
)
{
return
new
Rect
.
fromLTRB
(
rect
.
left
-
left
,
rect
.
top
-
top
,
rect
.
right
+
right
,
rect
.
bottom
+
bottom
);
}
Edge
Dims
operator
-(
EdgeDim
s
other
)
{
return
new
Edge
Dim
s
.
TRBL
(
Edge
Insets
operator
-(
EdgeInset
s
other
)
{
return
new
Edge
Inset
s
.
TRBL
(
top
-
other
.
top
,
right
-
other
.
right
,
bottom
-
other
.
bottom
,
...
...
@@ -69,8 +69,8 @@ class EdgeDims {
);
}
Edge
Dims
operator
+(
EdgeDim
s
other
)
{
return
new
Edge
Dim
s
.
TRBL
(
Edge
Insets
operator
+(
EdgeInset
s
other
)
{
return
new
Edge
Inset
s
.
TRBL
(
top
+
other
.
top
,
right
+
other
.
right
,
bottom
+
other
.
bottom
,
...
...
@@ -78,8 +78,8 @@ class EdgeDims {
);
}
Edge
Dim
s
operator
*(
double
other
)
{
return
new
Edge
Dim
s
.
TRBL
(
Edge
Inset
s
operator
*(
double
other
)
{
return
new
Edge
Inset
s
.
TRBL
(
top
*
other
,
right
*
other
,
bottom
*
other
,
...
...
@@ -87,8 +87,8 @@ class EdgeDims {
);
}
Edge
Dim
s
operator
/(
double
other
)
{
return
new
Edge
Dim
s
.
TRBL
(
Edge
Inset
s
operator
/(
double
other
)
{
return
new
Edge
Inset
s
.
TRBL
(
top
/
other
,
right
/
other
,
bottom
/
other
,
...
...
@@ -96,8 +96,8 @@ class EdgeDims {
);
}
Edge
Dim
s
operator
~/(
double
other
)
{
return
new
Edge
Dim
s
.
TRBL
(
Edge
Inset
s
operator
~/(
double
other
)
{
return
new
Edge
Inset
s
.
TRBL
(
(
top
~/
other
).
toDouble
(),
(
right
~/
other
).
toDouble
(),
(
bottom
~/
other
).
toDouble
(),
...
...
@@ -105,8 +105,8 @@ class EdgeDims {
);
}
Edge
Dim
s
operator
%(
double
other
)
{
return
new
Edge
Dim
s
.
TRBL
(
Edge
Inset
s
operator
%(
double
other
)
{
return
new
Edge
Inset
s
.
TRBL
(
top
%
other
,
right
%
other
,
bottom
%
other
,
...
...
@@ -114,17 +114,17 @@ class EdgeDims {
);
}
/// Linearly interpolate between two Edge
Dim
s.
/// Linearly interpolate between two Edge
Inset
s.
///
/// If either is null, this function interpolates from [Edge
Dim
s.zero].
static
Edge
Dims
lerp
(
EdgeDims
a
,
EdgeDim
s
b
,
double
t
)
{
/// If either is null, this function interpolates from [Edge
Inset
s.zero].
static
Edge
Insets
lerp
(
EdgeInsets
a
,
EdgeInset
s
b
,
double
t
)
{
if
(
a
==
null
&&
b
==
null
)
return
null
;
if
(
a
==
null
)
return
b
*
t
;
if
(
b
==
null
)
return
a
*
(
1.0
-
t
);
return
new
Edge
Dim
s
.
TRBL
(
return
new
Edge
Inset
s
.
TRBL
(
ui
.
lerpDouble
(
a
.
top
,
b
.
top
,
t
),
ui
.
lerpDouble
(
a
.
right
,
b
.
right
,
t
),
ui
.
lerpDouble
(
a
.
bottom
,
b
.
bottom
,
t
),
...
...
@@ -132,15 +132,15 @@ class EdgeDims {
);
}
/// An Edge
Dim
s with zero offsets in each direction.
static
const
Edge
Dims
zero
=
const
EdgeDim
s
.
TRBL
(
0.0
,
0.0
,
0.0
,
0.0
);
/// An Edge
Inset
s with zero offsets in each direction.
static
const
Edge
Insets
zero
=
const
EdgeInset
s
.
TRBL
(
0.0
,
0.0
,
0.0
,
0.0
);
bool
operator
==(
dynamic
other
)
{
if
(
identical
(
this
,
other
))
return
true
;
if
(
other
is
!
Edge
Dim
s
)
if
(
other
is
!
Edge
Inset
s
)
return
false
;
final
Edge
Dim
s
typedOther
=
other
;
final
Edge
Inset
s
typedOther
=
other
;
return
top
==
typedOther
.
top
&&
right
==
typedOther
.
right
&&
bottom
==
typedOther
.
bottom
&&
...
...
@@ -149,5 +149,5 @@ class EdgeDims {
int
get
hashCode
=>
hashValues
(
top
,
left
,
bottom
,
right
);
String
toString
()
=>
"Edge
Dim
s(
$top
,
$right
,
$bottom
,
$left
)"
;
String
toString
()
=>
"Edge
Inset
s(
$top
,
$right
,
$bottom
,
$left
)"
;
}
packages/flutter/lib/src/rendering/box.dart
View file @
e71bd77e
...
...
@@ -107,7 +107,7 @@ class BoxConstraints extends Constraints {
}
/// Returns new box constraints that are smaller by the given edge dimensions.
BoxConstraints
deflate
(
Edge
Dim
s
edges
)
{
BoxConstraints
deflate
(
Edge
Inset
s
edges
)
{
assert
(
edges
!=
null
);
assert
(
debugAssertIsNormalized
);
double
horizontal
=
edges
.
left
+
edges
.
right
;
...
...
packages/flutter/lib/src/rendering/grid.dart
View file @
e71bd77e
...
...
@@ -40,7 +40,7 @@ class GridSpecification {
this
.
rowOffsets
,
this
.
columnSpacing
:
0.0
,
this
.
rowSpacing
:
0.0
,
this
.
padding
:
Edge
Dim
s
.
zero
this
.
padding
:
Edge
Inset
s
.
zero
})
{
assert
(
_debugIsMonotonic
(
columnOffsets
));
assert
(
_debugIsMonotonic
(
rowOffsets
));
...
...
@@ -61,7 +61,7 @@ class GridSpecification {
int
rowCount
,
this
.
rowSpacing
:
0.0
,
this
.
columnSpacing
:
0.0
,
this
.
padding
:
Edge
Dim
s
.
zero
this
.
padding
:
Edge
Inset
s
.
zero
})
:
columnOffsets
=
_generateRegularOffsets
(
columnCount
,
tileWidth
),
rowOffsets
=
_generateRegularOffsets
(
rowCount
,
tileHeight
)
{
assert
(
_debugIsMonotonic
(
columnOffsets
));
...
...
@@ -105,7 +105,7 @@ class GridSpecification {
///
/// The grid's size encloses the spaced rows and columns and is then inflated
/// by the padding.
final
Edge
Dim
s
padding
;
final
Edge
Inset
s
padding
;
/// The size of the grid.
Size
get
gridSize
=>
new
Size
(
columnOffsets
.
last
+
padding
.
horizontal
,
rowOffsets
.
last
+
padding
.
vertical
);
...
...
@@ -189,7 +189,7 @@ abstract class GridDelegateWithInOrderChildPlacement extends GridDelegate {
GridDelegateWithInOrderChildPlacement
({
this
.
columnSpacing
:
0.0
,
this
.
rowSpacing
:
0.0
,
this
.
padding
:
Edge
Dim
s
.
zero
this
.
padding
:
Edge
Inset
s
.
zero
})
{
assert
(
columnSpacing
!=
null
&&
columnSpacing
>=
0.0
);
assert
(
rowSpacing
!=
null
&&
rowSpacing
>=
0.0
);
...
...
@@ -203,7 +203,7 @@ abstract class GridDelegateWithInOrderChildPlacement extends GridDelegate {
final
double
rowSpacing
;
// Insets for the entire grid.
final
Edge
Dim
s
padding
;
final
Edge
Inset
s
padding
;
GridChildPlacement
getChildPlacement
(
GridSpecification
specification
,
int
index
,
Object
placementData
)
{
final
int
columnCount
=
specification
.
columnOffsets
.
length
-
1
;
...
...
@@ -227,7 +227,7 @@ class FixedColumnCountGridDelegate extends GridDelegateWithInOrderChildPlacement
this
.
columnCount
,
double
columnSpacing:
0.0
,
double
rowSpacing:
0.0
,
Edge
Dims
padding:
EdgeDim
s
.
zero
,
Edge
Insets
padding:
EdgeInset
s
.
zero
,
this
.
tileAspectRatio
:
1.0
})
:
super
(
columnSpacing:
columnSpacing
,
rowSpacing:
rowSpacing
,
padding:
padding
)
{
assert
(
columnCount
!=
null
&&
columnCount
>=
0
);
...
...
@@ -285,7 +285,7 @@ class MaxTileWidthGridDelegate extends GridDelegateWithInOrderChildPlacement {
this
.
tileAspectRatio
:
1.0
,
double
columnSpacing:
0.0
,
double
rowSpacing:
0.0
,
Edge
Dims
padding:
EdgeDim
s
.
zero
Edge
Insets
padding:
EdgeInset
s
.
zero
})
:
super
(
columnSpacing:
columnSpacing
,
rowSpacing:
rowSpacing
,
padding:
padding
)
{
assert
(
maxTileWidth
!=
null
&&
maxTileWidth
>=
0.0
);
assert
(
tileAspectRatio
!=
null
&&
tileAspectRatio
>
0.0
);
...
...
packages/flutter/lib/src/rendering/list.dart
View file @
e71bd77e
...
...
@@ -15,7 +15,7 @@ class RenderList extends RenderVirtualViewport<ListParentData> {
RenderList
({
List
<
RenderBox
>
children
,
double
itemExtent
,
Edge
Dim
s
padding
,
Edge
Inset
s
padding
,
int
virtualChildCount
,
Offset
paintOffset:
Offset
.
zero
,
Axis
mainAxis:
Axis
.
vertical
,
...
...
@@ -45,9 +45,9 @@ class RenderList extends RenderVirtualViewport<ListParentData> {
markNeedsLayout
();
}
Edge
Dim
s
get
padding
=>
_padding
;
Edge
Dim
s
_padding
;
void
set
padding
(
Edge
Dim
s
newValue
)
{
Edge
Inset
s
get
padding
=>
_padding
;
Edge
Inset
s
_padding
;
void
set
padding
(
Edge
Inset
s
newValue
)
{
if
(
_padding
==
newValue
)
return
;
_padding
=
newValue
;
...
...
packages/flutter/lib/src/rendering/shifted_box.dart
View file @
e71bd77e
...
...
@@ -84,7 +84,7 @@ abstract class RenderShiftedBox extends RenderBox with RenderObjectWithChildMixi
/// padding, effectively creating empty space around the child.
class
RenderPadding
extends
RenderShiftedBox
{
RenderPadding
({
Edge
Dim
s
padding
,
Edge
Inset
s
padding
,
RenderBox
child
})
:
_padding
=
padding
,
super
(
child
)
{
assert
(
padding
!=
null
);
...
...
@@ -92,9 +92,9 @@ class RenderPadding extends RenderShiftedBox {
}
/// The amount to pad the child in each dimension.
Edge
Dim
s
get
padding
=>
_padding
;
Edge
Dim
s
_padding
;
void
set
padding
(
Edge
Dim
s
value
)
{
Edge
Inset
s
get
padding
=>
_padding
;
Edge
Inset
s
_padding
;
void
set
padding
(
Edge
Inset
s
value
)
{
assert
(
value
!=
null
);
assert
(
value
.
isNonNegative
);
if
(
_padding
==
value
)
...
...
packages/flutter/lib/src/widgets/app.dart
View file @
e71bd77e
...
...
@@ -108,8 +108,8 @@ class WidgetsApp extends StatefulComponent {
WidgetsAppState
<
WidgetsApp
>
createState
()
=>
new
WidgetsAppState
<
WidgetsApp
>();
}
Edge
Dim
s
_getPadding
(
ui
.
WindowPadding
padding
)
{
return
new
Edge
Dim
s
.
TRBL
(
padding
.
top
,
padding
.
right
,
padding
.
bottom
,
padding
.
left
);
Edge
Inset
s
_getPadding
(
ui
.
WindowPadding
padding
)
{
return
new
Edge
Inset
s
.
TRBL
(
padding
.
top
,
padding
.
right
,
padding
.
bottom
,
padding
.
left
);
}
class
WidgetsAppState
<
T
extends
WidgetsApp
>
extends
State
<
T
>
implements
BindingObserver
{
...
...
packages/flutter/lib/src/widgets/basic.dart
View file @
e71bd77e
...
...
@@ -354,7 +354,7 @@ class Padding extends OneChildRenderObjectWidget {
}
/// The amount to pad the child in each dimension.
final
Edge
Dim
s
padding
;
final
Edge
Inset
s
padding
;
RenderPadding
createRenderObject
(
BuildContext
context
)
=>
new
RenderPadding
(
padding:
padding
);
...
...
@@ -926,18 +926,18 @@ class Container extends StatelessComponent {
final
Decoration
foregroundDecoration
;
/// Empty space to surround the decoration.
final
Edge
Dim
s
margin
;
final
Edge
Inset
s
margin
;
/// Empty space to inscribe inside the decoration.
final
Edge
Dim
s
padding
;
final
Edge
Inset
s
padding
;
/// The transformation matrix to apply before painting the container.
final
Matrix4
transform
;
Edge
Dim
s
get
_paddingIncludingDecoration
{
Edge
Inset
s
get
_paddingIncludingDecoration
{
if
(
decoration
==
null
||
decoration
.
padding
==
null
)
return
padding
;
Edge
Dim
s
decorationPadding
=
decoration
.
padding
;
Edge
Inset
s
decorationPadding
=
decoration
.
padding
;
if
(
padding
==
null
)
return
decorationPadding
;
return
padding
+
decorationPadding
;
...
...
@@ -949,7 +949,7 @@ class Container extends StatelessComponent {
if
(
child
==
null
&&
(
constraints
==
null
||
!
constraints
.
isTight
))
current
=
new
ConstrainedBox
(
constraints:
const
BoxConstraints
.
expand
());
Edge
Dim
s
effectivePadding
=
_paddingIncludingDecoration
;
Edge
Inset
s
effectivePadding
=
_paddingIncludingDecoration
;
if
(
effectivePadding
!=
null
)
current
=
new
Padding
(
padding:
effectivePadding
,
child:
current
);
...
...
@@ -1248,7 +1248,7 @@ class FixedColumnCountGrid extends GridRenderObjectWidgetBase {
this
.
columnSpacing
,
this
.
rowSpacing
,
this
.
tileAspectRatio
:
1.0
,
this
.
padding
:
Edge
Dim
s
.
zero
this
.
padding
:
Edge
Inset
s
.
zero
})
:
super
(
key:
key
,
children:
children
)
{
assert
(
columnCount
!=
null
);
}
...
...
@@ -1266,7 +1266,7 @@ class FixedColumnCountGrid extends GridRenderObjectWidgetBase {
final
double
tileAspectRatio
;
/// The amount of padding to apply to each child.
final
Edge
Dim
s
padding
;
final
Edge
Inset
s
padding
;
FixedColumnCountGridDelegate
createDelegate
()
{
return
new
FixedColumnCountGridDelegate
(
...
...
@@ -1290,7 +1290,7 @@ class MaxTileWidthGrid extends GridRenderObjectWidgetBase {
this
.
columnSpacing
,
this
.
rowSpacing
,
this
.
tileAspectRatio
:
1.0
,
this
.
padding
:
Edge
Dim
s
.
zero
this
.
padding
:
Edge
Inset
s
.
zero
})
:
super
(
key:
key
,
children:
children
)
{
assert
(
maxTileWidth
!=
null
);
}
...
...
@@ -1308,7 +1308,7 @@ class MaxTileWidthGrid extends GridRenderObjectWidgetBase {
final
double
rowSpacing
;
/// The amount of padding to apply to each child.
final
Edge
Dim
s
padding
;
final
Edge
Inset
s
padding
;
MaxTileWidthGridDelegate
createDelegate
()
{
return
new
MaxTileWidthGridDelegate
(
...
...
packages/flutter/lib/src/widgets/focus.dart
View file @
e71bd77e
...
...
@@ -280,7 +280,7 @@ class _FocusState extends State<Focus> {
}
Size
_mediaSize
;
Edge
Dim
s
_mediaPadding
;
Edge
Inset
s
_mediaPadding
;
void
_ensureVisibleIfFocused
()
{
if
(!
Focus
.
_atScope
(
context
))
...
...
@@ -295,7 +295,7 @@ class _FocusState extends State<Focus> {
MediaQueryData
data
=
MediaQuery
.
of
(
context
);
if
(
data
!=
null
)
{
Size
newMediaSize
=
data
.
size
;
Edge
Dim
s
newMediaPadding
=
data
.
padding
;
Edge
Inset
s
newMediaPadding
=
data
.
padding
;
if
(
newMediaSize
!=
_mediaSize
||
newMediaPadding
!=
_mediaPadding
)
{
_mediaSize
=
newMediaSize
;
_mediaPadding
=
newMediaPadding
;
...
...
packages/flutter/lib/src/widgets/implicit_animations.dart
View file @
e71bd77e
...
...
@@ -27,11 +27,11 @@ class DecorationTween extends Tween<Decoration> {
}
}
/// An interpolation between two [Edge
Dim
s]s.
class
Edge
DimsTween
extends
Tween
<
EdgeDim
s
>
{
Edge
DimsTween
({
EdgeDims
begin
,
EdgeDim
s
end
})
:
super
(
begin:
begin
,
end:
end
);
/// An interpolation between two [Edge
Inset
s]s.
class
Edge
InsetsTween
extends
Tween
<
EdgeInset
s
>
{
Edge
InsetsTween
({
EdgeInsets
begin
,
EdgeInset
s
end
})
:
super
(
begin:
begin
,
end:
end
);
Edge
Dims
lerp
(
double
t
)
=>
EdgeDim
s
.
lerp
(
begin
,
end
,
t
);
Edge
Insets
lerp
(
double
t
)
=>
EdgeInset
s
.
lerp
(
begin
,
end
,
t
);
}
/// An interpolation between two [Matrix4]s.
...
...
@@ -215,10 +215,10 @@ class AnimatedContainer extends AnimatedWidgetBase {
final
Decoration
foregroundDecoration
;
/// Empty space to surround the decoration.
final
Edge
Dim
s
margin
;
final
Edge
Inset
s
margin
;
/// Empty space to inscribe inside the decoration.
final
Edge
Dim
s
padding
;
final
Edge
Inset
s
padding
;
/// The transformation matrix to apply before painting the container.
final
Matrix4
transform
;
...
...
@@ -256,8 +256,8 @@ class _AnimatedContainerState extends AnimatedWidgetBaseState<AnimatedContainer>
BoxConstraintsTween
_constraints
;
DecorationTween
_decoration
;
DecorationTween
_foregroundDecoration
;
Edge
Dim
sTween
_margin
;
Edge
Dim
sTween
_padding
;
Edge
Inset
sTween
_margin
;
Edge
Inset
sTween
_padding
;
Matrix4Tween
_transform
;
Tween
<
double
>
_width
;
Tween
<
double
>
_height
;
...
...
@@ -267,8 +267,8 @@ class _AnimatedContainerState extends AnimatedWidgetBaseState<AnimatedContainer>
_constraints
=
visitor
(
_constraints
,
config
.
constraints
,
(
dynamic
value
)
=>
new
BoxConstraintsTween
(
begin:
value
));
_decoration
=
visitor
(
_decoration
,
config
.
decoration
,
(
dynamic
value
)
=>
new
DecorationTween
(
begin:
value
));
_foregroundDecoration
=
visitor
(
_foregroundDecoration
,
config
.
foregroundDecoration
,
(
dynamic
value
)
=>
new
DecorationTween
(
begin:
value
));
_margin
=
visitor
(
_margin
,
config
.
margin
,
(
dynamic
value
)
=>
new
Edge
Dim
sTween
(
begin:
value
));
_padding
=
visitor
(
_padding
,
config
.
padding
,
(
dynamic
value
)
=>
new
Edge
Dim
sTween
(
begin:
value
));
_margin
=
visitor
(
_margin
,
config
.
margin
,
(
dynamic
value
)
=>
new
Edge
Inset
sTween
(
begin:
value
));
_padding
=
visitor
(
_padding
,
config
.
padding
,
(
dynamic
value
)
=>
new
Edge
Inset
sTween
(
begin:
value
));
_transform
=
visitor
(
_transform
,
config
.
transform
,
(
dynamic
value
)
=>
new
Matrix4Tween
(
begin:
value
));
_width
=
visitor
(
_width
,
config
.
width
,
(
dynamic
value
)
=>
new
Tween
<
double
>(
begin:
value
));
_height
=
visitor
(
_height
,
config
.
height
,
(
dynamic
value
)
=>
new
Tween
<
double
>(
begin:
value
));
...
...
packages/flutter/lib/src/widgets/media_query.dart
View file @
e71bd77e
...
...
@@ -27,7 +27,7 @@ class MediaQueryData {
final
double
devicePixelRatio
;
/// The padding around the edges of the media (e.g., the screen).
final
Edge
Dim
s
padding
;
final
Edge
Inset
s
padding
;
/// The orientation of the media (e.g., whether the device is in landscape or portrait mode).
Orientation
get
orientation
{
...
...
packages/flutter/lib/src/widgets/scrollable.dart
View file @
e71bd77e
...
...
@@ -684,7 +684,7 @@ class Block extends StatelessComponent {
}
final
List
<
Widget
>
children
;
final
Edge
Dim
s
padding
;
final
Edge
Inset
s
padding
;
final
double
initialScrollOffset
;
final
Axis
scrollDirection
;
final
ViewportAnchor
scrollAnchor
;
...
...
packages/flutter/lib/src/widgets/scrollable_list.dart
View file @
e71bd77e
...
...
@@ -37,7 +37,7 @@ class ScrollableList extends Scrollable {
final
double
itemExtent
;
final
bool
itemsWrap
;
final
Edge
Dim
s
padding
;
final
Edge
Inset
s
padding
;
final
ScrollableListPainter
scrollableListPainter
;
final
Iterable
<
Widget
>
children
;
...
...
@@ -110,7 +110,7 @@ class _VirtualListViewport extends VirtualViewport {
final
ViewportAnchor
anchor
;
final
double
itemExtent
;
final
bool
itemsWrap
;
final
Edge
Dim
s
padding
;
final
Edge
Inset
s
padding
;
final
RenderObjectPainter
overlayPainter
;
double
get
_leadingPadding
{
...
...
@@ -180,7 +180,7 @@ class _VirtualListViewportElement extends VirtualViewportElement {
void
layout
(
BoxConstraints
constraints
)
{
final
int
length
=
renderObject
.
virtualChildCount
;
final
double
itemExtent
=
widget
.
itemExtent
;
final
Edge
Dims
padding
=
widget
.
padding
??
EdgeDim
s
.
zero
;
final
Edge
Insets
padding
=
widget
.
padding
??
EdgeInset
s
.
zero
;
final
Size
containerSize
=
renderObject
.
size
;
double
containerExtent
;
...
...
@@ -250,7 +250,7 @@ class ListViewport extends _VirtualListViewport with VirtualViewportFromIterable
ViewportAnchor
anchor:
ViewportAnchor
.
start
,
double
itemExtent
,
bool
itemsWrap:
false
,
Edge
Dim
s
padding
,
Edge
Inset
s
padding
,
RenderObjectPainter
overlayPainter
,
this
.
children
})
:
super
(
...
...
@@ -301,7 +301,7 @@ class ScrollableLazyList extends Scrollable {
final
double
itemExtent
;
final
int
itemCount
;
final
ItemListBuilder
itemBuilder
;
final
Edge
Dim
s
padding
;
final
Edge
Inset
s
padding
;
final
ScrollableListPainter
scrollableListPainter
;
ScrollableState
createState
()
=>
new
_ScrollableLazyListState
();
...
...
@@ -359,7 +359,7 @@ class LazyListViewport extends _VirtualListViewport with VirtualViewportFromBuil
Axis
mainAxis:
Axis
.
vertical
,
ViewportAnchor
anchor:
ViewportAnchor
.
start
,
double
itemExtent
,
Edge
Dim
s
padding
,
Edge
Inset
s
padding
,
RenderObjectPainter
overlayPainter
,
this
.
itemCount
,
this
.
itemBuilder
...
...
packages/flutter/test/painting/edge_
dim
s_test.dart
→
packages/flutter/test/painting/edge_
inset
s_test.dart
View file @
e71bd77e
...
...
@@ -7,12 +7,12 @@ import 'package:flutter/painting.dart';
import
'package:test/test.dart'
;
void
main
(
)
{
test
(
"Edge
Dim
s.lerp()"
,
()
{
Edge
Dims
a
=
new
EdgeDim
s
.
all
(
10.0
);
Edge
Dims
b
=
new
EdgeDim
s
.
all
(
20.0
);
expect
(
Edge
Dim
s
.
lerp
(
a
,
b
,
0.25
),
equals
(
a
*
1.25
));
expect
(
Edge
Dim
s
.
lerp
(
a
,
b
,
0.25
),
equals
(
b
*
0.625
));
expect
(
Edge
Dims
.
lerp
(
a
,
b
,
0.25
),
equals
(
a
+
const
EdgeDim
s
.
all
(
2.5
)));
expect
(
Edge
Dims
.
lerp
(
a
,
b
,
0.25
),
equals
(
b
-
const
EdgeDim
s
.
all
(
7.5
)));
test
(
"Edge
Inset
s.lerp()"
,
()
{
Edge
Insets
a
=
new
EdgeInset
s
.
all
(
10.0
);
Edge
Insets
b
=
new
EdgeInset
s
.
all
(
20.0
);
expect
(
Edge
Inset
s
.
lerp
(
a
,
b
,
0.25
),
equals
(
a
*
1.25
));
expect
(
Edge
Inset
s
.
lerp
(
a
,
b
,
0.25
),
equals
(
b
*
0.625
));
expect
(
Edge
Insets
.
lerp
(
a
,
b
,
0.25
),
equals
(
a
+
const
EdgeInset
s
.
all
(
2.5
)));
expect
(
Edge
Insets
.
lerp
(
a
,
b
,
0.25
),
equals
(
b
-
const
EdgeInset
s
.
all
(
7.5
)));
});
}
packages/flutter/test/rendering/box_test.dart
View file @
e71bd77e
...
...
@@ -34,7 +34,7 @@ void main() {
child:
size
);
RenderBox
padding
=
new
RenderPadding
(
padding:
new
Edge
Dim
s
.
all
(
50.0
),
padding:
new
Edge
Inset
s
.
all
(
50.0
),
child:
inner
);
RenderBox
flex
=
new
RenderFlex
(
...
...
@@ -67,7 +67,7 @@ void main() {
RenderBox
coloredBox
=
new
RenderDecoratedBox
(
decoration:
new
BoxDecoration
()
);
RenderBox
paddingBox
=
new
RenderPadding
(
padding:
const
Edge
Dim
s
.
all
(
10.0
),
RenderBox
paddingBox
=
new
RenderPadding
(
padding:
const
Edge
Inset
s
.
all
(
10.0
),
child:
coloredBox
);
RenderBox
root
=
new
RenderDecoratedBox
(
decoration:
new
BoxDecoration
(),
...
...
@@ -82,7 +82,7 @@ void main() {
RenderDecoratedBox
coloredBox
=
new
RenderDecoratedBox
(
decoration:
new
BoxDecoration
());
RenderPadding
paddedBox
=
new
RenderPadding
(
child:
coloredBox
,
padding:
const
Edge
Dim
s
.
all
(
10.0
));
child:
coloredBox
,
padding:
const
Edge
Inset
s
.
all
(
10.0
));
layout
(
paddedBox
);
...
...
packages/flutter/test/widget/asset_vendor_test.dart
View file @
e71bd77e
...
...
@@ -83,7 +83,7 @@ Widget buildImageAtRatio(String image, Key key, double ratio, bool inferSize) {
data:
new
MediaQueryData
(
size:
const
Size
(
windowSize
,
windowSize
),
devicePixelRatio:
ratio
,
padding:
const
Edge
Dim
s
.
all
(
0.0
)
padding:
const
Edge
Inset
s
.
all
(
0.0
)
),
child:
new
AssetVendor
(
bundle:
new
TestAssetBundle
(),
...
...
packages/flutter/test/widget/bottom_sheet_test.dart
View file @
e71bd77e
...
...
@@ -81,7 +81,7 @@ void main() {
scaffoldKey
.
currentState
.
showBottomSheet
((
BuildContext
context
)
{
return
new
Container
(
margin:
new
Edge
Dim
s
.
all
(
40.0
),
margin:
new
Edge
Inset
s
.
all
(
40.0
),
child:
new
Text
(
'BottomSheet'
)
);
}).
closed
.
then
((
_
)
{
...
...
packages/flutter/test/widget/box_decoration_test.dart
View file @
e71bd77e
...
...
@@ -12,7 +12,7 @@ void main() {
testWidgets
((
WidgetTester
tester
)
{
tester
.
pumpWidget
(
new
Container
(
padding:
new
Edge
Dim
s
.
all
(
50.0
),
padding:
new
Edge
Inset
s
.
all
(
50.0
),
decoration:
new
BoxDecoration
(
shape:
BoxShape
.
circle
,
border:
new
Border
.
all
(
width:
10.0
,
color:
const
Color
(
0x80FF00FF
)),
...
...
packages/flutter/test/widget/dismissable_test.dart
View file @
e71bd77e
...
...
@@ -39,7 +39,7 @@ Widget buildDismissableItem(int item) {
Widget
widgetBuilder
(
)
{
return
new
Container
(
padding:
const
Edge
Dim
s
.
all
(
10.0
),
padding:
const
Edge
Inset
s
.
all
(
10.0
),
child:
new
ScrollableList
(
scrollDirection:
scrollDirection
,
itemExtent:
itemExtent
,
...
...
packages/flutter/test/widget/scrollable_list_hit_testing_test.dart
View file @
e71bd77e
...
...
@@ -100,7 +100,7 @@ void main() {
new
ScrollableList
(
key:
new
GlobalKey
(),
itemExtent:
290.0
,
padding:
new
Edge
Dim
s
.
TRBL
(
20.0
,
15.0
,
10.0
,
5.0
),
padding:
new
Edge
Inset
s
.
TRBL
(
20.0
,
15.0
,
10.0
,
5.0
),
children:
items
.
map
((
int
item
)
{
return
new
Container
(
child:
new
GestureDetector
(
...
...
@@ -135,7 +135,7 @@ void main() {
key:
new
GlobalKey
(),
itemExtent:
290.0
,
scrollAnchor:
ViewportAnchor
.
end
,
padding:
new
Edge
Dim
s
.
TRBL
(
20.0
,
15.0
,
10.0
,
5.0
),
padding:
new
Edge
Inset
s
.
TRBL
(
20.0
,
15.0
,
10.0
,
5.0
),
children:
items
.
map
((
int
item
)
{
return
new
Container
(
child:
new
GestureDetector
(
...
...
packages/flutter/test/widget/scrollable_list_vertical_test.dart
View file @
e71bd77e
...
...
@@ -71,7 +71,7 @@ void main() {
tester
.
pumpWidget
(
new
ScrollableList
(
itemExtent:
290.0
,
padding:
new
Edge
Dim
s
.
only
(
top:
250.0
),
padding:
new
Edge
Inset
s
.
only
(
top:
250.0
),
scrollDirection:
Axis
.
vertical
,
children:
items
.
map
((
int
item
)
{
return
new
Container
(
...
...
packages/flutter/test/widget/tooltip_test.dart
View file @
e71bd77e
...
...
@@ -28,9 +28,9 @@ void main() {
key:
key
,
message:
'TIP'
,
height:
20.0
,
padding:
const
Edge
Dim
s
.
all
(
5.0
),
padding:
const
Edge
Inset
s
.
all
(
5.0
),
verticalOffset:
20.0
,
screenEdgeMargin:
const
Edge
Dim
s
.
all
(
10.0
),
screenEdgeMargin:
const
Edge
Inset
s
.
all
(
10.0
),
preferBelow:
false
,
fadeDuration:
const
Duration
(
seconds:
1
),
showDuration:
const
Duration
(
seconds:
2
),
...
...
@@ -82,9 +82,9 @@ void main() {
key:
key
,
message:
'TIP'
,
height:
100.0
,
padding:
const
Edge
Dim
s
.
all
(
0.0
),
padding:
const
Edge
Inset
s
.
all
(
0.0
),
verticalOffset:
100.0
,
screenEdgeMargin:
const
Edge
Dim
s
.
all
(
100.0
),
screenEdgeMargin:
const
Edge
Inset
s
.
all
(
100.0
),
preferBelow:
false
,
fadeDuration:
const
Duration
(
seconds:
1
),
showDuration:
const
Duration
(
seconds:
2
),
...
...
@@ -138,9 +138,9 @@ void main() {
key:
key
,
message:
'TIP'
,
height:
100.0
,
padding:
const
Edge
Dim
s
.
all
(
0.0
),
padding:
const
Edge
Inset
s
.
all
(
0.0
),
verticalOffset:
100.0
,
screenEdgeMargin:
const
Edge
Dim
s
.
all
(
100.0
),
screenEdgeMargin:
const
Edge
Inset
s
.
all
(
100.0
),
preferBelow:
false
,
fadeDuration:
const
Duration
(
seconds:
1
),
showDuration:
const
Duration
(
seconds:
2
),
...
...
@@ -205,9 +205,9 @@ void main() {
key:
key
,
message:
'TIP'
,
height:
100.0
,
padding:
const
Edge
Dim
s
.
all
(
0.0
),
padding:
const
Edge
Inset
s
.
all
(
0.0
),
verticalOffset:
100.0
,
screenEdgeMargin:
const
Edge
Dim
s
.
all
(
100.0
),
screenEdgeMargin:
const
Edge
Inset
s
.
all
(
100.0
),
preferBelow:
true
,
fadeDuration:
const
Duration
(
seconds:
1
),
showDuration:
const
Duration
(
seconds:
2
),
...
...
@@ -260,9 +260,9 @@ void main() {
key:
key
,
message:
'TIP'
,
height:
10.0
,
padding:
const
Edge
Dim
s
.
all
(
0.0
),
padding:
const
Edge
Inset
s
.
all
(
0.0
),
verticalOffset:
10.0
,
screenEdgeMargin:
const
Edge
Dim
s
.
all
(
10.0
),
screenEdgeMargin:
const
Edge
Inset
s
.
all
(
10.0
),
preferBelow:
true
,
fadeDuration:
const
Duration
(
seconds:
1
),
showDuration:
const
Duration
(
seconds:
2
),
...
...
@@ -317,9 +317,9 @@ void main() {
key:
key
,
message:
'TIP'
,
height:
10.0
,
padding:
const
Edge
Dim
s
.
all
(
0.0
),
padding:
const
Edge
Inset
s
.
all
(
0.0
),
verticalOffset:
10.0
,
screenEdgeMargin:
const
Edge
Dim
s
.
all
(
10.0
),
screenEdgeMargin:
const
Edge
Inset
s
.
all
(
10.0
),
preferBelow:
true
,
fadeDuration:
const
Duration
(
seconds:
1
),
showDuration:
const
Duration
(
seconds:
2
),
...
...
packages/flutter_markdown/lib/src/markdown.dart
View file @
e71bd77e
...
...
@@ -68,7 +68,7 @@ class MarkdownBody extends MarkdownBodyRaw {
///
/// new ScrollableViewport(
/// child: new Padding(
/// padding: new Edge
Dim
s.all(16.0),
/// padding: new Edge
Inset
s.all(16.0),
/// child: new Markdown(data: markdownSource)
/// )
/// )
...
...
packages/flutter_markdown/lib/src/markdown_raw.dart
View file @
e71bd77e
...
...
@@ -29,7 +29,7 @@ class MarkdownRaw extends StatelessComponent {
this
.
data
,
this
.
markdownStyle
,
this
.
syntaxHighlighter
,
this
.
padding
:
const
Edge
Dim
s
.
all
(
16.0
),
this
.
padding
:
const
Edge
Inset
s
.
all
(
16.0
),
this
.
onTapLink
});
...
...
@@ -43,7 +43,7 @@ class MarkdownRaw extends StatelessComponent {
final
SyntaxHighlighter
syntaxHighlighter
;
/// Padding used
final
Edge
Dim
s
padding
;
final
Edge
Inset
s
padding
;
/// Callback when a link is tapped
final
MarkdownLinkCallback
onTapLink
;
...
...
@@ -94,7 +94,7 @@ class MarkdownBodyRaw extends StatefulComponent {
///
/// new ScrollableViewport(
/// child: new Padding(
/// padding: new Edge
Dim
s.all(16.0),
/// padding: new Edge
Inset
s.all(16.0),
/// child: new MarkdownBodyRaw(
/// data: markdownSource,
/// markdownStyle: myStyle
...
...
@@ -382,7 +382,7 @@ class _Block {
}
else
{
bullet
=
new
Padding
(
padding:
new
Edge
Dim
s
.
only
(
right:
5.0
),
padding:
new
Edge
Inset
s
.
only
(
right:
5.0
),
child:
new
Text
(
"
${blockPosition + 1}
."
,
style:
new
TextStyle
(
textAlign:
TextAlign
.
right
)
...
...
@@ -404,19 +404,19 @@ class _Block {
}
BoxDecoration
decoration
;
Edge
Dim
s
padding
;
Edge
Inset
s
padding
;
if
(
tag
==
'blockquote'
)
{
decoration
=
markdownStyle
.
blockquoteDecoration
;
padding
=
new
Edge
Dim
s
.
all
(
markdownStyle
.
blockquotePadding
);
padding
=
new
Edge
Inset
s
.
all
(
markdownStyle
.
blockquotePadding
);
}
else
if
(
tag
==
'pre'
)
{
decoration
=
markdownStyle
.
codeblockDecoration
;
padding
=
new
Edge
Dim
s
.
all
(
markdownStyle
.
codeblockPadding
);
padding
=
new
Edge
Inset
s
.
all
(
markdownStyle
.
codeblockPadding
);
}
return
new
Container
(
padding:
padding
,
margin:
new
Edge
Dim
s
.
only
(
bottom:
spacing
),
margin:
new
Edge
Inset
s
.
only
(
bottom:
spacing
),
child:
contents
,
decoration:
decoration
);
...
...
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