Commit graph

843 commits

Author SHA1 Message Date
Ian Hickson f92f71feb9 Lock flutter tool while updating artifacts (#4476)
This prevents multiple simultaneous runs of the analyzer from stomping
over each other (e.g. multiple runs of 'update-packages'). Certain
long-lived commands (like analyze, run, logs) are exempted once they've
done enough work to be safe from most stomping action.

This still doesn't make us entirely safe from craziness, e.g. if you're
half way through an 'update-packages' run and you call 'git pull', who
knows what state you'll end up in. But there's only so much one can do.

Fixes https://github.com/flutter/flutter/issues/2762
2016-06-14 10:16:08 -07:00
Hans Muller ebaf9e29a0 Gallery shrine demo uses image assets (#4544) 2016-06-13 14:48:24 -07:00
Hans Muller 187ff00294 New gallery app bar background (#4539) 2016-06-13 12:41:29 -07:00
Adam Barth 1a3adae101 Use @required for onPressed and onChanged (#4534)
We now use the `@required` annotation to encourage developers to
explicitly set onPressed and onChanged callbacks to null when that would
disable the widget.

Fixes #287
2016-06-12 13:25:06 -07:00
Matt Perry ffde6777fc Pull Flutter gallery assets from Google's git repo. (#4493)
This repo contains the final licensed images.
2016-06-09 16:03:10 -04:00
Matt Perry 3e0e6b9997 Smoothly scale the Pesto logo as the app bar resizes. (#4465)
Also update the assets version to pull in better quality logo images.

BUG=https://github.com/flutter/flutter/issues/4407
2016-06-08 15:49:21 -04:00
Adam Barth 7d9f8d903d Introduce TapDownDetails and TapUpDetails (#4431)
We have these details objects for the same reason we now have drag details
objects: future extensibility.
2016-06-07 16:16:53 -07:00
Todd Volkert 7ac0ce7938 Add API for specifying the system overlay style. (#4422)
Fixes 3544
2016-06-07 14:39:15 -07:00
Hans Muller 0b7e975e2c Updated fitness and weather manual tests, new asset locations (#4351) 2016-06-03 10:38:03 -07:00
Adam Barth 2d4acb8041 Convert drag gestures to use details objects (#4343)
Previously we supplied individual parameters to the various drag and pan
callbacks. However, that approach isn't extensible because each new
parameter is a breaking change to the API.

This patch makes a one-time breaking change to the API to provide a
"details" object that we can extend over time as we need to expose more
information. The first planned extension is adding enough information to
accurately produce an overscroll glow on Android.
2016-06-02 23:45:49 -07:00
Hans Muller dd27a489fa Update gallery demo list (#4335) 2016-06-02 16:12:54 -07:00
Hans Muller 309b9f8010 Version 0.0 of a gallery demo of the Material Design "Shrine" app (#4327) 2016-06-02 14:23:20 -07:00
Adam Barth 1ff7109b02 Mark State.setState as protected (#4295)
This required refactoring some cases where we weren't following the rules for
the protected annotation.
2016-06-02 10:46:12 -07:00
Seth Ladd 604c75f1ed compress text assets for docs, when uploading (#3926)
* compress text assets for docs, when uploading

* reorder args

* ensure old files are deleted

* recurse on the cp

* set source path correctly
2016-05-25 15:19:06 -07:00
Hans Muller bacd3d2cb0 Revised Drawer Header (#4160) 2016-05-24 12:31:42 -07:00
Ian Hickson b5c6da105c Port our microbenchmarks to the new world (#4121)
Our microbenchmarks now run on real devices.
2016-05-23 15:04:50 -07:00
Ian Hickson cd19af8f59 Remove the calculator test (#4093)
Fixes the breakage that https://github.com/flutter/flutter/pull/4092 would cause.
2016-05-21 10:41:41 -07:00
Mitch Rudominer 719add8171 New Material Design calculator example. (#3999)
* New Material Design calculator example. (Attempt 2 after git fetch upstream).

* Responded to code review.

* Second round of code review.
2016-05-20 10:27:03 -07:00
Ian Hickson 942ccc5cb0 Try to simplify our bot setup. (#3986)
This moves all the bot-related files to `dev/bots`, hiding it from our
home page in github. Also, simplifies the travis setup, though that
doesn't do any difference to the performance sadly.
2016-05-18 11:38:45 -07:00
Ian Hickson f284c1a049 Fix tests (#3977)
Also, make sure that broken tests actually break the bots.

And add a test to make sure that keeps happening.
2016-05-17 12:45:37 -07:00
Seth Ladd a03c8f77ad gracefully handle generating docs twice (#3939)
* gracefully handle generating docs twice

* silently handle if directory doesn't exist
2016-05-16 13:05:13 -07:00
Ian Hickson 3252701753 Make it possible to run tests live on a device (#3936)
This makes it possible to substitute 'flutter run' for 'flutter test'
and actually watch a test run on a device.

For any test that depends on flutter_test:

1. Remove any import of 'package:test/test.dart'.

2. Replace `testWidgets('...', (WidgetTester tester) {`
      with `testWidgets('...', (WidgetTester tester) async {`

3. Add an "await" in front of calls to any of the following:
    * tap()
    * tapAt()
    * fling()
    * flingFrom()
    * scroll()
    * scrollAt()
    * pump()
    * pumpWidget()

4. Replace any calls to `tester.flushMicrotasks()` with calls to
   `await tester.idle()`.

There's a guarding API that you can use, if you have particularly
complicated tests, to get better error messages. Search for
TestAsyncUtils.
2016-05-16 12:53:13 -07:00
Ian Hickson c5ff156f24 Revert "Rename DefaultTextStyle constructor to explicit (#3920)" (#3930)
This reverts commit 55f9145ef4.

Turns out that this commit breaks apps that use the material library,
because of the _errorTextStyle DefaultTextStyle which has inherit:true.
Just setting it to false doesn't work, unfortunately, because then you
hit some sort of issue with merging that text style with others that
have inherit:true.
2016-05-16 11:08:07 -07:00
Adam Barth 55f9145ef4 Rename DefaultTextStyle constructor to explicit (#3920)
To make it clear that this constructor requires an explicit style. Also
throw a descriptive error recommending the inherit constructor for
styles with the inherit bit set.

Fixes #3842
2016-05-16 10:35:35 -07:00
Seth Ladd 707fe582a6 Docs homepage (#3908)
* put an index at root of API docs bucket

* ignore all of dev/docs/doc dir, fix a bug, remove private names from doc gen script

* tweaks from review
2016-05-16 08:28:58 -07:00
Devon Carew 2f642ce908 updates from the flutter gallery rename (#3898)
* updates from the flutter gallery rename

* rename ids to io.flutter.gallery
2016-05-13 12:46:50 -07:00
Seth Ladd 7e4a91f340 add a webmaster tools verification file (#3902)
* add a webmaster tools verification file

* also put the verification file at the root of our bucket

* add comment for when we can simplify this script
2016-05-13 12:27:06 -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 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
Devon Carew 61c003734b checked mode fix; add type annotation (#3737) 2016-05-04 13:41:46 -07:00
Devon Carew e464a81998 remove the packages/flutter_tools/.analysis_options file (#3733) 2016-05-04 11:43:01 -07:00
Yegor 4d88752c39 [tools] delete profile_startup.dart (#3703)
The same can now be achieved using `flutter run --trace-startup --no-checked`.
2016-05-03 15:52:15 -07:00
Devon Carew a807b009ad Re add large sample (#3661)
* Revert "Revert "Mega gallery (#3647)" (#3659)"

This reverts commit ea62d31fde.

* fix the dev/dartdoc.dart script
2016-05-01 15:52:51 -07:00
Adam Barth ea62d31fde Revert "Mega gallery (#3647)" (#3659)
This reverts commit 9497fb56d4.

This patch broke the dartdoc step on the bots.
2016-05-01 14:58:40 -07:00
Devon Carew 9497fb56d4 Mega gallery (#3647)
* working on a large benchmark app

* build a 100k saple app

* print sizes of other libs; scale to 60k lines

* test the generated app on travis
2016-04-29 21:47:17 -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
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 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
Devon Carew 4678c12098 find all repo packages (#3368)
* find all repo packages

* .dartignore
2016-04-15 20:25:57 -07:00
Yegor 9ce995f65e [driver] refactor API to finder objects (#3365) 2016-04-15 16:57:35 -07:00
Yegor f3a4f722c4 [flutter_test] new WidgetTester API based on finder objects (#3288) 2016-04-13 23:40:15 -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
Devon Carew dd81a21c93 small change to the generated dartdoc styles (#3290) 2016-04-13 10:04:35 -07:00
Devon Carew 8d02f304cf update styles for the generated dartdocs (#3276)
* styles updates for the api docs

* update library docs

* use the new --favion and --use-categories options for dartdoc
2016-04-12 13:08:57 -07:00
Devon Carew 3cfa4d39c6 docs cleanup (#3196)
* some docs cleanup

* update styles

* remove unused file
2016-04-07 15:27:43 -07:00
Seth Ladd 5b5c701d84 document libs from sky_services (#3170)
* document libs from sky_services

* scan directory of sky_services for libraries

* simplify error message when sky_services directory not found

* address review comments
2016-04-07 12:46:50 -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
Adam Barth f71d470154 Add Stocks to the Mozart manual test 2016-04-06 17:16:11 -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
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 618e7e4942 Adds a first draft of LazyBlock
LazyBlock is intended as a replacement for MixedViewport. Rather than

maintaining a table of all the observed child sizes (like

MixedViewport), LazyBlock works by dead reckoning the location of the

children based on the existing viewport. This approach makes it easier

to resize children because LazyBlock doesn't cache any additional

information that would need to be invalidated.



This patch contains a first draft of LazyBlock that works in a simple

usage scenario. Subsequent patches will replace

ScrollableMixedWidgetList with LazyBlock and port the existing

ScrollableMixedWidgetList tests over to LazyBlock.



Related to #3075
2016-04-05 14:13:31 -07:00
Devon Carew 9a4c2c681f add a dev/dartdoc.dart script to generate docs for the packages/ packages
* add a dev/dartdoc.dart script to generate docs for the packages/ packages

* remove description

* rename readme

* change to using --include-external

* move docs to dev/docs
2016-04-05 12:33:12 -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 6d58770499 Fix the fixed height card demo
Turns out card_collection had all kinds of bugs.
2016-04-01 16:10:22 -07:00
Viktor Lidholt 794b705133 Merge pull request #3052 from vlidholt/linedrawing
Initial version of complex layout performance test
2016-04-01 15:25:51 -07:00
Ian Hickson b4e4c70375 Bring the hamburger menu back to card_collection 2016-04-01 14:55:20 -07:00
Adam Barth 1ba539a661 Add constants for FractionalOffsets
Adds some names for common FractionalOffset values.
2016-03-28 22:51:06 -07:00
Hixie 9fc29dbbb8 Support hairline borders
Previously, border with '0' was ambiguous. Sometimes we treated it as
hairline borders, sometimes as "don't show the border", though even in
the latter case we did some graphics work sometimes. Now we have an
explicit BorderStyle.none flag to not draw the border efficiently.
2016-03-24 14:05:38 -07:00
Adam Barth 502a4ae078 Use FractionalOffset for gradients
These were using Offsets, but they're really FractionalOffsets.

Fixes #2318
2016-03-15 19:30:41 -07:00
Hixie 797e27edd3 Add @override annotations to flutter framework 2016-03-14 14:02:26 -07:00
Adam Barth e2744e9a30 Stop using a prebuilt APK
Instead, require an AndroidManifest.xml and always build an APK.

Fixes #2517
2016-03-14 13:32:00 -07:00
Adam Barth d5b2e2a01c [rename fixit] Flex alignments
* justifyContent -> mainAxisAlignment
* alignItems -> crossAxisAlignment
* FlexJustifyContent -> MainAxisAlignment
* FlexAlignItems -> CrossAxisAlignment

Fixes #231
2016-03-12 18:33:47 -08:00
Adam Barth 5e1af2f37e [rename fixit] DismissDirection left -> endToStart, right -> startToEnd
Removes an LTR bias in DismissDirection.

Fixes #2562
2016-03-12 18:33:47 -08:00
Adam Barth ede5dfce30 [rename fixit] ToolBar -> AppBar
* left -> leading (Removes an LTR bias)
* center -> title (Widget was actually centered)
* right -> actions (Removes an LTR bias, asymmetric with leading)

Fixes #2348
2016-03-12 18:33:47 -08:00
Adam Barth 9b9ad3db17 [rename fixit] RouteBuilder -> BuildContext
Fixes #2353
2016-03-12 17:18:31 -08:00
Adam Barth 95fc5ae070 [rename fixit] *Component* -> *Widget*
This patch renames StatelessComponent to StatelessWidget and
StatefulComponent to StatefulWidget.

Fixes #2308
2016-03-12 12:34:05 -08:00
Adam Barth e71bd77e4f [rename fixit] EdgeDims -> EdgeInsets
Fixes #1382
2016-03-12 12:33:38 -08:00
Adam Barth 7ba1960518 [rename fixit] ThemeData#text -> textTheme
Fixes #1278
2016-03-12 12:32:37 -08:00
Hixie 6795efacab Enable always_specify_types lint
And fix the zillion issues that uncovered.
2016-03-12 00:37:31 -08:00
Ian Hickson 43b0104114 Revert "Merge pull request #2639 from Hixie/always_specify_types"
This reverts commit f41b3411da, reversing
changes made to e33d8d9621.

This was a bad check-in due to my mangling uploading a new version of the branch from a different machine.

This reverts https://github.com/flutter/flutter/pull/2639 and will be replaced by https://github.com/flutter/flutter/pull/2640
2016-03-12 00:34:37 -08:00
Hixie d162d98c79 Enable always_specify_types lint
And fix the zillion issues that uncovered.
2016-03-11 18:27:32 -08:00
Ian Hickson 1b9cd52081 Enable ALL THE LINTS
Well, all the easy ones, anyway.

For some reason `// ignore:` isn't working for me so I've disabled
lints that need that. Also disabled those that require a ton of work
(which I'm doing, but not in this PR, to keep it reviewable).

This adds:
- avoid_init_to_null
- library_names
- package_api_docs
- package_names
- package_prefixed_library_names
- prefer_is_not_empty
- sort_constructors_first
- sort_unnamed_constructors_first
- unnecessary_getters_setters
2016-03-10 23:15:31 -08:00
Adam Barth e4b1eab854 Remove //examples/widgets
Most of the remaining widget examples are actually manual tests. This patch
moves them into //dev/manual_tests. A couple are examples of using services,
which I've moved to //examples/layers/services. The remainder are out-dated and
are removed by this patch.
2016-03-08 16:37:32 -08:00
Adam Barth 357fbf8a42 Move update_packages.dart to flutter update-packages
Now that we don't require the Dart SDK to be in your path, it's hard to run
./dev/update_packages.dart. Instead, you can now run `flutter update-packages`.

Fixes #1906
2016-02-25 16:27:56 -08:00
Devon Carew 04eee82dd2 rename some flutter command references in readmes 2016-02-17 07:34:59 -08:00
Ian Hickson 74c806634e Add a note about the firebase/ directory.
Also, make dev/update_packages.dart skip directories that have no
pubspec.yaml, since firebase/ doesn't have one.
2016-01-10 16:54:25 -08:00
Eric Seidel d8e4fee9a0 Add nicer logging/reporting to dev/update_packages.dart
Makes it more obvious where we are spending our time on Travis.

Also added travis caching for the global pub cache to
speed this up!  Modeled what dartdoc does:
https://github.com/dart-lang/dartdoc/blob/master/.travis.yml#L13

@Hixie
2015-12-14 15:30:09 -08:00
Eric Seidel 20deda1def Don't do performance testing in checked mode
This makes startup 1500ms instead of 1700ms.

@chinmaygarde @hixie
2015-12-07 12:54:21 -08:00
Eric Seidel 047c53ee3e Make profile_startup.dart print instructions.
@chinmaygarde
2015-12-04 12:26:19 -08:00
Eric Seidel 5e70bd13f6 Add script for profiling startup using flutter trace on Android
This will work after the next Engine roll.  Currently it requires
a fix to tracing which isn't in the released engine.

Next steps are to make this work on a bot, and to add iOS support.

@abarth @chinmaygarde
2015-12-04 11:19:38 -08:00
Ian Hickson 92a6212007 dev/update_packages.dart --upgrade
Add an --upgrade flag to the dev/update_packages.dart flag which runs
'pub upgrade' instead of 'pub get'. Tell people to use this when using
'flutter analyze' since 'pub get' doesn't have the same guarantee of
getting everything in sync.
2015-11-27 20:01:13 -08:00
Adam Barth 99d51f5f5a Fix analyzer warnings
Should make Travis green again. Also, add better logging to
dev/update_packages.dart.
2015-11-21 13:39:45 -08:00
Eric Seidel a2ee056310 Moar shebang.
Make it possible to run dev/update_packages.dart directly from the shell.

@abarth
2015-11-16 15:43:04 -08:00
Nathan Kerr 9d016b7c10 Move Python script over to Dart. 2015-11-10 12:53:44 -08:00
Ian Hickson 3419068cb3 Port test logic to Dart. 2015-11-09 09:00:49 -08:00
Adam Barth 576795dcc6 Add a CONTRIBUTING.md
This document describes the workflow for contributing code to this repository.
2015-11-08 21:56:20 -08:00
Adam Barth 2ed113430a Add dev/run_tests
This script runs the Flutter unit tests. By default, the script assumes you
have compiled a SkyShell in an "engine/src" that's a peer to the "flutter"
directory.
2015-11-06 23:14:17 -08:00
Adam Barth 08539b4e4d Rewire the pubspecs to use local paths
Using local paths ensures that each package sees each other package at HEAD.
2015-11-06 22:46:52 -08:00