Commit a74d02da authored by Adam Barth's avatar Adam Barth

Rename Sky to Flutter in a few more places

parent 0a0a92eb
Sky Examples
============
Flutter Examples
================
This directory contains several examples of using Sky. Each of these is an
This directory contains several examples of using Flutter. Each of these is an
individual Dart application package. If you wish to run them with `sky_tool`
then you will want to run `pub get` inside their directory before running
`./packages/sky/sky_tool start`.
......@@ -10,7 +10,7 @@ then you will want to run `pub get` inside their directory before running
the text "hello, world."
2. *Stocks.* The [stocks app](stocks) is an example of a typical mobile app
built using Sky. The app shows a list of all the stocks in the NASDAQ.
built using Flutter. The app shows a list of all the stocks in the NASDAQ.
3. *Widgets.* The [widgets app](widgets) contains a number of Sky widgets so
3. *Widgets.* The [widgets app](widgets) contains a number of Flutter widgets so
you can experiment with them in a simple container.
......@@ -42,5 +42,5 @@ void main() {
child: new RenderPadding(child: table, padding: new EdgeDims.symmetric(vertical: 50.0))
);
new SkyBinding(root: root);
new FlutterBinding(root: root);
}
......@@ -72,5 +72,5 @@ void main() {
direction: FlexDirection.vertical,
alignItems: FlexAlignItems.stretch
);
new SkyBinding(root: root);
new FlutterBinding(root: root);
}
......@@ -73,5 +73,5 @@ void main() {
],
direction: FlexDirection.vertical
);
new SkyBinding(root: root);
new FlutterBinding(root: root);
}
......@@ -51,5 +51,5 @@ RenderBox buildFlexExample() {
}
void main() {
new SkyBinding(root: buildFlexExample());
new FlutterBinding(root: buildFlexExample());
}
......@@ -98,6 +98,6 @@ Pancetta meatball tongue tenderloin rump tail jowl boudin.""";
);
updateTaskDescription('Interactive Flex', topColor);
new SkyBinding(root: root);
new FlutterBinding(root: root);
sky.view.setEventCallback(handleEvent);
}
......@@ -36,5 +36,5 @@ void main() {
child: new RenderPadding(child: table, padding: new EdgeDims.symmetric(vertical: 50.0))
);
new SkyBinding(root: root);
new FlutterBinding(root: root);
}
......@@ -23,4 +23,4 @@ RenderBox buildGridExample() {
return new RenderGrid(children: children, maxChildExtent: 100.0);
}
main() => new SkyBinding(root: buildGridExample());
main() => new FlutterBinding(root: buildGridExample());
......@@ -35,5 +35,5 @@ Pancetta meatball tongue tenderloin rump tail jowl boudin.""";
flexRoot.add(child);
child.parentData.flex = 1;
new SkyBinding(root: root);
new FlutterBinding(root: root);
}
......@@ -549,5 +549,5 @@ RenderBox buildSectorExample() {
}
void main() {
new SkyBinding(root: buildSectorExample());
new FlutterBinding(root: buildSectorExample());
}
......@@ -18,7 +18,7 @@ void main() {
var paddedBox = new RenderPadding(
padding: const EdgeDims.all(50.0),
child: coloredBox);
new SkyBinding(root: new RenderDecoratedBox(
new FlutterBinding(root: new RenderDecoratedBox(
decoration: const BoxDecoration(
backgroundColor: const Color(0xFFFFFFFF)
),
......
......@@ -59,5 +59,5 @@ void main() {
(p4.verticalCenter == p2.height / al.cm(2.0)) as al.Constraint,
]);
new SkyBinding(root: root);
new FlutterBinding(root: root);
}
......@@ -29,7 +29,7 @@ void main() {
RenderPadding root = new RenderPadding(padding: new EdgeDims.all(20.0), child: transformBox);
new SkyBinding(root: root);
new FlutterBinding(root: root);
scheduler.addPersistentFrameCallback(rotate);
}
......
......@@ -84,5 +84,5 @@ void main() {
// that it doesn't eat events.
paragraph.parentData..top = 40.0
..left = 20.0;
new SkyBinding(root: stack);
new FlutterBinding(root: stack);
}
......@@ -24,5 +24,5 @@ void main() {
RenderFlex flex = new RenderFlex();
flex.add(spin);
new SkyBinding(root: flex);
new FlutterBinding(root: flex);
}
......@@ -70,12 +70,12 @@ void rotate(double timeStamp) {
void main() {
// Because we're going to use Widgets, we want to initialise its
// SkyBinding, not use the default one. We don't really need to do
// FlutterBinding, not use the default one. We don't really need to do
// this, because RenderBoxToWidgetAdapter does it for us, but
// it's good practice in case we happen to not have a
// RenderBoxToWidgetAdapter in our tree at startup, or in case we
// want a renderViewOverride.
WidgetSkyBinding.initWidgetSkyBinding();
WidgetFlutterBinding.initWidgetFlutterBinding();
RenderProxyBox proxy = new RenderProxyBox();
new RenderBoxToWidgetAdapter(proxy, builder); // adds itself to proxy
......@@ -88,6 +88,6 @@ void main() {
transformBox = new RenderTransform(child: flexRoot, transform: new Matrix4.identity());
RenderPadding root = new RenderPadding(padding: new EdgeDims.all(80.0), child: transformBox);
SkyBinding.instance.renderView.child = root;
FlutterBinding.instance.renderView.child = root;
scheduler.addPersistentFrameCallback(rotate);
}
......@@ -6,4 +6,4 @@ Flutter is optimized for today's, and tomorrow's, mobile devices. We are
focused on low-latency input and high frame rates on Android and iOS.
See the [getting started guide](https://flutter.github.io/getting-started/) for
information about using Sky.
information about using Flutter.
......@@ -4,7 +4,7 @@
/// The Flutter painting library
///
/// This library includes a variety of classes that wrap the Sky
/// This library includes a variety of classes that wrap the Flutter
/// engine's painting API for more specialised purposes, such as painting scaled
/// images, interpolating between shadows, painting borders around boxes, etc.
///
......
......@@ -20,7 +20,7 @@ export 'package:sky/src/rendering/object.dart';
export 'package:sky/src/rendering/paragraph.dart';
export 'package:sky/src/rendering/proxy_box.dart';
export 'package:sky/src/rendering/shifted_box.dart';
export 'package:sky/src/rendering/sky_binding.dart';
export 'package:sky/src/rendering/binding.dart';
export 'package:sky/src/rendering/stack.dart';
export 'package:sky/src/rendering/toggleable.dart';
export 'package:sky/src/rendering/view.dart';
......
......@@ -6,7 +6,7 @@ import 'package:sky/animation.dart';
import 'package:sky/rendering.dart';
import 'package:sky/src/fn3/framework.dart';
class WidgetFlutterBinding extends SkyBinding {
class WidgetFlutterBinding extends FlutterBinding {
WidgetFlutterBinding() {
BuildableElement.scheduleBuildFor = scheduleBuildFor;
......@@ -14,14 +14,14 @@ class WidgetFlutterBinding extends SkyBinding {
_renderViewElement.mount(null, null);
}
/// Ensures that there is a SkyBinding object instantiated.
/// Ensures that there is a FlutterBinding object instantiated.
static void initBinding() {
if (SkyBinding.instance == null)
if (FlutterBinding.instance == null)
new WidgetFlutterBinding();
assert(SkyBinding.instance is WidgetFlutterBinding);
assert(FlutterBinding.instance is WidgetFlutterBinding);
}
static WidgetFlutterBinding get instance => SkyBinding.instance;
static WidgetFlutterBinding get instance => FlutterBinding.instance;
/// The [Element] that is at the root of the hierarchy (and which wraps the
/// [RenderView] object at the root of the rendering hierarchy).
......
......@@ -7,7 +7,7 @@ import 'dart:sky' as sky;
import 'package:sky/gestures.dart';
import 'package:sky/src/fn3/basic.dart';
import 'package:sky/src/fn3/framework.dart';
import 'package:sky/src/rendering/sky_binding.dart';
import 'package:sky/src/rendering/binding.dart';
class GestureDetector extends StatefulComponent {
const GestureDetector({
......@@ -60,7 +60,7 @@ class GestureDetectorState extends State<GestureDetector> {
didUpdateConfig(null);
}
final PointerRouter _router = SkyBinding.instance.pointerRouter;
final PointerRouter _router = FlutterBinding.instance.pointerRouter;
TapGestureRecognizer _tap;
TapGestureRecognizer _ensureTap() {
......
......@@ -32,7 +32,7 @@ class _PointerState {
typedef void EventListener(sky.Event event);
/// A hit test entry used by [SkyBinding]
/// A hit test entry used by [FlutterBinding]
class BindingHitTestEntry extends HitTestEntry {
const BindingHitTestEntry(HitTestTarget target, this.result) : super(target);
......@@ -42,9 +42,9 @@ class BindingHitTestEntry extends HitTestEntry {
/// The glue between the render tree and the sky engine
// TODO(ianh): rename this class FlutterBinding
class SkyBinding extends HitTestTarget {
class FlutterBinding extends HitTestTarget {
SkyBinding({ RenderBox root: null, RenderView renderViewOverride }) {
FlutterBinding({ RenderBox root: null, RenderView renderViewOverride }) {
assert(_instance == null);
_instance = this;
......@@ -66,8 +66,8 @@ class SkyBinding extends HitTestTarget {
}
/// The singleton instance of the binding
static SkyBinding get instance => _instance;
static SkyBinding _instance;
static FlutterBinding get instance => _instance;
static FlutterBinding _instance;
/// The render tree that's attached to the output surface
RenderView get renderView => _renderView;
......@@ -175,5 +175,5 @@ class SkyBinding extends HitTestTarget {
/// Prints a textual representation of the entire render tree
void debugDumpRenderTree() {
SkyBinding.instance.renderView.toStringDeep().split('\n').forEach(print);
FlutterBinding.instance.renderView.toStringDeep().split('\n').forEach(print);
}
......@@ -585,7 +585,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
/// information is cleaned prior to painting so that render objects will
/// appear on screen in their up-to-date locations.
///
/// See [SkyBinding] for an example of how this function is used.
/// See [FlutterBinding] for an example of how this function is used.
static void flushLayout() {
sky.tracing.begin('RenderObject.flushLayout');
_debugDoingLayout = true;
......@@ -906,7 +906,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
/// Painting occurs after layout and before the scene is recomposited so that
/// scene is composited with up-to-date display lists for every render object.
///
/// See [SkyBinding] for an example of how this function is used.
/// See [FlutterBinding] for an example of how this function is used.
static void flushPaint() {
sky.tracing.begin('RenderObject.flushPaint');
_debugDoingPaint = true;
......
......@@ -6,7 +6,7 @@ import 'dart:sky' as sky;
import 'package:sky/animation.dart';
import 'package:sky/gestures.dart';
import 'package:sky/src/rendering/sky_binding.dart';
import 'package:sky/src/rendering/binding.dart';
import 'package:sky/src/rendering/box.dart';
import 'package:sky/src/rendering/object.dart';
import 'package:sky/src/rendering/proxy_box.dart';
......@@ -41,7 +41,7 @@ abstract class RenderToggleable extends RenderConstrainedBox {
void attach() {
super.attach();
_tap = new TapGestureRecognizer(
router: SkyBinding.instance.pointerRouter,
router: FlutterBinding.instance.pointerRouter,
onTap: _handleTap
);
}
......
......@@ -90,7 +90,7 @@ class DragController {
}
void update(Point globalPosition) {
HitTestResult result = SkyBinding.instance.hitTest(globalPosition);
HitTestResult result = FlutterBinding.instance.hitTest(globalPosition);
DragTarget target = _getDragTarget(result.path);
if (target == _activeTarget)
return;
......
......@@ -1477,15 +1477,15 @@ abstract class MultiChildRenderObjectWrapper extends RenderObjectWrapper {
}
class WidgetSkyBinding extends SkyBinding {
class WidgetFlutterBinding extends FlutterBinding {
WidgetSkyBinding({ RenderView renderViewOverride: null })
WidgetFlutterBinding({ RenderView renderViewOverride: null })
: super(renderViewOverride: renderViewOverride);
static void initWidgetSkyBinding({ RenderView renderViewOverride: null }) {
if (SkyBinding.instance == null)
new WidgetSkyBinding(renderViewOverride: renderViewOverride);
assert(SkyBinding.instance is WidgetSkyBinding);
static void initWidgetFlutterBinding({ RenderView renderViewOverride: null }) {
if (FlutterBinding.instance == null)
new WidgetFlutterBinding(renderViewOverride: renderViewOverride);
assert(FlutterBinding.instance is WidgetFlutterBinding);
}
void handleEvent(sky.Event event, BindingHitTestEntry entry) {
......@@ -1518,12 +1518,12 @@ abstract class App extends StatefulComponent {
void didMount() {
super.didMount();
SkyBinding.instance.addEventListener(_handleEvent);
FlutterBinding.instance.addEventListener(_handleEvent);
}
void didUnmount() {
super.didUnmount();
SkyBinding.instance.removeEventListener(_handleEvent);
FlutterBinding.instance.removeEventListener(_handleEvent);
}
void syncConstructorArguments(Component source) { }
......@@ -1559,12 +1559,12 @@ abstract class AbstractWidgetRoot extends StatefulComponent {
class RenderViewWrapper extends OneChildRenderObjectWrapper {
RenderViewWrapper({ Key key, Widget child }) : super(key: key, child: child);
RenderView get renderObject => super.renderObject;
RenderView createNode() => SkyBinding.instance.renderView;
RenderView createNode() => FlutterBinding.instance.renderView;
}
class AppContainer extends AbstractWidgetRoot {
AppContainer(this.app) {
assert(SkyBinding.instance is WidgetSkyBinding);
assert(FlutterBinding.instance is WidgetFlutterBinding);
}
final App app;
Widget build() => new RenderViewWrapper(child: app);
......@@ -1572,7 +1572,7 @@ class AppContainer extends AbstractWidgetRoot {
AppContainer _container;
void runApp(App app, { RenderView renderViewOverride, bool enableProfilingLoop: false }) {
WidgetSkyBinding.initWidgetSkyBinding(renderViewOverride: renderViewOverride);
WidgetFlutterBinding.initWidgetFlutterBinding(renderViewOverride: renderViewOverride);
_container = new AppContainer(app);
if (enableProfilingLoop) {
new Timer.periodic(const Duration(milliseconds: 20), (_) {
......
......@@ -5,7 +5,7 @@
import 'dart:sky' as sky;
import 'package:sky/gestures.dart';
import 'package:sky/src/rendering/sky_binding.dart';
import 'package:sky/src/rendering/binding.dart';
import 'package:sky/src/widgets/framework.dart';
class GestureDetector extends StatefulComponent {
......@@ -70,7 +70,7 @@ class GestureDetector extends StatefulComponent {
_syncGestureListeners();
}
final PointerRouter _router = SkyBinding.instance.pointerRouter;
final PointerRouter _router = FlutterBinding.instance.pointerRouter;
TapGestureRecognizer _tap;
TapGestureRecognizer _ensureTap() {
......
......@@ -46,7 +46,7 @@ class WidgetTester {
}
return result;
}
List<Layer> get layers => _layers(SkyBinding.instance.renderView.layer);
List<Layer> get layers => _layers(FlutterBinding.instance.renderView.layer);
void walkElements(ElementVisitor visitor) {
......
......@@ -45,7 +45,7 @@ class WidgetTester {
}
return result;
}
List<Layer> get layers => _layers(SkyBinding.instance.renderView.layer);
List<Layer> get layers => _layers(FlutterBinding.instance.renderView.layer);
void walkWidgets(WidgetTreeWalker walker) {
void walk(Widget widget) {
......@@ -103,10 +103,10 @@ class WidgetTester {
return _getWidgetPoint(widget, (Size size) => size.bottomRight(Point.origin));
}
HitTestResult _hitTest(Point location) => SkyBinding.instance.hitTest(location);
HitTestResult _hitTest(Point location) => FlutterBinding.instance.hitTest(location);
void _dispatchEvent(sky.Event event, HitTestResult result) {
SkyBinding.instance.dispatchEvent(event, result);
FlutterBinding.instance.dispatchEvent(event, result);
}
void tap(Widget widget, { int pointer: 1 }) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment