2454 Commits

Author SHA1 Message Date
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
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
Hans Muller
03f9210641 Refactored MaterialApp (#3475)
* Refactored MaterialApp
2016-04-21 17:14:22 -07:00
Hans Muller
a6532cc731 Remove IconThemeData.clampedOpacity (#3483)
* Remove IconThemeData.clampedOpacity
2016-04-21 17:11:20 -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
Matt Perry
6ca36a94b7 Add a text selection handle for the collapsed case. (#3467)
Also simplify handle drawing. All 3 cases are the same, just rotated.

Also fix selection changes on iOS.
2016-04-21 17:08:27 -04:00
Eric Seidel
cd084005fa Merge pull request #3470 from eseidelGoogle/master
Add a service extension for toggling the PerformanceOverlay
2016-04-21 13:29:23 -07:00
Eric Seidel
898b3ce8ba Add a service extension for toggling the PerformanceOverlay
This only works for apps which use WidgetsApp.  Apps which don't
(like the game) could presumably read the static themselves
off of WidgetsApp.

@devoncarew @hixie
2016-04-21 12:55:49 -07:00
Ian Hickson
3142aba407 Refactor the Gesturer's interfaces (#3459)
* Refactor the Gesturer's interfaces

This makes them more coherent.

It also makes it easier for the tests to override each specific part of
hit-testing, should that be necessary.

* Update binding.dart
2016-04-21 12:20:01 -07:00
Matt Perry
11f236ec25 Add basic text selection to editable text. (#3223)
Only partially works. Editing the selected text doesn't work very well,
which probably will require engine changes. Currently only draws the
selected text and allows you to manipulate the selection with draggable
selection handles.
2016-04-21 13:53:31 -04:00
Hans Muller
986b017445 Gallery Smoke Test (#3446)
* Gallery Smoke Test
2016-04-21 08:54:43 -07:00
Adam Barth
161f945e84 A blinking cursor should push only one frame (#3445)
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.
2016-04-20 20:36:39 -07:00
Matt Perry
fffbf6e97b Fix OverlayEntry.remove to work even after the Overlay is disposed. (#3412) 2016-04-20 17:35:49 -04:00
Ian Hickson
112f2cc37b Reset _simulation at the end of a fling (#3435)
Also a bit of code cleanup.

The key part of this patch is the addition in `_endScroll` to reset
`_simulation`. It seems like this was the one place where it's possible
for us to end the animation but not reset our state. Since we assert
that are state is coherent, we were hitting asserts when a fling
finished and then you interacted with the widget again.
2016-04-20 11:02:20 -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
Ian Hickson
c294014d00 Remove deprecated API in EdgeInsets 2016-04-20 00:05:43 -07:00
Ian Hickson
e69812441f Rename RowInkWell to TableRowInkWell
...so that people don't think it's for Row.
2016-04-19 23:35:23 -07:00
Devon Carew
ff9bdb2c58 redraw the app after a repaint rainbow change (#3420) 2016-04-19 19:22:08 -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
Ian Hickson
6e0c76f4ba Give DefaultAssetBundle a default asset bundle. (#3422)
This makes it easier to use e.g. AssetImage in simple test applications.

Also, dartdoc improvements.

Also, use @required in one place, to see if it causes any trouble. If it
doesn't, I'll start using it in more places.
2016-04-19 16:14:30 -07:00
Devon Carew
dd2bde1918 add a service extension for repaint rainbow (#3409)
* add a service extension for repaint rainbow

* review comments
2016-04-19 12:57:10 -07:00
Ian Hickson
6dc440bdfd Make rootBundle handle the no-mojo case. (#3408)
The defaulting logic for bundles really belongs in the services layer,
not the widgets layer. This way we can tell non-widget code just to use
rootBundle if it just wants to read a JSON file or some such.
2016-04-19 11:19:38 -07:00
Ian Hickson
261923e5c6 Refactor service extensions (#3397)
Bindings now have a debugRegisterServiceExtensions() method that is
invoked in debug mode (only). (Once we have a profile mode, there'll be
a registerProfileServiceExtensions() method that gets called in that
mode only to register extensions that apply then.)

The BindingBase class provides convenience methods for registering
service extensions that do the equivalent of:

```dart
void extension() { ... }
bool extension([bool enabled]) { ... }
double extension([double extension])  { ... }
Map<String, String> extension([Map<String, String> parameters]) { ... }
```

The BindingBase class also itself registers ext.flutter.reassemble,
which it has call a function on the binding called
reassembleApplication().

The Scheduler binding now exposes the preexisting
ext.flutter.timeDilation.

The Renderer binding now exposes the preexisting ext.flutter.debugPaint.

The Renderer binding hooks reassembleApplication to trigger the
rendering tree to be reprocessed (in particular, to fix up the
optimisation closures).

All the logic from rendering/debug.dart about service extensions is
replaced by the above.

I moved basic_types to foundation.

The FlutterWidgets binding hooks reassembleApplication to trigger the
widget tree to be entirely rebuilt.

Flutter Driver now uses ext.flutter.driver instead of
ext.flutter_driver, and is hooked using the same binding mechanism.
Eventually we'll probably move the logic into the Flutter library so
that you just get it without having to invoke a special method first.
2016-04-19 10:53:58 -07:00
Ian Hickson
61605a9d9d Rearrange scheduling library (#3388)
To be more consistent with other parts of the platform:

* put the binding in a binding.dart file.

* rearrange some members of the Scheduler class to be more close to
  execution order.

* factor out Priority class into its own file.

* add more dart docs.
2016-04-19 10:35:18 -07:00
Hans Muller
c4ae13ed22 Refresh indicator (#3354) 2016-04-15 18:39:18 -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
Hans Muller
f7cf0d97ca Fix the progress indicator demo (#3367) 2016-04-15 16:21:38 -07:00
Ian Hickson
efbcb0aa0c Fix docs for Divider. (#3364)
Fixes https://github.com/flutter/flutter/issues/3363
2016-04-15 15:40:04 -07:00
Ian Hickson
b5e471eec5 Include the error runtimeType in the message. (#3355)
Fixes https://github.com/flutter/flutter/issues/3352
2016-04-15 15:15:52 -07:00
Ian Hickson
d348f28df7 Use the same logic in flushPaint as flushLayout (#3353)
If two repaint boundaries mark themselves dirty, but the second one is a
child of the first, then the second one will get repainted by the first
and then when we come to paint it directly, we get confused because it
isn't dirty any more.

We ran into this in layout before. Apply the same fix. Also, apply the
same fix to composition while we're at it.
2016-04-15 14:55:18 -07:00
Ian Hickson
d9ca22a397 have invokeFrameCallback print the right stack (#3351)
Exception stack variable was shadowing the function argument stack.
2016-04-15 13:18:37 -07:00
Ian Hickson
e41c1c0b06 Split services/ into services/ and foundation/ (#3350)
We're getting back to the point where we have a bunch of foundation APIs
and it's getting confusing having them mixed with services/.
2016-04-15 13:18:29 -07:00
pq
de25ea22f7 Adding @optionalTypeArgs.
With the new dev build we've got the updated linter and so can use the `@optionalTypeArgs` annotation (in `meta 0.12.0`).

Bonus: this lets us clean up one more Regexp in the `analyze` command! :)
2016-04-14 10:03:46 -07:00
Yegor
f3a4f722c4 [flutter_test] new WidgetTester API based on finder objects (#3288) 2016-04-13 23:40:15 -07:00
Ian Hickson
a5a34d9704 AnimatedDefaultTextStyle (#3324) 2016-04-13 20:58:42 -07:00
Alhaad Gokhale
6f9acb84ff Repaint child view on attach / detach. 2016-04-13 18:01:49 -07:00
Ian Hickson
571e2e84aa Stop importing identifiers we don't use. (#3314) 2016-04-13 14:42:07 -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
Ian Hickson
e1aaf39f82 Fix Block intrinsic functions (#3286)
* Fix Block intrinsic functions

* Update block_test.dart

Fix the test per travis
2016-04-13 09:35:10 -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