199 Commits

Author SHA1 Message Date
Ian Hickson
e1aaf39f82 Fix Block intrinsic functions (#3286)
* Fix Block intrinsic functions

* Update block_test.dart

Fix the test per travis
2016-04-13 09:35:10 -07:00
Ian Hickson
ecf1cce82c Provide details when reporting invalid constraints (#3281)
This also shrinks the width of the error messages a bit because now that
we use 'package:' URLs the stacks are a bit narrower.
2016-04-12 15:42:00 -07:00
Adam Barth
ec4a6a96f2 Add more dartdocs to material.dart (#3279) 2016-04-12 14:18:58 -07:00
Adam Barth
47715c5076 Add padding support to LazyBlock (#3272)
Also fill in some related dartdocs.
2016-04-12 13:05:44 -07:00
Jason Simmons
0f70464e1d Treat pointer cancel events similarly to pointer up events (#3242) 2016-04-12 11:17:43 -07:00
Ian Hickson
47f5c6f2e0 Add even more careful checks around BoxConstraints (#3243)
I ran into a case where I was setting minHeight=∞ and then calling
layout() with that constraint, which is all kinds of bad. To try to
catch this earlier, this patch now provides a way to catch constraints
that are requiring infinite values.

We don't _always_ check this because there are valid uses for
BoxConstraints.biggest, e.g. as an additionalConstraint.
2016-04-11 11:10:11 -07:00
krisgiesing
504610791f Update wording on viewport test (#3228) 2016-04-08 23:52:52 -07:00
Adam Barth
8254dce2f5 Dismissable doesn't resize from its full size (#3194)
Previously we'd snap to the size of the background widget before resizing to

zero. Now we force the background widget to match the size of the dimissable

widget at the time it was dismissed.



Fixes #3092
2016-04-07 15:08:02 -07:00
Adam Barth
81e18ac11c We should lerp decorations in the correct direction (#3176)
Previously we lerped them backwards.



Fixes #2832
2016-04-07 12:46:10 -07:00
Adam Barth
7570495b0a SnackBarActions shouldn't be tappable twice
They should automagically disable after the first tap.
2016-04-06 21:13:53 -07:00
Adam Barth
1e207c0150 Remove RenderBlockViewport
Previously this was used by MixedViewport, but now we don't need it because

LazyBlockViewport has replaced MixedViewport.



I've also taken this opportunity to modernize RenderBlock.
2016-04-06 19:39:10 -07:00
Adam Barth
76f66605b0 TabView should keep state
Previously, we lost sync with the tab view contents when switching tabs. Now we
key the subtrees to make sure they keep their state across tab animations.

Fixes #3147
2016-04-06 17:15:53 -07:00
Adam Barth
2d49e8074c Remove MixedViewport
Also, port the MixedViewport tests to LazyBlockViewport. Fix bugs found by the tests.
2016-04-06 15:24:52 -07:00
Ian Hickson
798dfa2bc9 Fix analyzer warnings
Fix some legit uses of GlobalKey to specify the type they want.



Fix some sketchy uses of GlobalKey in tests to fake it with "as

dynamic".



Remove some extraneous imports that made the build red.
2016-04-06 14:14:34 -07:00
krisgiesing
0213b67e76 Handle dirty bits correctly when render objects are re-attached
Fixes #2855
2016-04-06 12:39:22 -07:00
Adam Barth
6fd6859793 LazyBlock docs and physics
This patch adds dartdoc to LazyBlock. Also, this patch fixes the scrolling
physics of LazyBlock. Previously, we updated a running simulation only when the
change in scroll behavior changed the current scroll offset. Now we update
running simulations every time the behavior changes because the simulation
might depend on quantities other than the current scroll offset.
2016-04-06 12:36:54 -07:00
Adam Barth
40899eb274 Port clients of ScrollableMixedWidgetList to LazyBlock
LazyBlock is going to replace ScrollableMixedWidgetList at some point.
2016-04-05 20:18:35 -07:00
Adam Barth
767ce82646 Add support for discrete material sliders
Fixes #1541
2016-04-04 11:14:12 -07:00
Ian Hickson
ee703da9de Rationalise all our exception handling.
- Create a FlutterErrorDetails struct-like class that describes an

  exception along with more details that aren't in the exception, like

  where it was caught and what was going on when it was caught.



- Provide a FlutterError static API for handling these objects:



  - FlutterError.onError which is called whenever Flutter catches an

    error.



  - FlutterError.reportError() which handles an error.



  - FlutterError.dumpErrorToConsole() which is the default behavior

    for onError.



- Removes all the existing exception handler callbacks.



- Replaces all the existing places that described exceptions using

  debugPrint with calls to FlutterError.reportError().



- Extend lockState() to also catch exceptions, so that we catch

  exceptions that happen during finalizers.



- Make the test framework catch errors and treat them as failures.



- Provide a mechanism to override this behavior in the test framework.



- Make the tests that used to depend on the exception handler

  callbacks use this new mechanism.



- Make pump() also support the phase argument.



- Improve some tests using these new features.



Fixes #2356, #2988, #2985, #2220.
2016-04-02 10:24:12 -07:00
Andrew P. Wilson
f516dbcc2e Leave all entered targets when finishing. 2016-04-01 09:45:28 -07:00
Adam Barth
fca2ac1189 Merge pull request #3023 from abarth/add_test
Add a scrolling test now that it passes
2016-04-01 08:16:35 -07:00
Adam Barth
884ec65c9e Don't delay between dismissing a snack bar and the next snack bar
Previously, the Dismissable widget was animating down to zero width off
screen. Now, we tell it to skip the resize animation.

Fixes #3030
2016-03-31 23:25:03 -07:00
Adam Barth
dbb7c2e850 Add a scrolling test now that it passes
We fixed this issue a different way but the test is still valuable.
2016-03-31 17:28:20 -07:00
Kris Giesing
9dfd5d4021 Part 2 of independent layout pipelines
Adds BuildOwner to manage the dirty list and build processing for
widgets/elements, and adds a widget unit test to make sure separation
is enforced.

Fixes #2723
2016-03-31 11:02:00 -07:00
Adam Barth
243a49f7d0 Merge pull request #2992 from abarth/reactive_build
Reactivating a StatefulElement should imply a build
2016-03-29 16:12:01 -07:00
Adam Barth
b841e868f1 Reactivating a StatefulElement should imply a build
Fixes #2901
2016-03-29 16:02:10 -07:00
Ian Hickson
663164339d Merge pull request #2984 from Hixie/table
More table fixes
2016-03-29 15:54:57 -07:00
Andrew Wilson
fad5df4c5e Merge pull request #2948 from apwilson/image
Add keys to ResourceImages.
2016-03-29 14:16:18 -07:00
Hixie
bdfeaaa47a More table fixes 2016-03-29 14:10:17 -07:00
Andrew Wilson
ed00f3ed5c Add keys to ResourceImages. 2016-03-29 14:02:49 -07:00
Hixie
baf06515e5 Table widget
- Add x and y to the parent data, in case it's useful. In point of fact,
  I ended up not needing it.

- Make columnWidths settable rather than having a setter so that the
  code in the widgets layer is more idiomatic.

- Teach setFlatChildren about avoiding unnecessary drop/adopt loops.

- Assert that the child list length is correct more aggressively so that
  we catch the dumb bug I had more quickly next time.

- Improve the toString() to handle empty tables better.

- Resort the imports in framework.dart.

- Introduce a LocalKey for cases where you don't want to allow use of
  GlobalKey.

- Make inflateWidget and deactivateChild public for subclass use.

- Table widget.

- Cell widget.

- TableRow fake widget.
2016-03-29 12:43:19 -07:00
Andrew Wilson
8ff1982776 Allow Draggables to drop through DragTargets that don't accept them to one that does. 2016-03-29 10:31:04 -07:00
Adam Barth
1ba539a661 Add constants for FractionalOffsets
Adds some names for common FractionalOffset values.
2016-03-28 22:51:06 -07:00
Matt Perry
641604ad94 Merge pull request #2850 from mpcomplete/form
Added a Form widget to manage multiple Input widgets.
2016-03-28 13:55:08 -04:00
Hixie
6af9e6c96b RenderTable 2016-03-25 18:40:18 -07:00
Matt Perry
a7b28a3ede Added a Form widget to manage multiple Input widgets. 2016-03-25 17:55:38 -04:00
Andrew Wilson
3a84cef248 Merge pull request #2907 from apwilson/velocity_drop
Add a callback when a Draggable is dropped without being accepted.
2016-03-25 14:28:14 -07:00
Andrew Wilson
f90ccf4825 Add a callabck when a Draggable is dropped without being accepted. 2016-03-25 14:18:24 -07:00
Adam Barth
3c6d4f660e Add a default MediaQuery value
Now MediaQuery.of always returns a non-null value. By default, you get the
values associated with the current ui.Window.

Fixes #2894
2016-03-25 13:07:42 -07:00
krisgiesing
cef24293b7 Merge pull request #2839 from krisgiesing/offscreen_layout
Allow independent rendering pipelines
2016-03-24 16:26:36 -07:00
Adam Barth
c8c325d095 Replace EdgeInsets.TRBL with EdgeInsets.fromLTRB
This matches the pattern from Rect. I've left EdgeInsets.TRBL marked as
deprecated to give clients a chance to update.

Fixes #2860
2016-03-24 15:19:40 -07:00
Kris Giesing
bb5a82a726 Allow independent rendering pipelines
Fixes #2723
2016-03-24 14:59:21 -07:00
Adam Barth
dff356fcf8 Merge pull request #2872 from abarth/fix_inherited
Inherited widgets should work across reactivations
2016-03-24 12:11:00 -07:00
Adam Barth
e361c0b096 Inherited widgets should work across reactivations
Previously we updated only the reactivated element's inherited widgets. Now we
update all the inherited widgets for the whole subtree that's being
reactivated. We need to visit the whole subtree anyway, so there isn't much of
a loss.

Fixes #2733
Fixes #2438
Fixes #1701
2016-03-24 10:54:08 -07:00
Adam Barth
3ebbabdc0c Remove incorrect comment
This test is no longer disabled.

Fixes #2827
2016-03-24 10:00:30 -07:00
Ian Hickson
da88f1d01f Merge pull request #2828 from Hixie/lru
Replace use of LruMap with a pure LinkedHashMap
2016-03-22 23:24:40 -07:00
Ian Hickson
ea04c910e7 Replace use of LruMap with a pure LinkedHashMap
...so that we can shed the quiver dependency in flutter's framework.
2016-03-22 23:01:31 -07:00
Ian Hickson
9356c19dce Handle NaNs in constraints, just in case. 2016-03-22 22:53:40 -07:00
Hixie
34cc0c4728 Rationalise the overflow render boxes
New RenderAligningShiftedBox abstract class for render boxes with
"alignment", which as of now is:

 - RenderPositionedBox
 - RenderConstrainedOverflowBox (ex RenderOverflowBox)
 - RenderSizedOverflowBox
 - RenderFractionallySizedOverflowBox (ex RenderFractionallySizedBox)

(The respective widgets are Align, OverflowBox, SizedOverflowBox, and
FractionallySizedBox. They haven't been renamed.)

Also I added some toString details.
2016-03-22 14:06:49 -07:00
Hixie
71976b306b Fix RenderFractionallySizedBox's constraints logic
Fixes https://github.com/flutter/flutter/issues/2735
2016-03-22 10:29:43 -07:00