| OLD | NEW |
| 1 library ppw_platform; | 1 library ppw_platform; |
| 2 | 2 |
| 3 import 'dart:async'; | 3 import 'dart:async'; |
| 4 | 4 |
| 5 abstract class PlatformTarget { | 5 abstract class PlatformTarget { |
| 6 bool _initialized = false; | 6 bool _initialized = false; |
| 7 | 7 |
| 8 factory PlatformTarget() => new _DefaultPlatform(); | 8 factory PlatformTarget() => new _DefaultPlatform(); |
| 9 | 9 |
| 10 PlatformTarget.base(); | 10 PlatformTarget.base(); |
| 11 | 11 |
| 12 bool get initialized => _initialized; | 12 bool get initialized => _initialized; |
| 13 | 13 |
| 14 void initialize() { | 14 void initialize() { |
| 15 assert(!_initialized); | 15 assert(!_initialized); |
| 16 _initialized = true; | 16 _initialized = true; |
| 17 } | 17 } |
| 18 | 18 |
| 19 Future clearValues(); | 19 Future clearValues(); |
| 20 | 20 |
| 21 Future setValue(String key, String value); | 21 Future setValue(String key, String value); |
| 22 | 22 |
| 23 Future<String> getValue(String key); | 23 Future<String> getValue(String key); |
| 24 | 24 |
| 25 void trackAnalyticsEvent(String category, String action, [String label, | |
| 26 int value]) { | |
| 27 print('Analytics:: ' | |
| 28 'category: $category; action: $action; label: $label; value: $value'); | |
| 29 } | |
| 30 | |
| 31 bool get renderBig; | 25 bool get renderBig; |
| 32 | 26 |
| 33 bool get showAbout; | 27 bool get showAbout; |
| 34 | 28 |
| 35 void toggleAbout([bool value]); | 29 void toggleAbout([bool value]); |
| 36 | 30 |
| 37 Stream get aboutChanged; | 31 Stream get aboutChanged; |
| 38 } | 32 } |
| 39 | 33 |
| 40 class _DefaultPlatform extends PlatformTarget { | 34 class _DefaultPlatform extends PlatformTarget { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 62 value = !_about; | 56 value = !_about; |
| 63 } | 57 } |
| 64 _about = value; | 58 _about = value; |
| 65 _aboutController.add(null); | 59 _aboutController.add(null); |
| 66 } | 60 } |
| 67 | 61 |
| 68 bool get showAbout => _about; | 62 bool get showAbout => _about; |
| 69 | 63 |
| 70 Stream get aboutChanged => _aboutController.stream; | 64 Stream get aboutChanged => _aboutController.stream; |
| 71 } | 65 } |
| OLD | NEW |