From 4604021dd3e1edd00a5fb56821c1e04e88d85ff6 Mon Sep 17 00:00:00 2001 From: Collin Jackson Date: Fri, 17 Jul 2015 16:17:32 -0700 Subject: [PATCH 1/6] Support for non-alphabetic baselines --- .../example/rendering/align_items.dart | 4 ++-- .../flutter/example/stocks/lib/stock_row.dart | 7 +++++- packages/flutter/lib/painting/text_style.dart | 15 ++++++++++-- packages/flutter/lib/rendering/box.dart | 4 ++-- packages/flutter/lib/rendering/flex.dart | 24 +++++++++++++------ packages/flutter/lib/theme/typography.dart | 23 +++++++++--------- packages/flutter/lib/widgets/basic.dart | 5 +++- 7 files changed, 56 insertions(+), 26 deletions(-) diff --git a/packages/flutter/example/rendering/align_items.dart b/packages/flutter/example/rendering/align_items.dart index a8c15484e3..5a9c247fc8 100644 --- a/packages/flutter/example/rendering/align_items.dart +++ b/packages/flutter/example/rendering/align_items.dart @@ -20,7 +20,7 @@ void main() { TextStyle style = const TextStyle(color: const Color(0xFF000000)); RenderParagraph paragraph = new RenderParagraph(new InlineStyle(style, [new InlineText("${alignItems}")])); table.add(new RenderPadding(child: paragraph, padding: new EdgeDims.only(top: 20.0))); - var row = new RenderFlex(alignItems: alignItems); + var row = new RenderFlex(alignItems: alignItems, baseline: TextBaseline.alphabetic); style = new TextStyle(fontSize: 15.0, color: const Color(0xFF000000)); row.add(new RenderDecoratedBox( @@ -32,7 +32,7 @@ void main() { decoration: new BoxDecoration(backgroundColor: const Color(0x7FCCFFCC)), child: new RenderParagraph(new InlineStyle(style, [new InlineText('foo foo foo')])) )); - var subrow = new RenderFlex(alignItems: alignItems); + var subrow = new RenderFlex(alignItems: alignItems, baseline: TextBaseline.alphabetic); style = new TextStyle(fontSize: 25.0, color: const Color(0xFF000000)); subrow.add(new RenderDecoratedBox( decoration: new BoxDecoration(backgroundColor: const Color(0x7FCCCCFF)), diff --git a/packages/flutter/example/stocks/lib/stock_row.dart b/packages/flutter/example/stocks/lib/stock_row.dart index ab98f8a0ec..8e9ba64200 100644 --- a/packages/flutter/example/stocks/lib/stock_row.dart +++ b/packages/flutter/example/stocks/lib/stock_row.dart @@ -6,6 +6,7 @@ import 'package:sky/painting/text_style.dart'; import 'package:sky/rendering/box.dart'; import 'package:sky/widgets/ink_well.dart'; import 'package:sky/widgets/basic.dart'; +import 'package:sky/widgets/default_text_style.dart'; import 'package:sky/widgets/theme.dart'; import 'stock_arrow.dart'; @@ -60,7 +61,11 @@ class StockRow extends Component { margin: const EdgeDims.only(right: 5.0) ), new Flexible( - child: new Flex(children, alignItems: FlexAlignItems.baseline) + child: new Flex( + children, + alignItems: FlexAlignItems.baseline, + textBaseline: DefaultTextStyle.of(this).textBaseline + ) ) ]) ) diff --git a/packages/flutter/lib/painting/text_style.dart b/packages/flutter/lib/painting/text_style.dart index 1ebc558fa7..db5b0ecd9e 100644 --- a/packages/flutter/lib/painting/text_style.dart +++ b/packages/flutter/lib/painting/text_style.dart @@ -10,6 +10,8 @@ const bold = FontWeight.w700; enum TextAlign { left, right, center } +enum TextBaseline { alphabetic, ideographic } + enum TextDecoration { none, underline, overline, lineThrough } const underline = const [TextDecoration.underline]; const overline = const [TextDecoration.overline]; @@ -24,6 +26,7 @@ class TextStyle { this.fontSize, this.fontWeight, this.textAlign, + this.textBaseline, this.height, this.decoration, this.decorationColor, @@ -35,6 +38,7 @@ class TextStyle { final double fontSize; // in pixels final FontWeight fontWeight; final TextAlign textAlign; + final TextBaseline textBaseline; final double height; // multiple of fontSize final List decoration; // TODO(ianh): Switch this to a Set<> once Dart supports constant Sets final Color decorationColor; @@ -46,6 +50,7 @@ class TextStyle { double fontSize, FontWeight fontWeight, TextAlign textAlign, + TextBaseline textBaseline, double height, List decoration, Color decorationColor, @@ -57,6 +62,7 @@ class TextStyle { fontSize: fontSize != null ? fontSize : this.fontSize, fontWeight: fontWeight != null ? fontWeight : this.fontWeight, textAlign: textAlign != null ? textAlign : this.textAlign, + textBaseline: textBaseline != null ? textBaseline : this.textBaseline, height: height != null ? height : this.height, decoration: decoration != null ? decoration : this.decoration, decorationColor: decorationColor != null ? decorationColor : this.decorationColor, @@ -71,6 +77,7 @@ class TextStyle { fontSize: other.fontSize, fontWeight: other.fontWeight, textAlign: other.textAlign, + textBaseline: other.textBaseline, height: other.height, decoration: other.decoration, decorationColor: other.decorationColor, @@ -157,10 +164,11 @@ class TextStyle { return true; return other is TextStyle && color == other.color && - fontFamily == other.fontFamily && + fontFamily == other.fontFamily && fontSize == other.fontSize && fontWeight == other.fontWeight && - textAlign == other.textAlign && + textAlign == other.textAlign && + textBaseline == other.textBaseline && decoration == other.decoration && decorationColor == other.decorationColor && decorationStyle == other.decorationStyle; @@ -174,6 +182,7 @@ class TextStyle { value = 37 * value + fontSize.hashCode; value = 37 * value + fontWeight.hashCode; value = 37 * value + textAlign.hashCode; + value = 37 * value + textBaseline.hashCode; value = 37 * value + decoration.hashCode; value = 37 * value + decorationColor.hashCode; value = 37 * value + decorationStyle.hashCode; @@ -193,6 +202,8 @@ class TextStyle { result.add('${prefix}fontWeight: $fontWeight'); if (textAlign != null) result.add('${prefix}textAlign: $textAlign'); + if (textBaseline != null) + result.add('${prefix}textBaseline: $textBaseline'); if (decoration != null) result.add('${prefix}decoration: $decoration'); if (decorationColor != null) diff --git a/packages/flutter/lib/rendering/box.dart b/packages/flutter/lib/rendering/box.dart index b07874e5d4..416312d810 100644 --- a/packages/flutter/lib/rendering/box.dart +++ b/packages/flutter/lib/rendering/box.dart @@ -7,10 +7,12 @@ import 'dart:sky' as sky; import 'package:sky/base/debug.dart'; import 'package:sky/painting/box_painter.dart'; +import 'package:sky/painting/text_style.dart'; import 'package:sky/rendering/object.dart'; import 'package:vector_math/vector_math.dart'; export 'package:sky/painting/box_painter.dart'; +export 'package:sky/painting/text_style.dart' show TextBaseline; // GENERIC BOX RENDERING // Anything that has a concept of x, y, width, height is going to derive from this @@ -253,8 +255,6 @@ class BoxParentData extends ParentData { String toString() => 'position=$position'; } -enum TextBaseline { alphabetic, ideographic } - abstract class RenderBox extends RenderObject { void setupParentData(RenderObject child) { diff --git a/packages/flutter/lib/rendering/flex.dart b/packages/flutter/lib/rendering/flex.dart index fd7d233094..48792fda02 100644 --- a/packages/flutter/lib/rendering/flex.dart +++ b/packages/flutter/lib/rendering/flex.dart @@ -47,10 +47,12 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin children, FlexDirection direction: FlexDirection.horizontal, FlexJustifyContent justifyContent: FlexJustifyContent.start, - FlexAlignItems alignItems: FlexAlignItems.center + FlexAlignItems alignItems: FlexAlignItems.center, + TextBaseline textBaseline }) : _direction = direction, _justifyContent = justifyContent, - _alignItems = alignItems { + _alignItems = alignItems, + _textBaseline = textBaseline { addAll(children); } @@ -81,6 +83,15 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin _textBaseline; + void set textBaseline (TextBaseline value) { + if (_textBaseline != value) { + _textBaseline = value; + markNeedsLayout(); + } + } + bool _overflowOccurredDuringLayout = false; void setupParentData(RenderBox child) { @@ -342,8 +353,8 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin new RenderFlex(direction: this.direction); RenderFlex get root => super.root; @@ -416,6 +418,7 @@ class Flex extends MultiChildRenderObjectWrapper { root.direction = direction; root.justifyContent = justifyContent; root.alignItems = alignItems; + root.textBaseline = textBaseline; } } From 1b440cc68baaa167d4314524458c3004938d8dc2 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Sat, 18 Jul 2015 12:22:30 -0700 Subject: [PATCH 2/6] Improve developer-facing READMEs Also, stop pushing the SDK to sky_sdk now that this repo exists. --- packages/flutter/README.md | 188 ++++++++----------------------------- 1 file changed, 38 insertions(+), 150 deletions(-) diff --git a/packages/flutter/README.md b/packages/flutter/README.md index daae838b09..e92a57e533 100644 --- a/packages/flutter/README.md +++ b/packages/flutter/README.md @@ -1,50 +1,14 @@ -Contributing -============ +Getting Started with Sky +======================== -This SDK is generated from the -[Sky repository](https://github.com/domokit/sky_engine) using -[deploy_sdk.py](https://github.com/domokit/sky_engine/blob/master/sky/tools/deploy_sdk.py). -Static files (including this README.md) are located under -[sky/sdk](https://github.com/domokit/sky_engine/tree/master/sky/sdk). +Sky apps are written in Dart. To get started, we need to set up Dart SDK: -Pull -requests and issue reports are gladly accepted at the -[Sky repository](https://github.com/domokit/sky_engine)! + - Install the [Dart SDK](https://www.dartlang.org/downloads/). + - Ensure that `$DART_SDK` is set to the path of your Dart SDK. -Sky -=== - -Sky is an experimental, high-performance UI framework for mobile apps. Sky helps -you create apps with beautiful user interfaces and high-quality interactive -design that run smoothly at 120 Hz. - -Sky consists of two components: - -1. *The Sky engine.* The engine is the core of the system. Written in C++, the - engine provides the muscle of the Sky system. The engine provides - several primitives, including a soft real-time scheduler and a hierarchical, - retained-mode graphics system, that let you build high-quality apps. - -2. *The Sky framework.* The [framework](packages/sky/lib/framework) makes it - easy to build apps using Sky by providing familiar user interface widgets, - such as buttons, infinite lists, and animations, on top of the engine using - Dart. These extensible components follow a functional programming style - inspired by [React](http://facebook.github.io/react/). - -We're still iterating on Sky heavily, which means the framework and underlying -engine are both likely to change in incompatible ways several times, but if -you're interested in trying out the system, this document can help you get -started. - -Examples --------- - -Sky uses Dart and Sky applications are -[Dart Packages](https://www.dartlang.org/docs/tutorials/shared-pkgs/). -Application creation starts by creating a new directory and +Once we have the Dart SDK, we can creating a new directory and adding a [pubspec.yaml](https://www.dartlang.org/tools/pub/pubspec.html): - pubspec.yaml for your app: ```yaml name: your_app_name dependencies: @@ -52,20 +16,23 @@ dependencies: ``` Once the pubspec is in place, create a `lib` directory (where your dart code -will go), ensure that the 'dart' and 'pub' executables are on your $PATH and +will go) ensure that the 'dart' and 'pub' executables are on your $PATH and run the following: -`pub get && pub run sky:init`. + - `mkdir lib` + - `pub get && pub run sky:init` Currently the Sky Engine assumes the entry point for your application is a -`main` function in a Dart file inside your package: +`main` function in `lib/main.dart`: ```dart import 'package:sky/widgets/basic.dart'; class HelloWorldApp extends App { Widget build() { - return new Text('Hello, world!'); + return new Center( + child: new Text('Hello, world!') + ); } } @@ -78,63 +45,25 @@ Execution starts in `main`, which instructs the framework to run a new instance of the `HelloWorldApp`. The framework then calls the `build()` function on `HelloWorldApp` to create a tree of widgets, some of which might be other `Components`, which in turn have `build()` functions that generate -more widgets iteratively to create the widget hierarchy. +more widgets iteratively to create the widget hierarchy. To learn more about +the widget system, please see the [widgets tutorial](lib/widgets/README.md). -Later, if a `Component` changes state, the framework calls that component's -`build()` function again to create a new widget tree. The framework diffs the -new widget tree against the old widget tree and any differences are applyed -to the underlying render tree. - - * To learn more about the widget system, please see the - [widgets tutorial](lib/widgets/README.md). - * To learn how to run Sky on your device, please see the - [Running a Sky application](#running-a-sky-application) section in this - document. - * To dive into examples, please see the [examples directory](example/). - -Services --------- - -Sky apps can access services from the host operating system using Mojo IPC. For -example, you can access the network using the `network_service.mojom` interface. -Although you can use these low-level interfaces directly, you might prefer to -access these services via libraries in the framework. For example, the -`fetch.dart` library wraps the underlying `network_service.mojom` in an -ergonomic interface: - -```dart -import 'package:sky/mojo/net/fetch.dart'; - -main() async { - Response response = await fetchBody('example.txt'); - print(response.bodyAsString()); -} -``` - -Set up your computer --------------------- - -1. Install the Dart SDK: - - https://www.dartlang.org/tools/download.html - -2. Install the `adb` tool from the Android SDK: - - https://developer.android.com/sdk/installing/index.html - -3. Ensure that `$DART_SDK` is set to the path of your Dart SDK and `adb` - (inside `platform-tools` in the android sdk) is in your `$PATH`. - -Set up your device ------------------- +Setup your Android device +------------------------- Currently Sky requires an Android device running the Lollipop (or newer) version of the Android operating system. -1. Enable developer mode on your device by visiting `Settings > About phone` + - Install the `adb` tool from the [Android SDK](https://developer.android.com/sdk/installing/index.html) + and ensure that `adb (inside `platform-tools` in the Android SDK) is in your + `$PATH`. + + - Enable developer mode on your device by visiting `Settings > About phone` and tapping the `Build number` field five times. -2. Enable `USB debugging` in `Settings > Developer options`. + - Enable `USB debugging` in `Settings > Developer options`. -3. Using a USB cable, plug your phone into your computer. If prompted on your + - Using a USB cable, plug your phone into your computer. If prompted on your device, authorize your computer to access your device. Running a Sky application @@ -142,73 +71,32 @@ Running a Sky application The `sky` pub package includes a `sky_tool` script to assist in running Sky applications inside the `SkyDemo.apk` harness. The `sky_tool` script -expects to be run from the root directory of your application pub package. To -run one of the examples in this SDK, try: +expects to be run from the root directory of your application's package (i.e., +the same directory that contains the `pubspec.yaml` file). To run your app, +follow these instructions: -1. `cd example/stocks` - -2. `pub get` to set up a copy of the sky package in the app directory. - -3. `./packages/sky/sky_tool start` to start the dev server and upload your + - `./packages/sky/sky_tool start` to start the dev server and upload your app to the device. (NOTE: add a `--install` flag to install `SkyDemo.apk` if it is not already installed on the device.) -4. Use `adb logcat` to view any errors or Dart `print()` output from the app. + - Use `adb logcat` to view any errors or Dart `print()` output from the app. `adb logcat -s sky` can be used to filter only adb messages from `SkyDemo.apk`. -Measuring Performance ---------------------- + Building a standalone APK + ------------------------- -Sky has support for generating trace files compatible with -[Chrome's about:tracing](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool). - -`packages/sky/sky_tool start_tracing` and `packages/sky/sky_tool stop_tracing` -are the commands to use. - -Due to https://github.com/domokit/mojo/issues/127 tracing currently -requires root access on the device. + Although it is possible to build a standalone APK containing your application, + doing so right now is difficult. If you're feeling brave, you can see how we + build the `Stocks.apk` in [example/stocks](example/stocks). Eventually we plan + to make this much easier and support platforms other than Android, but that work + still in progress. Debugging --------- Sky uses [Observatory](https://www.dartlang.org/tools/observatory/) for debugging and profiling. While running your Sky app using `sky_tool`, you can -access Observatory by navigating your web browser to http://localhost:8181/. - -Building a standalone MyApp ---------------------------- - -Although it is possible to bundle the Sky Engine in your own app (instead of -running your code inside SkyDemo.apk), right now doing so is difficult. - -There is one example of doing so if you're feeling brave: -https://github.com/domokit/sky_engine/tree/master/sky/sdk/example/stocks - -Eventually we plan to make this much easier and support platforms other than -Android, but that work is yet in progress. - -Adding Services to MyApp ------------------------- - -[Mojo IPC](https://github.com/domokit/mojo) is an inter-process-communication -system designed to provide cross-thread, cross-process, and language-agnostic -communication between applications. Sky uses Mojo IPC to make it possible -to write UI code in Dart and yet depend on networking code, etc. written in -another language. Services are replicable, meaning that Dart code -written to use the `network_service` remains portable to any platform -(iOS, Android, etc.) by simply providing a 'natively' written `network_service`. - -Embedders of the Sky Engine and consumers of the Sky Framework can use this -same mechanism to expose not only existing services like the -[Keyboard](https://github.com/domokit/mojo/blob/master/mojo/services/keyboard/public/interfaces/keyboard.mojom) -service to allow Sky Framework Dart code to interface with the underlying -platform's Keyboard, but also to expose any additional non-Dart business logic -to Sky/Dart UI code. - -As an example, [SkyApplication](https://github.com/domokit/sky_engine/blob/master/sky/shell/org/domokit/sky/shell/SkyApplication.java) -exposes a mojo `network_service` (required by Sky Engine C++ code) -[SkyDemoApplication](https://github.com/domokit/sky_engine/blob/master/sky/apk/demo/org/domokit/sky/demo/SkyDemoApplication.java) -additionally exposes `keyboard_service` and `sensor_service` for use by the Sky -Framework from Dart. +access Observatory by navigating your web browser to +[http://localhost:8181/](http://localhost:8181/). From b5347ce5562895cf8c066d7cc00d0d03f9dc17d8 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Sat, 18 Jul 2015 12:34:40 -0700 Subject: [PATCH 3/6] Improve the READMEs further --- packages/flutter/README.md | 45 ++++++++++++-------------- packages/flutter/lib/widgets/README.md | 6 ++-- 2 files changed, 24 insertions(+), 27 deletions(-) diff --git a/packages/flutter/README.md b/packages/flutter/README.md index e92a57e533..912bd45e41 100644 --- a/packages/flutter/README.md +++ b/packages/flutter/README.md @@ -1,10 +1,11 @@ -Getting Started with Sky +Getting started with Sky ======================== Sky apps are written in Dart. To get started, we need to set up Dart SDK: - Install the [Dart SDK](https://www.dartlang.org/downloads/). - - Ensure that `$DART_SDK` is set to the path of your Dart SDK. + - Ensure that `$DART_SDK` is set to the path of your Dart SDK and that the + `dart` and `pub` executables are on your `$PATH`. Once we have the Dart SDK, we can creating a new directory and adding a [pubspec.yaml](https://www.dartlang.org/tools/pub/pubspec.html): @@ -15,24 +16,22 @@ dependencies: sky: any ``` -Once the pubspec is in place, create a `lib` directory (where your dart code -will go) ensure that the 'dart' and 'pub' executables are on your $PATH and -run the following: +Once the `pubspec.yaml` is in place, create a `lib` directory (where your Dart\ +code will go) and use the `pub` tool to fetch the Sky package and its +dependencies: - `mkdir lib` - `pub get && pub run sky:init` -Currently the Sky Engine assumes the entry point for your application is a -`main` function in `lib/main.dart`: +Currently Sky assumes the entry point for your application is a `main` function +in `lib/main.dart`: ```dart import 'package:sky/widgets/basic.dart'; class HelloWorldApp extends App { Widget build() { - return new Center( - child: new Text('Hello, world!') - ); + return new Center(child: new Text('Hello, world!')); } } @@ -41,11 +40,9 @@ void main() { } ``` -Execution starts in `main`, which instructs the framework to run a new -instance of the `HelloWorldApp`. The framework then calls the `build()` -function on `HelloWorldApp` to create a tree of widgets, some of which might -be other `Components`, which in turn have `build()` functions that generate -more widgets iteratively to create the widget hierarchy. To learn more about +Execution starts in `main`, which runs a new instance of the `HelloWorldApp`. +The `HelloWorldApp` builds a `Text` widget containing the famous _Hello, world!_ +string and centers it on the screen using a `Center` widget. To learn more about the widget system, please see the [widgets tutorial](lib/widgets/README.md). Setup your Android device @@ -84,15 +81,6 @@ follow these instructions: `adb logcat -s sky` can be used to filter only adb messages from `SkyDemo.apk`. - Building a standalone APK - ------------------------- - - Although it is possible to build a standalone APK containing your application, - doing so right now is difficult. If you're feeling brave, you can see how we - build the `Stocks.apk` in [example/stocks](example/stocks). Eventually we plan - to make this much easier and support platforms other than Android, but that work - still in progress. - Debugging --------- @@ -100,3 +88,12 @@ Sky uses [Observatory](https://www.dartlang.org/tools/observatory/) for debugging and profiling. While running your Sky app using `sky_tool`, you can access Observatory by navigating your web browser to [http://localhost:8181/](http://localhost:8181/). + +Building a standalone APK +------------------------- + +Although it is possible to build a standalone APK containing your application, +doing so right now is difficult. If you're feeling brave, you can see how we +build the `Stocks.apk` in [example/stocks](example/stocks). Eventually we plan +to make this much easier and support platforms other than Android, but that work +still in progress. diff --git a/packages/flutter/lib/widgets/README.md b/packages/flutter/lib/widgets/README.md index 70df5f226c..600743b824 100644 --- a/packages/flutter/lib/widgets/README.md +++ b/packages/flutter/lib/widgets/README.md @@ -12,14 +12,14 @@ in the underlying render tree to transition from one state to the next. Hello World ----------- -To build an application, create a subclass of App and instantiate it: +To build an application, create a subclass of `App` and instantiate it: ```dart import 'package:sky/widgets/basic.dart'; class HelloWorldApp extends App { Widget build() { - return new Text('Hello, world!'); + return new Center(child: new Text('Hello, world!')); } } @@ -403,7 +403,7 @@ an existing stateful component) you'll avoid unnecessary work. Also, some operations that involve interacting with the widget hierarchy cannot be done in a component's constructor. -When overriding `initState`, a component should call its superclass's +When overriding `initState`, a component should call its superclass's `initState` function. Keys From 7094e17f651c6cfa93b4958ca5241047165b2585 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Sat, 18 Jul 2015 12:45:41 -0700 Subject: [PATCH 4/6] Fix typos in README.md --- packages/flutter/README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/flutter/README.md b/packages/flutter/README.md index 912bd45e41..f79eeafe3a 100644 --- a/packages/flutter/README.md +++ b/packages/flutter/README.md @@ -7,8 +7,8 @@ Sky apps are written in Dart. To get started, we need to set up Dart SDK: - Ensure that `$DART_SDK` is set to the path of your Dart SDK and that the `dart` and `pub` executables are on your `$PATH`. -Once we have the Dart SDK, we can creating a new directory and -adding a [pubspec.yaml](https://www.dartlang.org/tools/pub/pubspec.html): +Once you have instealled Dart SDK, create a new directory and adding a +[pubspec.yaml](https://www.dartlang.org/tools/pub/pubspec.html): ```yaml name: your_app_name @@ -16,9 +16,8 @@ dependencies: sky: any ``` -Once the `pubspec.yaml` is in place, create a `lib` directory (where your Dart\ -code will go) and use the `pub` tool to fetch the Sky package and its -dependencies: +Next, create a `lib` directory (where your Dart code will go) and use the `pub` +tool to fetch the Sky package and its dependencies: - `mkdir lib` - `pub get && pub run sky:init` From 44e0d42c12448bd174805836953ccd9a819bd7ae Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Sat, 18 Jul 2015 12:46:18 -0700 Subject: [PATCH 5/6] Another typo --- packages/flutter/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/flutter/README.md b/packages/flutter/README.md index f79eeafe3a..19cca8b90e 100644 --- a/packages/flutter/README.md +++ b/packages/flutter/README.md @@ -7,7 +7,7 @@ Sky apps are written in Dart. To get started, we need to set up Dart SDK: - Ensure that `$DART_SDK` is set to the path of your Dart SDK and that the `dart` and `pub` executables are on your `$PATH`. -Once you have instealled Dart SDK, create a new directory and adding a +Once you have installed Dart SDK, create a new directory and adding a [pubspec.yaml](https://www.dartlang.org/tools/pub/pubspec.html): ```yaml From 41695fb1b5a858a0b11d077e2ff194d7bff50585 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Sat, 18 Jul 2015 12:48:16 -0700 Subject: [PATCH 6/6] More typos --- packages/flutter/README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/flutter/README.md b/packages/flutter/README.md index 19cca8b90e..77df1349ba 100644 --- a/packages/flutter/README.md +++ b/packages/flutter/README.md @@ -7,7 +7,7 @@ Sky apps are written in Dart. To get started, we need to set up Dart SDK: - Ensure that `$DART_SDK` is set to the path of your Dart SDK and that the `dart` and `pub` executables are on your `$PATH`. -Once you have installed Dart SDK, create a new directory and adding a +Once you have installed Dart SDK, create a new directory and add a [pubspec.yaml](https://www.dartlang.org/tools/pub/pubspec.html): ```yaml @@ -16,14 +16,14 @@ dependencies: sky: any ``` -Next, create a `lib` directory (where your Dart code will go) and use the `pub` -tool to fetch the Sky package and its dependencies: +Next, create a `lib` directory (which is where your Dart code will go) and use +the `pub` tool to fetch the Sky package and its dependencies: - `mkdir lib` - `pub get && pub run sky:init` -Currently Sky assumes the entry point for your application is a `main` function -in `lib/main.dart`: +Sky assumes the entry point for your application is a `main` function in +`lib/main.dart`: ```dart import 'package:sky/widgets/basic.dart'; @@ -40,7 +40,7 @@ void main() { ``` Execution starts in `main`, which runs a new instance of the `HelloWorldApp`. -The `HelloWorldApp` builds a `Text` widget containing the famous _Hello, world!_ +The `HelloWorldApp` builds a `Text` widget containing the famous `Hello, world!` string and centers it on the screen using a `Center` widget. To learn more about the widget system, please see the [widgets tutorial](lib/widgets/README.md). @@ -51,7 +51,7 @@ Currently Sky requires an Android device running the Lollipop (or newer) version of the Android operating system. - Install the `adb` tool from the [Android SDK](https://developer.android.com/sdk/installing/index.html) - and ensure that `adb (inside `platform-tools` in the Android SDK) is in your + and ensure that `adb` (inside `platform-tools` in the Android SDK) is in your `$PATH`. - Enable developer mode on your device by visiting `Settings > About phone`