This updates to mojo 4e4d51ce28a and mojo sdk 711a0bcfb141b4 and updates the sky
package's pubspec.yaml dependency to '>=0.1.0 <0.2.0' to be compatible with
the current mojo package. This includes an update to the Mojo Dart generator to
produce real classes for enums and the corresponding updates for users of the
KeyboardType enum in Sky as well as one scoped_ptr->std::unique_ptr in shell
corresponding to a change in the Mojo EDK.
When a new version of the sky and sky_services package are pushed this will fix
domokit/mojo#440.
- Remove the unique objects used as slots since we decided 'null' was
fine after all
- Rename 'slot' to 'newSlot' when it's used as an argument to change the
_slot field, to clarify which variable has the newer value
- Remove the RenderObject registry since we'll do listeners a different
way. This also removes handleEvent for the same reason.
- Remove the TODOs for mount/unmount becoming didMount/didUnmount since
the methods do in fact do the mounting/unmounting.
In the old world, we had two ways to bind a Widget tree to a
RenderObject node, one way for RenderView and one mostly untested way
for other cases (it's only tested by the spinning_mixed.dart demo). For
fn3, I made these the same code path.
This patch also introduces GlobalKey, though the GlobalKey logic isn't
hooked in yet.
This is Hello World in the new world:
```dart
import 'package:sky/src/fn3.dart';
void main() {
runApp(new Text('Hello World!'));
}
```
- I extracted the BuildScheduler into a separate binding.dart file.
- Various changes to expose private members that are needed by
binding.dart.
- Registering the render objects for event dispatch.
- Convert the tests to use the new binding mechanism.
This doesn't yet have a RenderView or event handling.
Since our build function depends on scrollBehavior.isScrollable, any
time we update scrollBehavior we are implicitly updating our state. As
such, we must do so during a setState() call, or else we won't rebuild
and might not bother to listen to the scroll gestures.
This probably broke when we made Block not listen to gestures if it
wasn't overflowing.
- move _uniqueChild earlier since a comment now mentions it earlier.
- reorder methods in Element to more closely reflect call order.
- change mount to be the place that sets the parent pointer, for consistency.
- make the lifecycleState a purely debug-time thing for consistency.
- make BuildableElement.unmount set dirty to false so that we won't
build unmounted objects.
- rename "updated" to "newWidget" for clarity.
- change how we unmount things so that the slot is reset up to a
RenderObjectElement, but not further, and don't reset the depth.
- adds dartdocs
- replaces config setter with didUpdateConfig() so that you can't replace
the config outside of the system
- renames didUnmount() with destroy().
- rename Component to StatelessComponent, ComponentConfiguration to
StatefulComponent
- move debug dump to end of file
- renamed _holder to _element
* If no source path is provided, then run the analyzer on the Sky unit tests
* Fix the filter for errors found in pub cache packages
* Generalize the filter for the analyzer's "xx errors/warnings/hints found" status message
Also fix a test that caused a warning in the analyzer.
Previously EditableText would render a text widget with no cursor if the text
value was empty.
Also adjust the height of the cursor widget to reflect the style's line
height, and update the cursor painting to match.
This patch contains a prototype of a new widget framework. In this framework,
Components can be reused in the tree as many times as the author desires. Also,
StatefulComponent is split into two pieces, a ComponentConfiguration and a
ComponentState. The ComponentConfiguration is created by the author and can be
reused as many times as desired. When mounted into the tree, the
ComponentConfiguration creates a ComponentState to hold the state for the
component. The state remains in the tree and cannot be reused.
This will ensure that the width of an empty Input is consistent with the
width of an Input that contains text.
Also add a unit test for the Input widget and a way for tests to provide mock
implementations of Mojo services such as the keyboard.
Also, introduce Colors and Typography to hold the material colors and the
typography declarations. Previously we expected clients of these libraries to
import them into a namespace, but that doesn't play nice with re-exporting them
from material.dart.
When we sync() a Component, we need to clear the old Component's _child
pointer, otherwise if we reuse that Component we'll get confused about
what the old child is.
We were not removing children if they were more recently synced than we
were. This makes no sense. We should remove all children unless they
were synced this very generation already (in which case they'll be
somewhere else in the tree by now).
This patch is part of a sequence of patches towards fewer top-level libraries.
In this patch, the gesture libraries are combined into one gestures.dart
library.
Also:
- don't mark a node as from the new generation if it is dirty, since we
know it still has to be built.
- establish the rule that you can't call setState() during initState()
or build().
- make syncChild() return early for unchanged children.
- update the tests, including adding a new one.