Skip to content

Implementation of cast methods allows mutation without notifications. #92

@markegli

Description

@markegli

Changes on ObservableMap and ObservableList objects created via cast or castFrom mutate the original collections but do not trigger notifications on the original collections.

final original = ObservableList<int>.from([1, 2, 3]);
original.changes.listen(print); // Listener never triggered.
final cast = original.cast<num>();
cast.add(4);
print(original); // Prints [1, 2, 3, 4].
await Future(() {}); // Flush any microtasks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions