Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
c5719c6c
E
engine
项目概览
sxychenjing
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c5719c6c
编写于
7月 18, 2015
作者:
A
Adam Barth
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #128 from abarth/more_readme_improvements
Improve the READMEs further
上级
553969c5
7ea8f879
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
25 addition
and
28 deletion
+25
-28
README.md
README.md
+1
-1
sky/sdk/README.md
sky/sdk/README.md
+21
-24
sky/sdk/lib/widgets/README.md
sky/sdk/lib/widgets/README.md
+3
-3
未找到文件。
README.md
浏览文件 @
c5719c6c
...
...
@@ -8,7 +8,7 @@ Sky is optimized for today's, and tomorrow's, mobile devices. We are focused
on low-latency input, high frame rates, and we are purely mobile first.
-
For information about using Sky to build apps, please see
[
Getting
S
tarted with Sky
](
sky/sdk/README.md
)
.
[
Getting
s
tarted with Sky
](
sky/sdk/README.md
)
.
-
For information about contributing to Sky, please see
[
CONTRIBUTING.md
](
CONTRIBUTING.md
)
.
sky/sdk/README.md
浏览文件 @
c5719c6c
Getting
S
tarted with Sky
Getting
s
tarted 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.
sky/sdk/lib/widgets/README.md
浏览文件 @
c5719c6c
...
...
@@ -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
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录