Commit 89a09822 authored by Adam Barth's avatar Adam Barth

Simplify Scaffold

Rather than using a custom render object, we can just use a Stack.
parent 922aece1
......@@ -81,7 +81,7 @@ class AddressBookHome extends StatelessComponent {
Widget build(BuildContext context) {
return new Scaffold(
toolbar: buildToolBar(context),
toolBar: buildToolBar(context),
body: buildBody(context),
floatingActionButton: buildFloatingActionButton(context)
);
......
......@@ -192,7 +192,7 @@ final ThemeData _theme = new ThemeData(
class DemoHome extends StatelessComponent {
Widget build(BuildContext context) {
return new Scaffold(
toolbar: new ToolBar(center: new Text('Sky Demos')),
toolBar: new ToolBar(center: new Text('Sky Demos')),
body: new Material(
type: MaterialType.canvas,
child: new DemoList()
......
......@@ -219,7 +219,7 @@ class FeedFragmentState extends State<FeedFragment> {
Widget build(BuildContext context) {
return new Scaffold(
toolbar: buildToolBar(),
toolBar: buildToolBar(),
body: buildBody(),
snackBar: new Placeholder(key: _snackBarPlaceholderKey),
floatingActionButton: buildFloatingActionButton()
......
......@@ -105,7 +105,7 @@ class MealFragmentState extends State<MealFragment> {
Widget build(BuildContext context) {
return new Scaffold(
toolbar: buildToolBar(),
toolBar: buildToolBar(),
body: buildBody()
);
}
......
......@@ -200,7 +200,7 @@ class MeasurementFragmentState extends State<MeasurementFragment> {
Widget build(BuildContext context) {
return new Scaffold(
toolbar: buildToolBar(),
toolBar: buildToolBar(),
body: buildBody(context),
snackBar: new Placeholder(key: _snackBarPlaceholderKey)
);
......
......@@ -122,7 +122,7 @@ class SettingsFragmentState extends State<SettingsFragment> {
Widget build(BuildContext context) {
return new Scaffold(
toolbar: buildToolBar(),
toolBar: buildToolBar(),
body: buildSettingsPane(context)
);
}
......
......@@ -182,7 +182,7 @@ class MineDiggerState extends State<MineDigger> {
return new Title(
title: 'Mine Digger',
child: new Scaffold(
toolbar: buildToolBar(context),
toolBar: buildToolBar(context),
body: new Container(
child: new Center(child: board),
decoration: new BoxDecoration(backgroundColor: Colors.grey[50])
......
......@@ -237,7 +237,7 @@ class StockHomeState extends State<StockHome> {
Widget build(BuildContext context) {
return new Scaffold(
toolbar: _isSearching ? buildSearchBar() : buildToolBar(),
toolBar: _isSearching ? buildSearchBar() : buildToolBar(),
body: buildTabNavigator(),
snackBar: new Placeholder(key: _snackBarPlaceholderKey),
floatingActionButton: buildFloatingActionButton()
......
......@@ -119,7 +119,7 @@ class StockSettingsState extends State<StockSettings> {
Widget build(BuildContext context) {
return new Scaffold(
toolbar: buildToolBar(context),
toolBar: buildToolBar(context),
body: buildSettingsPane(context)
);
}
......
......@@ -25,7 +25,7 @@ class StockSymbolViewerState extends State<StockSymbolViewer> {
TextStyle headings = Theme.of(context).text.body2;
return new Scaffold(
toolbar: new ToolBar(
toolBar: new ToolBar(
left: new IconButton(
icon: 'navigation/arrow_back',
onPressed: config.navigator.pop
......
......@@ -342,7 +342,7 @@ class CardCollectionState extends State<CardCollection> {
}
return new Scaffold(
toolbar: buildToolBar(),
toolBar: buildToolBar(),
body: body
);
}
......
......@@ -34,7 +34,7 @@ class DatePickerDemoState extends State<DatePickerDemo> {
),
child: new Stack([
new Scaffold(
toolbar: new ToolBar(center: new Text("Date Picker")),
toolBar: new ToolBar(center: new Text("Date Picker")),
body: new Material(
child: new Row(
[new Text(_dateTime.toString())],
......
......@@ -101,7 +101,7 @@ class DragAndDropApp extends StatefulComponent {
class DragAndDropAppState extends State<DragAndDropApp> {
Widget build(BuildContext context) {
return new Scaffold(
toolbar: new ToolBar(
toolBar: new ToolBar(
center: new Text('Drag and Drop Flutter Demo')
),
body: new Material(
......
......@@ -89,7 +89,7 @@ class EnsureVisibleApp extends App {
child: new Title(
title: 'Cards',
child: new Scaffold(
toolbar: new ToolBar(center: new Text('Tap a Card')),
toolBar: new ToolBar(center: new Text('Tap a Card')),
body: cardCollection
)
)
......
......@@ -138,7 +138,7 @@ class OverlayGeometryAppState extends State<OverlayGeometryApp> {
Widget build(BuildContext context) {
List<Widget> layers = <Widget>[
new Scaffold(
toolbar: new ToolBar(center: new Text('Tap a Card')),
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]),
......
......@@ -149,7 +149,7 @@ class PageableListAppState extends State<PageableListApp> {
return new IconTheme(
data: const IconThemeData(color: IconThemeColor.white),
child: new Scaffold(
toolbar: buildToolBar(),
toolBar: buildToolBar(),
body: buildBody(context)
)
);
......
......@@ -103,7 +103,7 @@ class ProgressIndicatorAppState extends State<ProgressIndicatorApp> {
child: new Title(
title: 'Progress Indicators',
child: new Scaffold(
toolbar: new ToolBar(center: new Text('Progress Indicators')),
toolBar: new ToolBar(center: new Text('Progress Indicators')),
body: new DefaultTextStyle(
style: Theme.of(context).text.title,
child: body
......
......@@ -59,7 +59,7 @@ class ScaleAppState extends State<ScaleApp> {
return new Theme(
data: new ThemeData.dark(),
child: new Scaffold(
toolbar: new ToolBar(
toolBar: new ToolBar(
center: new Text('Scale Demo')),
body: new Material(
type: MaterialType.canvas,
......
......@@ -124,7 +124,7 @@ class SectorApp extends App {
child: new Title(
title: 'Sector Layout',
child: new Scaffold(
toolbar: new ToolBar(
toolBar: new ToolBar(
center: new Text('Sector Layout in a Widget Tree')
),
body: buildBody()
......
......@@ -106,7 +106,7 @@ HAL: This mission is too important for me to allow you to jeopardize it.''';
color: Colors.grey[50],
child: interactiveBody
),
toolbar: new ToolBar(
toolBar: new ToolBar(
center: new Text('Hal and Dave')
)
)
......
......@@ -131,7 +131,7 @@ class TabbedNavigatorAppState extends State<TabbedNavigatorApp> {
);
return new Scaffold(
toolbar: toolbar,
toolBar: toolbar,
body: tabNavigator
);
}
......
......@@ -14,6 +14,7 @@ const double kStatusBarHeight = 50.0;
// Mobile Portrait: 56dp
// Tablet/Desktop: 64dp
const double kToolBarHeight = 56.0;
const double kSnackBarHeight = 52.0;
const double kMaterialDrawerHeight = 140.0;
const double kScrollbarSize = 10.0;
......
......@@ -15,7 +15,6 @@ import 'package:sky/src/widgets/placeholder.dart';
import 'package:sky/src/widgets/theme.dart';
import 'package:sky/src/widgets/transitions.dart';
const double _kSnackHeight = 52.0;
const double _kSideMargins = 24.0;
const double _kVerticalPadding = 14.0;
const Color _kSnackBackground = const Color(0xFF323232);
......@@ -72,14 +71,14 @@ class SnackBar extends StatelessComponent {
performance: performance,
height: new AnimatedValue<double>(
0.0,
end: _kSnackHeight,
end: kSnackBarHeight,
curve: easeIn,
reverseCurve: easeOut
),
child: new ClipRect(
child: new OverflowBox(
minHeight: _kSnackHeight,
maxHeight: _kSnackHeight,
minHeight: kSnackBarHeight,
maxHeight: kSnackBarHeight,
child: new Material(
level: 2,
color: _kSnackBackground,
......
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