diff --git a/examples/fitness/lib/main.dart b/examples/fitness/lib/main.dart index c44d54aa8c..90f1b185cf 100644 --- a/examples/fitness/lib/main.dart +++ b/examples/fitness/lib/main.dart @@ -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'; diff --git a/examples/material_gallery/lib/demo/progress_indicator_demo.dart b/examples/material_gallery/lib/demo/progress_indicator_demo.dart index 9babb5f58e..1b5337d27d 100644 --- a/examples/material_gallery/lib/demo/progress_indicator_demo.dart +++ b/examples/material_gallery/lib/demo/progress_indicator_demo.dart @@ -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 { diff --git a/examples/material_gallery/lib/demo/weathers_demo.dart b/examples/material_gallery/lib/demo/weathers_demo.dart index a69aa290e6..2613678bbc 100644 --- a/examples/material_gallery/lib/demo/weathers_demo.dart +++ b/examples/material_gallery/lib/demo/weathers_demo.dart @@ -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'; diff --git a/examples/mine_digger/lib/main.dart b/examples/mine_digger/lib/main.dart index b0599348a9..11ef19d2cb 100644 --- a/examples/mine_digger/lib/main.dart +++ b/examples/mine_digger/lib/main.dart @@ -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 diff --git a/examples/rendering/baseline.dart b/examples/rendering/baseline.dart index 2e5163e1ac..2a7a59708e 100644 --- a/examples/rendering/baseline.dart +++ b/examples/rendering/baseline.dart @@ -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); } diff --git a/examples/rendering/borders.dart b/examples/rendering/borders.dart index c6aee48331..019f9918ee 100644 --- a/examples/rendering/borders.dart +++ b/examples/rendering/borders.dart @@ -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) ) ) ) diff --git a/examples/rendering/flex.dart b/examples/rendering/flex.dart index 8d74e49f75..270bac3437 100644 --- a/examples/rendering/flex.dart +++ b/examples/rendering/flex.dart @@ -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 ); diff --git a/examples/rendering/interactive_flex.dart b/examples/rendering/interactive_flex.dart index 7532f2844b..b93fde2619 100644 --- a/examples/rendering/interactive_flex.dart +++ b/examples/rendering/interactive_flex.dart @@ -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'; diff --git a/examples/rendering/spinning_flex.dart b/examples/rendering/spinning_flex.dart index 7557f59ce7..2a100bca1a 100644 --- a/examples/rendering/spinning_flex.dart +++ b/examples/rendering/spinning_flex.dart @@ -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()); diff --git a/examples/rendering/transform.dart b/examples/rendering/transform.dart index 6a145144de..4a4d7f763d 100644 --- a/examples/rendering/transform.dart +++ b/examples/rendering/transform.dart @@ -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 ); diff --git a/examples/stocks/lib/main.dart b/examples/stocks/lib/main.dart index 38fe4981ae..c342b4e190 100644 --- a/examples/stocks/lib/main.dart +++ b/examples/stocks/lib/main.dart @@ -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 { return null; } - Future _onLocaleChanged(ui.Locale locale) async { + Future _onLocaleChanged(Locale locale) async { String localeString = locale.toString(); await initializeMessages(localeString); Intl.defaultLocale = localeString; diff --git a/examples/stocks/lib/stock_arrow.dart b/examples/stocks/lib/stock_arrow.dart index 142d6f6eb0..67f0203d75 100644 --- a/examples/stocks/lib/stock_arrow.dart +++ b/examples/stocks/lib/stock_arrow.dart @@ -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); } diff --git a/examples/stocks/lib/stock_home.dart b/examples/stocks/lib/stock_home.dart index 81c93c65dd..b244dd9f96 100644 --- a/examples/stocks/lib/stock_home.dart +++ b/examples/stocks/lib/stock_home.dart @@ -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); diff --git a/examples/stocks/lib/stock_list.dart b/examples/stocks/lib/stock_list.dart index 19fae3e599..153db6926a 100644 --- a/examples/stocks/lib/stock_list.dart +++ b/examples/stocks/lib/stock_list.dart @@ -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); diff --git a/examples/stocks/lib/stock_menu.dart b/examples/stocks/lib/stock_menu.dart index ed515c7413..065d0d45fa 100644 --- a/examples/stocks/lib/stock_menu.dart +++ b/examples/stocks/lib/stock_menu.dart @@ -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 } diff --git a/examples/stocks/lib/stock_row.dart b/examples/stocks/lib/stock_row.dart index 5c7e329956..40a7399b4b 100644 --- a/examples/stocks/lib/stock_row.dart +++ b/examples/stocks/lib/stock_row.dart @@ -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 } diff --git a/examples/stocks/lib/stock_settings.dart b/examples/stocks/lib/stock_settings.dart index eea7e096cf..2cfcd54575 100644 --- a/examples/stocks/lib/stock_settings.dart +++ b/examples/stocks/lib/stock_settings.dart @@ -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); diff --git a/examples/stocks/lib/stock_strings.dart b/examples/stocks/lib/stock_strings.dart index e65d1f3273..d5c1dc4cd6 100644 --- a/examples/stocks/lib/stock_strings.dart +++ b/examples/stocks/lib/stock_strings.dart @@ -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. diff --git a/examples/stocks/lib/stock_symbol_viewer.dart b/examples/stocks/lib/stock_symbol_viewer.dart index 92161a0d8c..d718e385ec 100644 --- a/examples/stocks/lib/stock_symbol_viewer.dart +++ b/examples/stocks/lib/stock_symbol_viewer.dart @@ -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 }); diff --git a/examples/stocks/lib/stock_types.dart b/examples/stocks/lib/stock_types.dart index e65eff4f64..2aa83947fc 100644 --- a/examples/stocks/lib/stock_types.dart +++ b/examples/stocks/lib/stock_types.dart @@ -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 } diff --git a/examples/widgets/card_collection.dart b/examples/widgets/card_collection.dart index 3193303d5a..d422a88015 100644 --- a/examples/widgets/card_collection.dart +++ b/examples/widgets/card_collection.dart @@ -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 { }); } - ui.Shader _createShader(Rect bounds) { + Shader _createShader(Rect bounds) { return new LinearGradient( begin: bounds.topLeft, end: bounds.bottomLeft, diff --git a/examples/widgets/drag_and_drop.dart b/examples/widgets/drag_and_drop.dart index 2e72eddb3e..3f813c0645 100644 --- a/examples/widgets/drag_and_drop.dart +++ b/examples/widgets/drag_and_drop.dart @@ -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; diff --git a/examples/widgets/hero_under.dart b/examples/widgets/hero_under.dart index 1177f1d660..1c1b5bc251 100644 --- a/examples/widgets/hero_under.dart +++ b/examples/widgets/hero_under.dart @@ -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'; diff --git a/examples/widgets/mimic_demo.dart b/examples/widgets/mimic_demo.dart index a901bb4105..3ce73c8c12 100644 --- a/examples/widgets/mimic_demo.dart +++ b/examples/widgets/mimic_demo.dart @@ -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; diff --git a/examples/widgets/nine_patch.dart b/examples/widgets/nine_patch.dart index f0faf2cd60..073070a147 100644 --- a/examples/widgets/nine_patch.dart +++ b/examples/widgets/nine_patch.dart @@ -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() { diff --git a/examples/widgets/overlay_geometry.dart b/examples/widgets/overlay_geometry.dart index fed1bfa36a..74e0545619 100644 --- a/examples/widgets/overlay_geometry.dart +++ b/examples/widgets/overlay_geometry.dart @@ -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); diff --git a/examples/widgets/pageable_list.dart b/examples/widgets/pageable_list.dart index 5141a91e64..142c9c6558 100644 --- a/examples/widgets/pageable_list.dart +++ b/examples/widgets/pageable_list.dart @@ -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); diff --git a/examples/widgets/resolution_awareness.dart b/examples/widgets/resolution_awareness.dart index 888de8fd6d..c98117f77f 100644 --- a/examples/widgets/resolution_awareness.dart +++ b/examples/widgets/resolution_awareness.dart @@ -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'; diff --git a/examples/widgets/smooth_resize.dart b/examples/widgets/smooth_resize.dart index 3788660021..347224e862 100644 --- a/examples/widgets/smooth_resize.dart +++ b/examples/widgets/smooth_resize.dart @@ -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> _kColors = >[ Colors.amber, diff --git a/examples/widgets/spinning_mixed.dart b/examples/widgets/spinning_mixed.dart index 4e6d0651d5..b8acb69f73 100644 --- a/examples/widgets/spinning_mixed.dart +++ b/examples/widgets/spinning_mixed.dart @@ -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); diff --git a/packages/flutter/lib/animation.dart b/packages/flutter/lib/animation.dart index 7137fc214c..c386df379e 100644 --- a/packages/flutter/lib/animation.dart +++ b/packages/flutter/lib/animation.dart @@ -15,5 +15,4 @@ export 'src/animation/animations.dart'; export 'src/animation/curves.dart'; export 'src/animation/forces.dart'; export 'src/animation/listener_helpers.dart'; -export 'src/animation/ticker.dart'; export 'src/animation/tween.dart'; diff --git a/packages/flutter/lib/painting.dart b/packages/flutter/lib/painting.dart index ca38e5f8de..7902f6b323 100644 --- a/packages/flutter/lib/painting.dart +++ b/packages/flutter/lib/painting.dart @@ -17,7 +17,6 @@ export 'src/painting/box_painter.dart'; export 'src/painting/colors.dart'; export 'src/painting/decoration.dart'; export 'src/painting/edge_dims.dart'; -export 'src/painting/shadows.dart'; export 'src/painting/text_editing.dart'; export 'src/painting/text_painter.dart'; export 'src/painting/text_style.dart'; diff --git a/packages/flutter/lib/scheduler.dart b/packages/flutter/lib/scheduler.dart index 11e4466abc..17b3030c23 100644 --- a/packages/flutter/lib/scheduler.dart +++ b/packages/flutter/lib/scheduler.dart @@ -12,3 +12,4 @@ library scheduler; export 'src/scheduler/scheduler.dart'; +export 'src/scheduler/ticker.dart'; diff --git a/packages/flutter/lib/src/animation/animation.dart b/packages/flutter/lib/src/animation/animation.dart index 502a47d58a..1e89f48edb 100644 --- a/packages/flutter/lib/src/animation/animation.dart +++ b/packages/flutter/lib/src/animation/animation.dart @@ -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' show Color, Size, Rect, VoidCallback, lerpDouble; +import 'dart:ui' show Color, Size, Rect, VoidCallback; /// The direction in which an animation is running. enum AnimationDirection { diff --git a/packages/flutter/lib/src/animation/animation_controller.dart b/packages/flutter/lib/src/animation/animation_controller.dart index 3c887d3dc1..124aa31285 100644 --- a/packages/flutter/lib/src/animation/animation_controller.dart +++ b/packages/flutter/lib/src/animation/animation_controller.dart @@ -3,15 +3,15 @@ // found in the LICENSE file. import 'dart:async'; -import 'dart:ui' show VoidCallback, lerpDouble; +import 'dart:ui' as ui show lerpDouble; +import 'package:flutter/scheduler.dart'; import 'package:newton/newton.dart'; import 'animation.dart'; import 'curves.dart'; import 'forces.dart'; import 'listener_helpers.dart'; -import 'ticker.dart'; /// A controller for an animation. /// @@ -20,7 +20,7 @@ import 'ticker.dart'; /// bounds of the animation and can drive an animation using a physics /// simulation. class AnimationController extends Animation - with EagerListenerMixin, LocalListenersMixin, LocalAnimationStatusListenersMixin { + with AnimationEagerListenerMixin, AnimationLocalListenersMixin, AnimationLocalStatusListenersMixin { /// Creates an animation controller. /// @@ -257,7 +257,7 @@ class _RepeatingSimulation extends Simulation { double x(double timeInSeconds) { assert(timeInSeconds >= 0.0); final double t = (timeInSeconds / _periodInSeconds) % 1.0; - return lerpDouble(min, max, t); + return ui.lerpDouble(min, max, t); } double dx(double timeInSeconds) => 1.0; diff --git a/packages/flutter/lib/src/animation/animations.dart b/packages/flutter/lib/src/animation/animations.dart index 6acc193a69..831948d94a 100644 --- a/packages/flutter/lib/src/animation/animations.dart +++ b/packages/flutter/lib/src/animation/animations.dart @@ -63,7 +63,7 @@ class AlwaysStoppedAnimation extends Animation { /// Implements most of the [Animation] interface, by deferring its behavior to a /// given [parent] Animation. To implement an [Animation] that proxies to a /// parent, this class plus implementing "T get value" is all that is necessary. -abstract class ProxyAnimatedMixin { +abstract class AnimationWithParentMixin { /// The animation whose value this animation will proxy. /// /// This animation must remain the same for the lifetime of this object. If @@ -87,7 +87,7 @@ abstract class ProxyAnimatedMixin { /// object, and then later change the animation from which the proxy receieves /// its value. class ProxyAnimation extends Animation - with LazyListenerMixin, LocalListenersMixin, LocalAnimationStatusListenersMixin { + with AnimationLazyListenerMixin, AnimationLocalListenersMixin, AnimationLocalStatusListenersMixin { ProxyAnimation([Animation animation]) { _parent = animation; if (_parent == null) { @@ -158,7 +158,7 @@ class ProxyAnimation extends Animation /// 0.0 because the tween does not change the status or direction of the /// animation. class ReverseAnimation extends Animation - with LazyListenerMixin, LocalAnimationStatusListenersMixin { + with AnimationLazyListenerMixin, AnimationLocalStatusListenersMixin { ReverseAnimation(this.parent); /// The animation whose value and direction this animation is reversing. @@ -211,7 +211,7 @@ class ReverseAnimation extends Animation /// [CurvedAnimation] is useful when you wish to apply a [Curve] and you already /// have the underlying animation object. If you don't yet have an animation and /// want to apply a [Curve] to a [Tween], consider using [CurveTween]. -class CurvedAnimation extends Animation with ProxyAnimatedMixin { +class CurvedAnimation extends Animation with AnimationWithParentMixin { CurvedAnimation({ this.parent, this.curve: Curves.linear, @@ -283,7 +283,7 @@ enum _TrainHoppingMode { minimize, maximize } /// removed, it exposes a [dispose()] method. Call this method to shut this /// object down. class TrainHoppingAnimation extends Animation - with EagerListenerMixin, LocalListenersMixin, LocalAnimationStatusListenersMixin { + with AnimationEagerListenerMixin, AnimationLocalListenersMixin, AnimationLocalStatusListenersMixin { TrainHoppingAnimation(this._currentTrain, this._nextTrain, { this.onSwitchedTrain }) { assert(_currentTrain != null); if (_nextTrain != null) { diff --git a/packages/flutter/lib/src/animation/listener_helpers.dart b/packages/flutter/lib/src/animation/listener_helpers.dart index 809a40c788..fb761e5726 100644 --- a/packages/flutter/lib/src/animation/listener_helpers.dart +++ b/packages/flutter/lib/src/animation/listener_helpers.dart @@ -12,7 +12,7 @@ abstract class _ListenerMixin { } /// A mixin that helps listen to another object only when this object has registered listeners. -abstract class LazyListenerMixin implements _ListenerMixin { +abstract class AnimationLazyListenerMixin implements _ListenerMixin { int _listenerCounter = 0; void didRegisterListener() { assert(_listenerCounter >= 0); @@ -33,7 +33,7 @@ abstract class LazyListenerMixin implements _ListenerMixin { /// A mixin that replaces the didRegisterListener/didUnregisterListener contract /// with a dispose contract. -abstract class EagerListenerMixin implements _ListenerMixin { +abstract class AnimationEagerListenerMixin implements _ListenerMixin { void didRegisterListener() { } void didUnregisterListener() { } @@ -43,7 +43,7 @@ abstract class EagerListenerMixin implements _ListenerMixin { /// A mixin that implements the addListener/removeListener protocol and notifies /// all the registered listeners when notifyListeners is invoked. -abstract class LocalListenersMixin extends _ListenerMixin { +abstract class AnimationLocalListenersMixin extends _ListenerMixin { final List _listeners = []; void addListener(VoidCallback listener) { didRegisterListener(); @@ -63,7 +63,7 @@ abstract class LocalListenersMixin extends _ListenerMixin { /// A mixin that implements the addStatusListener/removeStatusListener protocol /// and notifies all the registered listeners when notifyStatusListeners is /// invoked. -abstract class LocalAnimationStatusListenersMixin extends _ListenerMixin { +abstract class AnimationLocalStatusListenersMixin extends _ListenerMixin { final List _statusListeners = []; void addStatusListener(AnimationStatusListener listener) { didRegisterListener(); diff --git a/packages/flutter/lib/src/animation/tween.dart b/packages/flutter/lib/src/animation/tween.dart index 5acd1b43f9..3d002d76ed 100644 --- a/packages/flutter/lib/src/animation/tween.dart +++ b/packages/flutter/lib/src/animation/tween.dart @@ -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' show Color, Size, Rect, VoidCallback, lerpDouble; +import 'dart:ui' show Color, Size, Rect, VoidCallback; import 'animation.dart'; import 'animations.dart'; @@ -28,7 +28,7 @@ abstract class Animatable { } } -class _AnimatedEvaluation extends Animation with ProxyAnimatedMixin { +class _AnimatedEvaluation extends Animation with AnimationWithParentMixin { _AnimatedEvaluation(this.parent, this._evaluatable); /// The animation from which this value is derived. diff --git a/packages/flutter/lib/src/gestures/binding.dart b/packages/flutter/lib/src/gestures/binding.dart index 0cc7c63c19..42c58bbb51 100644 --- a/packages/flutter/lib/src/gestures/binding.dart +++ b/packages/flutter/lib/src/gestures/binding.dart @@ -3,7 +3,7 @@ // found in the LICENSE file. import 'dart:typed_data'; -import 'dart:ui' as ui; +import 'dart:ui' as ui show window; import 'package:flutter/services.dart'; import 'package:mojo/bindings.dart' as mojo_bindings; diff --git a/packages/flutter/lib/src/material/bottom_sheet.dart b/packages/flutter/lib/src/material/bottom_sheet.dart index 2d4f0a0738..398e33fa70 100644 --- a/packages/flutter/lib/src/material/bottom_sheet.dart +++ b/packages/flutter/lib/src/material/bottom_sheet.dart @@ -4,9 +4,6 @@ import 'dart:async'; -import 'package:flutter/animation.dart'; -import 'package:flutter/painting.dart'; -import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'colors.dart'; diff --git a/packages/flutter/lib/src/material/checkbox.dart b/packages/flutter/lib/src/material/checkbox.dart index 6b2ba1bab9..b1fc42418e 100644 --- a/packages/flutter/lib/src/material/checkbox.dart +++ b/packages/flutter/lib/src/material/checkbox.dart @@ -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 Gradient; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; @@ -122,23 +122,24 @@ class _RenderCheckbox extends RenderToggleable { // Create an inner rectangle to cover inside of rectangle. This is needed to avoid // painting artefacts caused by overlayed paintings. Rect innerRect = rect.deflate(1.0); - ui.RRect rrect = new ui.RRect.fromRectXY( - rect, _kEdgeRadius, _kEdgeRadius); + RRect rrect = new RRect.fromRectXY(rect, _kEdgeRadius, _kEdgeRadius); // Outline of the empty rrect - paint.style = ui.PaintingStyle.stroke; + paint.style = PaintingStyle.stroke; canvas.drawRRect(rrect, paint); // Radial gradient that changes size if (!position.isDismissed) { paint - ..style = ui.PaintingStyle.fill + ..style = PaintingStyle.fill ..shader = new ui.Gradient.radial( new Point(_kEdgeSize / 2.0, _kEdgeSize / 2.0), - _kEdgeSize * (_kMidpoint - position.value) * 8.0, [ - const Color(0x00000000), - inactiveColor - ]); + _kEdgeSize * (_kMidpoint - position.value) * 8.0, + [ + const Color(0x00000000), + inactiveColor + ] + ); canvas.drawRect(innerRect, paint); } @@ -149,24 +150,22 @@ class _RenderCheckbox extends RenderToggleable { // First draw a rounded rect outline then fill inner rectangle with the active color paint ..color = activeColor.withAlpha((t * 255).floor()) - ..style = ui.PaintingStyle.stroke; + ..style = PaintingStyle.stroke; canvas.drawRRect(rrect, paint); - paint.style = ui.PaintingStyle.fill; + paint.style = PaintingStyle.fill; canvas.drawRect(innerRect, paint); } // White inner check paint ..color = const Color(0xFFFFFFFF) - ..style = ui.PaintingStyle.stroke; + ..style = PaintingStyle.stroke; Path path = new Path(); Point start = new Point(_kEdgeSize * 0.15, _kEdgeSize * 0.45); Point mid = new Point(_kEdgeSize * 0.4, _kEdgeSize * 0.7); Point end = new Point(_kEdgeSize * 0.85, _kEdgeSize * 0.25); - Point lerp(Point p1, Point p2, double t) => - new Point(p1.x * (1.0 - t) + p2.x * t, p1.y * (1.0 - t) + p2.y * t); - Point drawStart = lerp(start, mid, 1.0 - t); - Point drawEnd = lerp(mid, end, t); + Point drawStart = Point.lerp(start, mid, 1.0 - t); + Point drawEnd = Point.lerp(mid, end, t); path.moveTo(offsetX + drawStart.x, offsetY + drawStart.y); path.lineTo(offsetX + mid.x, offsetY + mid.y); path.lineTo(offsetX + drawEnd.x, offsetY + drawEnd.y); diff --git a/packages/flutter/lib/src/material/circle_avatar.dart b/packages/flutter/lib/src/material/circle_avatar.dart index dcd8c8307d..39e51be93e 100644 --- a/packages/flutter/lib/src/material/circle_avatar.dart +++ b/packages/flutter/lib/src/material/circle_avatar.dart @@ -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/widgets.dart'; import 'constants.dart'; diff --git a/packages/flutter/lib/src/material/dialog.dart b/packages/flutter/lib/src/material/dialog.dart index 18bdfb647c..dae65a598f 100644 --- a/packages/flutter/lib/src/material/dialog.dart +++ b/packages/flutter/lib/src/material/dialog.dart @@ -4,7 +4,6 @@ import 'dart:async'; -import 'package:flutter/animation.dart'; import 'package:flutter/widgets.dart'; import 'colors.dart'; diff --git a/packages/flutter/lib/src/material/drawer.dart b/packages/flutter/lib/src/material/drawer.dart index a87773b791..d3f2480358 100644 --- a/packages/flutter/lib/src/material/drawer.dart +++ b/packages/flutter/lib/src/material/drawer.dart @@ -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/widgets.dart'; import 'colors.dart'; diff --git a/packages/flutter/lib/src/material/dropdown.dart b/packages/flutter/lib/src/material/dropdown.dart index 2596368be6..db0c8acc80 100644 --- a/packages/flutter/lib/src/material/dropdown.dart +++ b/packages/flutter/lib/src/material/dropdown.dart @@ -4,9 +4,6 @@ import 'dart:async'; -import 'package:flutter/animation.dart'; -import 'package:flutter/painting.dart'; -import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'debug.dart'; diff --git a/packages/flutter/lib/src/material/flexible_space_bar.dart b/packages/flutter/lib/src/material/flexible_space_bar.dart index 85cdeccc95..679cecf667 100644 --- a/packages/flutter/lib/src/material/flexible_space_bar.dart +++ b/packages/flutter/lib/src/material/flexible_space_bar.dart @@ -4,7 +4,6 @@ import 'dart:math' as math; -import 'package:flutter/animation.dart'; import 'package:flutter/widgets.dart'; import 'debug.dart'; diff --git a/packages/flutter/lib/src/material/floating_action_button.dart b/packages/flutter/lib/src/material/floating_action_button.dart index 5519d735ec..da1454c1b1 100644 --- a/packages/flutter/lib/src/material/floating_action_button.dart +++ b/packages/flutter/lib/src/material/floating_action_button.dart @@ -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/widgets.dart'; import 'icon_theme.dart'; diff --git a/packages/flutter/lib/src/material/icon_theme_data.dart b/packages/flutter/lib/src/material/icon_theme_data.dart index 46dffa1519..dc4b42d3fe 100644 --- a/packages/flutter/lib/src/material/icon_theme_data.dart +++ b/packages/flutter/lib/src/material/icon_theme_data.dart @@ -2,7 +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 'dart:ui' as ui show lerpDouble; +import 'dart:ui' show hashValues; enum IconThemeColor { white, black } @@ -28,7 +29,7 @@ class IconThemeData { return color == typedOther.color && opacity == typedOther.opacity; } - int get hashCode => ui.hashValues(color, opacity); + int get hashCode => hashValues(color, opacity); String toString() => '$color'; } diff --git a/packages/flutter/lib/src/material/input.dart b/packages/flutter/lib/src/material/input.dart index 1597ef4059..22e0f4f93c 100644 --- a/packages/flutter/lib/src/material/input.dart +++ b/packages/flutter/lib/src/material/input.dart @@ -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 'package:flutter/animation.dart'; -import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; import 'package:sky_services/editing/editing.mojom.dart' as mojom; @@ -13,7 +11,6 @@ import 'debug.dart'; import 'icon.dart'; import 'theme.dart'; -export 'package:flutter/rendering.dart' show ValueChanged; export 'package:sky_services/editing/editing.mojom.dart' show KeyboardType; /// A material design text input field. diff --git a/packages/flutter/lib/src/material/material.dart b/packages/flutter/lib/src/material/material.dart index eb7de2c85d..2915b6cef6 100644 --- a/packages/flutter/lib/src/material/material.dart +++ b/packages/flutter/lib/src/material/material.dart @@ -4,8 +4,6 @@ import 'dart:math' as math; -import 'package:flutter/animation.dart'; -import 'package:flutter/painting.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:vector_math/vector_math_64.dart'; diff --git a/packages/flutter/lib/src/material/material_app.dart b/packages/flutter/lib/src/material/material_app.dart index c674755859..d69430f230 100644 --- a/packages/flutter/lib/src/material/material_app.dart +++ b/packages/flutter/lib/src/material/material_app.dart @@ -3,7 +3,7 @@ // found in the LICENSE file. import 'dart:async'; -import 'dart:ui' as ui; +import 'dart:ui' as ui show WindowPadding, window; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; @@ -12,6 +12,8 @@ import 'package:flutter/widgets.dart'; import 'page.dart'; import 'theme.dart'; +export 'dart:ui' show Locale; + const TextStyle _errorTextStyle = const TextStyle( color: const Color(0xD0FF0000), fontFamily: 'monospace', @@ -38,7 +40,7 @@ class RouteArguments { } typedef Widget RouteBuilder(RouteArguments args); -typedef Future LocaleChangedCallback(ui.Locale locale); +typedef Future LocaleChangedCallback(Locale locale); class MaterialApp extends StatefulComponent { MaterialApp({ @@ -152,7 +154,7 @@ class _MaterialAppState extends State implements BindingObserver { }); } - void didChangeLocale(ui.Locale locale) { + void didChangeLocale(Locale locale) { if (config.onLocaleChanged != null) { config.onLocaleChanged(locale).then((LocaleQueryData data) { if (mounted) @@ -161,7 +163,7 @@ class _MaterialAppState extends State implements BindingObserver { } } - void didChangeAppLifecycleState(ui.AppLifecycleState state) { } + void didChangeAppLifecycleState(AppLifecycleState state) { } final HeroController _heroController = new HeroController(); diff --git a/packages/flutter/lib/src/material/page.dart b/packages/flutter/lib/src/material/page.dart index 2ad1658f9c..1401a3cd6b 100644 --- a/packages/flutter/lib/src/material/page.dart +++ b/packages/flutter/lib/src/material/page.dart @@ -4,7 +4,6 @@ import 'dart:async'; -import 'package:flutter/animation.dart'; import 'package:flutter/widgets.dart'; class _MaterialPageTransition extends AnimatedComponent { diff --git a/packages/flutter/lib/src/material/popup_menu.dart b/packages/flutter/lib/src/material/popup_menu.dart index ddf1610fe9..2fa5473c17 100644 --- a/packages/flutter/lib/src/material/popup_menu.dart +++ b/packages/flutter/lib/src/material/popup_menu.dart @@ -4,7 +4,6 @@ import 'dart:async'; -import 'package:flutter/animation.dart'; import 'package:flutter/widgets.dart'; import 'ink_well.dart'; diff --git a/packages/flutter/lib/src/material/progress_indicator.dart b/packages/flutter/lib/src/material/progress_indicator.dart index c58a9233ec..e7e5017f76 100644 --- a/packages/flutter/lib/src/material/progress_indicator.dart +++ b/packages/flutter/lib/src/material/progress_indicator.dart @@ -3,9 +3,7 @@ // found in the LICENSE file. import 'dart:math' as math; -import 'dart:ui' as ui; -import 'package:flutter/animation.dart'; import 'package:flutter/widgets.dart'; import 'theme.dart'; @@ -86,7 +84,7 @@ class _LinearProgressIndicatorPainter extends CustomPainter { void paint(Canvas canvas, Size size) { Paint paint = new Paint() ..color = backgroundColor - ..style = ui.PaintingStyle.fill; + ..style = PaintingStyle.fill; canvas.drawRect(Point.origin & size, paint); paint.color = valueColor; @@ -155,7 +153,7 @@ class _CircularProgressIndicatorPainter extends CustomPainter { Paint paint = new Paint() ..color = valueColor ..strokeWidth = _kCircularProgressIndicatorStrokeWidth - ..style = ui.PaintingStyle.stroke; + ..style = PaintingStyle.stroke; if (value != null) { double angle = value.clamp(0.0, 1.0) * _kSweep; diff --git a/packages/flutter/lib/src/material/radio.dart b/packages/flutter/lib/src/material/radio.dart index 555b0e7e82..c90b302d17 100644 --- a/packages/flutter/lib/src/material/radio.dart +++ b/packages/flutter/lib/src/material/radio.dart @@ -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 'package:flutter/widgets.dart'; @@ -116,13 +114,13 @@ class _RenderRadio extends RenderToggleable { // Outer circle Paint paint = new Paint() ..color = Color.lerp(inactiveColor, radioColor, position.value) - ..style = ui.PaintingStyle.stroke + ..style = PaintingStyle.stroke ..strokeWidth = 2.0; canvas.drawCircle(center, _kOuterRadius, paint); // Inner circle if (!position.isDismissed) { - paint.style = ui.PaintingStyle.fill; + paint.style = PaintingStyle.fill; canvas.drawCircle(center, _kInnerRadius * position.value, paint); } } diff --git a/packages/flutter/lib/src/material/scaffold.dart b/packages/flutter/lib/src/material/scaffold.dart index 40bb8e3a05..74d36f7ac2 100644 --- a/packages/flutter/lib/src/material/scaffold.dart +++ b/packages/flutter/lib/src/material/scaffold.dart @@ -6,8 +6,6 @@ import 'dart:async'; import 'dart:collection'; import 'dart:math' as math; -import 'package:flutter/animation.dart'; -import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'bottom_sheet.dart'; diff --git a/packages/flutter/lib/src/material/scrollbar_painter.dart b/packages/flutter/lib/src/material/scrollbar_painter.dart index 6a461db975..4eb485834e 100644 --- a/packages/flutter/lib/src/material/scrollbar_painter.dart +++ b/packages/flutter/lib/src/material/scrollbar_painter.dart @@ -4,8 +4,6 @@ import 'dart:async'; -import 'package:flutter/animation.dart'; -import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; const double _kMinScrollbarThumbLength = 18.0; diff --git a/packages/flutter/lib/src/material/slider.dart b/packages/flutter/lib/src/material/slider.dart index 2d4cc6cff7..e5011d5708 100644 --- a/packages/flutter/lib/src/material/slider.dart +++ b/packages/flutter/lib/src/material/slider.dart @@ -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/gestures.dart'; -import 'package:flutter/painting.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; diff --git a/packages/flutter/lib/src/material/snack_bar.dart b/packages/flutter/lib/src/material/snack_bar.dart index 410bcfe383..59cc63fb1c 100644 --- a/packages/flutter/lib/src/material/snack_bar.dart +++ b/packages/flutter/lib/src/material/snack_bar.dart @@ -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/widgets.dart'; import 'flat_button.dart'; diff --git a/packages/flutter/lib/src/material/switch.dart b/packages/flutter/lib/src/material/switch.dart index e7bfcfe1a1..38f33bea55 100644 --- a/packages/flutter/lib/src/material/switch.dart +++ b/packages/flutter/lib/src/material/switch.dart @@ -2,10 +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 'package:flutter/gestures.dart'; -import 'package:flutter/painting.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; @@ -194,13 +191,13 @@ class _RenderSwitch extends RenderToggleable { size.width - 2.0 * trackHorizontalPadding, _kTrackHeight ); - ui.RRect trackRRect = new ui.RRect.fromRectXY( - trackRect, _kTrackRadius, _kTrackRadius); + RRect trackRRect = new RRect.fromRectXY(trackRect, _kTrackRadius, _kTrackRadius); canvas.drawRRect(trackRRect, paint); Offset thumbOffset = new Offset( offset.dx + kRadialReactionRadius + position.value * _trackInnerLength, - offset.dy + size.height / 2.0); + offset.dy + size.height / 2.0 + ); paintRadialReaction(canvas, thumbOffset); diff --git a/packages/flutter/lib/src/material/tabs.dart b/packages/flutter/lib/src/material/tabs.dart index c466ea147d..7faf8179a4 100644 --- a/packages/flutter/lib/src/material/tabs.dart +++ b/packages/flutter/lib/src/material/tabs.dart @@ -6,7 +6,6 @@ import 'dart:async'; import 'dart:math' as math; import 'package:newton/newton.dart'; -import 'package:flutter/animation.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; diff --git a/packages/flutter/lib/src/material/theme.dart b/packages/flutter/lib/src/material/theme.dart index 50bea89304..d6458e320c 100644 --- a/packages/flutter/lib/src/material/theme.dart +++ b/packages/flutter/lib/src/material/theme.dart @@ -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/widgets.dart'; import 'theme_data.dart'; diff --git a/packages/flutter/lib/src/material/time_picker.dart b/packages/flutter/lib/src/material/time_picker.dart index 195310e802..94bd578639 100644 --- a/packages/flutter/lib/src/material/time_picker.dart +++ b/packages/flutter/lib/src/material/time_picker.dart @@ -4,10 +4,7 @@ import 'dart:math' as math; -import 'package:flutter/animation.dart'; -import 'package:flutter/painting.dart'; -import 'package:flutter/rendering.dart'; -import 'package:flutter/services.dart'; +import 'package:flutter/services.dart' show HapticFeedbackType, userFeedback; import 'package:flutter/widgets.dart'; import 'colors.dart'; diff --git a/packages/flutter/lib/src/material/tooltip.dart b/packages/flutter/lib/src/material/tooltip.dart index 3bec742be7..35757bc25c 100644 --- a/packages/flutter/lib/src/material/tooltip.dart +++ b/packages/flutter/lib/src/material/tooltip.dart @@ -5,9 +5,6 @@ import 'dart:async'; import 'dart:math' as math; -import 'package:flutter/animation.dart'; -import 'package:flutter/painting.dart'; -import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'colors.dart'; diff --git a/packages/flutter/lib/src/material/two_level_list.dart b/packages/flutter/lib/src/material/two_level_list.dart index dae089a467..0746b44107 100644 --- a/packages/flutter/lib/src/material/two_level_list.dart +++ b/packages/flutter/lib/src/material/two_level_list.dart @@ -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/widgets.dart'; import 'colors.dart'; diff --git a/packages/flutter/lib/src/painting/basic_types.dart b/packages/flutter/lib/src/painting/basic_types.dart index 2c40e5c7dd..5cdf33389c 100644 --- a/packages/flutter/lib/src/painting/basic_types.dart +++ b/packages/flutter/lib/src/painting/basic_types.dart @@ -3,21 +3,51 @@ // found in the LICENSE file. export 'dart:ui' show + BlurStyle, Canvas, Color, ColorFilter, + FilterQuality, FontStyle, FontWeight, + ImageShader, + LayerDrawLooperBuilder, + MaskFilter, Offset, Paint, + PaintingStyle, Path, Point, + RRect, + RSTransform, Rect, + Shader, Size, + StrokeCap, TextAlign, TextBaseline, TextDecoration, TextDecorationStyle, + TextDirection, + TileMode, + TransferMode, + VertexMode, VoidCallback, hashValues, hashList; + +// Intentionally not exported: +// - Image, decodeImageFromDataPipe, decodeImageFromList: +// We use ui.* to make it very explicit that these are low-level image APIs. +// Generally, higher layers provide more reasonable APIs around images. +// - lerpDouble: +// Hopefully this will eventually become Double.lerp. +// - Paragraph, ParagraphBuilder, ParagraphStyle, TextBox: +// These are low-level text primitives. Use this package's TextPainter API. +// - Picture, PictureRecorder, Scene, SceneBuilder: +// These are low-level primitives. Generally, the rendering layer makes these moot. +// - Gradient: +// Use this package's higher-level Gradient API instead. +// - window, WindowPadding +// These are generally wrapped by other APIs so we always refer to them directly +// as ui.* to avoid making them seem like high-level APIs. diff --git a/packages/flutter/lib/src/painting/box_painter.dart b/packages/flutter/lib/src/painting/box_painter.dart index 47db2269ed..9f5cf28685 100644 --- a/packages/flutter/lib/src/painting/box_painter.dart +++ b/packages/flutter/lib/src/painting/box_painter.dart @@ -3,7 +3,7 @@ // found in the LICENSE file. import 'dart:math' as math; -import 'dart:ui' as ui; +import 'dart:ui' as ui show Image, Gradient, lerpDouble; import 'package:flutter/services.dart'; @@ -238,7 +238,7 @@ class BoxShadow { /// A 2D gradient. abstract class Gradient { const Gradient(); - ui.Shader createShader(); + Shader createShader(); } /// A 2D linear gradient. @@ -248,7 +248,7 @@ class LinearGradient extends Gradient { this.end, this.colors, this.stops, - this.tileMode: ui.TileMode.clamp + this.tileMode: TileMode.clamp }); /// The point at which stop 0.0 of the gradient is placed. @@ -269,9 +269,9 @@ class LinearGradient extends Gradient { final List stops; /// How this gradient should tile the plane. - final ui.TileMode tileMode; + final TileMode tileMode; - ui.Shader createShader() { + Shader createShader() { return new ui.Gradient.linear([begin, end], this.colors, this.stops, this.tileMode); } @@ -320,7 +320,7 @@ class RadialGradient extends Gradient { this.radius, this.colors, this.stops, - this.tileMode: ui.TileMode.clamp + this.tileMode: TileMode.clamp }); /// The center of the gradient. @@ -343,9 +343,9 @@ class RadialGradient extends Gradient { final List stops; /// How this gradient should tile the plane. - final ui.TileMode tileMode; + final TileMode tileMode; - ui.Shader createShader() { + Shader createShader() { return new ui.Gradient.radial(center, radius, colors, stops, tileMode); } @@ -869,7 +869,7 @@ class BoxDecoration extends Decoration { double shortestSide = rect.shortestSide; // In principle, we should use shortestSide / 2.0, but we don't want to // run into floating point rounding errors. Instead, we just use - // shortestSide and let ui.Canvas do any remaining clamping. + // shortestSide and let Canvas do any remaining clamping. return borderRadius > shortestSide ? shortestSide : borderRadius; } @@ -879,7 +879,7 @@ class BoxDecoration extends Decoration { switch (shape) { case BoxShape.rectangle: if (borderRadius != null) { - ui.RRect bounds = new ui.RRect.fromRectXY(Point.origin & size, borderRadius, borderRadius); + RRect bounds = new RRect.fromRectXY(Point.origin & size, borderRadius, borderRadius); return bounds.contains(position); } return true; @@ -938,7 +938,7 @@ class _BoxDecorationPainter extends BoxPainter { return hasUniformWidth; } - void _paintBox(ui.Canvas canvas, Rect rect, Paint paint) { + void _paintBox(Canvas canvas, Rect rect, Paint paint) { switch (_decoration.shape) { case BoxShape.circle: assert(_decoration.borderRadius == null); @@ -951,30 +951,30 @@ class _BoxDecorationPainter extends BoxPainter { canvas.drawRect(rect, paint); } else { double radius = _decoration.getEffectiveBorderRadius(rect); - canvas.drawRRect(new ui.RRect.fromRectXY(rect, radius, radius), paint); + canvas.drawRRect(new RRect.fromRectXY(rect, radius, radius), paint); } break; } } - void _paintShadows(ui.Canvas canvas, Rect rect) { + void _paintShadows(Canvas canvas, Rect rect) { if (_decoration.boxShadow == null) return; for (BoxShadow boxShadow in _decoration.boxShadow) { final Paint paint = new Paint() ..color = boxShadow.color - ..maskFilter = new ui.MaskFilter.blur(ui.BlurStyle.normal, boxShadow._blurSigma); + ..maskFilter = new MaskFilter.blur(BlurStyle.normal, boxShadow._blurSigma); final Rect bounds = rect.shift(boxShadow.offset).inflate(boxShadow.spreadRadius); _paintBox(canvas, bounds, paint); } } - void _paintBackgroundColor(ui.Canvas canvas, Rect rect) { + void _paintBackgroundColor(Canvas canvas, Rect rect) { if (_decoration.backgroundColor != null || _decoration.gradient != null) _paintBox(canvas, rect, _backgroundPaint); } - void _paintBackgroundImage(ui.Canvas canvas, Rect rect) { + void _paintBackgroundImage(Canvas canvas, Rect rect) { final BackgroundImage backgroundImage = _decoration.backgroundImage; if (backgroundImage == null) return; @@ -993,7 +993,7 @@ class _BoxDecorationPainter extends BoxPainter { ); } - void _paintBorder(ui.Canvas canvas, Rect rect) { + void _paintBorder(Canvas canvas, Rect rect) { if (_decoration.border == null) return; @@ -1056,19 +1056,19 @@ class _BoxDecorationPainter extends BoxPainter { canvas.drawPath(path, paint); } - void _paintBorderWithRadius(ui.Canvas canvas, Rect rect) { + void _paintBorderWithRadius(Canvas canvas, Rect rect) { assert(_hasUniformBorder); assert(_decoration.shape == BoxShape.rectangle); Color color = _decoration.border.top.color; double width = _decoration.border.top.width; double radius = _decoration.getEffectiveBorderRadius(rect); - ui.RRect outer = new ui.RRect.fromRectXY(rect, radius, radius); - ui.RRect inner = new ui.RRect.fromRectXY(rect.deflate(width), radius - width, radius - width); + RRect outer = new RRect.fromRectXY(rect, radius, radius); + RRect inner = new RRect.fromRectXY(rect.deflate(width), radius - width, radius - width); canvas.drawDRRect(outer, inner, new Paint()..color = color); } - void _paintBorderWithCircle(ui.Canvas canvas, Rect rect) { + void _paintBorderWithCircle(Canvas canvas, Rect rect) { assert(_hasUniformBorder); assert(_decoration.shape == BoxShape.circle); assert(_decoration.borderRadius == null); @@ -1078,14 +1078,14 @@ class _BoxDecorationPainter extends BoxPainter { Paint paint = new Paint() ..color = _decoration.border.top.color ..strokeWidth = width - ..style = ui.PaintingStyle.stroke; + ..style = PaintingStyle.stroke; Point center = rect.center; double radius = (rect.shortestSide - width) / 2.0; canvas.drawCircle(center, radius, paint); } /// Paint the box decoration into the given location on the given canvas - void paint(ui.Canvas canvas, Rect rect) { + void paint(Canvas canvas, Rect rect) { _paintShadows(canvas, rect); _paintBackgroundColor(canvas, rect); _paintBackgroundImage(canvas, rect); diff --git a/packages/flutter/lib/src/painting/decoration.dart b/packages/flutter/lib/src/painting/decoration.dart index 2827d08dd9..e0e0519293 100644 --- a/packages/flutter/lib/src/painting/decoration.dart +++ b/packages/flutter/lib/src/painting/decoration.dart @@ -2,8 +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 'basic_types.dart'; import 'edge_dims.dart'; export 'edge_dims.dart' show EdgeDims; @@ -16,14 +15,14 @@ abstract class Decoration { EdgeDims get padding => null; Decoration lerpFrom(Decoration a, double t) => this; Decoration lerpTo(Decoration b, double t) => b; - bool hitTest(ui.Size size, ui.Point position) => true; + bool hitTest(Size size, Point position) => true; bool get needsListeners => false; - void addChangeListener(ui.VoidCallback listener) { assert(false); } - void removeChangeListener(ui.VoidCallback listener) { assert(false); } + void addChangeListener(VoidCallback listener) { assert(false); } + void removeChangeListener(VoidCallback listener) { assert(false); } BoxPainter createBoxPainter(); String toString([String prefix = '']) => '$prefix$runtimeType'; } abstract class BoxPainter { - void paint(ui.Canvas canvas, ui.Rect rect); + void paint(Canvas canvas, Rect rect); } diff --git a/packages/flutter/lib/src/painting/edge_dims.dart b/packages/flutter/lib/src/painting/edge_dims.dart index 5a0990f917..5fd44573b2 100644 --- a/packages/flutter/lib/src/painting/edge_dims.dart +++ b/packages/flutter/lib/src/painting/edge_dims.dart @@ -2,8 +2,9 @@ // 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' show hashValues; +import 'dart:ui' as ui show lerpDouble; + +import 'basic_types.dart'; /// An immutable set of offsets in each of the four cardinal directions. /// @@ -50,13 +51,13 @@ class EdgeDims { double get vertical => top + bottom; /// The size that this EdgeDims would occupy with an empty interior. - ui.Size get collapsedSize => new ui.Size(horizontal, vertical); + Size get collapsedSize => new Size(horizontal, vertical); /// An EdgeDims with top and bottom as well as left and right flipped. EdgeDims get flipped => new EdgeDims.TRBL(bottom, left, top, right); - ui.Rect inflateRect(ui.Rect rect) { - return new ui.Rect.fromLTRB(rect.left - left, rect.top - top, rect.right + right, rect.bottom + bottom); + Rect inflateRect(Rect rect) { + return new Rect.fromLTRB(rect.left - left, rect.top - top, rect.right + right, rect.bottom + bottom); } EdgeDims operator -(EdgeDims other) { diff --git a/packages/flutter/lib/src/painting/shadows.dart b/packages/flutter/lib/src/painting/shadows.dart deleted file mode 100644 index 1a7d199e57..0000000000 --- a/packages/flutter/lib/src/painting/shadows.dart +++ /dev/null @@ -1,29 +0,0 @@ -// 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 'dart:ui' as ui; - -/// A helper class to build a [ui.DrawLooper] for drawing shadows -class ShadowDrawLooperBuilder { - ui.LayerDrawLooperBuilder _builder = new ui.LayerDrawLooperBuilder(); - - /// Adds a shadow with the given parameters. - void addShadow(ui.Offset offset, ui.Color color, double blur) { - _builder.addLayerOnTop( - new ui.DrawLooperLayerInfo() - ..setPaintBits(ui.PaintBits.all) - ..setOffset(offset) - ..setColorMode(ui.TransferMode.src), - new ui.Paint() - ..color = color - ..maskFilter = new ui.MaskFilter.blur(ui.BlurStyle.normal, blur) - ); - } - - /// Returns the draw looper built for the added shadows - ui.DrawLooper build() { - _builder.addLayerOnTop(new ui.DrawLooperLayerInfo(), new ui.Paint()); - return _builder.build(); - } -} diff --git a/packages/flutter/lib/src/painting/text_painter.dart b/packages/flutter/lib/src/painting/text_painter.dart index 14bf7f1ba6..7723474160 100644 --- a/packages/flutter/lib/src/painting/text_painter.dart +++ b/packages/flutter/lib/src/painting/text_painter.dart @@ -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 Paragraph, ParagraphBuilder, ParagraphStyle, TextBox; import 'basic_types.dart'; import 'text_editing.dart'; @@ -212,7 +212,7 @@ class TextPainter { } /// Paints the text onto the given canvas at the given offset. - void paint(ui.Canvas canvas, ui.Offset offset) { + void paint(Canvas canvas, Offset offset) { assert(!_needsLayout && "Please call layout() before paint() to position the text before painting it." is String); _paragraph.paint(canvas, offset); } @@ -223,7 +223,7 @@ class TextPainter { return null; ui.TextBox box = boxes[0]; double caretEnd = box.end; - double dx = box.direction == ui.TextDirection.rtl ? caretEnd : caretEnd - caretPrototype.width; + double dx = box.direction == TextDirection.rtl ? caretEnd : caretEnd - caretPrototype.width; return new Offset(dx, 0.0); } @@ -233,7 +233,7 @@ class TextPainter { return null; ui.TextBox box = boxes[0]; double caretStart = box.start; - double dx = box.direction == ui.TextDirection.rtl ? caretStart - caretPrototype.width : caretStart; + double dx = box.direction == TextDirection.rtl ? caretStart - caretPrototype.width : caretStart; return new Offset(dx, 0.0); } diff --git a/packages/flutter/lib/src/painting/text_style.dart b/packages/flutter/lib/src/painting/text_style.dart index b0f506e25d..d03c1ade87 100644 --- a/packages/flutter/lib/src/painting/text_style.dart +++ b/packages/flutter/lib/src/painting/text_style.dart @@ -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 ParagraphStyle, TextStyle, lerpDouble; import 'basic_types.dart'; diff --git a/packages/flutter/lib/src/rendering/basic_types.dart b/packages/flutter/lib/src/rendering/basic_types.dart index f3a756ff67..2beeee69c4 100644 --- a/packages/flutter/lib/src/rendering/basic_types.dart +++ b/packages/flutter/lib/src/rendering/basic_types.dart @@ -2,19 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -export 'dart:ui' show - Canvas, - Color, - ColorFilter, - Offset, - Paint, - Path, - Point, - Rect, - Size, - TransferMode, - VoidCallback; - typedef void ValueChanged(T value); /// A BitField over an enum (or other class whose values implement "index"). diff --git a/packages/flutter/lib/src/rendering/binding.dart b/packages/flutter/lib/src/rendering/binding.dart index 55c0c798e9..8769ba85e9 100644 --- a/packages/flutter/lib/src/rendering/binding.dart +++ b/packages/flutter/lib/src/rendering/binding.dart @@ -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 window; import 'package:flutter/gestures.dart'; import 'package:flutter/scheduler.dart'; diff --git a/packages/flutter/lib/src/rendering/box.dart b/packages/flutter/lib/src/rendering/box.dart index a88840a20d..89009486b2 100644 --- a/packages/flutter/lib/src/rendering/box.dart +++ b/packages/flutter/lib/src/rendering/box.dart @@ -3,19 +3,15 @@ // found in the LICENSE file. import 'dart:math' as math; -import 'dart:ui' as ui; -import 'dart:ui' show hashValues; +import 'dart:ui' as ui show lerpDouble; import 'package:flutter/animation.dart'; import 'package:flutter/gestures.dart'; -import 'package:flutter/painting.dart'; import 'package:vector_math/vector_math_64.dart'; import 'debug.dart'; import 'object.dart'; -export 'package:flutter/painting.dart' show EdgeDims, FractionalOffset, TextBaseline; - // This class should only be used in debug builds class _DebugSize extends Size { _DebugSize(Size source, this._owner, this._canBeUsedByParent): super.copy(source); @@ -837,7 +833,7 @@ abstract class RenderBox extends RenderObject { void debugPaintSize(PaintingContext context, Offset offset) { assert(() { Paint paint = new Paint() - ..style = ui.PaintingStyle.stroke + ..style = PaintingStyle.stroke ..strokeWidth = 1.0 ..color = debugPaintSizeColor; context.canvas.drawRect((offset & size).deflate(0.5), paint); @@ -847,7 +843,7 @@ abstract class RenderBox extends RenderObject { void debugPaintBaselines(PaintingContext context, Offset offset) { assert(() { Paint paint = new Paint() - ..style = ui.PaintingStyle.stroke + ..style = PaintingStyle.stroke ..strokeWidth = 0.25; Path path; // ideographic baseline diff --git a/packages/flutter/lib/src/rendering/debug.dart b/packages/flutter/lib/src/rendering/debug.dart index 550bfc325c..a0cd3374fc 100644 --- a/packages/flutter/lib/src/rendering/debug.dart +++ b/packages/flutter/lib/src/rendering/debug.dart @@ -5,7 +5,6 @@ import 'dart:async'; import 'dart:convert' show JSON; import 'dart:developer' as developer; -import 'dart:ui' as ui; import 'package:flutter/painting.dart'; import 'package:flutter/rendering.dart'; @@ -18,35 +17,35 @@ export 'package:flutter/services.dart' show debugPrint; bool debugPaintSizeEnabled = false; /// The color to use when painting RenderObject bounds. -ui.Color debugPaintSizeColor = const ui.Color(0xFF00FFFF); +Color debugPaintSizeColor = const Color(0xFF00FFFF); /// The color to use when painting some boxes that just add space (e.g. an empty /// RenderConstrainedBox or RenderPadding). -ui.Color debugPaintSpacingColor = const ui.Color(0x90909090); +Color debugPaintSpacingColor = const Color(0x90909090); /// The color to use when painting RenderPadding edges. -ui.Color debugPaintPaddingColor = const ui.Color(0x900090FF); +Color debugPaintPaddingColor = const Color(0x900090FF); /// The color to use when painting RenderPadding edges. -ui.Color debugPaintPaddingInnerEdgeColor = const ui.Color(0xFF0090FF); +Color debugPaintPaddingInnerEdgeColor = const Color(0xFF0090FF); /// The color to use when painting the arrows used to show RenderPositionedBox alignment. -ui.Color debugPaintArrowColor = const ui.Color(0xFFFFFF00); +Color debugPaintArrowColor = const Color(0xFFFFFF00); /// Causes each RenderBox to paint a line at each of its baselines. bool debugPaintBaselinesEnabled = false; /// The color to use when painting alphabetic baselines. -ui.Color debugPaintAlphabeticBaselineColor = const ui.Color(0xFF00FF00); +Color debugPaintAlphabeticBaselineColor = const Color(0xFF00FF00); /// The color ot use when painting ideographic baselines. -ui.Color debugPaintIdeographicBaselineColor = const ui.Color(0xFFFFD000); +Color debugPaintIdeographicBaselineColor = const Color(0xFFFFD000); /// Causes each Layer to paint a box around its bounds. bool debugPaintLayerBordersEnabled = false; /// The color to use when painting Layer borders. -ui.Color debugPaintLayerBordersColor = const ui.Color(0xFFFF9800); +Color debugPaintLayerBordersColor = const Color(0xFFFF9800); /// Causes RenderBox objects to flash while they are being tapped. bool debugPaintPointersEnabled = false; @@ -55,7 +54,7 @@ bool debugPaintPointersEnabled = false; int debugPaintPointersColorValue = 0x00BBBB; /// The color to use when painting RenderError boxes in checked mode. -ui.Color debugErrorBoxColor = const ui.Color(0xFFFF0000); +Color debugErrorBoxColor = const Color(0xFFFF0000); /// Overlay a rotating set of colors when repainting layers in checked mode. bool debugEnableRepaintRainbox = false; diff --git a/packages/flutter/lib/src/rendering/editable_line.dart b/packages/flutter/lib/src/rendering/editable_line.dart index b124ff9828..bc4ad25cae 100644 --- a/packages/flutter/lib/src/rendering/editable_line.dart +++ b/packages/flutter/lib/src/rendering/editable_line.dart @@ -2,14 +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 'dart:ui' as ui show Paragraph, ParagraphBuilder, ParagraphStyle, TextBox; import 'package:flutter/gestures.dart'; -import 'package:flutter/painting.dart'; +import 'basic_types.dart'; import 'box.dart'; import 'object.dart'; -import 'paragraph.dart'; const _kCaretGap = 1.0; // pixels const _kCaretHeightOffset = 2.0; // pixels diff --git a/packages/flutter/lib/src/rendering/image.dart b/packages/flutter/lib/src/rendering/image.dart index 5b18a690a1..597dfa2ed7 100644 --- a/packages/flutter/lib/src/rendering/image.dart +++ b/packages/flutter/lib/src/rendering/image.dart @@ -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 'dart:ui' as ui; - -import 'package:flutter/painting.dart'; +import 'dart:ui' as ui show Image; import 'box.dart'; import 'object.dart'; diff --git a/packages/flutter/lib/src/rendering/layer.dart b/packages/flutter/lib/src/rendering/layer.dart index 3c96290f2f..5342d7a389 100644 --- a/packages/flutter/lib/src/rendering/layer.dart +++ b/packages/flutter/lib/src/rendering/layer.dart @@ -2,16 +2,15 @@ // 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 Picture, SceneBuilder; +import 'dart:ui' show Offset; +import 'package:flutter/painting.dart'; import 'package:vector_math/vector_math_64.dart'; import 'package:mojo_services/mojo/ui/layouts.mojom.dart' as mojom; -import 'basic_types.dart'; import 'debug.dart'; -export 'basic_types.dart'; - /// A composited layer /// /// During painting, the render tree generates a tree of composited layers that @@ -317,7 +316,7 @@ class ClipRRectLayer extends ContainerLayer { ClipRRectLayer({ this.clipRRect }); /// The rounded-rect to clip in the parent's coordinate system - ui.RRect clipRRect; + RRect clipRRect; // TODO(abarth): Why is the rounded-rect in the parent's coordinate system // instead of in the coordinate system of this layer? @@ -403,7 +402,7 @@ class ShaderMaskLayer extends ContainerLayer { ShaderMaskLayer({ this.shader, this.maskRect, this.transferMode }); /// The shader to apply to the children. - ui.Shader shader; + Shader shader; /// The size of the shader. Rect maskRect; diff --git a/packages/flutter/lib/src/rendering/object.dart b/packages/flutter/lib/src/rendering/object.dart index f92a4aae4b..ec8cf012a0 100644 --- a/packages/flutter/lib/src/rendering/object.dart +++ b/packages/flutter/lib/src/rendering/object.dart @@ -3,7 +3,7 @@ // found in the LICENSE file. import 'dart:developer'; -import 'dart:ui' as ui; +import 'dart:ui' as ui show PictureRecorder; import 'package:flutter/gestures.dart'; import 'package:flutter/painting.dart'; @@ -18,8 +18,8 @@ import 'node.dart'; import 'semantics.dart'; import 'binding.dart'; -export 'layer.dart'; export 'package:flutter/gestures.dart' show HitTestEntry, HitTestResult; +export 'package:flutter/painting.dart'; /// Base class for data associated with a [RenderObject] by its parent. /// @@ -163,7 +163,7 @@ class PaintingContext { canvas.drawRect(_paintBounds, new Paint()..color = debugCurrentRepaintColor.toColor()); if (debugPaintLayerBordersEnabled) { Paint paint = new Paint() - ..style = ui.PaintingStyle.stroke + ..style = PaintingStyle.stroke ..strokeWidth = 1.0 ..color = debugPaintLayerBordersColor; canvas.drawRect(_paintBounds, paint); @@ -223,9 +223,9 @@ class PaintingContext { /// This function will call painter synchronously with a painting context that /// is clipped by the given clip. The given clip should not incorporate the /// painting offset. - void pushClipRRect(bool needsCompositing, Offset offset, Rect bounds, ui.RRect clipRRect, PaintingContextCallback painter) { + void pushClipRRect(bool needsCompositing, Offset offset, Rect bounds, RRect clipRRect, PaintingContextCallback painter) { Rect offsetBounds = bounds.shift(offset); - ui.RRect offsetClipRRect = clipRRect.shift(offset); + RRect offsetClipRRect = clipRRect.shift(offset); if (needsCompositing) { _stopRecordingIfNeeded(); ClipRRectLayer clipLayer = new ClipRRectLayer(clipRRect: offsetClipRRect); @@ -305,7 +305,7 @@ class PaintingContext { /// /// This function will call painter synchronously with a painting context that /// will be masked with the given shader. - void pushShaderMask(Offset offset, ui.Shader shader, Rect maskRect, TransferMode transferMode, PaintingContextCallback painter) { + void pushShaderMask(Offset offset, Shader shader, Rect maskRect, TransferMode transferMode, PaintingContextCallback painter) { _stopRecordingIfNeeded(); ShaderMaskLayer shaderLayer = new ShaderMaskLayer( shader: shader, diff --git a/packages/flutter/lib/src/rendering/paragraph.dart b/packages/flutter/lib/src/rendering/paragraph.dart index 9c7df5167c..330af42451 100644 --- a/packages/flutter/lib/src/rendering/paragraph.dart +++ b/packages/flutter/lib/src/rendering/paragraph.dart @@ -2,24 +2,10 @@ // 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 'box.dart'; import 'object.dart'; import 'semantics.dart'; -export 'package:flutter/painting.dart' show - FontStyle, - FontWeight, - PlainTextSpan, - StyledTextSpan, - TextAlign, - TextBaseline, - TextDecoration, - TextDecorationStyle, - TextSpan, - TextStyle; - /// A render object that displays a paragraph of text class RenderParagraph extends RenderBox { diff --git a/packages/flutter/lib/src/rendering/proxy_box.dart b/packages/flutter/lib/src/rendering/proxy_box.dart index 4d81aaae26..e4b183b104 100644 --- a/packages/flutter/lib/src/rendering/proxy_box.dart +++ b/packages/flutter/lib/src/rendering/proxy_box.dart @@ -2,12 +2,10 @@ // 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/painting.dart'; import 'package:flutter/gestures.dart'; import 'package:vector_math/vector_math_64.dart'; +import 'basic_types.dart'; import 'box.dart'; import 'debug.dart'; import 'object.dart'; @@ -19,7 +17,6 @@ export 'package:flutter/gestures.dart' show PointerMoveEvent, PointerUpEvent, PointerCancelEvent; -export 'package:flutter/painting.dart' show Decoration, BoxDecoration; /// A base class for render objects that resemble their children. /// @@ -642,7 +639,7 @@ class RenderOpacity extends RenderProxyBox { } } -typedef ui.Shader ShaderCallback(Rect bounds); +typedef Shader ShaderCallback(Rect bounds); class RenderShaderMask extends RenderProxyBox { RenderShaderMask({ RenderBox child, ShaderCallback shaderCallback, TransferMode transferMode }) @@ -805,7 +802,7 @@ class RenderClipRRect extends RenderProxyBox { void paint(PaintingContext context, Offset offset) { if (child != null) { Rect rect = Point.origin & size; - ui.RRect rrect = new ui.RRect.fromRectXY(rect, xRadius, yRadius); + RRect rrect = new RRect.fromRectXY(rect, xRadius, yRadius); context.pushClipRRect(needsCompositing, offset, rect, rrect, super.paint); } } diff --git a/packages/flutter/lib/src/rendering/shifted_box.dart b/packages/flutter/lib/src/rendering/shifted_box.dart index 73d6357e07..0718aed7a0 100644 --- a/packages/flutter/lib/src/rendering/shifted_box.dart +++ b/packages/flutter/lib/src/rendering/shifted_box.dart @@ -3,9 +3,6 @@ // found in the LICENSE file. import 'dart:math' as math; -import 'dart:ui' as ui; - -import 'package:flutter/painting.dart'; import 'box.dart'; import 'debug.dart'; @@ -300,7 +297,7 @@ class RenderPositionedBox extends RenderShiftedBox { if (child != null && !child.size.isEmpty) { Path path; paint = new Paint() - ..style = ui.PaintingStyle.stroke + ..style = PaintingStyle.stroke ..strokeWidth = 1.0 ..color = debugPaintArrowColor; path = new Path(); diff --git a/packages/flutter/lib/src/rendering/view.dart b/packages/flutter/lib/src/rendering/view.dart index abdcbf4765..d12b3b741d 100644 --- a/packages/flutter/lib/src/rendering/view.dart +++ b/packages/flutter/lib/src/rendering/view.dart @@ -3,9 +3,8 @@ // found in the LICENSE file. import 'dart:developer'; -import 'dart:ui' as ui; +import 'dart:ui' as ui show Scene, SceneBuilder, window; -import 'package:flutter/painting.dart'; import 'package:flutter/scheduler.dart'; import 'package:vector_math/vector_math_64.dart'; diff --git a/packages/flutter/lib/src/rendering/viewport.dart b/packages/flutter/lib/src/rendering/viewport.dart index 967eaba638..e1fee2ae61 100644 --- a/packages/flutter/lib/src/rendering/viewport.dart +++ b/packages/flutter/lib/src/rendering/viewport.dart @@ -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 window; import 'package:vector_math/vector_math_64.dart'; diff --git a/packages/flutter/lib/src/scheduler/scheduler.dart b/packages/flutter/lib/src/scheduler/scheduler.dart index 4da82e4032..22387c4167 100644 --- a/packages/flutter/lib/src/scheduler/scheduler.dart +++ b/packages/flutter/lib/src/scheduler/scheduler.dart @@ -5,11 +5,14 @@ import 'dart:async'; import 'dart:collection'; import 'dart:developer'; -import 'dart:ui' as ui; +import 'dart:ui' as ui show window; +import 'dart:ui' show VoidCallback; import 'package:collection/collection.dart'; import 'package:flutter/services.dart'; +export 'dart:ui' show VoidCallback; + /// Slows down animations by this factor to help in development. double timeDilation = 1.0; @@ -32,7 +35,7 @@ SchedulerExceptionHandler debugSchedulerExceptionHandler; /// /// Combines the task and its priority. class _TaskEntry { - final ui.VoidCallback task; + final VoidCallback task; final int priority; const _TaskEntry(this.task, this.priority); @@ -110,7 +113,7 @@ abstract class Scheduler extends BindingBase { bool _hasRequestedABeginFrameCallback = false; /// Schedules the given [task] with the given [priority]. - void scheduleTask(ui.VoidCallback task, Priority priority) { + void scheduleTask(VoidCallback task, Priority priority) { bool isFirstTask = _taskQueue.isEmpty; _taskQueue.add(new _TaskEntry(task, priority._value)); if (isFirstTask) diff --git a/packages/flutter/lib/src/animation/ticker.dart b/packages/flutter/lib/src/scheduler/ticker.dart similarity index 98% rename from packages/flutter/lib/src/animation/ticker.dart rename to packages/flutter/lib/src/scheduler/ticker.dart index 9e4845453d..9e6be89643 100644 --- a/packages/flutter/lib/src/animation/ticker.dart +++ b/packages/flutter/lib/src/scheduler/ticker.dart @@ -4,7 +4,7 @@ import 'dart:async'; -import 'package:flutter/scheduler.dart'; +import 'scheduler.dart'; typedef TickerCallback(Duration elapsed); diff --git a/packages/flutter/lib/src/services/image_decoder.dart b/packages/flutter/lib/src/services/image_decoder.dart index fcba7ecf04..8a60e4177c 100644 --- a/packages/flutter/lib/src/services/image_decoder.dart +++ b/packages/flutter/lib/src/services/image_decoder.dart @@ -4,7 +4,7 @@ import 'dart:async'; import 'dart:typed_data'; -import 'dart:ui' as ui; +import 'dart:ui' as ui show Image, decodeImageFromDataPipe, decodeImageFromList; import 'package:mojo/core.dart' show MojoDataPipeConsumer; diff --git a/packages/flutter/lib/src/services/image_resource.dart b/packages/flutter/lib/src/services/image_resource.dart index 75d4f0dbe7..c6d0e9e2b4 100644 --- a/packages/flutter/lib/src/services/image_resource.dart +++ b/packages/flutter/lib/src/services/image_resource.dart @@ -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 'print.dart'; diff --git a/packages/flutter/lib/src/widgets/basic.dart b/packages/flutter/lib/src/widgets/basic.dart index a47685e4f4..0db20a8a7c 100644 --- a/packages/flutter/lib/src/widgets/basic.dart +++ b/packages/flutter/lib/src/widgets/basic.dart @@ -2,72 +2,46 @@ // 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; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'framework.dart'; +export 'package:flutter/animation.dart'; +export 'package:flutter/painting.dart'; export 'package:flutter/rendering.dart' show - BackgroundImage, - Border, - BorderSide, + Axis, BoxConstraints, - BoxDecoration, - BoxShadow, - BoxShape, - Canvas, - Color, - ColorFilter, CustomClipper, CustomPainter, - Decoration, - DecorationPosition, - EdgeDims, + FixedColumnCountGridDelegate, FlexAlignItems, FlexDirection, FlexJustifyContent, - FixedColumnCountGridDelegate, - FontStyle, - FontWeight, - FractionalOffset, - Gradient, + FractionalOffsetTween, GridDelegate, HitTestBehavior, - ImageFit, - ImageRepeat, - InputEvent, - LinearGradient, - Matrix4, MaxTileWidthGridDelegate, - Offset, + MultiChildLayoutDelegate, OneChildLayoutDelegate, - Paint, - Path, + Painter, + PaintingContext, PlainTextSpan, - Point, PointerCancelEvent, + PointerCancelEventListener, PointerDownEvent, + PointerDownEventListener, PointerEvent, PointerMoveEvent, + PointerMoveEventListener, PointerUpEvent, - RadialGradient, - Rect, - Axis, - Size, - StyledTextSpan, - TextAlign, - TextBaseline, - TextDecoration, - TextDecorationStyle, - TextSpan, - TextStyle, - TransferMode, + PointerUpEventListener, + RelativeRect, + ShaderCallback, ValueChanged, - ViewportAnchor, - VoidCallback; - + ViewportAnchor; // PAINTING NODES diff --git a/packages/flutter/lib/src/widgets/binding.dart b/packages/flutter/lib/src/widgets/binding.dart index 96ec7f4177..43a0abb66f 100644 --- a/packages/flutter/lib/src/widgets/binding.dart +++ b/packages/flutter/lib/src/widgets/binding.dart @@ -2,8 +2,9 @@ // 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:developer'; +import 'dart:ui' as ui show window; +import 'dart:ui' show AppLifecycleState, Locale; import 'package:flutter/gestures.dart'; import 'package:flutter/rendering.dart'; @@ -12,11 +13,13 @@ import 'package:flutter/services.dart'; import 'framework.dart'; +export 'dart:ui' show AppLifecycleState, Locale; + class BindingObserver { bool didPopRoute() => false; void didChangeMetrics() { } - void didChangeLocale(ui.Locale locale) { } - void didChangeAppLifecycleState(ui.AppLifecycleState state) { } + void didChangeLocale(Locale locale) { } + void didChangeAppLifecycleState(AppLifecycleState state) { } } /// A concrete binding for applications based on the Widgets framework. @@ -69,7 +72,7 @@ class WidgetFlutterBinding extends BindingBase with Scheduler, Gesturer, MojoShe dispatchLocaleChanged(ui.window.locale); } - void dispatchLocaleChanged(ui.Locale locale) { + void dispatchLocaleChanged(Locale locale) { for (BindingObserver observer in _observers) observer.didChangeLocale(locale); } @@ -82,7 +85,7 @@ class WidgetFlutterBinding extends BindingBase with Scheduler, Gesturer, MojoShe activity.finishCurrentActivity(); } - void handleAppLifecycleStateChanged(ui.AppLifecycleState state) { + void handleAppLifecycleStateChanged(AppLifecycleState state) { for (BindingObserver observer in _observers) observer.didChangeAppLifecycleState(state); } diff --git a/packages/flutter/lib/src/widgets/checked_mode_banner.dart b/packages/flutter/lib/src/widgets/checked_mode_banner.dart index cad5edd228..e5e0faa43d 100644 --- a/packages/flutter/lib/src/widgets/checked_mode_banner.dart +++ b/packages/flutter/lib/src/widgets/checked_mode_banner.dart @@ -3,10 +3,6 @@ // found in the LICENSE file. import 'dart:math' as math; -import 'dart:ui' as ui; - -import 'package:flutter/painting.dart'; -import 'package:flutter/rendering.dart'; import 'basic.dart'; import 'framework.dart'; @@ -37,7 +33,7 @@ class _CheckedModeBannerPainter extends CustomPainter { void paint(Canvas canvas, Size size) { final Paint paintShadow = new Paint() ..color = const Color(0x7F000000) - ..maskFilter = new ui.MaskFilter.blur(ui.BlurStyle.normal, kShadowBlur); + ..maskFilter = new MaskFilter.blur(BlurStyle.normal, kShadowBlur); final Paint paintBanner = new Paint() ..color = kColor; canvas diff --git a/packages/flutter/lib/src/widgets/dismissable.dart b/packages/flutter/lib/src/widgets/dismissable.dart index 19e4a08b94..a1f1edd420 100644 --- a/packages/flutter/lib/src/widgets/dismissable.dart +++ b/packages/flutter/lib/src/widgets/dismissable.dart @@ -2,10 +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/animation.dart'; - import 'basic.dart'; import 'transitions.dart'; import 'framework.dart'; @@ -186,7 +182,7 @@ class _DismissableState extends State { _dismissController.value = _dragExtent.abs() / _size.width; } - bool _isFlingGesture(ui.Offset velocity) { + bool _isFlingGesture(Offset velocity) { double vx = velocity.dx; double vy = velocity.dy; if (_directionIsYAxis) { @@ -215,7 +211,7 @@ class _DismissableState extends State { return false; } - void _handleDragEnd(ui.Offset velocity) { + void _handleDragEnd(Offset velocity) { if (!_isActive || _dismissController.isAnimating) return; setState(() { diff --git a/packages/flutter/lib/src/widgets/editable.dart b/packages/flutter/lib/src/widgets/editable.dart index 3eb9e8e6df..bb36706329 100644 --- a/packages/flutter/lib/src/widgets/editable.dart +++ b/packages/flutter/lib/src/widgets/editable.dart @@ -4,9 +4,8 @@ import 'dart:async'; +import 'package:flutter/rendering.dart' show RenderEditableLine; import 'package:sky_services/editing/editing.mojom.dart' as mojom; -import 'package:flutter/painting.dart'; -import 'package:flutter/rendering.dart'; import 'basic.dart'; import 'framework.dart'; diff --git a/packages/flutter/lib/src/widgets/enter_exit_transition.dart b/packages/flutter/lib/src/widgets/enter_exit_transition.dart index c12aef5509..a71d85bd92 100644 --- a/packages/flutter/lib/src/widgets/enter_exit_transition.dart +++ b/packages/flutter/lib/src/widgets/enter_exit_transition.dart @@ -4,8 +4,6 @@ import 'dart:async'; -import 'package:flutter/animation.dart'; - import 'basic.dart'; import 'framework.dart'; diff --git a/packages/flutter/lib/src/widgets/framework.dart b/packages/flutter/lib/src/widgets/framework.dart index 4e97db8f77..53e47e4bd5 100644 --- a/packages/flutter/lib/src/widgets/framework.dart +++ b/packages/flutter/lib/src/widgets/framework.dart @@ -8,7 +8,7 @@ import 'dart:collection'; import 'package:flutter/rendering.dart'; export 'dart:ui' show hashValues, hashList; -export 'package:flutter/rendering.dart' show debugPrint; +export 'package:flutter/rendering.dart' show RenderObject, RenderBox, debugPrint; // KEYS diff --git a/packages/flutter/lib/src/widgets/heroes.dart b/packages/flutter/lib/src/widgets/heroes.dart index 833b9a1217..9b3b18262b 100644 --- a/packages/flutter/lib/src/widgets/heroes.dart +++ b/packages/flutter/lib/src/widgets/heroes.dart @@ -4,8 +4,6 @@ import 'dart:collection'; -import 'package:flutter/animation.dart'; -import 'package:flutter/rendering.dart'; import 'package:flutter/scheduler.dart'; import 'basic.dart'; diff --git a/packages/flutter/lib/src/widgets/implicit_animations.dart b/packages/flutter/lib/src/widgets/implicit_animations.dart index 94b705497e..fb721623f5 100644 --- a/packages/flutter/lib/src/widgets/implicit_animations.dart +++ b/packages/flutter/lib/src/widgets/implicit_animations.dart @@ -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 'package:flutter/animation.dart'; - import 'basic.dart'; import 'framework.dart'; diff --git a/packages/flutter/lib/src/widgets/mimic.dart b/packages/flutter/lib/src/widgets/mimic.dart index 0ae06a7fcf..2260eee0c6 100644 --- a/packages/flutter/lib/src/widgets/mimic.dart +++ b/packages/flutter/lib/src/widgets/mimic.dart @@ -4,8 +4,7 @@ import 'dart:async'; -import 'package:flutter/animation.dart'; -import 'package:flutter/rendering.dart'; +import 'package:flutter/rendering.dart' show RenderStack; import 'basic.dart'; import 'framework.dart'; @@ -110,7 +109,9 @@ class MimicOverlayEntry { RenderBox stack = context.ancestorRenderObjectOfType(const TypeMatcher()); // TODO(abarth): Handle the case where the transform here isn't just a translation. - Point localPosition = stack == null ? globalPosition: stack.globalToLocal(globalPosition); + // TODO(ianh): We should probably be getting the overlay's render object rather than looking for a RenderStack. + assert(stack != null); + Point localPosition = stack.globalToLocal(globalPosition); return new Positioned( left: localPosition.x, top: localPosition.y, diff --git a/packages/flutter/lib/src/widgets/modal_barrier.dart b/packages/flutter/lib/src/widgets/modal_barrier.dart index b7e013b08e..942432d6b9 100644 --- a/packages/flutter/lib/src/widgets/modal_barrier.dart +++ b/packages/flutter/lib/src/widgets/modal_barrier.dart @@ -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 'package:flutter/animation.dart'; - import 'basic.dart'; import 'framework.dart'; import 'gesture_detector.dart'; diff --git a/packages/flutter/lib/src/widgets/pageable_list.dart b/packages/flutter/lib/src/widgets/pageable_list.dart index e08c101185..238680420f 100644 --- a/packages/flutter/lib/src/widgets/pageable_list.dart +++ b/packages/flutter/lib/src/widgets/pageable_list.dart @@ -4,8 +4,7 @@ import 'dart:async'; -import 'package:flutter/animation.dart'; -import 'package:flutter/rendering.dart'; +import 'package:flutter/rendering.dart' show RenderList, ViewportDimensions; import 'basic.dart'; import 'framework.dart'; diff --git a/packages/flutter/lib/src/widgets/pages.dart b/packages/flutter/lib/src/widgets/pages.dart index 92b78cbd63..edbe3bc8d8 100644 --- a/packages/flutter/lib/src/widgets/pages.dart +++ b/packages/flutter/lib/src/widgets/pages.dart @@ -4,8 +4,7 @@ import 'dart:async'; -import 'package:flutter/animation.dart'; - +import 'basic.dart'; import 'navigator.dart'; import 'overlay.dart'; import 'routes.dart'; diff --git a/packages/flutter/lib/src/widgets/routes.dart b/packages/flutter/lib/src/widgets/routes.dart index 07fbc9f960..09ea237496 100644 --- a/packages/flutter/lib/src/widgets/routes.dart +++ b/packages/flutter/lib/src/widgets/routes.dart @@ -4,8 +4,6 @@ import 'dart:async'; -import 'package:flutter/animation.dart'; - import 'basic.dart'; import 'focus.dart'; import 'framework.dart'; diff --git a/packages/flutter/lib/src/widgets/scrollable.dart b/packages/flutter/lib/src/widgets/scrollable.dart index 8036dc5b80..6a90b01ffd 100644 --- a/packages/flutter/lib/src/widgets/scrollable.dart +++ b/packages/flutter/lib/src/widgets/scrollable.dart @@ -4,12 +4,11 @@ import 'dart:async'; import 'dart:math' as math; -import 'dart:ui' as ui; +import 'dart:ui' as ui show window; import 'package:newton/newton.dart'; -import 'package:flutter/animation.dart'; import 'package:flutter/gestures.dart'; -import 'package:flutter/rendering.dart'; +import 'package:flutter/rendering.dart' show HasScrollDirection; import 'basic.dart'; import 'framework.dart'; diff --git a/packages/flutter/lib/src/widgets/semantics_debugger.dart b/packages/flutter/lib/src/widgets/semantics_debugger.dart index 0a810985d2..854505297a 100644 --- a/packages/flutter/lib/src/widgets/semantics_debugger.dart +++ b/packages/flutter/lib/src/widgets/semantics_debugger.dart @@ -3,9 +3,7 @@ // found in the LICENSE file. import 'dart:math' as math; -import 'dart:ui' as ui; -import 'package:flutter/painting.dart'; import 'package:flutter/rendering.dart'; import 'package:sky_services/semantics/semantics.mojom.dart' as mojom; @@ -193,17 +191,17 @@ class _SemanticsDebuggerEntry { if (innerRect.isEmpty) { Paint fill = new Paint() ..color = lineColor - ..style = ui.PaintingStyle.fill; + ..style = PaintingStyle.fill; canvas.drawRect(rect, fill); } else { Paint fill = new Paint() ..color = const Color(0xFFFFFFFF) - ..style = ui.PaintingStyle.fill; + ..style = PaintingStyle.fill; canvas.drawRect(rect, fill); Paint line = new Paint() ..strokeWidth = rank * 2.0 ..color = lineColor - ..style = ui.PaintingStyle.stroke; + ..style = PaintingStyle.stroke; canvas.drawRect(innerRect, line); } if (textPainter != null) { diff --git a/packages/flutter/lib/src/widgets/status_transitions.dart b/packages/flutter/lib/src/widgets/status_transitions.dart index f118d3bdb0..a3a0bc524a 100644 --- a/packages/flutter/lib/src/widgets/status_transitions.dart +++ b/packages/flutter/lib/src/widgets/status_transitions.dart @@ -2,8 +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 'basic.dart'; import 'framework.dart'; /// A component that rebuilds when the given animation changes status. diff --git a/packages/flutter/lib/src/widgets/transitions.dart b/packages/flutter/lib/src/widgets/transitions.dart index a0cee0114f..ffeb756827 100644 --- a/packages/flutter/lib/src/widgets/transitions.dart +++ b/packages/flutter/lib/src/widgets/transitions.dart @@ -4,8 +4,6 @@ import 'dart:math' as math; -import 'package:flutter/animation.dart'; -import 'package:flutter/rendering.dart'; import 'package:vector_math/vector_math_64.dart' show Matrix4; import 'basic.dart'; diff --git a/packages/flutter/test/engine/canvas_test_disabled.dart b/packages/flutter/test/engine/canvas_test_disabled.dart index e6db08e74d..26741181c4 100644 --- a/packages/flutter/test/engine/canvas_test_disabled.dart +++ b/packages/flutter/test/engine/canvas_test_disabled.dart @@ -2,8 +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 'dart:ui' show Rect, Color, Paint; +import 'dart:ui' as ui show PictureRecorder; +import 'dart:ui' show Rect, Color, Paint, Canvas; import 'package:test/test.dart'; import 'package:vector_math/vector_math_64.dart'; @@ -11,7 +11,7 @@ import 'package:vector_math/vector_math_64.dart'; void main() { ui.PictureRecorder recorder = new ui.PictureRecorder(); - ui.Canvas canvas = new ui.Canvas(recorder, new Rect.fromLTRB(0.0, 0.0, 100.0, 100.0)); + Canvas canvas = new Canvas(recorder, new Rect.fromLTRB(0.0, 0.0, 100.0, 100.0)); test("matrix access should work", () { // Matrix equality doesn't work! diff --git a/packages/flutter/test/rendering/image_test.dart b/packages/flutter/test/rendering/image_test.dart index 7e36964087..264d60d21c 100644 --- a/packages/flutter/test/rendering/image_test.dart +++ b/packages/flutter/test/rendering/image_test.dart @@ -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; import 'package:flutter/rendering.dart'; import 'package:test/test.dart'; diff --git a/packages/flutter/test/widget/page_forward_transitions_test.dart b/packages/flutter/test/widget/page_forward_transitions_test.dart index 8471d1b966..98e7a38901 100644 --- a/packages/flutter/test/widget/page_forward_transitions_test.dart +++ b/packages/flutter/test/widget/page_forward_transitions_test.dart @@ -3,7 +3,6 @@ // found in the LICENSE file. import 'package:flutter_test/flutter_test.dart'; -import 'package:flutter/animation.dart'; import 'package:flutter/material.dart'; import 'package:test/test.dart' hide TypeMatcher; diff --git a/packages/flutter/test/widget/positioned_test.dart b/packages/flutter/test/widget/positioned_test.dart index 28f2c71baa..7a03b2c14b 100644 --- a/packages/flutter/test/widget/positioned_test.dart +++ b/packages/flutter/test/widget/positioned_test.dart @@ -3,7 +3,6 @@ // found in the LICENSE file. import 'package:flutter_test/flutter_test.dart'; -import 'package:flutter/animation.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; diff --git a/packages/flutter/test/widget/shader_mask_test.dart b/packages/flutter/test/widget/shader_mask_test.dart index 513f57703c..72a1df7313 100644 --- a/packages/flutter/test/widget/shader_mask_test.dart +++ b/packages/flutter/test/widget/shader_mask_test.dart @@ -2,14 +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 'dart:ui' show Shader; import 'package:flutter_test/flutter_test.dart'; -import 'package:flutter/painting.dart'; import 'package:flutter/widgets.dart'; import 'package:test/test.dart'; -ui.Shader createShader(Rect bounds) { +Shader createShader(Rect bounds) { return new LinearGradient( begin: bounds.topLeft, end: bounds.bottomLeft, diff --git a/packages/flutter_sprites/lib/flutter_sprites.dart b/packages/flutter_sprites/lib/flutter_sprites.dart index 6d14e81f41..a66015778e 100644 --- a/packages/flutter_sprites/lib/flutter_sprites.dart +++ b/packages/flutter_sprites/lib/flutter_sprites.dart @@ -10,12 +10,10 @@ import 'dart:collection'; import 'dart:convert'; import 'dart:math' as math; import 'dart:typed_data'; -import 'dart:ui' as ui; +import 'dart:ui' as ui show Image; import 'package:box2d/box2d.dart' as box2d; -import 'package:flutter/animation.dart'; import 'package:flutter/gestures.dart'; -import 'package:flutter/painting.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter/services.dart'; diff --git a/packages/flutter_sprites/lib/src/effect_line.dart b/packages/flutter_sprites/lib/src/effect_line.dart index 05ca8e82d6..9af90505dd 100644 --- a/packages/flutter_sprites/lib/src/effect_line.dart +++ b/packages/flutter_sprites/lib/src/effect_line.dart @@ -15,7 +15,7 @@ class EffectLine extends Node { EffectLine({ this.texture: null, - this.transferMode: ui.TransferMode.dstOver, + this.transferMode: TransferMode.dstOver, List points, this.widthMode : EffectLineWidthMode.linear, this.minWidth: 10.0, @@ -38,8 +38,8 @@ class EffectLine extends Node { _colorSequence = colorSequence; if (_colorSequence == null) { _colorSequence = new ColorSequence.fromStartAndEndColor( - new Color(0xffffffff), - new Color(0xffffffff) + const Color(0xffffffff), + const Color(0xffffffff) ); } @@ -51,7 +51,7 @@ class EffectLine extends Node { final Texture texture; - final ui.TransferMode transferMode; + final TransferMode transferMode; final EffectLineWidthMode widthMode; final double minWidth; diff --git a/packages/flutter_sprites/lib/src/layer.dart b/packages/flutter_sprites/lib/src/layer.dart index 7a8e084474..8c8e5927e2 100644 --- a/packages/flutter_sprites/lib/src/layer.dart +++ b/packages/flutter_sprites/lib/src/layer.dart @@ -22,7 +22,7 @@ class Layer extends Node with SpritePaint { Layer([this.layerRect = null]); Paint _cachedPaint = new Paint() - ..filterQuality = ui.FilterQuality.low + ..filterQuality = FilterQuality.low ..isAntiAlias = false; void _prePaint(Canvas canvas, Matrix4 matrix) { diff --git a/packages/flutter_sprites/lib/src/particle_system.dart b/packages/flutter_sprites/lib/src/particle_system.dart index 90dd254bd9..ee40e7f065 100644 --- a/packages/flutter_sprites/lib/src/particle_system.dart +++ b/packages/flutter_sprites/lib/src/particle_system.dart @@ -144,7 +144,7 @@ class ParticleSystem extends Node { /// The transfer mode used to draw the particle system. Default is /// [TransferMode.plus]. - ui.TransferMode transferMode; + TransferMode transferMode; List<_Particle> _particles; @@ -154,7 +154,7 @@ class ParticleSystem extends Node { double opacity = 1.0; static Paint _paint = new Paint() - ..filterQuality = ui.FilterQuality.low + ..filterQuality = FilterQuality.low ..isAntiAlias = false; ParticleSystem(this.texture, @@ -186,7 +186,7 @@ class ParticleSystem extends Node { this.redVar: 0, this.greenVar: 0, this.blueVar: 0, - this.transferMode: ui.TransferMode.plus, + this.transferMode: TransferMode.plus, this.numParticlesToEmit: 0, this.autoRemoveOnFinish: true}) { _particles = new List<_Particle>(); @@ -362,7 +362,7 @@ class ParticleSystem extends Node { void paint(Canvas canvas) { if (opacity == 0.0) return; - List transforms = []; + List transforms = []; List rects = []; List colors = []; @@ -391,7 +391,7 @@ class ParticleSystem extends Node { double ay = rect.height / 2; double tx = particle.pos[0] + -scos * ax + ssin * ay; double ty = particle.pos[1] + -ssin * ax - scos * ay; - ui.RSTransform transform = new ui.RSTransform(scos, ssin, tx, ty); + RSTransform transform = new RSTransform(scos, ssin, tx, ty); transforms.add(transform); // Color @@ -417,7 +417,7 @@ class ParticleSystem extends Node { } canvas.drawAtlas(texture.image, transforms, rects, colors, - ui.TransferMode.modulate, null, _paint); + TransferMode.modulate, null, _paint); } } diff --git a/packages/flutter_sprites/lib/src/physics_debug.dart b/packages/flutter_sprites/lib/src/physics_debug.dart index bdba48e341..24616390e1 100644 --- a/packages/flutter_sprites/lib/src/physics_debug.dart +++ b/packages/flutter_sprites/lib/src/physics_debug.dart @@ -43,7 +43,7 @@ class _PhysicsDebugDraw extends box2d.DebugDraw { void drawCircle(Vector2 center, num radius, box2d.Color3i color, [Vector2 axis]) { Paint paint = new Paint() ..color = _toColor(color) - ..style = ui.PaintingStyle.stroke + ..style = PaintingStyle.stroke ..strokeWidth = 1.0; canvas.drawCircle(_toPoint(center), _scale(radius), paint); diff --git a/packages/flutter_sprites/lib/src/sprite.dart b/packages/flutter_sprites/lib/src/sprite.dart index 4b14073b6a..b770b9d3aa 100644 --- a/packages/flutter_sprites/lib/src/sprite.dart +++ b/packages/flutter_sprites/lib/src/sprite.dart @@ -17,7 +17,7 @@ class Sprite extends NodeWithSize with SpritePaint { bool constrainProportions = false; Paint _cachedPaint = new Paint() - ..filterQuality = ui.FilterQuality.low + ..filterQuality = FilterQuality.low ..isAntiAlias = false; /// Creates a new sprite from the provided [texture]. @@ -107,13 +107,13 @@ abstract class SpritePaint { /// /// // Add the colors of the sprite with the colors of the background /// mySprite.transferMode = TransferMode.plusMode; - ui.TransferMode transferMode; + TransferMode transferMode; void _updatePaint(Paint paint) { paint.color = new Color.fromARGB((255.0*_opacity).toInt(), 255, 255, 255); if (colorOverlay != null) { - paint.colorFilter = new ColorFilter.mode(colorOverlay, ui.TransferMode.srcATop); + paint.colorFilter = new ColorFilter.mode(colorOverlay, TransferMode.srcATop); } if (transferMode != null) { diff --git a/packages/flutter_sprites/lib/src/textured_line.dart b/packages/flutter_sprites/lib/src/textured_line.dart index 41def9885e..2cbe95fdd5 100644 --- a/packages/flutter_sprites/lib/src/textured_line.dart +++ b/packages/flutter_sprites/lib/src/textured_line.dart @@ -38,8 +38,8 @@ class TexturedLinePainter { _cachedPaint = new Paint(); } else { Matrix4 matrix = new Matrix4.identity(); - ui.ImageShader shader = new ui.ImageShader(texture.image, - ui.TileMode.repeated, ui.TileMode.repeated, matrix.storage); + ImageShader shader = new ImageShader(texture.image, + TileMode.repeated, TileMode.repeated, matrix.storage); _cachedPaint = new Paint() ..shader = shader; @@ -77,7 +77,7 @@ class TexturedLinePainter { bool removeArtifacts = true; - ui.TransferMode transferMode = ui.TransferMode.srcOver; + TransferMode transferMode = TransferMode.srcOver; Paint _cachedPaint = new Paint(); @@ -169,7 +169,7 @@ class TexturedLinePainter { lastMiter = currentMiter; } - canvas.drawVertices(ui.VertexMode.triangles, vertices, textureCoordinates, verticeColors, ui.TransferMode.modulate, indicies, _cachedPaint); + canvas.drawVertices(VertexMode.triangles, vertices, textureCoordinates, verticeColors, TransferMode.modulate, indicies, _cachedPaint); } double _xPosForStop(double stop) { diff --git a/packages/flutter_sprites/lib/src/virtual_joystick.dart b/packages/flutter_sprites/lib/src/virtual_joystick.dart index c660cf0047..a9cbc97672 100644 --- a/packages/flutter_sprites/lib/src/virtual_joystick.dart +++ b/packages/flutter_sprites/lib/src/virtual_joystick.dart @@ -14,7 +14,7 @@ class VirtualJoystick extends NodeWithSize { _paintControl = new Paint() ..color=new Color(0xffffffff) ..strokeWidth = 1.0 - ..style = ui.PaintingStyle.stroke; + ..style = PaintingStyle.stroke; } Point _value = Point.origin; diff --git a/packages/flutter_test/lib/src/widget_tester.dart b/packages/flutter_test/lib/src/widget_tester.dart index ec948d0afc..6c120f1e08 100644 --- a/packages/flutter_test/lib/src/widget_tester.dart +++ b/packages/flutter_test/lib/src/widget_tester.dart @@ -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 window; import 'package:quiver/testing/async.dart'; import 'package:quiver/time.dart'; @@ -35,7 +35,7 @@ class WidgetTester extends Instrumentation { } void setLocale(String languageCode, String countryCode) { - ui.Locale locale = new ui.Locale(languageCode, countryCode); + Locale locale = new Locale(languageCode, countryCode); binding.dispatchLocaleChanged(locale); async.flushMicrotasks(); } diff --git a/packages/playfair/lib/playfair.dart b/packages/playfair/lib/playfair.dart index be292be5f3..30a7e99d23 100644 --- a/packages/playfair/lib/playfair.dart +++ b/packages/playfair/lib/playfair.dart @@ -5,11 +5,4 @@ /// A simple charting library for Flutter. library playfair; -import 'dart:ui' as ui; -import 'dart:math' as math; - -import 'package:flutter/material.dart'; -import 'package:flutter/rendering.dart'; -import 'package:flutter/painting.dart'; - -part 'src/base.dart'; +export 'src/base.dart'; diff --git a/packages/playfair/lib/src/base.dart b/packages/playfair/lib/src/base.dart index b1e985d20d..e69edced7a 100644 --- a/packages/playfair/lib/src/base.dart +++ b/packages/playfair/lib/src/base.dart @@ -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 playfair; +import 'dart:math' as math; + +import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; class ChartData { const ChartData({ @@ -54,17 +57,17 @@ class _ChartWrapper extends LeafRenderObjectWidget { final TextTheme textTheme; final ChartData data; - RenderChart createRenderObject() => new RenderChart(textTheme: textTheme, data: data); + _RenderChart createRenderObject() => new _RenderChart(textTheme: textTheme, data: data); - void updateRenderObject(RenderChart renderObject, _ChartWrapper oldWidget) { - renderObject.textTheme = textTheme; - renderObject.data = data; + void updateRenderObject(_RenderChart renderObject, _ChartWrapper oldWidget) { + renderObject + ..textTheme = textTheme + ..data = data; } } -class RenderChart extends RenderConstrainedBox { - - RenderChart({ +class _RenderChart extends RenderConstrainedBox { + _RenderChart({ TextTheme textTheme, ChartData data }) : _painter = new ChartPainter(textTheme: textTheme, data: data), @@ -98,7 +101,7 @@ class RenderChart extends RenderConstrainedBox { } } -class Gridline { +class _Gridline { double value; TextPainter labelPainter; Point labelPosition; @@ -106,7 +109,7 @@ class Gridline { Point end; } -class Indicator { +class _Indicator { Point start; Point end; TextPainter labelPainter; @@ -148,18 +151,18 @@ class ChartPainter { Rect _rect; // These are updated by _layout() - List _horizontalGridlines; + List<_Gridline> _horizontalGridlines; List _markers; - Indicator _indicator; + _Indicator _indicator; void _layout() { // Create the scale labels double yScaleWidth = 0.0; - _horizontalGridlines = new List(); + _horizontalGridlines = new List<_Gridline>(); assert(data.numHorizontalGridlines > 1); double stepSize = (data.endY - data.startY) / (data.numHorizontalGridlines - 1); for(int i = 0; i < data.numHorizontalGridlines; i++) { - Gridline gridline = new Gridline() + _Gridline gridline = new _Gridline() ..value = _roundToPlaces(data.startY + stepSize * i, data.roundToPlaces); if (gridline.value < data.startY || gridline.value > data.endY) continue; // TODO(jackson): Align things so this doesn't ever happen @@ -185,7 +188,7 @@ class ChartPainter { ); // Left align and vertically center the labels on the right side - for(Gridline gridline in _horizontalGridlines) { + for(_Gridline gridline in _horizontalGridlines) { gridline.start = _convertPointToRectSpace(new Point(data.startX, gridline.value), markerRect); gridline.end = _convertPointToRectSpace(new Point(data.endX, gridline.value), markerRect); gridline.labelPosition = new Point( @@ -206,13 +209,13 @@ class ChartPainter { if (data.indicatorLine != null && data.indicatorLine >= data.startY && data.indicatorLine <= data.endY) { - _indicator = new Indicator() + _indicator = new _Indicator() ..start = _convertPointToRectSpace(new Point(data.startX, data.indicatorLine), markerRect) ..end = _convertPointToRectSpace(new Point(data.endX, data.indicatorLine), markerRect); if (data.indicatorText != null) { TextSpan text = new StyledTextSpan( _textTheme.body1, - [new PlainTextSpan("${data.indicatorText}")] + [new PlainTextSpan("${data.indicatorText}")] ); _indicator.labelPainter = new TextPainter(text) ..maxWidth = markerRect.width @@ -236,17 +239,17 @@ class ChartPainter { return new Point(x, y); } - void _paintGrid(ui.Canvas canvas) { + void _paintGrid(Canvas canvas) { Paint paint = new Paint() ..strokeWidth = kGridStrokeWidth ..color = kGridColor; - for(Gridline gridline in _horizontalGridlines) { + for(_Gridline gridline in _horizontalGridlines) { gridline.labelPainter.paint(canvas, gridline.labelPosition.toOffset()); canvas.drawLine(gridline.start, gridline.end, paint); } } - void _paintChart(ui.Canvas canvas) { + void _paintChart(Canvas canvas) { Paint paint = new Paint() ..strokeWidth = kMarkerStrokeWidth ..color = kMarkerColor; @@ -256,11 +259,11 @@ class ChartPainter { canvas.drawCircle(marker, kMarkerRadius, paint); path.lineTo(marker.x, marker.y); } - paint.style = ui.PaintingStyle.stroke; + paint.style = PaintingStyle.stroke; canvas.drawPath(path, paint); } - void _paintIndicator(ui.Canvas canvas) { + void _paintIndicator(Canvas canvas) { if (_indicator == null) return; Paint paint = new Paint() @@ -271,7 +274,7 @@ class ChartPainter { _indicator.labelPainter.paint(canvas, _indicator.labelPosition.toOffset()); } - void paint(ui.Canvas canvas, Rect rect) { + void paint(Canvas canvas, Rect rect) { if (rect != _rect) _needsLayout = true; _rect = rect;