The ShaderMask widget enables rendering its child with an alpha channel defined by a Shader. For example if the Shader was a linear gradient in alpha then the component behind the ShaderMask's child would appear wherever the gradient's alpha value was not fully opaque.
The card_collection.dart example demonstrates this. Select the "Let the sun shine" checkbox in the app's drawer.
I'm not sure this specific incarnation of the test ever crashed, since
the original test depended on user interaction and now works fine, but
just in case, here's a regression test for it so I can close that issue.
This also slightly changes the Widget.toString() output to include the
key since that will make debugging easier.
- Rename EdgeDims constructor to EdgeDims.TRBL().
- Add operator== to Size and Offset so that you can compare Size to
DebugSize in checked mode.
- Add Size.lerp().
- Add various operators to EdgeDims. (*, /, ~/, %)
- Add EdgeDims.lerp().
- Update style guide. I went there to fix an EdgeDims constructor
example, and stayed because some recent things came up and I wanted to
add them before I forgot.
Introduce a Draggable class that wraps all the logic of dragging
something and dropping it on a DragTarget.
Update examples/widgets/drag_and_drop.dart accordingly.
Make the performance/transition part of routes optional.
Initial snap offset support for ScrollableWidgetList (and ScrollableList<T>) and ScrollableMixedWidgetList. If a ```toSnapOffset(scrollOffset)``` function is provided, fling Scrolls will coast to the returned value. If ```alignmentOffset``` is specified then fling scrolls conclude when toSnapOffset's value lines up with the Scrollable widget's origin + alignmentOffset. For example if the Scrollable widget's height was 200.0, and alignmentOffset:100.0 was specified, then fling scrolls would end with the value returned by toSnapOffset() lined up with the center of the Scrollable.
This approach to Scrollable snapping assumes that the layout of whatever the Scrollable contains is known at the outset. This is often true however a ScrollableMixedWidgetList may not know its items' sizes until they've been reached by scrolling.
This is a first cut at snapping support. Among the things that remain to be done:
- Scrolling limits trump snapping. Snapping should probably trump scrolling limits.
- Drag scrolls aren't snapped. This may be desirable so perhaps the feature should be controlled with a flag.
- Specifying alignmentOffset as a percentage would probably be more convenient.
- It would be nice if one could wrap items in a SnapOffset value like: ```new SnapOffset(0.5, child: myItem)``` to snap to the center of the item.
Updated the CardCollection example: snapping and fixed size items can be turned on/off with Drawer checkboxes.
This patch makes a number of changes:
1) buildDirtyComponents now prevents all calls to setState, not just those
higher in the tree. This change is necessary for consistency with
MixedViewport and HomogeneousViewport because those widgets already build
subwidgets with that restriction. If the "normal" build didn't enforce that
rule, then some widgets would break when put inside a mixed or homogeneous
viewport.
2) We now notify global key listeners in a microtask after beginFrame. That
means setState is legal in these callbacks and that we'll produce another
frame if someone calls setState in such a callback.
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.