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
27b5fc14
Commit
27b5fc14
authored
Oct 19, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Scaffold should wrap its body in a Material
Fixes #1669
parent
88bcfa2d
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
216 additions
and
250 deletions
+216
-250
main.dart
examples/address_book/lib/main.dart
+14
-16
feed.dart
examples/fitness/lib/feed.dart
+14
-19
meal.dart
examples/fitness/lib/meal.dart
+11
-13
measurement.dart
examples/fitness/lib/measurement.dart
+20
-22
settings.dart
examples/fitness/lib/settings.dart
+21
-23
stock_list.dart
examples/stocks/lib/stock_list.dart
+10
-12
stock_settings.dart
examples/stocks/lib/stock_settings.dart
+27
-29
stock_symbol_viewer.dart
examples/stocks/lib/stock_symbol_viewer.dart
+15
-17
date_picker.dart
examples/widgets/date_picker.dart
+4
-6
drag_and_drop.dart
examples/widgets/drag_and_drop.dart
+18
-20
indexed_stack.dart
examples/widgets/indexed_stack.dart
+5
-8
overlay_geometry.dart
examples/widgets/overlay_geometry.dart
+0
-1
pageable_list.dart
examples/widgets/pageable_list.dart
+1
-4
progress_indicator.dart
examples/widgets/progress_indicator.dart
+0
-1
scale.dart
examples/widgets/scale.dart
+4
-6
scrollbar.dart
examples/widgets/scrollbar.dart
+0
-1
sector.dart
examples/widgets/sector.dart
+46
-48
tabs.dart
examples/widgets/tabs.dart
+2
-3
scaffold.dart
packages/flutter/lib/src/material/scaffold.dart
+4
-1
No files found.
examples/address_book/lib/main.dart
View file @
27b5fc14
...
...
@@ -60,22 +60,20 @@ class AddressBookHome extends StatelessComponent {
static
final
GlobalKey
noteKey
=
new
GlobalKey
(
label:
'note field'
);
Widget
buildBody
(
BuildContext
context
)
{
return
new
Material
(
child:
new
Block
([
new
AspectRatio
(
aspectRatio:
16.0
/
9.0
,
child:
new
Container
(
decoration:
new
BoxDecoration
(
backgroundColor:
Colors
.
purple
[
300
])
)
),
new
Field
(
inputKey:
nameKey
,
icon:
"social/person"
,
placeholder:
"Name"
),
new
Field
(
inputKey:
phoneKey
,
icon:
"communication/phone"
,
placeholder:
"Phone"
),
new
Field
(
inputKey:
emailKey
,
icon:
"communication/email"
,
placeholder:
"Email"
),
new
Field
(
inputKey:
addressKey
,
icon:
"maps/place"
,
placeholder:
"Address"
),
new
Field
(
inputKey:
ringtoneKey
,
icon:
"av/volume_up"
,
placeholder:
"Ringtone"
),
new
Field
(
inputKey:
noteKey
,
icon:
"content/add"
,
placeholder:
"Add note"
),
])
);
return
new
Block
([
new
AspectRatio
(
aspectRatio:
16.0
/
9.0
,
child:
new
Container
(
decoration:
new
BoxDecoration
(
backgroundColor:
Colors
.
purple
[
300
])
)
),
new
Field
(
inputKey:
nameKey
,
icon:
"social/person"
,
placeholder:
"Name"
),
new
Field
(
inputKey:
phoneKey
,
icon:
"communication/phone"
,
placeholder:
"Phone"
),
new
Field
(
inputKey:
emailKey
,
icon:
"communication/email"
,
placeholder:
"Email"
),
new
Field
(
inputKey:
addressKey
,
icon:
"maps/place"
,
placeholder:
"Address"
),
new
Field
(
inputKey:
ringtoneKey
,
icon:
"av/volume_up"
,
placeholder:
"Ringtone"
),
new
Field
(
inputKey:
noteKey
,
icon:
"content/add"
,
placeholder:
"Add note"
),
]);
}
Widget
build
(
BuildContext
context
)
{
...
...
examples/fitness/lib/feed.dart
View file @
27b5fc14
...
...
@@ -14,13 +14,11 @@ class FitnessItemList extends StatelessComponent {
final
FitnessItemHandler
onDismissed
;
Widget
build
(
BuildContext
context
)
{
return
new
Material
(
child:
new
ScrollableList
<
FitnessItem
>(
padding:
const
EdgeDims
.
all
(
4.0
),
items:
items
,
itemExtent:
kFitnessItemHeight
,
itemBuilder:
(
_
,
item
)
=>
item
.
toRow
(
onDismissed:
onDismissed
)
)
return
new
ScrollableList
<
FitnessItem
>(
padding:
const
EdgeDims
.
all
(
4.0
),
items:
items
,
itemExtent:
kFitnessItemHeight
,
itemBuilder:
(
_
,
item
)
=>
item
.
toRow
(
onDismissed:
onDismissed
)
);
}
}
...
...
@@ -171,14 +169,13 @@ class FeedFragmentState extends State<FeedFragment> {
Widget
buildBody
()
{
TextStyle
style
=
Theme
.
of
(
context
).
text
.
title
;
if
(
config
.
userData
==
null
)
return
new
Material
();
if
(
config
.
userData
.
items
.
length
==
0
)
return
new
Material
(
child:
new
Row
(
[
new
Text
(
"No data yet.
\n
Add some!"
,
style:
style
)],
justifyContent:
FlexJustifyContent
.
center
)
return
new
Container
();
if
(
config
.
userData
.
items
.
length
==
0
)
{
return
new
Row
(
[
new
Text
(
"No data yet.
\n
Add some!"
,
style:
style
)],
justifyContent:
FlexJustifyContent
.
center
);
}
switch
(
_fitnessMode
)
{
case
FitnessMode
.
feed
:
return
new
FitnessItemList
(
...
...
@@ -186,11 +183,9 @@ class FeedFragmentState extends State<FeedFragment> {
onDismissed:
_handleItemDismissed
);
case
FitnessMode
.
chart
:
return
new
Material
(
child:
new
Container
(
padding:
const
EdgeDims
.
all
(
20.0
),
child:
buildChart
()
)
return
new
Container
(
padding:
const
EdgeDims
.
all
(
20.0
),
child:
buildChart
()
);
}
}
...
...
examples/fitness/lib/meal.dart
View file @
27b5fc14
...
...
@@ -85,19 +85,17 @@ class MealFragmentState extends State<MealFragment> {
Widget
buildBody
()
{
Meal
meal
=
new
Meal
(
when:
new
DateTime
.
now
());
return
new
Material
(
child:
new
ScrollableViewport
(
child:
new
Container
(
padding:
const
EdgeDims
.
all
(
20.0
),
child:
new
BlockBody
([
new
Text
(
meal
.
displayDate
),
new
Input
(
key:
descriptionKey
,
placeholder:
'Describe meal'
,
onChanged:
_handleDescriptionChanged
),
])
)
return
new
ScrollableViewport
(
child:
new
Container
(
padding:
const
EdgeDims
.
all
(
20.0
),
child:
new
BlockBody
([
new
Text
(
meal
.
displayDate
),
new
Input
(
key:
descriptionKey
,
placeholder:
'Describe meal'
,
onChanged:
_handleDescriptionChanged
),
])
)
);
}
...
...
examples/fitness/lib/measurement.dart
View file @
27b5fc14
...
...
@@ -172,28 +172,26 @@ class MeasurementFragmentState extends State<MeasurementFragment> {
Widget
buildBody
(
BuildContext
context
)
{
Measurement
measurement
=
new
Measurement
(
when:
_when
);
// TODO(jackson): Revisit the layout of this pane to be more maintainable
return
new
Material
(
child:
new
Container
(
padding:
const
EdgeDims
.
all
(
20.0
),
child:
new
Column
([
new
GestureDetector
(
onTap:
_handleDatePressed
,
child:
new
Container
(
height:
50.0
,
child:
new
Column
([
new
Text
(
'Measurement Date'
),
new
Text
(
measurement
.
displayDate
,
style:
Theme
.
of
(
context
).
text
.
caption
),
],
alignItems:
FlexAlignItems
.
start
)
)
),
new
Input
(
key:
weightKey
,
placeholder:
'Enter weight'
,
keyboardType:
KeyboardType
.
NUMBER
,
onChanged:
_handleWeightChanged
),
],
alignItems:
FlexAlignItems
.
stretch
)
)
return
new
Container
(
padding:
const
EdgeDims
.
all
(
20.0
),
child:
new
Column
([
new
GestureDetector
(
onTap:
_handleDatePressed
,
child:
new
Container
(
height:
50.0
,
child:
new
Column
([
new
Text
(
'Measurement Date'
),
new
Text
(
measurement
.
displayDate
,
style:
Theme
.
of
(
context
).
text
.
caption
),
],
alignItems:
FlexAlignItems
.
start
)
)
),
new
Input
(
key:
weightKey
,
placeholder:
'Enter weight'
,
keyboardType:
KeyboardType
.
NUMBER
,
onChanged:
_handleWeightChanged
),
],
alignItems:
FlexAlignItems
.
stretch
)
);
}
...
...
examples/fitness/lib/settings.dart
View file @
27b5fc14
...
...
@@ -92,29 +92,27 @@ class SettingsFragmentState extends State<SettingsFragment> {
}
Widget
buildSettingsPane
(
BuildContext
context
)
{
return
new
Material
(
child:
new
ScrollableViewport
(
child:
new
Container
(
padding:
const
EdgeDims
.
symmetric
(
vertical:
20.0
),
child:
new
BlockBody
([
new
DrawerItem
(
onPressed:
()
{
_handleBackupChanged
(!(
config
.
userData
.
backupMode
==
BackupMode
.
enabled
));
},
child:
new
Row
([
new
Flexible
(
child:
new
Text
(
'Back up data to the cloud'
)),
new
Switch
(
value:
config
.
userData
.
backupMode
==
BackupMode
.
enabled
,
onChanged:
_handleBackupChanged
),
])
),
new
DrawerItem
(
onPressed:
()
=>
_handleGoalWeightPressed
(),
child:
new
Column
([
new
Text
(
'Goal Weight'
),
new
Text
(
goalWeightText
,
style:
Theme
.
of
(
context
).
text
.
caption
),
],
alignItems:
FlexAlignItems
.
start
)
),
])
)
return
new
ScrollableViewport
(
child:
new
Container
(
padding:
const
EdgeDims
.
symmetric
(
vertical:
20.0
),
child:
new
BlockBody
([
new
DrawerItem
(
onPressed:
()
{
_handleBackupChanged
(!(
config
.
userData
.
backupMode
==
BackupMode
.
enabled
));
},
child:
new
Row
([
new
Flexible
(
child:
new
Text
(
'Back up data to the cloud'
)),
new
Switch
(
value:
config
.
userData
.
backupMode
==
BackupMode
.
enabled
,
onChanged:
_handleBackupChanged
),
])
),
new
DrawerItem
(
onPressed:
()
=>
_handleGoalWeightPressed
(),
child:
new
Column
([
new
Text
(
'Goal Weight'
),
new
Text
(
goalWeightText
,
style:
Theme
.
of
(
context
).
text
.
caption
),
],
alignItems:
FlexAlignItems
.
start
)
),
])
)
);
}
...
...
examples/stocks/lib/stock_list.dart
View file @
27b5fc14
...
...
@@ -12,18 +12,16 @@ class StockList extends StatelessComponent {
final
StockRowActionCallback
onAction
;
Widget
build
(
BuildContext
context
)
{
return
new
Material
(
child:
new
ScrollableList
<
Stock
>(
items:
stocks
,
itemExtent:
StockRow
.
kHeight
,
itemBuilder:
(
BuildContext
context
,
Stock
stock
)
{
return
new
StockRow
(
stock:
stock
,
onPressed:
onOpen
,
onLongPressed:
onAction
);
}
)
return
new
ScrollableList
<
Stock
>(
items:
stocks
,
itemExtent:
StockRow
.
kHeight
,
itemBuilder:
(
BuildContext
context
,
Stock
stock
)
{
return
new
StockRow
(
stock:
stock
,
onPressed:
onOpen
,
onLongPressed:
onAction
);
}
);
}
}
examples/stocks/lib/stock_settings.dart
View file @
27b5fc14
...
...
@@ -83,35 +83,33 @@ class StockSettingsState extends State<StockSettings> {
Widget
buildSettingsPane
(
BuildContext
context
)
{
// TODO(ianh): Once we have the gesture API hooked up, fix https://github.com/domokit/mojo/issues/281
// (whereby tapping the widgets below causes both the widget and the menu item to fire their callbacks)
return
new
Material
(
child:
new
ScrollableViewport
(
child:
new
Container
(
padding:
const
EdgeDims
.
symmetric
(
vertical:
20.0
),
child:
new
BlockBody
(<
Widget
>[
new
DrawerItem
(
icon:
'action/thumb_up'
,
onPressed:
()
=>
_confirmOptimismChange
(),
child:
new
Row
(<
Widget
>[
new
Flexible
(
child:
new
Text
(
'Everything is awesome'
)),
new
Checkbox
(
value:
config
.
optimism
==
StockMode
.
optimistic
,
onChanged:
(
bool
value
)
=>
_confirmOptimismChange
()
),
])
),
new
DrawerItem
(
icon:
'action/backup'
,
onPressed:
()
{
_handleBackupChanged
(!(
config
.
backup
==
BackupMode
.
enabled
));
},
child:
new
Row
(<
Widget
>[
new
Flexible
(
child:
new
Text
(
'Back up stock list to the cloud'
)),
new
Switch
(
value:
config
.
backup
==
BackupMode
.
enabled
,
onChanged:
_handleBackupChanged
),
])
),
])
)
return
new
ScrollableViewport
(
child:
new
Container
(
padding:
const
EdgeDims
.
symmetric
(
vertical:
20.0
),
child:
new
BlockBody
(<
Widget
>[
new
DrawerItem
(
icon:
'action/thumb_up'
,
onPressed:
()
=>
_confirmOptimismChange
(),
child:
new
Row
(<
Widget
>[
new
Flexible
(
child:
new
Text
(
'Everything is awesome'
)),
new
Checkbox
(
value:
config
.
optimism
==
StockMode
.
optimistic
,
onChanged:
(
bool
value
)
=>
_confirmOptimismChange
()
),
])
),
new
DrawerItem
(
icon:
'action/backup'
,
onPressed:
()
{
_handleBackupChanged
(!(
config
.
backup
==
BackupMode
.
enabled
));
},
child:
new
Row
(<
Widget
>[
new
Flexible
(
child:
new
Text
(
'Back up stock list to the cloud'
)),
new
Switch
(
value:
config
.
backup
==
BackupMode
.
enabled
,
onChanged:
_handleBackupChanged
),
])
),
])
)
);
}
...
...
examples/stocks/lib/stock_symbol_viewer.dart
View file @
27b5fc14
...
...
@@ -32,24 +32,22 @@ class StockSymbolViewerState extends State<StockSymbolViewer> {
),
center:
new
Text
(
'
${config.stock.name}
(
${config.stock.symbol}
)'
)
),
body:
new
Material
(
child:
new
Block
(<
Widget
>[
new
Container
(
padding:
new
EdgeDims
.
all
(
20.0
),
child:
new
Column
(<
Widget
>[
new
Text
(
'Last Sale'
,
style:
headings
),
new
Text
(
'
$lastSale
(
$changeInPrice
)'
),
new
Container
(
height:
8.0
),
new
Text
(
'Market Cap'
,
style:
headings
),
new
Text
(
'
${config.stock.marketCap}
'
),
],
alignItems:
FlexAlignItems
.
stretch
)
body:
new
Block
(<
Widget
>[
new
Container
(
padding:
new
EdgeDims
.
all
(
20.0
),
child:
new
Column
(<
Widget
>[
new
Text
(
'Last Sale'
,
style:
headings
),
new
Text
(
'
$lastSale
(
$changeInPrice
)'
),
new
Container
(
height:
8.0
),
new
Text
(
'Market Cap'
,
style:
headings
),
new
Text
(
'
${config.stock.marketCap}
'
),
],
alignItems:
FlexAlignItems
.
stretch
)
]
)
)
)
]
)
);
}
...
...
examples/widgets/date_picker.dart
View file @
27b5fc14
...
...
@@ -34,12 +34,10 @@ class DatePickerDemoState extends State<DatePickerDemo> {
child:
new
Stack
([
new
Scaffold
(
toolBar:
new
ToolBar
(
center:
new
Text
(
"Date Picker"
)),
body:
new
Material
(
child:
new
Row
(
[
new
Text
(
_dateTime
.
toString
())],
alignItems:
FlexAlignItems
.
end
,
justifyContent:
FlexJustifyContent
.
center
)
body:
new
Row
(
[
new
Text
(
_dateTime
.
toString
())],
alignItems:
FlexAlignItems
.
end
,
justifyContent:
FlexJustifyContent
.
center
)
),
new
Dialog
(
...
...
examples/widgets/drag_and_drop.dart
View file @
27b5fc14
...
...
@@ -103,26 +103,24 @@ class DragAndDropAppState extends State<DragAndDropApp> {
toolBar:
new
ToolBar
(
center:
new
Text
(
'Drag and Drop Flutter Demo'
)
),
body:
new
Material
(
child:
new
DefaultTextStyle
(
style:
Theme
.
of
(
context
).
text
.
body1
.
copyWith
(
textAlign:
TextAlign
.
center
),
child:
new
Column
([
new
Flexible
(
child:
new
Row
([
new
ExampleDragSource
(
navigator:
config
.
navigator
,
name:
'Orange'
,
color:
const
Color
(
0xFFFF9000
)),
new
ExampleDragSource
(
navigator:
config
.
navigator
,
name:
'Teal'
,
color:
const
Color
(
0xFF00FFFF
)),
new
ExampleDragSource
(
navigator:
config
.
navigator
,
name:
'Yellow'
,
color:
const
Color
(
0xFFFFF000
)),
],
alignItems:
FlexAlignItems
.
center
,
justifyContent:
FlexJustifyContent
.
spaceAround
)),
new
Flexible
(
child:
new
Row
([
new
Flexible
(
child:
new
ExampleDragTarget
()),
new
Flexible
(
child:
new
ExampleDragTarget
()),
new
Flexible
(
child:
new
ExampleDragTarget
()),
new
Flexible
(
child:
new
ExampleDragTarget
()),
])),
])
)
body:
new
DefaultTextStyle
(
style:
Theme
.
of
(
context
).
text
.
body1
.
copyWith
(
textAlign:
TextAlign
.
center
),
child:
new
Column
([
new
Flexible
(
child:
new
Row
([
new
ExampleDragSource
(
navigator:
config
.
navigator
,
name:
'Orange'
,
color:
const
Color
(
0xFFFF9000
)),
new
ExampleDragSource
(
navigator:
config
.
navigator
,
name:
'Teal'
,
color:
const
Color
(
0xFF00FFFF
)),
new
ExampleDragSource
(
navigator:
config
.
navigator
,
name:
'Yellow'
,
color:
const
Color
(
0xFFFFF000
)),
],
alignItems:
FlexAlignItems
.
center
,
justifyContent:
FlexJustifyContent
.
spaceAround
)),
new
Flexible
(
child:
new
Row
([
new
Flexible
(
child:
new
ExampleDragTarget
()),
new
Flexible
(
child:
new
ExampleDragTarget
()),
new
Flexible
(
child:
new
ExampleDragTarget
()),
new
Flexible
(
child:
new
ExampleDragTarget
()),
])),
])
)
);
}
...
...
examples/widgets/indexed_stack.dart
View file @
27b5fc14
...
...
@@ -40,14 +40,11 @@ class IndexedStackDemoState extends State<IndexedStackDemo> {
toolBar:
new
ToolBar
(
center:
new
Text
(
'IndexedStackDemo Demo'
)),
body:
new
GestureDetector
(
onTap:
_handleTap
,
child:
new
Container
(
decoration:
new
BoxDecoration
(
backgroundColor:
Theme
.
of
(
context
).
primarySwatch
[
50
]),
child:
new
Center
(
child:
new
Container
(
child:
indexedStack
,
padding:
const
EdgeDims
.
all
(
8.0
),
decoration:
new
BoxDecoration
(
border:
new
Border
.
all
(
color:
Theme
.
of
(
context
).
accentColor
))
)
child:
new
Center
(
child:
new
Container
(
child:
indexedStack
,
padding:
const
EdgeDims
.
all
(
8.0
),
decoration:
new
BoxDecoration
(
border:
new
Border
.
all
(
color:
Theme
.
of
(
context
).
accentColor
))
)
)
)
...
...
examples/widgets/overlay_geometry.dart
View file @
27b5fc14
...
...
@@ -139,7 +139,6 @@ class OverlayGeometryAppState extends State<OverlayGeometryApp> {
toolBar:
new
ToolBar
(
center:
new
Text
(
'Tap a Card'
)),
body:
new
Container
(
padding:
const
EdgeDims
.
symmetric
(
vertical:
12.0
,
horizontal:
8.0
),
decoration:
new
BoxDecoration
(
backgroundColor:
Theme
.
of
(
context
).
primarySwatch
[
50
]),
child:
new
ScrollableMixedWidgetList
(
builder:
builder
,
token:
cardModels
.
length
,
...
...
examples/widgets/pageable_list.dart
View file @
27b5fc14
...
...
@@ -137,10 +137,7 @@ class PageableListAppState extends State<PageableListApp> {
);
return
new
SizeObserver
(
callback:
updatePageSize
,
child:
new
Container
(
child:
list
,
decoration:
new
BoxDecoration
(
backgroundColor:
Theme
.
of
(
context
).
primarySwatch
[
50
])
)
child:
list
);
}
...
...
examples/widgets/progress_indicator.dart
View file @
27b5fc14
...
...
@@ -82,7 +82,6 @@ class ProgressIndicatorAppState extends State<ProgressIndicatorApp> {
onTap:
handleTap
,
child:
new
Container
(
padding:
const
EdgeDims
.
symmetric
(
vertical:
12.0
,
horizontal:
8.0
),
decoration:
new
BoxDecoration
(
backgroundColor:
Theme
.
of
(
context
).
cardColor
),
child:
new
BuilderTransition
(
variables:
[
valueAnimation
.
variable
],
performance:
valueAnimation
.
view
,
...
...
examples/widgets/scale.dart
View file @
27b5fc14
...
...
@@ -60,12 +60,10 @@ class ScaleAppState extends State<ScaleApp> {
child:
new
Scaffold
(
toolBar:
new
ToolBar
(
center:
new
Text
(
'Scale Demo'
)),
body:
new
Material
(
child:
new
GestureDetector
(
onScaleStart:
_handleScaleStart
,
onScaleUpdate:
_handleScaleUpdate
,
child:
new
CustomPaint
(
callback:
paint
,
token:
"
$_zoom
$_offset
"
)
)
body:
new
GestureDetector
(
onScaleStart:
_handleScaleStart
,
onScaleUpdate:
_handleScaleUpdate
,
child:
new
CustomPaint
(
callback:
paint
,
token:
"
$_zoom
$_offset
"
)
)
)
);
...
...
examples/widgets/scrollbar.dart
View file @
27b5fc14
...
...
@@ -49,7 +49,6 @@ class ScrollbarAppState extends State<ScrollbarApp> {
return
new
Scaffold
(
toolBar:
new
ToolBar
(
center:
new
Text
(
'Scrollbar Demo'
)),
body:
new
Container
(
decoration:
new
BoxDecoration
(
backgroundColor:
Theme
.
of
(
context
).
primarySwatch
[
50
]),
padding:
new
EdgeDims
.
all
(
12.0
),
child:
new
Center
(
child:
new
Card
(
child:
scrollable
))
)
...
...
examples/widgets/sector.dart
View file @
27b5fc14
...
...
@@ -68,56 +68,54 @@ class SectorAppState extends State<SectorApp> {
}
Widget
buildBody
()
{
return
new
Material
(
child:
new
Column
(<
Widget
>[
new
Container
(
padding:
new
EdgeDims
.
symmetric
(
horizontal:
8.0
,
vertical:
25.0
),
child:
new
Row
(<
Widget
>[
new
RaisedButton
(
enabled:
_enabledAdd
,
child:
new
IntrinsicWidth
(
child:
new
Row
(<
Widget
>[
new
Container
(
padding:
new
EdgeDims
.
all
(
4.0
),
margin:
new
EdgeDims
.
only
(
right:
10.0
),
child:
new
WidgetToRenderBoxAdapter
(
sectorAddIcon
)
),
new
Text
(
'ADD SECTOR'
),
])
),
onPressed:
addSector
return
new
Column
(<
Widget
>[
new
Container
(
padding:
new
EdgeDims
.
symmetric
(
horizontal:
8.0
,
vertical:
25.0
),
child:
new
Row
(<
Widget
>[
new
RaisedButton
(
enabled:
_enabledAdd
,
child:
new
IntrinsicWidth
(
child:
new
Row
(<
Widget
>[
new
Container
(
padding:
new
EdgeDims
.
all
(
4.0
),
margin:
new
EdgeDims
.
only
(
right:
10.0
),
child:
new
WidgetToRenderBoxAdapter
(
sectorAddIcon
)
),
new
Text
(
'ADD SECTOR'
),
])
),
new
RaisedButton
(
enabled:
_enabledRemove
,
child:
new
IntrinsicWidth
(
child:
new
Row
(<
Widget
>[
new
Container
(
padding:
new
EdgeDims
.
all
(
4.0
),
margin:
new
EdgeDims
.
only
(
right:
10.0
),
child:
new
WidgetToRenderBoxAdapter
(
sectorRemoveIcon
)
),
new
Text
(
'REMOVE SECTOR'
),
])
),
onPressed:
removeSector
)
],
justifyContent:
FlexJustifyContent
.
spaceAround
)
),
new
Flexible
(
child:
new
Container
(
margin:
new
EdgeDims
.
all
(
8.0
),
decoration:
new
BoxDecoration
(
border:
new
Border
.
all
(
color:
new
Color
(
0xFF000000
))
onPressed:
addSector
),
padding:
new
EdgeDims
.
all
(
8.0
),
child:
new
WidgetToRenderBoxAdapter
(
sectors
)
)
),
],
justifyContent:
FlexJustifyContent
.
spaceBetween
)
new
RaisedButton
(
enabled:
_enabledRemove
,
child:
new
IntrinsicWidth
(
child:
new
Row
(<
Widget
>[
new
Container
(
padding:
new
EdgeDims
.
all
(
4.0
),
margin:
new
EdgeDims
.
only
(
right:
10.0
),
child:
new
WidgetToRenderBoxAdapter
(
sectorRemoveIcon
)
),
new
Text
(
'REMOVE SECTOR'
),
])
),
onPressed:
removeSector
)
],
justifyContent:
FlexJustifyContent
.
spaceAround
)
),
new
Flexible
(
child:
new
Container
(
margin:
new
EdgeDims
.
all
(
8.0
),
decoration:
new
BoxDecoration
(
border:
new
Border
.
all
(
color:
new
Color
(
0xFF000000
))
),
padding:
new
EdgeDims
.
all
(
8.0
),
child:
new
WidgetToRenderBoxAdapter
(
sectors
)
)
),
],
justifyContent:
FlexJustifyContent
.
spaceBetween
);
}
...
...
examples/widgets/tabs.dart
View file @
27b5fc14
...
...
@@ -96,9 +96,8 @@ class TabbedNavigatorAppState extends State<TabbedNavigatorApp> {
Container
_buildCard
(
BuildContext
context
,
TabNavigator
tabNavigator
)
{
return
new
Container
(
child:
new
Card
(
child:
new
Padding
(
child:
tabNavigator
,
padding:
const
EdgeDims
.
all
(
8.0
))),
padding:
const
EdgeDims
.
all
(
12.0
),
decoration:
new
BoxDecoration
(
backgroundColor:
Theme
.
of
(
context
).
primarySwatch
[
100
])
padding:
const
EdgeDims
.
all
(
12.0
),
child:
new
Card
(
child:
new
Padding
(
child:
tabNavigator
,
padding:
const
EdgeDims
.
all
(
8.0
)))
);
}
...
...
packages/flutter/lib/src/material/scaffold.dart
View file @
27b5fc14
...
...
@@ -7,6 +7,7 @@ import 'dart:ui' as ui;
import
'package:flutter/widgets.dart'
;
import
'constants.dart'
;
import
'material.dart'
;
class
Scaffold
extends
StatelessComponent
{
Scaffold
({
...
...
@@ -38,7 +39,9 @@ class Scaffold extends StatelessComponent {
if
(
body
!=
null
)
{
children
.
add
(
new
Positioned
(
top:
toolBarHeight
,
right:
0.0
,
bottom:
statusBarHeight
,
left:
0.0
,
child:
body
child:
new
Material
(
child:
body
)
));
}
...
...
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