Skip to content

Commit

Permalink
Added missing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sunarya-thito committed Oct 26, 2024
1 parent 83cd8f4 commit 861f176
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
23 changes: 23 additions & 0 deletions lib/src/data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,18 @@ class _InheritedData<T> extends InheritedWidget {
required super.child,
});

@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
super.debugFillProperties(properties);
properties.add(DiagnosticsProperty<T>('data', data));
}

@override
String toStringShort() {
final String type = objectRuntimeType(this, 'Data');
return key == null ? type : '$type-$key';
}

@override
bool updateShouldNotify(covariant _InheritedData<T> oldWidget) {
if (data is DistinctData && oldWidget.data is DistinctData) {
Expand Down Expand Up @@ -731,7 +743,9 @@ class _CaptureAllData extends StatelessWidget {
}
}

/// A mixin for all kinds of Data properties.
mixin MultiModelItem {
/// The normalized model of the model.
Model<Object?> get normalized;
}

Expand Down Expand Up @@ -1287,6 +1301,15 @@ class _InheritedModel extends InheritedModel<ModelKey> {

const _InheritedModel(this.data, {required super.child});

@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
super.debugFillProperties(properties);
for (final model in data) {
properties
.add(DiagnosticsProperty(model.dataKey.toString(), model.value));
}
}

@override
bool updateShouldNotify(covariant _InheritedModel oldWidget) {
for (final model in data) {
Expand Down
4 changes: 4 additions & 0 deletions lib/src/list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ typedef ListChangeListener<T> = void Function(ListChangeDetails<T> details);
abstract class ListListenable<T> extends ValueListenable<List<T>> {
@override
List<T> get value;

/// Adds a [listener] to be notified of changes.
void addChangeListener(ListChangeListener<T> listener);

/// Removes a [listener] from being notified of changes.
void removeChangeListener(ListChangeListener<T> listener);
}

Expand Down
4 changes: 4 additions & 0 deletions lib/src/map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ typedef MapChangeListener<K, V> = void Function(MapChangeDetails<K, V> details);
abstract class MapListenable<K, V> extends ValueListenable<Map<K, V>> {
@override
Map<K, V> get value;

/// Adds a [listener] to be notified of changes.
void addChangeListener(MapChangeListener<K, V> listener);

/// Removes a [listener] from being notified of changes.
void removeChangeListener(MapChangeListener<K, V> listener);
}

Expand Down

0 comments on commit 861f176

Please sign in to comment.