1643 Commits

Author SHA1 Message Date
Adam Barth
6072552868 AspectRatio has incorrect intrinsic sizing (#3666)
If there's a max height or width, we should factor that into the intrinsic
sizing for the other dimension.
2016-05-02 15:51:45 -07:00
Adam Barth
0910a78fd6 Improve dartdoc for SystemChrome and SystemSound (#3669)
We need to import these enums in order for the dartdoc to linkify correctly.

Fixes #3668
2016-05-02 15:51:35 -07:00
Adam Barth
5460e94488 Add docs to Element.performRebuild (#3667) 2016-05-02 13:38:07 -07:00
Andrew Wilson
1c053b7d0a Fix NetworkImage by always auto following redirects. (#3653) 2016-04-29 20:53:53 -07:00
Adam Barth
b2fa6c250a Fix the padding and space for FlatButton and RaisedButton (#3650)
Instead of incorporating the margin into the button, introduce a ButtonBar
widget that supplies the proper spacing between the buttons. Also, make these
buttons more configurable via ButtonTheme so that dialogs can change the
minWidth and padding of the buttons as required by the spec.

Fixes #1843
Fixes #3184
2016-04-29 16:13:25 -07:00
Adam Barth
f8d76d1851 Center the "slow mode" banner (#3651)
Also add dartdocs.
2016-04-29 16:12:56 -07:00
Devon Carew
53c07045f2 create a service extension to terminate an app (#3634) 2016-04-29 13:34:31 -07:00
Yegor
7c017898da invert first frame condition to make it positive (#3641) 2016-04-29 13:34:06 -07:00
Ian Hickson
91dd969966 Refactor the test framework (#3622)
* Refactor widget test framework

Instead of:

```dart
  test("Card Collection smoke test", () {
    testWidgets((WidgetTester tester) {
```

...you now say:

```dart
  testWidgets("Card Collection smoke test", (WidgetTester tester) {
```

Instead of:

```dart
  expect(tester, hasWidget(find.text('hello')));
```

...you now say:

```dart
  expect(find.text('hello'), findsOneWidget);
```

Instead of the previous API (exists, widgets, widget, stateOf,
elementOf, etc), you now have the following comprehensive API. All these
are functions that take a Finder, except the all* properties.

* `any()` - true if anything matches, c.f. `Iterable.any`
* `allWidgets` - all the widgets in the tree
* `widget()` - the one and only widget that matches the finder
* `firstWidget()` - the first widget that matches the finder
* `allElements` - all the elements in the tree
* `element()` - the one and only element that matches the finder
* `firstElement()` - the first element that matches the finder
* `allStates` - all the `State`s in the tree
* `state()` - the one and only state that matches the finder
* `firstState()` - the first state that matches the finder
* `allRenderObjects` - all the render objects in the tree
* `renderObject()` - the one and only render object that matches the finder
* `firstRenderObject()` - the first render object that matches the finder

There's also `layers' which returns the list of current layers.

`tap`, `fling`, getCenter, getSize, etc, take Finders, like the APIs
above, and expect there to only be one matching widget.

The finders are:

 * `find.text(String text)`
 * `find.widgetWithText(Type widgetType, String text)`
 * `find.byKey(Key key)`
 * `find.byType(Type type)`
 * `find.byElementType(Type type)`
 * `find.byConfig(Widget config)`
 * `find.byWidgetPredicate(WidgetPredicate predicate)`
 * `find.byElementPredicate(ElementPredicate predicate)`

The matchers (for `expect`) are:

 * `findsNothing`
 * `findsWidgets`
 * `findsOneWidget`
 * `findsNWidgets(n)`
 * `isOnStage`
 * `isOffStage`
 * `isInCard`
 * `isNotInCard`

Benchmarks now use benchmarkWidgets instead of testWidgets.

Also, for those of you using mockers, `serviceMocker` now automatically
handles the binding initialization.

This patch also:

* changes how tests are run so that we can more easily swap the logic
  out for a "real" mode instead of FakeAsync.

* introduces CachingIterable.

* changes how flutter_driver interacts with the widget tree to use the
  aforementioned new API rather than ElementTreeTester, which is gone.

* removes ElementTreeTester.

* changes the semantics of a test for scrollables because we couldn't
  convince ourselves that the old semantics made sense; it only worked
  before because flushing the microtasks after every event was broken.

* fixes the flushing of microtasks after every event.

* Reindent the tests

* Fix review comments
2016-04-29 13:23:27 -07:00
Yegor
e60a624a4a fix first frame reporting logic (#3640) 2016-04-29 13:21:59 -07:00
Adam Barth
870c361915 Add ergonomic wrappers for Flutter platform services (#3636)
These wrappers also give us a chance to document what these services do.

Fixes #3164
2016-04-29 12:15:04 -07:00
Adam Barth
5497ba182f Update engine (#3637)
Turns out there were more clients of the old paragraph API than I expected.
This patch migrates them to the new API.
2016-04-29 11:19:35 -07:00
Matt Perry
f93ea0ead1 Clear the composing range when selecting text. (#3635)
This fixes a bug where editing the selected text on Android would delete
the wrong block of text.

BUG=https://github.com/flutter/flutter/issues/3567
2016-04-29 14:02:56 -04:00
Ian Hickson
055c919fda Allow children to overflow above a Baseline widget (#3573)
Turns out a common use for Baseline is making sure that the child's
baseline is higher than it otherwise would be, e.g. with the Material
font or other symbols.
2016-04-28 21:35:49 -07:00
Ian Hickson
770e17cf9f Fix truncated dartdoc. (#3619)
Note that the /// part of the doc was published, only the // line was
omitted. This means that we can safely put // comments between /// docs
and the member they are documenting.
2016-04-28 21:35:39 -07:00
Adam Barth
e41120bc68 Improve the TextPainter API (#3621)
Instead of using properties, TextPainter now receives min and max width as
parameters to layout. Also, this patch integrates the intrinsic sizing logic
into the main layout function, which satisfies all the existing uses cases.
2016-04-28 20:44:52 -07:00
Ian Hickson
dae5e54550 Support first frame notification in trivial apps (#3618)
Apps that didn't use [WidgetsApp] were not sending the `'Widgets
completed first useful frame'` notification. This fixes that by making
the code cleaner.
2016-04-28 15:20:26 -07:00
Adam Barth
5eb4443343 Address review comments from previous patches (#3600)
This patch addresses late-breaking comments on previous patches.
2016-04-28 09:32:19 -07:00
Adam Barth
bb238eba88 Fix typo in LazyBlock (#3594)
We were returning instead of breaking out of the loop when we hit the last
widget.

Fixes #3593
2016-04-27 17:46:44 -07:00
Hans Muller
620fb87567 Enable lining up the last tool bar action trailing list item elements (#3597) 2016-04-27 17:34:59 -07:00
Adam Barth
4aa3756835 Move cassowary into package:flutter (#3591)
Cassowary doesn't have any additional dependencies and this simplifies things.

Fixes #2442
2016-04-27 17:32:06 -07:00
Adam Barth
d8f2d018ad Expose dispatchDependencyChanged in InheritedWidget (#3580)
Some inherited widgets want to call this function direction, for example to
notify children when a mutable model object changes. Exposing this function to
subclasses of InheritedWidget is clear then forcing them to compute
updateShouldNotify for mutable model objects.
2016-04-27 15:51:20 -07:00
Adam Barth
cbe650a7e6 Move newton into package:flutter (#3585)
Rather that importing `package:newton/newton.dart` you can
`import package:flutter/physics.dart`.

Fixes #2441
2016-04-27 13:09:54 -07:00
Adam Barth
7ef1df4d5b Remove fetch.dart (#3584)
These uses cases are now address by http.dart via http.readDataPipe.
2016-04-27 13:09:37 -07:00
Ian Hickson
256adfcd46 Fix leaking animation in floating action button. (#3575) 2016-04-27 12:30:48 -07:00
Hans Muller
0f1dbe09af Fixes TimePicker (#3583)
* Fixed TimePicker crash and added tests

* Fixed TimePicker crash and added tests

* fixed a Lint-O
2016-04-27 12:26:18 -07:00
Adam Barth
67bf268de1 Add dartdoc to typography.dart (#3576) 2016-04-27 09:15:23 -07:00
Adam Barth
1b872603f3 Keyboard causes Scaffold body to resize (#3570)
This patch adds an option to Scaffold to disable resizing the body to avoid the
window padding. This lets developers create layouts that are stable when the
keyboard overlays the app.

Fixes #3565
2016-04-27 09:14:54 -07:00
Adam Barth
2781a0868a Tooltips show up in the wrong place (#3574)
We had a math-o.

Fixes #3563
2016-04-26 16:59:29 -07:00
Adam Barth
51b1550df7 Delay win-by-default in gesture arena (#3552)
Wait until the end of the microtask to tell gesture recognizers that
they've won in the gesture arena. This lets recognizers dispose reject
themselves at arbitrary times without triggering gestures in awkward
call stacks.

Fixes #3183
2016-04-26 14:52:31 -07:00
Adam Barth
4399fea12d Icons in material buttons should match text color (#3551)
Fixes #3186
2016-04-25 23:17:49 -07:00
Adam Barth
c6942c9945 Implement MainAxisAlignment.spaceEvenly (#3550)
Fixes #3289
2016-04-25 23:10:14 -07:00
Adam Barth
cc9d602b12 Block should work inside LazyBlock (#3546)
Previously we were locking down the state even when calling layout in
LazyBlock. Now we lock only when building children. Making this work well
involved moving the catch out of lockState and into the few callers who
actually wanted it.

Fixes #3534
2016-04-25 16:57:27 -07:00
Adam Barth
00f10da17f Document some construtors in transitions.dart (#3522) 2016-04-25 15:37:38 -07:00
Adam Barth
23634de989 Merge pull request #3535 from abarth/null_body
Handle the case of a null body in response.dart
2016-04-25 14:36:27 -07:00
Adam Barth
e5d09cb682 Handle the case of a null body in response.dart
We're supposed to return a null string when the HTTP response doesn't have a
body. Also handle the case of not having a headers map.
2016-04-25 14:22:11 -07:00
Hans Muller
2e4aa795e3 FlexibleSpaceBar should not include transparent widgets (#3527) 2016-04-25 11:46:28 -07:00
Adam Barth
e7dd870774 Improve docs for MediaQueryData.size
This would have answered a question we go on flutter-dev.

Fixes #3517
2016-04-25 09:31:11 -07:00
Adam Barth
8ce2f859ce Merge pull request #3516 from abarth/tweaks
Add Flow layout
2016-04-23 21:17:58 -07:00
Adam Barth
f53a5a525b Add Flow layout
A flow layout is optimized for reposition children with transformation
matrices. A flow layout can animate the position of its children very
efficiently.
2016-04-23 21:02:32 -07:00
Adam Barth
3ca80d9e35 A few minor improvements
This patch contains a few minor improvements to the framework that I ran
across while working on a new layout model.
2016-04-23 14:23:31 -07:00
Adam Barth
9d900ea75a Improve dartdoc for extent callbacks (#3514)
Fixes #3510
2016-04-23 09:45:43 -07:00
Adam Barth
e7f335862a Address review comments (#3515)
Somehow I missed these in my previous patch.
2016-04-23 09:07:55 -07:00
Adam Barth
8ac9cc45cc Improve the docs for Text and RichText (#3507)
Fixes #3503
2016-04-22 16:53:02 -07:00
Adam Barth
a5e794ca42 A blinking cursor should push only one frame (#3445) (#3506)
Prior to this patch, we were pushing two frames each time the cursor blinked.
In turning the cursor on or off, the markNeedsPaint call was triggering another
frame to be scheduled because we cleared a bit in the scheduler at the
beginning of the frame instead of at the end of the frame.

To implement scheduling correctly, we actually need two bits: one for
ensureVisualUpdate, which just promises to get to the end of the pipeline soon,
and scheduleFrame, which promises to get to the beginning of the pipeline soon.

(Reland)
2016-04-22 16:40:20 -07:00
Ian Hickson
b5a827bfa1 Clean up our timeline events. (#3504)
This adds in particular the ability to track the time at which the
framework boots up, and the time at which we are confident we have
completed the first useful frame.
2016-04-22 13:04:06 -07:00
Adam Barth
0d7b61f51e Improve elevation docs (#3502)
Fixes #3501
2016-04-22 12:58:03 -07:00
Adam Barth
d74025f451 Fix analyzer warning (#3499)
We don't need this assert anyway.
2016-04-22 11:36:15 -07:00
Adam Barth
c486fc4a96 Revert "A blinking cursor should push only one frame (#3445)"
This reverts commit 161f945e84bd3c801f32a030245f37755d5f677a.

This patch caused a number of regressions.

Fixes #3497
2016-04-22 11:05:52 -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