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

Unified Diff: lib/src/change_notifier.dart

Issue 1616953004: Fixed strong mode errors and warnings reachable from lib/observe.dart (Closed) Base URL: https://github.com/dart-lang/observe.git@master
Patch Set: Removed inferrable type param Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/bind_property.dart ('k') | lib/src/change_record.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/change_notifier.dart
diff --git a/lib/src/change_notifier.dart b/lib/src/change_notifier.dart
index 7febee562809dcce54d0840be77a964226a4600b..714010ca2b99417e1d2c6b22c384370699ab4f5c 100644
--- a/lib/src/change_notifier.dart
+++ b/lib/src/change_notifier.dart
@@ -16,13 +16,13 @@ import 'package:observe/src/observable.dart' show notifyPropertyChangeHelper;
/// When a field, property, or indexable item is changed, a derived class should
/// call [notifyPropertyChange]. See that method for an example.
abstract class ChangeNotifier implements Observable {
- StreamController _changes;
+ StreamController<List<ChangeRecord>> _changes;
List<ChangeRecord> _records;
Stream<List<ChangeRecord>> get changes {
if (_changes == null) {
- _changes = new StreamController.broadcast(sync: true,
- onListen: observed, onCancel: unobserved);
+ _changes = new StreamController.broadcast(
+ sync: true, onListen: observed, onCancel: unobserved);
}
return _changes.stream;
}
@@ -66,8 +66,9 @@ abstract class ChangeNotifier implements Observable {
/// @reflectable set myField(value) {
/// _myField = notifyPropertyChange(#myField, _myField, value);
/// }
- notifyPropertyChange(Symbol field, Object oldValue, Object newValue)
- => notifyPropertyChangeHelper(this, field, oldValue, newValue);
+ /*=T*/ notifyPropertyChange /*<T>*/ (
+ Symbol field, /*=T*/ oldValue, /*=T*/ newValue) =>
+ notifyPropertyChangeHelper /*<T>*/ (this, field, oldValue, newValue);
void notifyChange(ChangeRecord record) {
if (!hasObservers) return;
« no previous file with comments | « lib/src/bind_property.dart ('k') | lib/src/change_record.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698