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

Side by Side Diff: samples/third_party/pop-pop-win/app_package/platform_app.dart

Issue 200723008: samples/poppopwin: upgrade to first-class sample (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fixed pkgbuild.status for rename Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 library ppw_platform_web;
2
3 import 'dart:async';
4
5 import 'package:poppopwin/platform_target.dart';
6 import 'package:chrome_gen/gen/storage.dart';
7
8 class PlatformApp extends PlatformTarget {
9 final StreamController _aboutController = new StreamController(sync: true);
10 bool _about = false;
11
12 PlatformApp() : super.base();
13
14 @override
15 Future clearValues() => storage.local.clear();
16
17 @override
18 Future setValue(String key, String value) =>
19 storage.local.set({key : value});
20
21 @override
22 Future<String> getValue(String key) => storage.local.get(key)
23 .then((Map<String, String> values) => values[key]);
24
25 bool get renderBig => false;
26
27 bool get showAbout => _about;
28
29 Stream get aboutChanged => _aboutController.stream;
30
31 void toggleAbout([bool value]) {
32 assert(_about != null);
33 if(value == null) {
34 value = !_about;
35 }
36 _about = value;
37 _aboutController.add(null);
38 }
39 }
OLDNEW
« no previous file with comments | « samples/third_party/pop-pop-win/app_package/manifest.json ('k') | samples/third_party/pop-pop-win/app_package/style.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698