2312 Commits

Author SHA1 Message Date
Adam Barth
930b52a3e5 Rename InputFormField to TextField
This patch is the first of a series to rationalize the names of the text-input
related widgets.

See #7031
2017-01-19 14:53:08 -08:00
Adam Barth
aa82b741e2 Revert "Strengthen animation listener iteration patterns" (#7552) 2017-01-19 14:36:25 -08:00
Adam Barth
3312af7da5 Strengthen animation listener iteration patterns (#7537)
This patch aligns the iteration patterns used by animations and
ChangeNotifier. They now both respect re-entrant removal of listeners
and coalesce duplication registrations. (Also, ChangeNotifier
notification is no longer N^2).

Fixes #7533
2017-01-18 22:17:13 -08:00
Adam Barth
9f36737f3a InkSplash and InkHighlight shouldn't be special (#7531)
Previously, these classes where in material.dart, which meant they could
access private interfaces in that library. This patch moves them out
into their own files so that they need to play by the rules of the
public API.

Fixes #5969
2017-01-18 16:40:00 -08:00
Adam Barth
712eb969ea CustomSingleChildLayout should be able to resize (#7528)
It's not correct to set sizedByParent for
RenderCustomSingleChildLayoutBox because the delegate's size function
might depend on information other than the incoming constraints.
2017-01-18 16:33:42 -08:00
Adam Barth
23361d5ab6 Improve Route lifecycle (#7526)
Previously the navigator wouldn't always call Route.dispose when it was
removed from the tree. After this patch, the navigator remembers popped
routes so that it can call dispose on them when it is removed from the
tree.

Also, improve some error messages around calling dispose() more than
once on routes and AnimationControllers.

Fixes #7457
2017-01-18 16:32:44 -08:00
Adam Barth
7d5f172a26 Remove Force and SpringForce (#7532)
The only client of this machinery was AnimationController.fling, but
it's easier for that function to just create the simulation it needs
directly.

Fixes #7216
2017-01-18 16:32:00 -08:00
Adam Barth
40e305dc2d Fix analyzer warnings (#7523)
I see these errors in Atom on my Mac. I'm not sure why they're not being
picked up by the bots.
2017-01-18 13:18:09 -08:00
Hans Muller
0ce9917fb2 Support for vetoing an attempt to pop the current route (#7488) 2017-01-18 11:04:18 -08:00
Matt Perry
75f39789c7 Add support for specifying maxLines for Text. (#7493)
Overflow handling works with clipping, adding an ellipsis on the last
line, or fading the last line.

Fixes https://github.com/flutter/flutter/issues/7271
2017-01-18 12:34:34 -05:00
Hans Muller
60847a1ded Restore velocity tracker sample window duration (#7510) 2017-01-17 15:44:09 -08:00
Ian Hickson
9ece6daff6 Add more asserts and docs to ChangeNotifier. (#7513)
It took me a while to figure out what was going on (I was removing a
listener after disposal). These asserts helped.
2017-01-17 14:17:00 -08:00
Adam Barth
2b742289d4 Fix several minor bugs and add many tests (#7506)
* MultiTapGestureRecognizer previously would assert if there was no
   competition.
 * GestureArenaTeam would always select the first recongizer as the
   winner even if a later recognizer actually accepted the pointer
   sequence.
 * debugPrintStack would fail a type check if maxFrames was non-null.
 * FractionalOffset.lerp would throw a null-pointer exception if its
   second argument was null.

Also, add a number of tests for previously untested lines of code.
2017-01-17 11:00:10 -08:00
Reagan Middlebrook
fcc9df719f Clarifying allowed Divider use (#7486)
Clarifying that Dividers aren't restricted to usage in lists and Drawers. Maybe no one else is confused about this but I didn't realize it until I found them used in the calculator demo (8ca4caa440/examples/flutter_gallery/lib/demo/calculator/home.dart)
2017-01-14 11:48:55 -08:00
Adam Barth
ad27fcd3dc Add SimpleDialogOption (#7494)
The demo of the SimpleDialog had some useful code that should really be part of
the framework. This patch extracts it into a SimpleDialogOption widget.

Remove debugCheckHasScaffold because it is unused.

Also, add tests for InkWell, SimpleDialog, and other widgets.
2017-01-13 23:26:05 -08:00
Jason Simmons
3b702448fd Do not paint a RenderFittedBox with an empty size (#7489)
If the size is empty, then _updatePaintData will produce an invalid transform
that yields a NaN canvas bounds rectangle

Fixes https://github.com/flutter/flutter/issues/7431
2017-01-13 15:12:30 -08:00
Adam Barth
0139c69c84 Add GestureArenaTeam (#7481)
Previously, the Slider used a drag gesture recognizer to move the head
of the slider, but when the slider was in a vertical scroller, the
recognizer would wait until the user moved the pointer by enough pixels
to disambiguate between sliding the slider and scrolling the scroller.

That worked fine for actual drags, but the slider should also move when
the user taps the track. This patch introduces a tap recognizer to
handle that behavior.

To avoid the slider's drag and tap recognizers from competing with each
other in the arena, this patch introduces the notion of a
GestureArenaTeam, which lets several recognizers combine to form one
entry in the arena.  If that entry wins, the team picks the first of its
recognizers as the winner, avoiding latency.

Fixes #7454
2017-01-13 14:44:59 -08:00
Adam Barth
4955eef8a7 Refactor IconThemeData.fallback (#7490)
Now IconThemeData.fallback is a factory constructor and IconThemeData.of() does
the work of computing the fallback for its clients.

Also, add tests for ImageIcon and ListItems.
2017-01-13 14:44:47 -08:00
Adam Barth
3150e3fbd4 Ticker.stop should work when muted (#7487)
Previously, the ticker would not stop when it was muted because it thought it
was already not ticking.
2017-01-13 12:46:13 -08:00
Adam Barth
f5bd8976de Expose some text metrics on RenderParagraph (#7456)
The underlying TextPainter is not exposed, so this patch exposes some
useful metrics that clients might want to read.
2017-01-12 23:13:31 -08:00
Adam Barth
474e473a50 Remove Mimic (#7467)
This widget isn't tested and isn't used by Fuchsia or internally by Google. The
Hero widget is a better way of generating hero animations.
2017-01-12 13:14:24 -08:00
Adam Barth
709cc0034e Improve test coverage again (#7458)
This patch adds tests for radio buttons, the date picker, as well as a
number of other classes.
2017-01-12 13:14:09 -08:00
Adam Barth
8f708bfbc1 Test AboutDrawerItem (#7453)
Also, fix a few minor bugs found by the test.
2017-01-11 18:38:03 -08:00
Adam Barth
5dc96f2069 markNeedsBuild should handle case where the element is in the dirty list (#7448)
Previously we asserted that the element was not in the dirty list, but there
are scenarios where the element can be in the dirty list already. This patch
makes markNeedsBuild handle those cases by simply resorting the dirty list.

Fixes #6119
2017-01-11 14:37:40 -08:00
Jason Simmons
e3cdd4542c Calculate the caret position based on the next or previous rune (#7432)
The indexes passed to paragraph.getBoxesForRange are based on UTF-16 code
units.  If the caret is at a character that is encoded as multiple code units,
then the start and end indexes should be adjusted accordingly.
2017-01-11 14:32:13 -08:00
Hans Muller
a27192fe67 Navigator tutorial dartdoc (#7445) 2017-01-11 14:13:48 -08:00
Adam Barth
8f6aefa2c8 Remove HostMessages (#7436)
This API was deprecated. Clients should use PlatformMessages instead.
2017-01-11 08:59:43 -08:00
Adam Barth
2ee04c92bf Improve test coverage (#7430)
Also, make the exception handling for global key listeners slightly more
robust.
2017-01-10 20:41:42 -08:00
Adam Barth
03d1980733 Change Flexible's default FlexFit (#7404)
Change `Flexible`'s default `FlexFit`

Previously, `Flexible` defaulted to `FlexFit.tight`, which forced the child to
expand to fill the available space. Now, `Flexible` defaults to
`FlexFit.loose`, which does not force the child to expand to fill the available
space.

If you want the child to expand to fill the available space, consider using
`Expanded` instead.

Fixes #5169
2017-01-10 13:12:04 -08:00
Hans Muller
2155fb74b6 Tweak the Navigator class doc (#7415) 2017-01-10 11:19:09 -08:00
Adam Barth
5a2bf18488 Improve test coverage and fix bugs (#7410)
This patch improves test coverage for a number of files that had low
coverage. This patch also fixes a few minor bugs found by these tests.
2017-01-10 10:15:33 -08:00
Adam Barth
684259794b Add CupertinoAlertDialog (#7395)
Fixes #7375
2017-01-09 21:35:43 -08:00
Adam Barth
cd34593ca8 Test print.dart (#7406) 2017-01-09 21:35:26 -08:00
Ian Hickson
2eecb8be37 Improve Notification API (#7403)
- better documentation

- verify (at run time) that onNotification doesn't return null, and
  report copious helpful information if it does.

- add a toString/debugFillDescription convention to Notification.

- actually test Notification
2017-01-09 16:44:22 -08:00
Ian Hickson
d3faada983 Trivial improvement of AbstractNode docs. (#7399)
This confused me briefly the other day.
2017-01-09 16:33:40 -08:00
Ian Hickson
cd92e11f17 Use the actual pipeline owner for this assert. (#7400) 2017-01-09 16:33:25 -08:00
Adam Barth
84cf54892d Improve test coverage (#7401)
This patch adds a number of tests for previously untested lines.
2017-01-09 16:19:24 -08:00
Matt Perry
12d5b26c3a Add an onChanged callback to InputFormField. (#7398)
Fixes https://github.com/flutter/flutter/issues/7210
2017-01-09 15:43:16 -08:00
Hans Muller
b23aed7a86 New Tabs API (#7387) 2017-01-09 14:55:36 -08:00
Ian Hickson
e82b18d47b The core RenderSliver protocol. (#7370)
This implements a new RenderViewport2 class to replace the existing
RenderViewport class.
2017-01-09 14:49:14 -08:00
Adam Barth
0c42c9b1b2 Add CupertinoActivityIndicator (#7380)
Fixes #7372
2017-01-06 15:58:26 -08:00
Adam Barth
b40f0cae9c Allow Expanded.flex to be null (#7384)
Some clients pass null, which was previously allowed by Flexible.

Fixes #7383
2017-01-06 13:59:40 -08:00
Adam Barth
5b1e7c0a37 Rename TransferMode to BlendMode (#7357)
Skia calls this BlendMode now and that's a better name.

Fixes #7200
2017-01-06 00:07:47 -08:00
Ian Hickson
b0e8520ae6 Make LayoutCallback generic and other minor changes (#7367)
LayoutCallback passes constraints to the callback, but the constraints
object has a different type for different subclasses. This lets you
call invokeLayoutCallback() with a specific type to verify that
everything is working as expected.

Other changes:

Slightly improve the error reporting in RenderObject.

Allow toStringShallow on RenderObject to have its separator configured.
2017-01-05 22:12:08 -08:00
Ian Hickson
ec9a6fbbdd Add an assert and remove a TODO (#7368)
The assert helped me debug an issue recently.

The TODO is obsolete.
2017-01-05 22:11:29 -08:00
Ian Hickson
79c8e5c7c7 Add a toString to Simulation (#7364)
Also, make hasOneLineDescription more discerning.
Also, add a test for hasOneLineDescription.
Also, add a test for GravitySimulation, to test the toString.
2017-01-05 16:33:40 -08:00
Ian Hickson
11d1d54c8a Changes to the drag gesture detectors and the velocity tracker (#7363)
- more dartdocs for the drag typedefs

- more toStrings to aid debugging

- require the position for DragUpdateDetails since we were omitting it
  in some places

- add the primaryVelocity to DragEndDetails so that consumers don't
  have to themselves track the axis in question

- fix the velocity tracker so that it doesn't walk the null data.
  Previously, near time t=0 (which pretty much only matters in tests,
  but it does matter there) we would walk the velocity data and then
  also walk missing data, treating it as Point.zero with t=0.

- simplify some of the velocity tracker; e.g. instead of trying (and
  failing?) to clear the velocity tracker when the pointer stalls,
  just drop the data before a stall during the velocity estimation
  (where we redundantly had another bigger horizon anyway).
2017-01-05 16:19:14 -08:00
Ian Hickson
629255eb49 Fix SizeChangedLayoutNotifier and its test. (#7361)
Previously, SizeChangedLayoutNotifier fired a notification even for
the first layout.

Also, previously its test relied on that, and didn't actually change
size at all. This fixes the test as well.

Also, rename SizeChangedLayoutNotificaion to SizeChangedLayoutNotification.
2017-01-05 16:19:06 -08:00
Seth Ladd
86ad51f1ec Doc that SizedBox.expand can be used by Scaffold.body (#7141)
Closes https://github.com/flutter/flutter/issues/6907
2017-01-05 15:18:40 -08:00
Ian Hickson
207968ff79 Make SingleTickerProviderStateMixin more resilient (#7360)
It used to crash when the State never actually used the TickerProvider
interface.
2017-01-05 15:11:28 -08:00