Commit 09665c0d authored by Adam Barth's avatar Adam Barth

Change the default MaterialType to canvas

Canvas is by far the most popular type of material by call site (and makes for
a faster default because it doesn't have a RRect clip).
parent f9a7ed04
......@@ -193,7 +193,6 @@ class DemoHome extends StatelessComponent {
return new Scaffold(
toolBar: new ToolBar(center: new Text('Sky Demos')),
body: new Material(
type: MaterialType.canvas,
child: new DemoList()
)
);
......
......@@ -15,7 +15,6 @@ class FitnessItemList extends StatelessComponent {
Widget build(BuildContext context) {
return new Material(
type: MaterialType.canvas,
child: new ScrollableList<FitnessItem>(
padding: const EdgeDims.all(4.0),
items: items,
......@@ -172,10 +171,9 @@ class FeedFragmentState extends State<FeedFragment> {
Widget buildBody() {
TextStyle style = Theme.of(context).text.title;
if (config.userData == null)
return new Material(type: MaterialType.canvas);
return new Material();
if (config.userData.items.length == 0)
return new Material(
type: MaterialType.canvas,
child: new Row(
[new Text("No data yet.\nAdd some!", style: style)],
justifyContent: FlexJustifyContent.center
......@@ -189,7 +187,6 @@ class FeedFragmentState extends State<FeedFragment> {
);
case FitnessMode.chart:
return new Material(
type: MaterialType.canvas,
child: new Container(
padding: const EdgeDims.all(20.0),
child: buildChart()
......
......@@ -86,7 +86,6 @@ class MealFragmentState extends State<MealFragment> {
Widget buildBody() {
Meal meal = new Meal(when: new DateTime.now());
return new Material(
type: MaterialType.canvas,
child: new ScrollableViewport(
child: new Container(
padding: const EdgeDims.all(20.0),
......
......@@ -173,7 +173,6 @@ class MeasurementFragmentState extends State<MeasurementFragment> {
Measurement measurement = new Measurement(when: _when);
// TODO(jackson): Revisit the layout of this pane to be more maintainable
return new Material(
type: MaterialType.canvas,
child: new Container(
padding: const EdgeDims.all(20.0),
child: new Column([
......
......@@ -93,7 +93,6 @@ class SettingsFragmentState extends State<SettingsFragment> {
Widget buildSettingsPane(BuildContext context) {
return new Material(
type: MaterialType.canvas,
child: new ScrollableViewport(
child: new Container(
padding: const EdgeDims.symmetric(vertical: 20.0),
......
......@@ -13,7 +13,6 @@ class StockList extends StatelessComponent {
Widget build(BuildContext context) {
return new Material(
type: MaterialType.canvas,
child: new ScrollableList<Stock>(
items: stocks,
itemExtent: StockRow.kHeight,
......
......@@ -84,7 +84,6 @@ class StockSettingsState extends State<StockSettings> {
// 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(
type: MaterialType.canvas,
child: new ScrollableViewport(
child: new Container(
padding: const EdgeDims.symmetric(vertical: 20.0),
......
......@@ -33,7 +33,6 @@ class StockSymbolViewerState extends State<StockSymbolViewer> {
center: new Text('${config.stock.name} (${config.stock.symbol})')
),
body: new Material(
type: MaterialType.canvas,
child: new Block([
new Container(
padding: new EdgeDims.all(20.0),
......
......@@ -61,7 +61,6 @@ class ScaleAppState extends State<ScaleApp> {
toolBar: new ToolBar(
center: new Text('Scale Demo')),
body: new Material(
type: MaterialType.canvas,
child: new GestureDetector(
onScaleStart: _handleScaleStart,
onScaleUpdate: _handleScaleUpdate,
......
......@@ -65,7 +65,6 @@ class SectorApp extends MaterialApp {
Widget buildBody() {
return new Material(
type: MaterialType.canvas,
child: new Column([
new Container(
padding: new EdgeDims.symmetric(horizontal: 8.0, vertical: 25.0),
......
......@@ -118,6 +118,7 @@ class Dialog extends StatelessComponent {
child: new Material(
level: 4,
color: _getColor(context),
type: MaterialType.card,
child: new IntrinsicWidth(
child: new Block(dialogBody)
)
......
......@@ -23,7 +23,7 @@ class Material extends StatelessComponent {
Material({
Key key,
this.child,
this.type: MaterialType.card,
this.type: MaterialType.canvas,
this.level: 0,
this.color,
this.textStyle
......
......@@ -79,7 +79,6 @@ class SnackBar extends StatelessComponent {
child: new Material(
level: 2,
color: _kSnackBackground,
type: MaterialType.canvas,
child: new Container(
margin: const EdgeDims.symmetric(horizontal: _kSideMargins),
child: new DefaultTextStyle(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment