2153 Commits

Author SHA1 Message Date
Adam Barth
36d437d6f2 Add support for TextOverflow.ellipsis (#3818)
Fixes #417
2016-05-09 15:57:16 -07:00
Hans Muller
4d8f38e538 Correct ListItem leading/trailing widget layout (#3820) 2016-05-09 15:23:47 -07:00
Chinmay Garde
aff752f802 mojo_client: Dont try to iterate over response headers if there aren't any. (#3811) 2016-05-09 12:53:09 -07:00
Adam Barth
40152c5593 We were looking for HapticFeedback in the wrong service bundle (#3797)
Fixes #3795
2016-05-09 10:28:43 -07:00
Adam Barth
ee903af03f Move TextAlign out of TextStyle (#3789)
TextAlign applies to a whole paragraph instead of applying to an individual
text span. This patch moves the property out of TextStyle and into a separate
property on Text and RichText.
2016-05-06 17:33:27 -07:00
Adam Barth
ac2c8fec34 Left-align contents of drop-down button (#3775)
Fixes #3759
2016-05-06 13:07:05 -07:00
Ian Hickson
4d9fdda759 Remove ModalPosition (for real)
It has no more clients.

Follow-up to #3734.

Fixes #2484
2016-05-06 09:46:51 -07:00
Adam Barth
2592f8f4b6 DropDownMenu should use ScrollableList (#3745)
Previously it used Block, which is less efficient for large numbers of items.
Also move the top margin out of the menu item to fix the baseline alignment of
the text.

Fixes #1615
2016-05-05 12:09:29 -07:00
Adam Barth
b357aa32ec More docs for PerformanceOverlay (#3749)
Fixes #3747
2016-05-05 12:09:23 -07:00
Adam Barth
2fbf11a77b Expose blurSigma (#3743)
Fixes #3741
2016-05-04 18:50:38 -07:00
Adam Barth
6a46bf2e45 Ensure that DropDownMenus are always onscreen (#3742)
This patch sizes the menu such that it is always on screen, but doesn't scroll
the menu to ensure that the currently selected item is always visible and on
top of the button. That will need to wait for a later patch.

Also, teach CustomPaint how to repaint animations more efficiently.

Fixes #3720
2016-05-04 17:13:15 -07:00
Adam Barth
a5eb4c04c7 Remove ModalPosition (#3734)
Clients of getPosition should just use a one-child custom layout delegate
instead.

Fixes #2484
2016-05-04 12:40:50 -07:00
Matt Perry
a5920c3d52 First pass at a material-style copy/paste toolbar. (#3698)
* First pass at a material-style copy/paste toolbar.

This mimics the toolbar you see when selecting text in an Android
material app. There's still more to do (like integration with the system
clipboard), but this seemed like a good stopping point.

BUG=https://github.com/flutter/flutter/issues/1567
2016-05-04 15:37:04 -04:00
Phil Quitslund
04e892a457 Merge pull request #3729 from pq/annotate_literals_2
More type annotations for literals.
2016-05-04 12:32:54 -07:00
Ian McKellar
b04670699e Fix case of 'GET' HTTP method. (#3732)
Fixes #3730
2016-05-04 12:24:04 -07:00
pq
8bc06aa9b3 More type annotations for literals.
The `flutter` package gets more types!

Follow-up from: https://github.com/flutter/flutter/pull/3727.
2016-05-04 10:10:08 -07:00
Ian Hickson
1e093701b7 Save some memory by only storing one copy of the animation object... (#3724)
Turns out we were storing the same object in the base class and the
subclass. For pretty much every AnimatedWidget subclass.
2016-05-03 23:49:35 -07:00
Adam Barth
7712e583a4 Add missing dartdocs from material.dart (#3709)
Making progress towards document all public APIs in material.dart. We're still
missing a few odds and ends (as well as missing docs in tabs.dart,
tooltip.dart, and two_level_list.dart).
2016-05-03 21:07:29 -07:00
Adam Barth
bf0f38c615 Add more dartdoc to material.dart (#3702)
This patch completes the circuit on this library. The next step is to go
through and add docs to anything we missed.
2016-05-03 15:01:46 -07:00
Ian Hickson
50626e9b21 ClipPath (#3695)
* ClipPath

* Add a test for ClipOval and ClipPath
2016-05-03 14:45:36 -07:00
Adam Barth
00e0075f8b PathProvider.getTemporaryDirectory() never resolves (#3705)
We were looking for this service in the wrong service provider.

Fixes #3683
2016-05-03 14:35:00 -07:00
Ian Hickson
4b401a3e75 Track the worst frame in perf tests (#3642)
* Track the worst frame in perf tests

* Use backticks in "/// Returns `null` if"
2016-05-03 14:00:10 -07:00
Adam Barth
93926d2220 More dartdoc for material.dart (#3690)
Also, move the default theme transition duration into theme.dart.
2016-05-03 12:25:51 -07:00
Hans Muller
1a2f19b7fa Add a non-null builder assert to Builders, renamed IndexedBuilder (#3694) 2016-05-03 11:22:26 -07:00
Hans Muller
b38927e70e LayoutBuilder widget (#3670)
* LayoutBuilder Widget
2016-05-03 10:35:24 -07:00
Devon Carew
c9010c91f6 fix analysis errors (#3677)
* fix analysis errors

* review comments; fix test

* re-add an export for debugPrint
2016-05-03 09:09:00 -07:00
Ian Hickson
7020e6cb93 Fix Inherited bugs (#3657)
Fixes https://github.com/flutter/flutter/issues/3493

 - rebuild stateless widgets that have dependencies when their ancestors change but they don't

Fixes https://github.com/flutter/flutter/issues/3120

 - rebuild widgets that tried to inherit from a widget that didn't exist, when the widget is added

This adds a pointer and a bool to Element, which isn't great. It also adds a more or less complete tree walk when you add a new Inherited widget at the top of your tree, which isn't cheap.
2016-05-03 00:06:29 -07:00
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