Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(817)

Side by Side Diff: src/tests/site/gists/homepage_jw/web/main.dart

Issue 1319523005: Embed DartPad in the top part of homepage (Closed) Base URL: https://github.com/dart-lang/www.dartlang.org.git@master
Patch Set: remove 2nd dartpad Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 import 'dart:html' show HttpRequest;
2
3 main() async {
4 // Asychronously get text to display.
5 var lines = await getLines();
6
7 // If result is non-null, print it.
8 lines?.forEach((line) => print(line));
9 }
10
11 // Reads a file, returning its lines.
12 getLines() async {
13 var jabber = await HttpRequest.getString(
14 'https://www.dartlang.org/samples-files/jabberwocky.txt');
15 var lines = jabber.split('\n');
16 lines.retainWhere((line) =>
17 line.toLowerCase().contains('jabberwock'));
18 return lines;
19 }
OLDNEW
« no previous file with comments | « src/tests/site/gists/homepage_jw/pubspec.yaml ('k') | src/tests/site/gists/homepage_jw_html/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698