Commit graph

1319 commits

Author SHA1 Message Date
Hans Muller ac4ad3bc98 Flexible space bar demo needs to occupy more vertical space, etc (#3890) 2016-05-12 16:45:45 -07:00
Eric Seidel 1a1b89e5b3 Fix Flutter Gallery to use title case
@HansMuller
2016-05-12 12:51:10 -07:00
Phil Quitslund 616d9e2ea8 Merge pull request #3880 from pq/void_setters
Turn on `avoid_return_types_on_setters` and cleanup annotated setters.
2016-05-12 12:28:15 -07:00
Hans Muller 5bacc9f8e8 GridTileBar uses ellipsis, etc (#3881) 2016-05-12 12:27:49 -07:00
pq e54196d7fc Turn on avoid_return_types_on_setters and cleanup annotated setters.
It's safe to remove the unneeded `void`s from setters since the blocking issues in the
`always_declare_return_types` lint have been fixed (https://github.com/dart-lang/linter/).  We can also safely flip the bit on  `avoid_return_types_on_setters`.
2016-05-12 11:45:30 -07:00
Hans Muller 2e8315e8f5 Generate a Gallery demo transition-durations performance histogram (#3859) 2016-05-11 14:52:34 -07:00
Todd Volkert 810b3e32a6 Fix regexp that strips invalid characters from the project identifier
Fixes #3835
2016-05-10 13:24:20 -07:00
Todd Volkert baa25c83fb Fix broken identifier in the hello world example 2016-05-10 13:15:14 -07:00
Jim Beveridge 321b338adb Upgrade gradle files for Android Studio 2.1
Fixes #3833
2016-05-10 11:11:31 -07:00
Hans Muller 770f8f1d0c rename TracingCategory to TimelineStream (#3822) 2016-05-09 17:00:49 -07:00
Hans Muller 475d5a457d remove spurious copy of the material_gallery directory (#3806) 2016-05-09 12:18:32 -07:00
Hans Muller 74c3e74fba Call it Flutter Gallery (#3801) 2016-05-09 11:00:54 -07:00
Jason Simmons 09dde8718b Change the Android activity launch mode to singleTop (#3792) 2016-05-09 09:31:34 -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
Viktor Lidholt 153e1bb918 Fixes to particle system API (#3762) 2016-05-05 17:31:16 -07:00
krisgiesing 01978d98a8 Move global analysis options file to the repo root (#3750)
* Move global analysis options file to the repo root

Also restore the analysis options file for stocks example, since
the global options trigger warnings on generated intl files.

* Remove obsolete analysis options file for Material Gallery example
2016-05-05 16:30:38 -07:00
Phil Quitslund 32bbbc6458 Merge pull request #3738 from pq/annotate_literals_3
Last literals get their types.
2016-05-04 13:59:09 -07:00
Adam Barth 8da98105b4 Skip the gallery smoke test (#3736)
This test hangs occationally on the bots and the bots aren't smart enough to
recover, which means the whole project gets blocked.

Filed #3735 about the hang.
2016-05-04 13:42:29 -07:00
pq 98ef58396a Last literals get their types.
Last fixes to get the repo running clean checking for annotations on list and map literals.
2016-05-04 13:37:23 -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
krisgiesing 07b5f83e55 Add analysis options near the root of the repository (#3700)
This aligns the analysis options used by 'flutter analyze' with the
options used by Atom.
2016-05-04 10:15:15 -07:00
Hans Muller a9b965cb9b Gallery demo start-time performance test (#3655)
*  Gallery demo start-time performance test
2016-05-03 17:37:10 -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
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
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
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 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
Devon Carew 1bf6841f56 move the material_gallery/demos.dart script (#3582)
* move the material_gallery/demos.dart script

* rename all_demos.dart to all.dart
2016-04-27 12:23:02 -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
Viktor Lidholt b314a7d9fa Adds NineSliceSprite and optimizes gallery front page (#3485)
* Adds NineSliceSprite and optimizes gallery front page
2016-04-21 17:16:16 -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
Ian Hickson 0e11b0e6e3 Make the widgets binding reusable. (#3479)
Previously the widgets layer only provided a concrete binding, which
makes it awkward to extend it compared to other bindings. This moves
widgets to the same style as the other layers.

In a subsequent patch I'll use this to make the tests layer saner.
2016-04-21 16:06:51 -07:00
Ian Hickson 20eefbf576 Remove stray print from material gallery. (#3463)
Makes the tests noisy.
2016-04-21 14:57:37 -07:00
Adam Barth 248960a734 Add a route table to Material Gallery (#3457)
Use the route table to generate the list of screens to test in the smoke test.
2016-04-21 10:24:22 -07:00
Hans Muller 986b017445 Gallery Smoke Test (#3446)
* Gallery Smoke Test
2016-04-21 08:54:43 -07:00
Viktor Lidholt 9aeeb15849 Minor fixes to code parser test in gallery (#3439) 2016-04-20 12:45:54 -07:00
Adam Barth 140bf64a9d Update examples readme (#3434)
Previously this readme had some broken links.

Fixes #3428
2016-04-20 10:58:06 -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
Viktor Lidholt f7360126b8 Gallery code snippets now analyzed (#3391)
* Gallery code snippets now analyzed
2016-04-20 09:29:01 -07:00
Hans Muller c7e2e8ae81 Remove Scaffold scrollableKey use in gallery demos (#3406)
* Remove Scaffold scrollable_key demo usage
2016-04-19 16:31:11 -07:00
Hans Muller a2ce9483c1 Replace Block with ScrollableList in Cards demo (#3380) 2016-04-19 09:45:53 -07:00
Devon Carew 4678c12098 find all repo packages (#3368)
* find all repo packages

* .dartignore
2016-04-15 20:25:57 -07:00
Hans Muller c4ae13ed22 Refresh indicator (#3354) 2016-04-15 18:39:18 -07:00
Yegor 9ce995f65e [driver] refactor API to finder objects (#3365) 2016-04-15 16:57:35 -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
krisgiesing 27715e1d41 Add an example demonstrating use of isolates (#3347) 2016-04-15 16:31:23 -07:00
Hans Muller f7cf0d97ca Fix the progress indicator demo (#3367) 2016-04-15 16:21:38 -07:00
Eric Seidel 347831bf7f Merge pull request #3358 from eseidelGoogle/perf_overlay_gallery
Add a Performance Overlay toggle to the Gallery app
2016-04-15 13:25:08 -07:00
Eric Seidel a2b704b82c Merge pull request #3313 from eseidelGoogle/gallery_drive_perf
Add a basic scrolling test for the Gallery home page.
2016-04-14 09:05:02 -07:00
Yegor f3a4f722c4 [flutter_test] new WidgetTester API based on finder objects (#3288) 2016-04-13 23:40:15 -07:00
Viktor Lidholt ec85af59b4 Improvements to the Grid list demo (#3315)
* Improvements to the Grid list demo

* More nits and fixes to grid demo in gallery
2016-04-13 15:25:27 -07:00
Eric Seidel 7ee0ee7291 Per review comments 2016-04-13 14:46:42 -07:00
Eric Seidel 237f1ac263 Add a basic scrolling test for the Gallery home page.
Current numbers from my Nexus 5:
  "average_frame_build_time_millis": 22.6854,
  "missed_frame_build_budget_count": 15,
  "frame_count": 15

Filed https://github.com/flutter/flutter/issues/3296

@yjbanov @hansmuller @vlidholt
2016-04-13 14:21:51 -07:00
Ian Hickson 7861d02943 Fix dependency skew. (#3306)
...by adding tests to our examples that don't import flutter_test, which
pins the relevant dependencies.

Also, provide more information when complaining about leaked transient
callbacks in tests.

Also, make tests display full information when they have an exception,
by bypassing the throttling we have for Android logging in tests.

Also, make the word wrapping not wrap stack traces if they happen to
be included in exception output.

Also, fix a leaked transient callback in the checkbox code.
2016-04-13 13:53:39 -07:00
Eric Seidel 7ecc698c9c wip 2016-04-12 16:08:29 -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
Jason Simmons 3525aa1b0a Use the flutter.jar in the artifact cache by default (#3278)
See https://github.com/flutter/flutter/issues/3233
2016-04-12 14:26:22 -07:00
Adam Barth ec4a6a96f2 Add more dartdocs to material.dart (#3279) 2016-04-12 14:18:58 -07:00
Adam Barth 69f994446b Add more dartdoc to material.dart (#3261)
Now past halfway though material.dart by files.
2016-04-12 12:41:59 -07:00
Viktor Lidholt 2f60932df9 Adds nice photos and hero animations to the Grid gallery demo (#3258) 2016-04-12 12:12:00 -07:00
Hans Muller ba5a04e85a ClampOverscrolls Inherited Widget (#3267)
* ClampOverscrolls Inherited Widget
2016-04-12 10:12:44 -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
Viktor Lidholt 83ef964ac6 Updates selection controls gallery demo (#3225) 2016-04-08 14:33:34 -07:00
Hans Muller 34f23cc456 Added OverscrollIndicator, removed OverscrollIndicatorPainter (#3220)
* Added OverscrollIndicator, removed OverscrollIndicatorPainter
2016-04-08 14:21:00 -07:00
Viktor Lidholt 9b5361acab Moves and renames gallery demos (#3217) 2016-04-08 11:08:21 -07:00
Adam Barth 1251f01ec7 Convert some Columns into Blocks (#3210)
These columns were secretly re-creating Block in a more complex way. Now we
just use Block directly.
2016-04-08 10:42:48 -07:00
Adam Barth e456d86327 Update engine (#3214)
Also, update hello_android to use the new Java class names.
2016-04-08 10:25:41 -07:00
Viktor Lidholt f8c1d619a6 Fixes spelling in gallery button demo (#3209) 2016-04-08 10:24:09 -07:00
Hans Muller 6335872802 Added Scrollbar, removed ScrollbarPainter (#3203)
* Added Scrollbar, removed ScrollbarPainter

* removed a dead import

* updated per review feedback

* Only call dispatch if the widgets State is still mounted
2016-04-07 16:59:51 -07:00
Jason Simmons 4bcef2a340 Some documentation for running "flutter refresh" in the Gradle sample (#3201) 2016-04-07 16:16:22 -07:00
Viktor Lidholt b9e121a5fa New version of Button demo (#3174) 2016-04-07 13:08:14 -07:00
Adam Barth 907215df27 Add more dartdoc to material.dart (#3167)
Also, clean up a few interfaces that looked awkward when writing docs.
2016-04-07 10:03:59 -07:00
Hans Muller c058cf2e81 Overscroll indicator for MaterialList
Overscroll indicator for MaterialList
2016-04-06 16:46:37 -07:00
Ian Hickson 41338c354c Use Material design rules for capitalisation
See https://www.google.com/design/spec/style/writing.html#
2016-04-06 15:59:30 -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
Adam Barth 7ab122e557 PopupMenuButton should lazily build menu items
Previously, the client of PopupMenuButton needed to build all the menu times

when building the PopupMenuButton. This can get expensive if, for example, each
item in a scrollable list has a popup menu associated with it.

Now the client passes a builder function to the PopupMenuButton that gets
invoked only when its time to show the menu items.
2016-04-06 13:28:09 -07:00
Yegor 19e624ccfe [driver] give the timeline data some structure
Fixes https://github.com/flutter/flutter/issues/2713
2016-04-04 17:07:16 -07:00
Ian Hickson d748186c51 Use callbacks for sending messages up the app
Using .of() to call mutating setters is not great practice since it ties

parts of the app together in ways that prevent reuse and composition.



Since people are now using the gallery app to copy from, let's use the

better practice of using callbacks.
2016-04-04 15:25:06 -07:00
Hans Muller 08bb332cbb Merge pull request #3081 from HansMuller/gallery_tweaks
Gallery Tweaks
2016-04-04 14:26:23 -07:00
Adam Barth 767ce82646 Add support for discrete material sliders
Fixes #1541
2016-04-04 11:14:12 -07:00
Ian Hickson 79cfe1e092 Make a variety of private State members actually private. 2016-04-03 13:08:00 -07:00
Ian Hickson 285c696f14 Column->Block, uppercase BUTTON captions 2016-04-01 21:22:55 -07:00
Yegor 055fd00dc1 Merge pull request #3058 from yjbanov/timeline-summary
[driver] utility for extracting and saving timeline summary
2016-04-01 17:48:25 -07:00
Ian Hickson a05909e3a7 Merge pull request #3049 from Hixie/gallery
Tweak the typography demo to match the spec more
2016-04-01 14:36:01 -07:00
Jason Simmons 379c563b62 Merge pull request #3034 from jason-simmons/gradle_flx_refresh
Support "flutter refresh" in the Gradle-based sample project
2016-04-01 12:39:04 -07:00
Devon Carew f7e6100b08 sort imports
* sort imports
2016-04-01 11:32:02 -07:00
Kris Giesing ed03e96b68 Fix spinning_mixed widget example, plus minor style fix 2016-03-31 12:56:14 -07:00
Viktor Lidholt 4df24abb33 Merge pull request #3016 from vlidholt/linedrawing
Initial version of Fancy line drawer demo
2016-03-31 12:05:58 -07:00
krisgiesing 243960d741 Merge pull request #3010 from krisgiesing/offscreen_layout
Part 2 of independent layout pipelines
2016-03-31 11:11:22 -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 42d87c4191 Rename ToggleControlsDemo to SelectionControlsDemo
These are called selection controls in the spec and in the gallery UI.
2016-03-30 23:31:02 -07:00
Viktor Lidholt a1212dbc54 Initial version of Fancy line drawer demo 2016-03-30 16:56:46 -07:00
Viktor Lidholt 56ccad99a5 Fixes the broken Weather demo 2016-03-30 11:22:43 -07:00
Hans Muller 04e020590d Use _ScaffoldLayout to position scrollable appbars 2016-03-29 13:27:37 -07:00
Hans Muller 5a49c68893 author again 2016-03-29 08:49:49 -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