Commit db3b9e80 authored by Adam Barth's avatar Adam Barth

Rename App to MaterialApp

MaterialApp assumes that you're using material design.

Also move radial reaction and fix imports for stats box.
parent cceb4187
...@@ -94,7 +94,7 @@ final ThemeData theme = new ThemeData( ...@@ -94,7 +94,7 @@ final ThemeData theme = new ThemeData(
); );
void main() { void main() {
runApp(new App( runApp(new MaterialApp(
title: 'Address Book', title: 'Address Book',
theme: theme, theme: theme,
routes: <String, RouteBuilder>{ routes: <String, RouteBuilder>{
......
...@@ -201,7 +201,7 @@ class DemoHome extends StatelessComponent { ...@@ -201,7 +201,7 @@ class DemoHome extends StatelessComponent {
} }
void main() { void main() {
runApp(new App( runApp(new MaterialApp(
title: 'Flutter Demos', title: 'Flutter Demos',
theme: _theme, theme: _theme,
routes: { routes: {
......
...@@ -125,7 +125,7 @@ class FitnessAppState extends State<FitnessApp> { ...@@ -125,7 +125,7 @@ class FitnessAppState extends State<FitnessApp> {
} }
Widget build(BuildContext) { Widget build(BuildContext) {
return new App( return new MaterialApp(
theme: new ThemeData( theme: new ThemeData(
brightness: ThemeBrightness.light, brightness: ThemeBrightness.light,
primarySwatch: Colors.indigo, primarySwatch: Colors.indigo,
......
...@@ -53,7 +53,7 @@ class TestAppState extends State<TestApp> { ...@@ -53,7 +53,7 @@ class TestAppState extends State<TestApp> {
]; ];
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new App( return new MaterialApp(
title: 'EffectLine Demo', title: 'EffectLine Demo',
theme: _theme, theme: _theme,
routes: { routes: {
......
...@@ -81,7 +81,7 @@ class GameDemoState extends State<GameDemo> { ...@@ -81,7 +81,7 @@ class GameDemoState extends State<GameDemo> {
int _lastScore = 0; int _lastScore = 0;
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new App( return new MaterialApp(
title: 'Asteroids', title: 'Asteroids',
theme: _theme, theme: _theme,
routes: { routes: {
......
...@@ -32,7 +32,7 @@ main() async { ...@@ -32,7 +32,7 @@ main() async {
runApp(_app); runApp(_app);
} }
class TestBedApp extends App { class TestBedApp extends MaterialApp {
Widget build() { Widget build() {
ThemeData theme = new ThemeData( ThemeData theme = new ThemeData(
......
...@@ -32,7 +32,7 @@ main() async { ...@@ -32,7 +32,7 @@ main() async {
String json = await _bundle.loadString('assets/sprites.json'); String json = await _bundle.loadString('assets/sprites.json');
_spriteSheet = new SpriteSheet(_images['assets/sprites.png'], json); _spriteSheet = new SpriteSheet(_images['assets/sprites.png'], json);
runApp(new App( runApp(new MaterialApp(
title: 'Test drawAtlas', title: 'Test drawAtlas',
theme: _theme, theme: _theme,
routes: { routes: {
......
...@@ -33,7 +33,7 @@ main() async { ...@@ -33,7 +33,7 @@ main() async {
String json = await _bundle.loadString('assets/sprites.json'); String json = await _bundle.loadString('assets/sprites.json');
_spriteSheet = new SpriteSheet(_images['assets/sprites.png'], json); _spriteSheet = new SpriteSheet(_images['assets/sprites.png'], json);
runApp(new App( runApp(new MaterialApp(
title: 'Test Sprite Performance', title: 'Test Sprite Performance',
theme: _theme, theme: _theme,
routes: { routes: {
......
...@@ -27,7 +27,7 @@ main() async { ...@@ -27,7 +27,7 @@ main() async {
String json = await _bundle.loadString('assets/sprites.json'); String json = await _bundle.loadString('assets/sprites.json');
_spriteSheet = new SpriteSheet(_images['assets/sprites.png'], json); _spriteSheet = new SpriteSheet(_images['assets/sprites.png'], json);
runApp(new App( runApp(new MaterialApp(
title: 'Test Physics', title: 'Test Physics',
theme: new ThemeData( theme: new ThemeData(
brightness: ThemeBrightness.light, brightness: ThemeBrightness.light,
......
...@@ -87,7 +87,7 @@ class StocksAppState extends State<StocksApp> { ...@@ -87,7 +87,7 @@ class StocksAppState extends State<StocksApp> {
} }
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new App( return new MaterialApp(
title: 'Stocks', title: 'Stocks',
theme: theme, theme: theme,
routes: <String, RouteBuilder>{ routes: <String, RouteBuilder>{
......
...@@ -372,7 +372,7 @@ class CardCollectionState extends State<CardCollection> { ...@@ -372,7 +372,7 @@ class CardCollectionState extends State<CardCollection> {
} }
void main() { void main() {
runApp(new App( runApp(new MaterialApp(
title: 'Cards', title: 'Cards',
routes: { routes: {
'/': (RouteArguments args) => new CardCollection(navigator: args.navigator), '/': (RouteArguments args) => new CardCollection(navigator: args.navigator),
......
...@@ -129,7 +129,7 @@ class DragAndDropAppState extends State<DragAndDropApp> { ...@@ -129,7 +129,7 @@ class DragAndDropAppState extends State<DragAndDropApp> {
} }
void main() { void main() {
runApp(new App( runApp(new MaterialApp(
title: 'Drag and Drop Flutter Demo', title: 'Drag and Drop Flutter Demo',
routes: { routes: {
'/': (RouteArguments args) => new DragAndDropApp(navigator: args.navigator) '/': (RouteArguments args) => new DragAndDropApp(navigator: args.navigator)
......
...@@ -13,7 +13,7 @@ class CardModel { ...@@ -13,7 +13,7 @@ class CardModel {
Key get key => new ObjectKey(this); Key get key => new ObjectKey(this);
} }
class EnsureVisibleApp extends App { class EnsureVisibleApp extends MaterialApp {
static const TextStyle cardLabelStyle = static const TextStyle cardLabelStyle =
const TextStyle(color: Colors.white, fontSize: 18.0, fontWeight: bold); const TextStyle(color: Colors.white, fontSize: 18.0, fontWeight: bold);
......
...@@ -56,7 +56,7 @@ class IndexedStackDemoState extends State<IndexedStackDemo> { ...@@ -56,7 +56,7 @@ class IndexedStackDemoState extends State<IndexedStackDemo> {
} }
void main() { void main() {
runApp(new App( runApp(new MaterialApp(
title: 'IndexedStackDemo', title: 'IndexedStackDemo',
theme: new ThemeData( theme: new ThemeData(
brightness: ThemeBrightness.light, brightness: ThemeBrightness.light,
......
...@@ -57,7 +57,7 @@ final ThemeData theme = new ThemeData( ...@@ -57,7 +57,7 @@ final ThemeData theme = new ThemeData(
); );
void main() { void main() {
runApp(new App( runApp(new MaterialApp(
title: 'Navigation Example', title: 'Navigation Example',
theme: theme, theme: theme,
routes: routes routes: routes
......
...@@ -156,7 +156,7 @@ class OverlayGeometryAppState extends State<OverlayGeometryApp> { ...@@ -156,7 +156,7 @@ class OverlayGeometryAppState extends State<OverlayGeometryApp> {
} }
void main() { void main() {
runApp(new App( runApp(new MaterialApp(
theme: new ThemeData( theme: new ThemeData(
brightness: ThemeBrightness.light, brightness: ThemeBrightness.light,
primarySwatch: Colors.blue, primarySwatch: Colors.blue,
......
...@@ -156,7 +156,7 @@ class PageableListAppState extends State<PageableListApp> { ...@@ -156,7 +156,7 @@ class PageableListAppState extends State<PageableListApp> {
} }
void main() { void main() {
runApp(new App( runApp(new MaterialApp(
title: 'PageableList', title: 'PageableList',
theme: new ThemeData( theme: new ThemeData(
brightness: ThemeBrightness.light, brightness: ThemeBrightness.light,
......
...@@ -16,7 +16,7 @@ RenderBox initCircle() { ...@@ -16,7 +16,7 @@ RenderBox initCircle() {
); );
} }
class SectorApp extends App { class SectorApp extends MaterialApp {
RenderBoxToRenderSectorAdapter sectors = initCircle(); RenderBoxToRenderSectorAdapter sectors = initCircle();
math.Random rand = new math.Random(1); math.Random rand = new math.Random(1);
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
/// See https://www.google.com/design/spec/material-design/introduction.html /// See https://www.google.com/design/spec/material-design/introduction.html
library material; library material;
export 'src/material/app.dart';
export 'src/material/card.dart'; export 'src/material/card.dart';
export 'src/material/checkbox.dart'; export 'src/material/checkbox.dart';
export 'src/material/colors.dart'; export 'src/material/colors.dart';
...@@ -25,10 +24,11 @@ export 'src/material/icon_button.dart'; ...@@ -25,10 +24,11 @@ export 'src/material/icon_button.dart';
export 'src/material/icon.dart'; export 'src/material/icon.dart';
export 'src/material/ink_well.dart'; export 'src/material/ink_well.dart';
export 'src/material/input.dart'; export 'src/material/input.dart';
export 'src/material/material_button.dart';
export 'src/material/material.dart'; export 'src/material/material.dart';
export 'src/material/popup_menu.dart'; export 'src/material/material_app.dart';
export 'src/material/material_button.dart';
export 'src/material/popup_menu_item.dart'; export 'src/material/popup_menu_item.dart';
export 'src/material/popup_menu.dart';
export 'src/material/progress_indicator.dart'; export 'src/material/progress_indicator.dart';
export 'src/material/radio.dart'; export 'src/material/radio.dart';
export 'src/material/raised_button.dart'; export 'src/material/raised_button.dart';
...@@ -37,10 +37,11 @@ export 'src/material/shadows.dart'; ...@@ -37,10 +37,11 @@ export 'src/material/shadows.dart';
export 'src/material/snack_bar.dart'; export 'src/material/snack_bar.dart';
export 'src/material/switch.dart'; export 'src/material/switch.dart';
export 'src/material/tabs.dart'; export 'src/material/tabs.dart';
export 'src/material/theme.dart';
export 'src/material/theme_data.dart'; export 'src/material/theme_data.dart';
export 'src/material/theme.dart';
export 'src/material/title.dart'; export 'src/material/title.dart';
export 'src/material/tool_bar.dart'; export 'src/material/tool_bar.dart';
export 'src/material/typography.dart'; export 'src/material/typography.dart';
export 'src/material/radial_reaction.dart';
export 'widgets.dart'; export 'widgets.dart';
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
library painting; library painting;
export 'src/painting/box_painter.dart'; export 'src/painting/box_painter.dart';
export 'src/painting/radial_reaction.dart';
export 'src/painting/shadows.dart'; export 'src/painting/shadows.dart';
export 'src/painting/text_painter.dart'; export 'src/painting/text_painter.dart';
export 'src/painting/text_style.dart'; export 'src/painting/text_style.dart';
...@@ -23,6 +23,7 @@ export 'src/rendering/proxy_box.dart'; ...@@ -23,6 +23,7 @@ export 'src/rendering/proxy_box.dart';
export 'src/rendering/shifted_box.dart'; export 'src/rendering/shifted_box.dart';
export 'src/rendering/binding.dart'; export 'src/rendering/binding.dart';
export 'src/rendering/stack.dart'; export 'src/rendering/stack.dart';
export 'src/rendering/statistics_box.dart';
export 'src/rendering/toggleable.dart'; export 'src/rendering/toggleable.dart';
export 'src/rendering/view.dart'; export 'src/rendering/view.dart';
export 'src/rendering/viewport.dart'; export 'src/rendering/viewport.dart';
......
...@@ -23,21 +23,15 @@ const TextStyle _errorTextStyle = const TextStyle( ...@@ -23,21 +23,15 @@ const TextStyle _errorTextStyle = const TextStyle(
decorationStyle: TextDecorationStyle.double decorationStyle: TextDecorationStyle.double
); );
class App extends StatefulComponent { class MaterialApp extends StatefulComponent {
App({ MaterialApp({
Key key, Key key,
this.title, this.title,
this.theme, this.theme,
this.routes, this.routes,
this.onGenerateRoute this.onGenerateRoute
}) : super(key: key) { }) : super(key: key) {
assert(() { assert(routes != null);
'The "routes" argument to App() is required.';
'This might be a sign that you have not upgraded to our new Widgets framework.';
'For more details see: https://groups.google.com/forum/#!topic/flutter-dev/hcX3OvLws9c';
'...or look at our examples: https://github.com/flutter/engine/tree/master/examples';
return routes != null;
});
} }
final String title; final String title;
...@@ -45,10 +39,10 @@ class App extends StatefulComponent { ...@@ -45,10 +39,10 @@ class App extends StatefulComponent {
final Map<String, RouteBuilder> routes; final Map<String, RouteBuilder> routes;
final RouteGenerator onGenerateRoute; final RouteGenerator onGenerateRoute;
_AppState createState() => new _AppState(); _MaterialAppState createState() => new _MaterialAppState();
} }
class _AppState extends State<App> { class _MaterialAppState extends State<MaterialApp> {
GlobalObjectKey _navigator; GlobalObjectKey _navigator;
......
...@@ -5,11 +5,12 @@ ...@@ -5,11 +5,12 @@
import 'dart:async'; import 'dart:async';
import 'dart:sky' as sky; import 'dart:sky' as sky;
import 'package:sky/material.dart';
import 'package:sky/painting.dart'; import 'package:sky/painting.dart';
import 'package:sky/rendering.dart'; import 'package:sky/rendering.dart';
import 'package:sky/widgets.dart'; import 'package:sky/widgets.dart';
import 'radial_reaction.dart';
import 'shadows.dart';
import 'theme.dart'; import 'theme.dart';
export 'package:sky/rendering.dart' show ValueChanged; export 'package:sky/rendering.dart' show ValueChanged;
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
import 'framework.dart'; import 'package:sky/rendering.dart';
import 'package:sky/src/rendering/statistics_box.dart'; import 'framework.dart';
/// The options that control whether the statistics overlay displays certain /// The options that control whether the statistics overlay displays certain
/// aspects of the compositor /// aspects of the compositor
......
...@@ -10,7 +10,7 @@ void main() { ...@@ -10,7 +10,7 @@ void main() {
testWidgets((WidgetTester tester) { testWidgets((WidgetTester tester) {
NavigatorState navigator; NavigatorState navigator;
tester.pumpWidget( tester.pumpWidget(
new App( new MaterialApp(
routes: { routes: {
'/': (RouteArguments args) { '/': (RouteArguments args) {
navigator = args.navigator; navigator = args.navigator;
...@@ -39,7 +39,7 @@ void main() { ...@@ -39,7 +39,7 @@ void main() {
NavigatorState navigator; NavigatorState navigator;
tester.pumpWidget(new Container()); // throw away the old App and its Navigator tester.pumpWidget(new Container()); // throw away the old App and its Navigator
tester.pumpWidget( tester.pumpWidget(
new App( new MaterialApp(
routes: { routes: {
'/': (RouteArguments args) { '/': (RouteArguments args) {
navigator = args.navigator; navigator = args.navigator;
......
...@@ -10,7 +10,7 @@ void main() { ...@@ -10,7 +10,7 @@ void main() {
GlobalKey<PlaceholderState> placeholderKey = new GlobalKey<PlaceholderState>(); GlobalKey<PlaceholderState> placeholderKey = new GlobalKey<PlaceholderState>();
Key tapTarget = new Key('tap-target'); Key tapTarget = new Key('tap-target');
tester.pumpWidget(new App( tester.pumpWidget(new MaterialApp(
routes: { routes: {
'/': (RouteArguments args) { '/': (RouteArguments args) {
return new GestureDetector( return new GestureDetector(
......
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