mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00

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
39 lines
925 B
Plaintext
39 lines
925 B
Plaintext
<!--
|
|
// 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.
|
|
-->
|
|
<import src="/sky/framework/sky-element.sky" />
|
|
<import src="/sky/framework/sky-scrollable.sky" />
|
|
|
|
<sky-element>
|
|
<template>
|
|
<style>
|
|
sky-scrollable {
|
|
margin: 20px;
|
|
height: 400px;
|
|
border: 2px solid blue;
|
|
}
|
|
</style>
|
|
<sky-scrollable />
|
|
</template>
|
|
<script>
|
|
import "dart:sky";
|
|
import "../data/cities.dart" as cities;
|
|
|
|
@Tagname('scrolling')
|
|
class Scrolling extends SkyElement {
|
|
void shadowRootReady() {
|
|
Element parent = shadowRoot.querySelector('sky-scrollable');
|
|
for (Map city in cities.kData.getRange(0, 300)) {
|
|
Element div = document.createElement('div');
|
|
div.setChild(new Text(city['name']));
|
|
parent.appendChild(div);
|
|
}
|
|
}
|
|
}
|
|
|
|
_init(script) => register(script, Scrolling);
|
|
</script>
|
|
</sky-element>
|