Implement pure version of todos example 🎉
The `Widget` trait in `iced_pure` needed to change a bit to make the implementation of `Element::map` possible. Specifically, the `children` method has been split into `diff` and `children_state`.
This commit is contained in:
parent
e3108494e5
commit
bd22cc0bc0
18 changed files with 917 additions and 96 deletions
|
|
@ -85,8 +85,12 @@ where
|
|||
Box::new(())
|
||||
}
|
||||
|
||||
fn children(&self) -> &[Element<Message, Renderer>] {
|
||||
&self.children
|
||||
fn diff(&self, tree: &mut Tree) {
|
||||
tree.diff_children(&self.children);
|
||||
}
|
||||
|
||||
fn children_state(&self) -> Vec<Tree> {
|
||||
self.children.iter().map(Tree::new).collect()
|
||||
}
|
||||
|
||||
fn width(&self) -> Length {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue