Merge pull request #1774 from Hixie/exports

Clean up imports and exports.
This commit is contained in:
Ian Hickson
2016-02-11 00:12:42 -08:00
123 changed files with 346 additions and 492 deletions

View File

@@ -6,7 +6,6 @@ library fitness;
import 'package:playfair/playfair.dart' as playfair;
import 'package:flutter/material.dart';
import 'package:flutter/painting.dart';
import 'package:gcm/gcm.dart' as gcm;
import 'user_data.dart';

View File

@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/animation.dart';
import 'package:flutter/material.dart';
class ProgressIndicatorDemo extends StatefulComponent {

View File

@@ -3,7 +3,7 @@
// found in the LICENSE file.
import 'dart:async';
import 'dart:ui' as ui;
import 'dart:ui' as ui show Image;
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_sprites/flutter_sprites.dart';

View File

@@ -3,10 +3,7 @@
import 'dart:math';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/painting.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';
// Classic minesweeper-inspired game. The mouse controls are standard

View File

@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:ui' as ui;
import 'package:flutter/rendering.dart';
class _BaselinePainter extends CustomPainter {
@@ -29,7 +27,7 @@ class _BaselinePainter extends CustomPainter {
path.lineTo(w, h);
paint = new Paint()
..color = const Color(0xFFFF9000)
..style = ui.PaintingStyle.stroke
..style = PaintingStyle.stroke
..strokeWidth = 1.5;
canvas.drawPath(path, paint);
@@ -39,7 +37,7 @@ class _BaselinePainter extends CustomPainter {
path.lineTo(w, baseline);
paint = new Paint()
..color = const Color(0xFF00FF90)
..style = ui.PaintingStyle.stroke
..style = PaintingStyle.stroke
..strokeWidth = 1.5;
canvas.drawPath(path, paint);
}

View File

@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:ui' as ui;
import 'package:flutter/rendering.dart';
void main() {
@@ -15,7 +13,7 @@ void main() {
additionalConstraints: new BoxConstraints.tightFor(height: 100.0),
child: new RenderDecoratedBox(
decoration: new BoxDecoration(
backgroundColor: new ui.Color(0xFFFFFF00)
backgroundColor: const Color(0xFFFFFF00)
)
)
)
@@ -27,12 +25,12 @@ void main() {
child: new RenderDecoratedBox(
decoration: new BoxDecoration(
border: new Border(
top: new BorderSide(color: new ui.Color(0xFFF00000), width: 5.0),
right: new BorderSide(color: new ui.Color(0xFFFF9000), width: 10.0),
bottom: new BorderSide(color: new ui.Color(0xFFFFF000), width: 15.0),
left: new BorderSide(color: new ui.Color(0xFF00FF00), width: 20.0)
top: new BorderSide(color: const Color(0xFFF00000), width: 5.0),
right: new BorderSide(color: const Color(0xFFFF9000), width: 10.0),
bottom: new BorderSide(color: const Color(0xFFFFF000), width: 15.0),
left: new BorderSide(color: const Color(0xFF00FF00), width: 20.0)
),
backgroundColor: new ui.Color(0xFFDDDDDD)
backgroundColor: const Color(0xFFDDDDDD)
)
)
)
@@ -43,7 +41,7 @@ void main() {
additionalConstraints: new BoxConstraints.tightFor(height: 100.0),
child: new RenderDecoratedBox(
decoration: new BoxDecoration(
backgroundColor: new ui.Color(0xFFFFFF00)
backgroundColor: const Color(0xFFFFFF00)
)
)
)
@@ -54,7 +52,7 @@ void main() {
additionalConstraints: new BoxConstraints.tightFor(height: 100.0),
child: new RenderDecoratedBox(
decoration: new BoxDecoration(
backgroundColor: new ui.Color(0xFFFFFF00)
backgroundColor: const Color(0xFFFFFF00)
)
)
)
@@ -65,7 +63,7 @@ void main() {
additionalConstraints: new BoxConstraints.tightFor(height: 100.0),
child: new RenderDecoratedBox(
decoration: new BoxDecoration(
backgroundColor: new ui.Color(0xFFFFFF00)
backgroundColor: const Color(0xFFFFFF00)
)
)
)

View File

@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:ui' as ui;
import 'package:flutter/rendering.dart';
import 'lib/solid_color_box.dart';
@@ -11,11 +9,11 @@ RenderBox buildFlexExample() {
RenderFlex flexRoot = new RenderFlex(direction: FlexDirection.vertical);
RenderDecoratedBox root = new RenderDecoratedBox(
decoration: new BoxDecoration(backgroundColor: const ui.Color(0xFF000000)),
decoration: new BoxDecoration(backgroundColor: const Color(0xFF000000)),
child: flexRoot
);
void addFlexChildSolidColor(RenderFlex parent, ui.Color backgroundColor, { int flex: 0 }) {
void addFlexChildSolidColor(RenderFlex parent, Color backgroundColor, { int flex: 0 }) {
RenderSolidColorBox child = new RenderSolidColorBox(backgroundColor);
parent.add(child);
final FlexParentData childParentData = child.parentData;
@@ -23,13 +21,13 @@ RenderBox buildFlexExample() {
}
// Yellow bar at top
addFlexChildSolidColor(flexRoot, const ui.Color(0xFFFFFF00), flex: 1);
addFlexChildSolidColor(flexRoot, const Color(0xFFFFFF00), flex: 1);
// Turquoise box
flexRoot.add(new RenderSolidColorBox(const ui.Color(0x7700FFFF), desiredSize: new ui.Size(100.0, 100.0)));
flexRoot.add(new RenderSolidColorBox(const Color(0x7700FFFF), desiredSize: new Size(100.0, 100.0)));
var renderDecoratedBlock = new RenderDecoratedBox(
decoration: new BoxDecoration(backgroundColor: const ui.Color(0xFFFFFFFF))
decoration: new BoxDecoration(backgroundColor: const Color(0xFFFFFFFF))
);
flexRoot.add(new RenderPadding(padding: const EdgeDims.all(10.0), child: renderDecoratedBlock));
@@ -37,11 +35,11 @@ RenderBox buildFlexExample() {
var row = new RenderFlex(direction: FlexDirection.horizontal);
// Purple and blue cells
addFlexChildSolidColor(row, const ui.Color(0x77FF00FF), flex: 1);
addFlexChildSolidColor(row, const ui.Color(0xFF0000FF), flex: 2);
addFlexChildSolidColor(row, const Color(0x77FF00FF), flex: 1);
addFlexChildSolidColor(row, const Color(0xFF0000FF), flex: 2);
var decoratedRow = new RenderDecoratedBox(
decoration: new BoxDecoration(backgroundColor: const ui.Color(0xFF333333)),
decoration: new BoxDecoration(backgroundColor: const Color(0xFF333333)),
child: row
);

View File

@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:ui' as ui;
import 'dart:ui' as ui show Image, window;
import 'dart:math' as math;
import 'dart:typed_data';

View File

@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:ui' as ui;
import 'package:flutter/rendering.dart';
import 'lib/solid_color_box.dart';
@@ -14,16 +12,16 @@ RenderTransform transformBox;
void main() {
RenderFlex flexRoot = new RenderFlex(direction: FlexDirection.vertical);
void addFlexChildSolidColor(RenderFlex parent, ui.Color backgroundColor, { int flex: 0 }) {
void addFlexChildSolidColor(RenderFlex parent, Color backgroundColor, { int flex: 0 }) {
RenderSolidColorBox child = new RenderSolidColorBox(backgroundColor);
parent.add(child);
final FlexParentData childParentData = child.parentData;
childParentData.flex = flex;
}
addFlexChildSolidColor(flexRoot, const ui.Color(0xFFFF00FF), flex: 1);
addFlexChildSolidColor(flexRoot, const ui.Color(0xFFFFFF00), flex: 2);
addFlexChildSolidColor(flexRoot, const ui.Color(0xFF00FFFF), flex: 1);
addFlexChildSolidColor(flexRoot, const Color(0xFFFF00FF), flex: 1);
addFlexChildSolidColor(flexRoot, const Color(0xFFFFFF00), flex: 2);
addFlexChildSolidColor(flexRoot, const Color(0xFF00FFFF), flex: 1);
transformBox = new RenderTransform(child: flexRoot, transform: new Matrix4.identity());

View File

@@ -2,16 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:ui' as ui;
import 'package:flutter/rendering.dart';
void main() {
RenderDecoratedBox green = new RenderDecoratedBox(
decoration: new BoxDecoration(backgroundColor: const ui.Color(0xFF00FF00))
decoration: new BoxDecoration(backgroundColor: const Color(0xFF00FF00))
);
RenderConstrainedBox box = new RenderConstrainedBox(
additionalConstraints: new BoxConstraints.tight(const ui.Size(200.0, 200.0)),
additionalConstraints: new BoxConstraints.tight(const Size(200.0, 200.0)),
child: green
);

View File

@@ -5,29 +5,18 @@
library stocks;
import 'dart:async';
import 'dart:collection';
import 'dart:math' as math;
import 'dart:ui' as ui;
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/painting.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter/rendering.dart' show debugPaintSizeEnabled;
import 'package:intl/intl.dart';
import 'stock_data.dart';
import 'i18n/stock_messages_all.dart';
part 'stock_arrow.dart';
part 'stock_home.dart';
part 'stock_list.dart';
part 'stock_menu.dart';
part 'stock_row.dart';
part 'stock_settings.dart';
part 'stock_strings.dart';
part 'stock_symbol_viewer.dart';
part 'stock_types.dart';
import 'stock_data.dart';
import 'stock_home.dart';
import 'stock_settings.dart';
import 'stock_strings.dart';
import 'stock_symbol_viewer.dart';
import 'stock_types.dart';
class StocksApp extends StatefulComponent {
StocksAppState createState() => new StocksAppState();
@@ -94,7 +83,7 @@ class StocksAppState extends State<StocksApp> {
return null;
}
Future<LocaleQueryData> _onLocaleChanged(ui.Locale locale) async {
Future<LocaleQueryData> _onLocaleChanged(Locale locale) async {
String localeString = locale.toString();
await initializeMessages(localeString);
Intl.defaultLocale = localeString;

View File

@@ -2,7 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
part of stocks;
import 'dart:math' as math;
import 'package:flutter/material.dart';
class StockArrowPainter extends CustomPainter {
StockArrowPainter({ this.color, this.percentChange });
@@ -34,11 +36,11 @@ class StockArrowPainter extends CustomPainter {
path.lineTo(centerX + w, arrowY + h);
path.lineTo(centerX - w, arrowY + h);
path.close();
paint.style = ui.PaintingStyle.fill;
paint.style = PaintingStyle.fill;
canvas.drawPath(path, paint);
// Draw a circle that circumscribes the arrow.
paint.style = ui.PaintingStyle.stroke;
paint.style = PaintingStyle.stroke;
canvas.drawCircle(new Point(centerX, centerY), r, paint);
}

View File

@@ -2,7 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
part of stocks;
import 'dart:collection';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart' show debugDumpRenderTree, debugDumpLayerTree, debugDumpSemanticsTree;
import 'stock_data.dart';
import 'stock_list.dart';
import 'stock_menu.dart';
import 'stock_strings.dart';
import 'stock_symbol_viewer.dart';
import 'stock_types.dart';
typedef void ModeUpdater(StockMode mode);

View File

@@ -2,7 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
part of stocks;
import 'package:flutter/material.dart';
import 'stock_data.dart';
import 'stock_row.dart';
class StockList extends StatelessComponent {
StockList({ Key key, this.keySalt, this.stocks, this.onOpen, this.onShow, this.onAction }) : super(key: key);

View File

@@ -2,7 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
part of stocks;
import 'dart:async';
import 'dart:ui' as ui show window;
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart' show timeDilation;
enum _MenuItems { autorefresh, autorefreshCheckbox, refresh, speedUp, speedDown }

View File

@@ -2,7 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
part of stocks;
import 'package:flutter/material.dart';
import 'stock_data.dart';
import 'stock_arrow.dart';
enum StockRowPartKind { arrow }

View File

@@ -2,7 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
part of stocks;
import 'package:flutter/material.dart';
import 'stock_types.dart';
class StockSettings extends StatefulComponent {
const StockSettings(this.configuration, this.updater);

View File

@@ -1,4 +1,9 @@
part of stocks;
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:intl/intl.dart';
import 'package:flutter/widgets.dart';
// Wrappers for strings that are shown in the UI. The strings can be
// translated for different locales using the Dart intl package.

View File

@@ -2,7 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
part of stocks;
import 'package:flutter/material.dart';
import 'stock_data.dart';
import 'stock_arrow.dart';
import 'stock_row.dart';
class StockSymbolView extends StatelessComponent {
StockSymbolView({ this.stock });

View File

@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
part of stocks;
enum StockMode { optimistic, pessimistic }
enum BackupMode { enabled, disabled }

View File

@@ -2,11 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
import 'package:flutter/painting.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/rendering.dart' show debugDumpRenderTree;
class CardModel {
CardModel(this.value, this.height) {
@@ -394,7 +391,7 @@ class CardCollectionState extends State<CardCollection> {
});
}
ui.Shader _createShader(Rect bounds) {
Shader _createShader(Rect bounds) {
return new LinearGradient(
begin: bounds.topLeft,
end: bounds.bottomLeft,

View File

@@ -3,11 +3,8 @@
// found in the LICENSE file.
import 'dart:math' as math;
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
import 'package:flutter/painting.dart';
import 'package:flutter/rendering.dart';
class ExampleDragTarget extends StatefulComponent {
ExampleDragTargetState createState() => new ExampleDragTargetState();
@@ -144,7 +141,7 @@ class DashOutlineCirclePainter extends CustomPainter {
final double radius = size.shortestSide / 2.0;
final Paint paint = new Paint()
..color = const Color(0xFF000000)
..style = ui.PaintingStyle.stroke
..style = PaintingStyle.stroke
..strokeWidth = radius / 10.0;
final Path path = new Path();
final Rect box = Point.origin & size;

View File

@@ -2,7 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:ui' as ui;
import 'dart:ui' as ui show window;
import 'package:flutter/widgets.dart';
import 'package:flutter/material.dart';

View File

@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/animation.dart';
import 'package:flutter/material.dart';
const double _kHeight = 150.0;

View File

@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/painting.dart';
import 'package:flutter/material.dart';
void main() {

View File

@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:ui' as ui;
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
@@ -36,7 +34,7 @@ class _MarkerPainter extends CustomPainter {
paint
..color = const Color(0xFFFFFFFF)
..style = ui.PaintingStyle.stroke
..style = PaintingStyle.stroke
..strokeWidth = 1.0;
if (type == MarkerType.topLeft) {
canvas.drawLine(new Point(r, r), new Point(r + r - 1.0, r), paint);

View File

@@ -3,7 +3,6 @@
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter/painting.dart';
class CardModel {
CardModel(this.value, this.size, this.color);

View File

@@ -1,7 +1,8 @@
// Copyright (c) 2016, the Flutter project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:ui' as ui;
import 'dart:ui' as ui show window;
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

View File

@@ -2,9 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/animation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
final List<Map<int, Color>> _kColors = <Map<int, Color>>[
Colors.amber,

View File

@@ -2,15 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_rendering_examples/solid_color_box.dart';
// Solid colour, RenderObject version
void addFlexChildSolidColor(RenderFlex parent, ui.Color backgroundColor, { int flex: 0 }) {
void addFlexChildSolidColor(RenderFlex parent, Color backgroundColor, { int flex: 0 }) {
RenderSolidColorBox child = new RenderSolidColorBox(backgroundColor);
parent.add(child);
FlexParentData childParentData = child.parentData;
@@ -92,9 +90,9 @@ void main() {
attachWidgetTreeToRenderTree(proxy);
RenderFlex flexRoot = new RenderFlex(direction: FlexDirection.vertical);
addFlexChildSolidColor(flexRoot, const ui.Color(0xFFFF00FF), flex: 1);
addFlexChildSolidColor(flexRoot, const Color(0xFFFF00FF), flex: 1);
flexRoot.add(proxy);
addFlexChildSolidColor(flexRoot, const ui.Color(0xFF0000FF), flex: 1);
addFlexChildSolidColor(flexRoot, const Color(0xFF0000FF), flex: 1);
transformBox = new RenderTransform(child: flexRoot, transform: new Matrix4.identity());
RenderPadding root = new RenderPadding(padding: new EdgeDims.all(80.0), child: transformBox);