Skip to content

Commit

Permalink
Merge pull request flutter#1557 from abarth/material_app
Browse files Browse the repository at this point in the history
Rename App to MaterialApp
  • Loading branch information
abarth committed Oct 9, 2015
2 parents 0d1625d + 6483ebe commit e6e59e4
Show file tree
Hide file tree
Showing 27 changed files with 36 additions and 40 deletions.
2 changes: 1 addition & 1 deletion examples/address_book/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ final ThemeData theme = new ThemeData(
);

void main() {
runApp(new App(
runApp(new MaterialApp(
title: 'Address Book',
theme: theme,
routes: <String, RouteBuilder>{
Expand Down
2 changes: 1 addition & 1 deletion examples/demo_launcher/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class DemoHome extends StatelessComponent {
}

void main() {
runApp(new App(
runApp(new MaterialApp(
title: 'Flutter Demos',
theme: _theme,
routes: {
Expand Down
2 changes: 1 addition & 1 deletion examples/fitness/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class FitnessAppState extends State<FitnessApp> {
}

Widget build(BuildContext) {
return new App(
return new MaterialApp(
theme: new ThemeData(
brightness: ThemeBrightness.light,
primarySwatch: Colors.indigo,
Expand Down
2 changes: 1 addition & 1 deletion examples/game/example_effect_line.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class TestAppState extends State<TestApp> {
];

Widget build(BuildContext context) {
return new App(
return new MaterialApp(
title: 'EffectLine Demo',
theme: _theme,
routes: {
Expand Down
2 changes: 1 addition & 1 deletion examples/game/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class GameDemoState extends State<GameDemo> {
int _lastScore = 0;

Widget build(BuildContext context) {
return new App(
return new MaterialApp(
title: 'Asteroids',
theme: _theme,
routes: {
Expand Down
2 changes: 1 addition & 1 deletion examples/game/test_bed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ main() async {
runApp(_app);
}

class TestBedApp extends App {
class TestBedApp extends MaterialApp {

Widget build() {
ThemeData theme = new ThemeData(
Expand Down
2 changes: 1 addition & 1 deletion examples/game/test_drawatlas.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ main() async {
String json = await _bundle.loadString('assets/sprites.json');
_spriteSheet = new SpriteSheet(_images['assets/sprites.png'], json);

runApp(new App(
runApp(new MaterialApp(
title: 'Test drawAtlas',
theme: _theme,
routes: {
Expand Down
2 changes: 1 addition & 1 deletion examples/game/test_performance.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ main() async {
String json = await _bundle.loadString('assets/sprites.json');
_spriteSheet = new SpriteSheet(_images['assets/sprites.png'], json);

runApp(new App(
runApp(new MaterialApp(
title: 'Test Sprite Performance',
theme: _theme,
routes: {
Expand Down
2 changes: 1 addition & 1 deletion examples/game/test_physics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ main() async {
String json = await _bundle.loadString('assets/sprites.json');
_spriteSheet = new SpriteSheet(_images['assets/sprites.png'], json);

runApp(new App(
runApp(new MaterialApp(
title: 'Test Physics',
theme: new ThemeData(
brightness: ThemeBrightness.light,
Expand Down
2 changes: 1 addition & 1 deletion examples/stocks/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class StocksAppState extends State<StocksApp> {
}

Widget build(BuildContext context) {
return new App(
return new MaterialApp(
title: 'Stocks',
theme: theme,
routes: <String, RouteBuilder>{
Expand Down
2 changes: 1 addition & 1 deletion examples/widgets/card_collection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ class CardCollectionState extends State<CardCollection> {
}

void main() {
runApp(new App(
runApp(new MaterialApp(
title: 'Cards',
routes: {
'/': (RouteArguments args) => new CardCollection(navigator: args.navigator),
Expand Down
2 changes: 1 addition & 1 deletion examples/widgets/drag_and_drop.dart
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class DragAndDropAppState extends State<DragAndDropApp> {
}

void main() {
runApp(new App(
runApp(new MaterialApp(
title: 'Drag and Drop Flutter Demo',
routes: {
'/': (RouteArguments args) => new DragAndDropApp(navigator: args.navigator)
Expand Down
2 changes: 1 addition & 1 deletion examples/widgets/ensure_visible.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class CardModel {
Key get key => new ObjectKey(this);
}

class EnsureVisibleApp extends App {
class EnsureVisibleApp extends MaterialApp {

static const TextStyle cardLabelStyle =
const TextStyle(color: Colors.white, fontSize: 18.0, fontWeight: bold);
Expand Down
2 changes: 1 addition & 1 deletion examples/widgets/indexed_stack.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class IndexedStackDemoState extends State<IndexedStackDemo> {
}

void main() {
runApp(new App(
runApp(new MaterialApp(
title: 'IndexedStackDemo',
theme: new ThemeData(
brightness: ThemeBrightness.light,
Expand Down
2 changes: 1 addition & 1 deletion examples/widgets/navigation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ final ThemeData theme = new ThemeData(
);

void main() {
runApp(new App(
runApp(new MaterialApp(
title: 'Navigation Example',
theme: theme,
routes: routes
Expand Down
2 changes: 1 addition & 1 deletion examples/widgets/overlay_geometry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class OverlayGeometryAppState extends State<OverlayGeometryApp> {
}

void main() {
runApp(new App(
runApp(new MaterialApp(
theme: new ThemeData(
brightness: ThemeBrightness.light,
primarySwatch: Colors.blue,
Expand Down
2 changes: 1 addition & 1 deletion examples/widgets/pageable_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class PageableListAppState extends State<PageableListApp> {
}

void main() {
runApp(new App(
runApp(new MaterialApp(
title: 'PageableList',
theme: new ThemeData(
brightness: ThemeBrightness.light,
Expand Down
2 changes: 1 addition & 1 deletion examples/widgets/sector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RenderBox initCircle() {
);
}

class SectorApp extends App {
class SectorApp extends MaterialApp {

RenderBoxToRenderSectorAdapter sectors = initCircle();
math.Random rand = new math.Random(1);
Expand Down
9 changes: 5 additions & 4 deletions sky/packages/sky/lib/material.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
/// See https://www.google.com/design/spec/material-design/introduction.html
library material;

export 'src/material/app.dart';
export 'src/material/card.dart';
export 'src/material/checkbox.dart';
export 'src/material/colors.dart';
Expand All @@ -25,10 +24,11 @@ export 'src/material/icon_button.dart';
export 'src/material/icon.dart';
export 'src/material/ink_well.dart';
export 'src/material/input.dart';
export 'src/material/material_button.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.dart';
export 'src/material/progress_indicator.dart';
export 'src/material/radio.dart';
export 'src/material/raised_button.dart';
Expand All @@ -37,10 +37,11 @@ export 'src/material/shadows.dart';
export 'src/material/snack_bar.dart';
export 'src/material/switch.dart';
export 'src/material/tabs.dart';
export 'src/material/theme.dart';
export 'src/material/theme_data.dart';
export 'src/material/theme.dart';
export 'src/material/title.dart';
export 'src/material/tool_bar.dart';
export 'src/material/typography.dart';
export 'src/material/radial_reaction.dart';

export 'widgets.dart';
1 change: 0 additions & 1 deletion sky/packages/sky/lib/painting.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
library painting;

export 'src/painting/box_painter.dart';
export 'src/painting/radial_reaction.dart';
export 'src/painting/shadows.dart';
export 'src/painting/text_painter.dart';
export 'src/painting/text_style.dart';
1 change: 1 addition & 0 deletions sky/packages/sky/lib/rendering.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export 'src/rendering/proxy_box.dart';
export 'src/rendering/shifted_box.dart';
export 'src/rendering/binding.dart';
export 'src/rendering/stack.dart';
export 'src/rendering/statistics_box.dart';
export 'src/rendering/toggleable.dart';
export 'src/rendering/view.dart';
export 'src/rendering/viewport.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,26 @@ const TextStyle _errorTextStyle = const TextStyle(
decorationStyle: TextDecorationStyle.double
);

class App extends StatefulComponent {
App({
class MaterialApp extends StatefulComponent {
MaterialApp({
Key key,
this.title,
this.theme,
this.routes,
this.onGenerateRoute
}) : super(key: key) {
assert(() {
'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;
});
assert(routes != null);
}

final String title;
final ThemeData theme;
final Map<String, RouteBuilder> routes;
final RouteGenerator onGenerateRoute;

_AppState createState() => new _AppState();
_MaterialAppState createState() => new _MaterialAppState();
}

class _AppState extends State<App> {
class _MaterialAppState extends State<MaterialApp> {

GlobalObjectKey _navigator;

Expand Down
3 changes: 2 additions & 1 deletion sky/packages/sky/lib/src/material/switch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
import 'dart:async';
import 'dart:sky' as sky;

import 'package:sky/material.dart';
import 'package:sky/painting.dart';
import 'package:sky/rendering.dart';
import 'package:sky/widgets.dart';

import 'radial_reaction.dart';
import 'shadows.dart';
import 'theme.dart';

export 'package:sky/rendering.dart' show ValueChanged;
Expand Down
4 changes: 2 additions & 2 deletions sky/packages/sky/lib/src/widgets/statistics_overlay.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// 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
/// aspects of the compositor
Expand Down
4 changes: 2 additions & 2 deletions sky/unit/test/widget/drawer_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ void main() {
testWidgets((WidgetTester tester) {
NavigatorState navigator;
tester.pumpWidget(
new App(
new MaterialApp(
routes: {
'/': (RouteArguments args) {
navigator = args.navigator;
Expand Down Expand Up @@ -39,7 +39,7 @@ void main() {
NavigatorState navigator;
tester.pumpWidget(new Container()); // throw away the old App and its Navigator
tester.pumpWidget(
new App(
new MaterialApp(
routes: {
'/': (RouteArguments args) {
navigator = args.navigator;
Expand Down
2 changes: 1 addition & 1 deletion sky/unit/test/widget/snack_bar_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ void main() {
GlobalKey<PlaceholderState> placeholderKey = new GlobalKey<PlaceholderState>();
Key tapTarget = new Key('tap-target');

tester.pumpWidget(new App(
tester.pumpWidget(new MaterialApp(
routes: {
'/': (RouteArguments args) {
return new GestureDetector(
Expand Down

0 comments on commit e6e59e4

Please sign in to comment.