Commit 5d676f85 authored by Hixie's avatar Hixie

Refactor fn2.dart, since it breached our 1000-line threshold.

This moves input.dart to editing2/, since that way we can define the layering as strictly unidirectional.
It also reorders a bunch of imports to fit the style guide.
I removed the old remnants of the widgets example, and put the fn2 examples into the examples/widgets/ directory, to parallel the framework directory names.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1177243002.
parent a523d7f3
......@@ -2,30 +2,26 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:sky/framework/components2/tool_bar.dart';
import 'package:sky/framework/components2/drawer.dart';
import 'package:sky/framework/components2/drawer_header.dart';
import 'package:sky/framework/components2/floating_action_button.dart';
import 'package:sky/framework/components2/icon.dart';
import 'package:sky/framework/components2/icon_button.dart';
import 'package:sky/framework/components2/menu_divider.dart';
import 'package:sky/framework/components2/menu_item.dart';
import 'package:sky/framework/components2/input.dart';
import 'package:sky/framework/components2/modal_overlay.dart';
import 'package:sky/framework/components2/popup_menu.dart';
import 'package:sky/framework/components2/radio.dart';
import 'package:sky/framework/components2/scaffold.dart';
import 'package:sky/framework/fn2.dart';
import 'package:sky/framework/theme2/typography.dart' as typography;
import 'package:sky/framework/editing2/input.dart';
import 'package:sky/framework/theme2/colors.dart' as colors;
import 'package:sky/framework/widgets/drawer.dart';
import 'package:sky/framework/widgets/drawer_header.dart';
import 'package:sky/framework/widgets/floating_action_button.dart';
import 'package:sky/framework/widgets/icon.dart';
import 'package:sky/framework/widgets/icon_button.dart';
import 'package:sky/framework/widgets/menu_divider.dart';
import 'package:sky/framework/widgets/menu_item.dart';
import 'package:sky/framework/widgets/modal_overlay.dart';
import 'package:sky/framework/widgets/popup_menu.dart';
import 'package:sky/framework/widgets/radio.dart';
import 'package:sky/framework/widgets/scaffold.dart';
import 'package:sky/framework/widgets/tool_bar.dart';
import 'package:sky/framework/widgets/wrappers.dart';
import 'stock_data.dart';
import 'package:sky/framework/rendering/box.dart';
import 'stock_list.dart';
import 'stock_menu.dart';
import 'dart:async';
import 'dart:sky' as sky;
enum StockMode { optimistic, pessimistic }
class StocksApp extends App {
......
......@@ -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 'package:sky/framework/fn2.dart';
import 'package:vector_math/vector_math.dart';
import 'dart:math' as math;
import 'dart:sky' as sky;
import 'package:sky/framework/rendering/box.dart';
import 'package:sky/framework/rendering/object.dart';
import 'package:sky/framework/theme2/colors.dart' as colors;
import 'dart:math' as math;
import 'dart:sky' as sky;
import 'package:sky/framework/widgets/wrappers.dart';
class StockArrow extends Component {
......
......@@ -4,6 +4,7 @@
import 'dart:convert';
import 'dart:math';
import 'package:sky/framework/net/fetch.dart';
// Snapshot from http://www.nasdaq.com/screening/company-list.aspx
......
......@@ -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 'package:sky/framework/components2/fixed_height_scrollable.dart';
import 'package:sky/framework/fn2.dart';
import 'package:sky/framework/widgets/fixed_height_scrollable.dart';
import 'package:sky/framework/widgets/wrappers.dart';
import 'stock_data.dart';
import 'stock_row.dart';
......
......@@ -2,9 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:sky/framework/fn2.dart';
import 'package:sky/framework/components2/popup_menu.dart';
import 'package:sky/framework/components2/checkbox.dart';
import 'package:sky/framework/widgets/checkbox.dart';
import 'package:sky/framework/widgets/popup_menu.dart';
import 'package:sky/framework/widgets/wrappers.dart';
import 'package:sky/framework/theme/view_configuration.dart';
class StockMenu extends Component {
......
......@@ -3,11 +3,11 @@
// found in the LICENSE file.
import 'dart:sky' as sky;
import 'package:sky/framework/components2/ink_well.dart';
import 'package:sky/framework/fn2.dart';
import 'package:sky/framework/rendering/flex.dart';
import 'package:sky/framework/rendering/box.dart';
import 'package:sky/framework/theme/typography.dart' as typography;
import 'package:sky/framework/widgets/wrappers.dart';
import 'package:sky/framework/widgets/ink_well.dart';
import 'stock_arrow.dart';
import 'stock_data.dart';
......
......@@ -3,8 +3,11 @@
// found in the LICENSE file.
import 'dart:sky' as sky;
import 'package:sky/framework/fn2.dart';
import 'package:sky/framework/rendering/box.dart';
import 'package:sky/framework/widgets/ui_node.dart';
import 'package:sky/framework/widgets/wrappers.dart';
import '../lib/solid_color_box.dart';
class Rectangle extends RenderObjectWrapper {
......@@ -29,7 +32,7 @@ class ContainerApp extends App {
child: new Block([
new Container(
decoration: new BoxDecoration(backgroundColor: const sky.Color(0xFFFFFF00)),
height: 20.0,
height: 20.0
),
new Image(src: "https://www.dartlang.org/logos/dart-logo.png",
size: new sky.Size(300.0, 300.0),
......
......@@ -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 'package:sky/framework/fn2.dart';
import 'package:sky/framework/widgets/wrappers.dart';
class HelloWorldApp extends App {
UINode build() {
......@@ -12,4 +12,4 @@ class HelloWorldApp extends App {
void main() {
new HelloWorldApp();
}
\ No newline at end of file
}
#!mojo mojo:sky_viewer
<!--
// 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.
-->
<sky>
<import src="/sky/framework/debug/shake-to-reload.sky" />
<script>
import 'widgets_app.dart';
void main() {
new WidgetsApp();
}
</script>
</sky>
name: widgets
dependencies:
sky: any
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