|
Don't hardcode the list of events types in fn
This CL changes how events work in fn. Previously, event listeners were passed
in as constructor arguments. Now Nodes hold an |events| object, which contains
all the event registrations. When a Component renders, all its |events| are
copied onto the Node it produces. When an Element syncs, it walks its |events|
and adds them as event listeners on the underlying sky.Element.
The net result of this change is increased flexibility in how events are
registered. Now components don't need to enumerate all the possible events that
they support. Instead, the parent component can listen for whatever events it
likes.
Also, I've cleaned up the association between DrawerAnimation and Drawer. Now
the constructor for Drawer accepts an |animation| object and wires up its
internal event handlers itself instead of requiring the constructor to do all
the wiring.
R=rafaelw@chromium.org
Committed: https://chromium.googlesource.com/external/mojo/+/56a8123af9e87142f31c63a1051c2d7352c1a36a
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+119 lines, -211 lines) |
Patch |
 |
M |
sky/examples/fn/lib/component.dart
|
View
|
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
A |
sky/examples/fn/lib/event.dart
|
View
|
1
|
1 chunk |
+25 lines, -0 lines |
0 comments
|
Download
|
 |
M |
sky/examples/fn/lib/fn.dart
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
sky/examples/fn/lib/node.dart
|
View
|
1
|
9 chunks |
+46 lines, -127 lines |
0 comments
|
Download
|
 |
M |
sky/examples/fn/widgets/button.dart
|
View
|
|
1 chunk |
+1 line, -6 lines |
0 comments
|
Download
|
 |
M |
sky/examples/fn/widgets/buttonbase.dart
|
View
|
|
1 chunk |
+5 lines, -1 line |
0 comments
|
Download
|
 |
M |
sky/examples/fn/widgets/checkbox.dart
|
View
|
|
2 chunks |
+1 line, -5 lines |
0 comments
|
Download
|
 |
M |
sky/examples/fn/widgets/drawer.dart
|
View
|
|
3 chunks |
+23 lines, -36 lines |
0 comments
|
Download
|
 |
M |
sky/examples/fn/widgets/fixedheightscrollable.dart
|
View
|
|
2 chunks |
+5 lines, -5 lines |
0 comments
|
Download
|
 |
M |
sky/examples/fn/widgets/icon.dart
|
View
|
|
2 chunks |
+1 line, -4 lines |
0 comments
|
Download
|
 |
M |
sky/examples/fn/widgets/material.dart
|
View
|
|
1 chunk |
+3 lines, -4 lines |
0 comments
|
Download
|
 |
M |
sky/examples/fn/widgets/menuitem.dart
|
View
|
|
1 chunk |
+1 line, -8 lines |
0 comments
|
Download
|
 |
M |
sky/examples/fn/widgets/radio.dart
|
View
|
|
1 chunk |
+2 lines, -6 lines |
0 comments
|
Download
|
 |
M |
sky/examples/stocks-fn/stocksapp.dart
|
View
|
|
2 chunks |
+3 lines, -9 lines |
0 comments
|
Download
|
Total messages: 4 (0 generated)
|