The initial fix was updating Image to NetworkImage, which is the new
name for the Widget that takes a URL to an image.
However, this exposed an underlying bug: slots given to
MultiChildRenderObjectWrapper children were not getting updated in the
initial build. Initially, we don't have a next sibling for any of the
children's roots, since we haven't yet synced anyone after the one
we're syncing. So we pass null. However, as soon as we build the next
one, the previous one now has an out of date slot: null means
"append", but it needs to be "insert before the newly inserted root of
the next child". So now we update the slot after each insertion.
This returned the spinning_mixed demo to its original state, but that
state was buggy: the image would expand to fit the button and push the
text out of the button. To resolve that, this patch changes how
RenderImage sizes an image that has no desired dimensions but has some
constraints that make it impossible to show the image at full size:
now, we try to maintain the aspect ratio and honour the constraints
all at the same time.
Also, if the constraints are tight we skip all that logic, because
it'd be a waste of time.
To help with the slot issue above, I needed to see the widget tree and
the render tree and compare them (to see where the nodes were getting
out of order), so I also extended Widget.toString() to dump a deep
tree of the widget hierarchy.
Also, while debugging all this I noticed we sometimes walk the tree
into nodes that are null, which causes crashes. So to avoid that I
added null-checks to certain walkChildren() functions.
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/1212943007.
This:
- Adds asserts all over the place to make sure things are working
right with respect to the parent pointer.
- Fixes the bugs those asserts uncovered. It turns out we were failing
to update the parent pointer in a couple of cases: when the child
hadn't changed (but the parent had), and when the node was replaced.
- Remove the operator[] nonsense in scaffold.
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/1218183009.
This CL factors the skyx build logic out of sky/apk/rules.gni so that we can
build skyx bundles without building entire APKs. This change makes it possible
to build skyx bundles for all the examples (except game).
TBR=eseidel@google.com
Review URL: https://codereview.chromium.org/1222673003.
Previously, RenderImage knew about image_cache and expected to work in terms of
URLs. Now RenderImage works directly with sky.Image and it's the job of the
widgets system to interact with the network cache.
At the widgets layer, I've factored this work into three parts:
1) A wrapper for RenderImage that works in terms of sky.Image.
2) A component that can deal with any sort of Future<sky.Image>.
3) A NetworkImage component that translates relative URLs into
Future<sky.Image> using the image_cache.
A future CL will add a peer to NetworkImage that gets Future<sky.Image>s from
an asset bundle.
R=ianh@google.com, jackson@google.com
Review URL: https://codereview.chromium.org/1218023013.
Also:
- give users of Material who previously relied on Material's defaults
opinions about background colours
- reindent stock_row.dart
- import colors as colors in example/widgets/styled_text.dart, rather
than in global scope, for consistency with other files
- import typography as typograpyh in example/widgets/tabs.dart, rather
than in global scope, for consistency with other files
- make flat_button actually be transparent by not painting a
background, rather than painting 0x00000000. This is the what I
actually originally set out to do here.
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/1217293003.
A simple container for a TabBar. It is defined by a list of
TabNavigatorViews, each of which is just a TabLabel and
the tab's content.
The content of each tab is represented by a function
that produces a Widget called "content". I couldn't
bring myself to call it buildTabContentCallback or something
else more specific.
R=abarth@chromium.org, ianh@google.com
Review URL: https://codereview.chromium.org/1212993003.