213 Commits

Author SHA1 Message Date
Adam Barth
0d7b61f51e Improve elevation docs (#3502)
Fixes #3501
2016-04-22 12:58:03 -07:00
Ian Hickson
e968d91ca4 Rename binding abstract classes (#3482)
The old names were getting silly and started stepping on valuable namespace.

The new names are consistent and clear.
2016-04-21 17:18:46 -07:00
Ian Hickson
c167efca17 Minor widget_tester refactoring and docs (#3472)
This reorders some classes so that this file makes more sense, and adds
a bunch of docs. It also makes the following changes:

* Move allElements from Instrumentation to TestWidgets. (Instrumentation
  is going away.)

* Remove findElements.

* Rename byElement to byElementPredicate

* Rename byPredicate to byWidgetPredicate

* Implement _WidgetPredicateFinder so that byWidgetPredicate has good
  messages

* Fix one use of byElementPredicate to use byWidgetPredicate.
2016-04-21 16:35:46 -07:00
Matt Perry
11f236ec25 Add basic text selection to editable text. (#3223)
Only partially works. Editing the selected text doesn't work very well,
which probably will require engine changes. Currently only draws the
selected text and allows you to manipulate the selection with draggable
selection handles.
2016-04-21 13:53:31 -04:00
Ian Hickson
112f2cc37b Reset _simulation at the end of a fling (#3435)
Also a bit of code cleanup.

The key part of this patch is the addition in `_endScroll` to reset
`_simulation`. It seems like this was the one place where it's possible
for us to end the animation but not reset our state. Since we assert
that are state is coherent, we were hitting asserts when a fling
finished and then you interacted with the widget again.
2016-04-20 11:02:20 -07:00
Hans Muller
25164e1089 Make IconButton gesture targets as big as possible (#3423)
* Make IconButtons as big as possible
2016-04-20 10:00:14 -07:00
Ian Hickson
1b9476c4d9 Hide routes from the API when they're not needed. (#3431)
The 'routes' table is a point of confusion with new developers. By
providing a 'home' argument that sets the '/' route, we can delay the
point at which we teach developers about 'routes' until the point where
they want to have a second route.
2016-04-20 09:33:28 -07:00
Hans Muller
c4ae13ed22 Refresh indicator (#3354) 2016-04-15 18:39:18 -07:00
Ian Hickson
a91bc0ba9c Material Data Tables (#3337)
+ Add new demo to gallery to show data tables. (This currently doesn't
use a Card; I'll create a Card version in a subsequent patch.)

+ Fix checkbox alignment. It now centers in its box regardless.

+ Add Colors.black54.

+ Some minor fixes to dartdocs.

+ DataTable, DataColumn, DataRow, DataCell

+ RowInkWell

+ Augment dartdocs of materia/debug.dart.

+ DropDownButtonHideUnderline to hide the underline in a drop-down when
  used in a DataTable.

+ Add new capabilities to InkResponse to support RowInkWell.

+ Augment dartdocs of materia/material.dart.

+ Add an assert to catch nested Blocks.

+ Fix a crash in RenderBox when you remove an object and an ancestor
  used its baseline. (https://github.com/flutter/flutter/issues/2874)

+ Fix (and redocument) RenderBaseline/Baseline.

+ Add flex support to IntrinsicColumnWidth.

+ Document more stuff on the RenderTable side.

+ Fix a bug with parentData handling on RenderTable children.

+ Completely rewrite the column width computations. The old logic made
  no sense at all.

+ Add dartdocs to widgets/debug.dart.

+ Add a toString for TableRow.
2016-04-15 16:51:03 -07:00
Hans Muller
f7cf0d97ca Fix the progress indicator demo (#3367) 2016-04-15 16:21:38 -07:00
Ian Hickson
d348f28df7 Use the same logic in flushPaint as flushLayout (#3353)
If two repaint boundaries mark themselves dirty, but the second one is a
child of the first, then the second one will get repainted by the first
and then when we come to paint it directly, we get confused because it
isn't dirty any more.

We ran into this in layout before. Apply the same fix. Also, apply the
same fix to composition while we're at it.
2016-04-15 14:55:18 -07:00
Ian Hickson
e41c1c0b06 Split services/ into services/ and foundation/ (#3350)
We're getting back to the point where we have a bunch of foundation APIs
and it's getting confusing having them mixed with services/.
2016-04-15 13:18:29 -07:00
Yegor
f3a4f722c4 [flutter_test] new WidgetTester API based on finder objects (#3288) 2016-04-13 23:40:15 -07:00
Ian Hickson
571e2e84aa Stop importing identifiers we don't use. (#3314) 2016-04-13 14:42:07 -07:00
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