mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
stocks and stocks-fn should share the stocks data
Previously, the two versions of this sample app had separate copies of the stock data. This CL moves the common data to the common data directory so that they can share. Also, I've switched the data files to be |dart| files rather than |sky| files to make them easier to use from fn examples. R=eseidel@chromium.org Review URL: https://codereview.chromium.org/980953002
This commit is contained in:
parent
b15263b453
commit
2f7ec6c4a0
@ -1,9 +1,7 @@
|
||||
<!--
|
||||
// Copyright 2014 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.
|
||||
-->
|
||||
<script>
|
||||
|
||||
final List<Map> kData = [
|
||||
{"name":"New York","state":"New York","population":8363710},
|
||||
{"name":"Los Angeles","state":"California","population":3833995},
|
||||
@ -5005,4 +5003,3 @@ final List<Map> kData = [
|
||||
{"name":"Hartwell","state":"Georgia","population":4298},
|
||||
{"name":"Newport","state":"North Carolina","population":4298}
|
||||
];
|
||||
</script>
|
||||
@ -1,4 +1,7 @@
|
||||
<script>
|
||||
// Copyright 2014 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:math";
|
||||
|
||||
// Snapshot from http://www.nasdaq.com/screening/company-list.aspx
|
||||
@ -3013,5 +3016,3 @@ class StockOracle {
|
||||
}
|
||||
|
||||
final StockOracle oracle = new StockOracle.fromCompanyList(_kCompanyList);
|
||||
|
||||
</script>
|
||||
@ -5,7 +5,6 @@
|
||||
-->
|
||||
<import src="/sky/framework/sky-element.sky" />
|
||||
<import src="/sky/framework/sky-scrollable.sky" />
|
||||
<import src="../data/cities.sky" as="cities" />
|
||||
|
||||
<sky-element>
|
||||
<template>
|
||||
@ -20,6 +19,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import "dart:sky";
|
||||
import "../data/cities.dart" as cities;
|
||||
|
||||
@Tagname('scrolling')
|
||||
class Scrolling extends SkyElement {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,12 +1,12 @@
|
||||
library stocksapp;
|
||||
|
||||
import '../data/stocks.dart';
|
||||
import '../fn/lib/fn.dart';
|
||||
import '../fn/widgets/widgets.dart';
|
||||
import 'dart:collection';
|
||||
import 'dart:math';
|
||||
import 'dart:sky' as sky;
|
||||
|
||||
part 'companylist.dart';
|
||||
part 'stockarrow.dart';
|
||||
part 'stocklist.dart';
|
||||
part 'stockrow.dart';
|
||||
|
||||
@ -12,7 +12,6 @@
|
||||
<import src="/sky/framework/sky-scrollable.sky" />
|
||||
<import src="/sky/framework/sky-toolbar.sky" />
|
||||
<import src="stock.sky" as='view'/>
|
||||
<import src='companylist.sky' as='model'/>
|
||||
|
||||
<sky-element>
|
||||
<template>
|
||||
@ -71,6 +70,7 @@
|
||||
<script>
|
||||
import "dart:sky";
|
||||
import "dart:math";
|
||||
import "../data/stocks.dart" as model;
|
||||
|
||||
List pick(List list, int count) {
|
||||
var rng = new Random();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user