295 Commits

Author SHA1 Message Date
Adam Barth
beb8afa456 Switch to the assets plugin (#6408)
This patch removes our dependency on asset_bundle.mojom.
2016-10-19 22:04:56 -07:00
Adam Barth
c08ea4eb33 Switch to TextInputPlugin (#6392)
This patch removes uses of keyboard.mojom in favor of the
TextInputPlugin.
2016-10-19 15:53:31 -07:00
Matt Perry
d39eb84ac4 Add a maxLines parameter for multiline Input. (#6328)
If maxLines is 1, it's a single line Input that scrolls horizontally.
Otherwise, overflowed text wraps and scrolls vertically, taking up at
most `maxLines`.

Also fixed scrolling behavior so that the Input scrolls ensuring the
cursor is always visible.

Fixes https://github.com/flutter/flutter/issues/6271
2016-10-19 17:18:16 -04:00
Matt Perry
97dbd9eacf Rename RawInputLine to RawInput, and RenderEditableLine to RenderEdit… (#6401)
They support multiline text now.
2016-10-19 17:17:51 -04:00
Hans Muller
9eef853580 Update Android scrolling physicsAndroid physics (#6391) 2016-10-19 09:08:54 -07:00
Adam Barth
2cfc040572 Add TextInput class for interacting with the IME (#6386)
This class will eventually replace the Keyboard class we currently use. As part
of this migration, we'll switch from using mojom to interact with the IME to
using platform messages.
2016-10-18 22:41:09 -07:00
Adam Barth
88cf68c847 Migrate Clipboard to platform messages (#6367)
The platform plugin now supports clipboard operations.
2016-10-18 10:04:17 -07:00
Adam Barth
63e7a0e80a Add BuildContext.size as a convenience getter (#6355)
Developers need to get the size of the BuildContext sufficiently often
that we should provide a convenient getter for the value. Having this
getter is also an opportunity to catch common mistakes and provide
useful error messages that guide developers towards better patterns.

Fixes #2321
2016-10-17 12:33:11 -07:00
Adam Barth
4052a36677 Test what context the overlay entries build in (#6337)
Fixes #6245
2016-10-17 11:17:08 -07:00
Adam Barth
61240fe8c6 Tap above LongPressDraggable should work (#6348)
Previously, we were nulling out the ArenaEntry in MultiDragPointerState
too early, which was prevent MultiDragPointerState from rejecting the
gesture in `dispose` if we hadn't accepted by the time the pointer went
up. Now we properly reject the gesture, which causes the tap gesture to
win during `sweep` in the arena.

Also, add a bunch of docs and annotations based on information I learned
while studying this issue. Finally, rename a private member of tap
recognizer to a name that would have confused me less in my
investigation.

Fixes #1186
2016-10-17 10:05:28 -07:00
Adam Barth
06babb2898 Removing a Draggable during a drag should work (#6341)
Previously we would maroon the feedback in the overlay. Now we let the
drag proceed and only tear down the gesture recognizer when all the
drags it spawns have been resolved.

Fixes #6151
2016-10-15 18:31:14 -07:00
Adam Barth
1262833377 Support zero for Draggable.maxSimultaneousDrags (#6342)
This patch also makes it possible for a single DragTarget to handle
multiple draggables with the same data without asserting.

Fixes #6086
2016-10-15 18:25:25 -07:00
Adam Barth
ea3c3f53a5 Add Draggable.onDragStarted (#6343)
Fixes #6084
2016-10-15 13:03:31 -07:00
Adam Barth
ffe14b0d27 Navigator.push and Navigator.pushNamed should return Futures (#6333)
These futures complete when the route is popped off the navigator. This
generalizes and simplifies a mechanism already in place for dialogs and
menus.

Fixes #5283
2016-10-14 16:05:45 -07:00
Adam Barth
93d757c3e0 Dismissable should cull and clip background (#6325)
When not dismissing, the Dismissable widget should cull its background.
When a dismiss is in progress, it should clip the background to just the
part that is revealed.

Fixes #6127
2016-10-14 13:32:56 -07:00
Matt Perry
c13a6e275b Add a maxLines parameter for multiline Input. (#6310)
* Add a maxLines parameter for multiline Input.

If maxLines is 1, it's a single line Input that scrolls horizontally.
Otherwise, overflowed text wraps and scrolls vertically, taking up at
most `maxLines`.

Also fixed scrolling behavior so that the Input scrolls ensuring the
cursor is always visible.

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

* oops

* comments

* import

* test and RO.update fix

* constant

* fix.caretRect
2016-10-13 21:59:50 -04:00
Adam Barth
3b56f12219 Fix composited transform bounds calculations (#6302)
We weren't computing the bounds for composited transforms correctly. We
need to conjugate the transform by the offset in order to get the
correct paint bounds for the composited layer. We now also use the same
math in the non-composited case for consistency.

Also, don't scale the z-coordinate in RenderFittedBox.

Fixes #6293
2016-10-13 15:00:34 -07:00
Adam Barth
f5b9d388cd Switch to the new semantics backend (#6259)
This match switches the framework to use the semantics backend in `dart:ui`
rather than the Mojo backend.
2016-10-11 10:51:41 -07:00
Adam Barth
2c21d795a4 Deploy @checked (#6244)
This patch adds `@checked` everywhere is needed to remove the
`strong_mode_invalid_method_override` strong mode error.
2016-10-07 11:27:54 -07:00
Matt Perry
2fd78dcc53 Add multiline support to Input and friends. (#6155)
Fixes https://github.com/flutter/flutter/issues/6154
2016-10-05 15:46:48 -04:00
Dragoș Tiselice
42f773c327 Fixed DragTarget calling setState after dispose. (#6150)
DragTarget would call setState after it was disposed in didLeave
and didDrop. Fixes #6128.
2016-09-30 13:42:26 -07:00
Adam Barth
a3b06f31da Switch date picker to using a custom Dialog
Rather than removing all the padding from an AlertDialog, we now just use
Dialog directly for the date picker.
2016-09-29 08:59:22 -07:00
Ian Hickson
e01592a0c0 Fix globalToLocal and update spinning_mixed (#6035)
* globalToLocal was just broken when there was a rotation and a
  translation at the same time. This fixes that and adds a test.

* update graphic used by spinning_mixed since the old one went 404.

* simplify some of the code in the demo.

* fix MatrixUtils.transformPoint to be consistent with how we transform
  points elsewhere.

* stop transforming points elsewhere, just use
  MatrixUtils.transformPoint.

* make the Widget binding handle not having a root element.

* make the spinning_mixed demo update its widget tree.
2016-09-28 01:06:32 -07:00
Adam Barth
4c5084cbd2 Update clip geometry during hitTest if needed (#6091)
The code previously assumed that paint would be called before hitTest, but that
assumption isn't valid because RenderOpacity hit tests its children without
painting them.

Fixes #6089
2016-09-27 09:17:18 -07:00
Ian Hickson
9e673853e5 Turn off AnimationControllers when not in use (#5902)
This requires all AnimationController objects to be given a
TickerProvider, a class that can create the Ticker.

It also provides some nice mixins for people who want to have their
State provide a TickerProvider. And a schedulerTickerProvider for those
cases where you just want to see your battery burn.

Also, we now enforce destruction order for elements.
2016-09-26 10:57:10 -07:00
Ian Hickson
78c74116a9 LayoutBuilder + GlobalKey + setState assert (#6068)
This silences an assertion that fired when reparenting a widget with a
global key inside a LayoutBuilder callback when that callback also
happened to call setState (directly or indirectly) on that widget.

Normally such setStates are considered ok since we know we haven't
cleaned that subtree yet, but we were not correctly handling the case
where the list needed resorting in that situation.
2016-09-26 10:27:53 -07:00
Adam Barth
c27b03b823 Add FittedBox (#6029)
This widget lets you apply an ImageFit to a child widget.

Fixes #5830
2016-09-23 17:40:16 -07:00
Ian Hickson
6a5e658131 Make sure to rebuild widgets even when they move (#5975)
Previously in some rather esoteric cases involving global keys reversing
relative positions we would forget to build everyone.
2016-09-22 14:44:57 -07:00
Dan Rubel
8a186f3bbd tests to assert futures complete as expected (#5947) 2016-09-22 07:43:29 -04:00
Adam Barth
8e4ca4bd34 Draggable should have an affinity that selects an axis (#5985)
This structure for the API is hopefully less confusing that the previous one
(which implied that vertical drags would not trigger horizontally draggable
widgets).

Fixes #1987
2016-09-21 20:45:00 -07:00
James Robinson
a95c9fdb58 Isolate imports of generated Dart code from generated path (#5960)
This rewrites imports of various mojom.dart files from the Flutter
engine repo to instead import normal-looking dart files from the
(new) flutter_services package. This package handles exporting the
correct symbols from generated code wherever that may live.

Includes an engine roll to 3551e7a48e2e336777b15c7637af92fd7605b6c5
which contains the new flutter_services package.
2016-09-21 14:00:29 -07:00
Matt Perry
dc5e1bba36 Disallow back gestures during a page transition. (#5982)
Fixes https://github.com/flutter/flutter/issues/5973
2016-09-21 15:10:07 -04:00
Hans Muller
fc83640c88 ClampOverscrolls clamps Scrollable, not its Viewport (#5909) 2016-09-21 11:32:19 -07:00
Matt Perry
c9b08aa686 Fix a bug with how ScrollableGrid deals with padding. (#5963)
It wasn't taking padding into account when deciding which children were
visible. I modeled the solution off of the way ScrollableList handles
this.

Fixes https://github.com/flutter/flutter/issues/5522
2016-09-21 13:29:35 -04:00
Lex Berezhny
9f5eeb1bee Unittest to check Input box initial value (#5976)
Adds unit test to verify the initial value of Input widgets.
2016-09-20 20:13:30 -07:00
Hans Muller
aa9aaf2eb7 Restore Flutter gallery license page scrolling (#5934) 2016-09-20 15:13:50 -07:00
Hans Muller
63828aab23 Underflowing LazyBlock should relayout for additional children (#5956) 2016-09-20 11:15:23 -07:00
Adam Barth
17ac73890e Add MediaQuery.textScaleFactor (#5936)
This feature is the implementation of an accessibility feature that changes the
size of text by a constant factor.

Fixes #5873
2016-09-20 09:14:48 -07:00
Adam Barth
179ea4a0a6 Update framework to account from engine API changes (#5887)
The engine now reports coordinates in physical pixels.
2016-09-15 13:13:42 -07:00
Ian Hickson
bb4a2e8b4c Implement detachChild for LayoutBuilder (#5860)
Fixes https://github.com/flutter/flutter/issues/5840
2016-09-15 07:47:15 -07:00
Hans Muller
4ec5144427 Scrollable should restore its viewport dimensions when it reappears (#5862) 2016-09-14 11:08:07 -07:00
Hans Muller
f4904b1459 Refresh indicator overscroll (#5836)
* Added OverscrollIndicatorEdge et al

* RefreshIndicator only clamps its scrollable edge

* added a test

* Updated the test

* fixed lint-os

* fixed a typo

* Scrollable should restore its viewport dimensions when it reappears

* removed an accidental commit

* updated per review feedback
2016-09-14 10:44:51 -07:00
Ian Hickson
6b93efdd85 Make dependenciesChanged fire after initState (#5810)
This allows us to simplify the logic around inherited widgets e.g. in
the Image widget.
2016-09-12 10:43:42 -07:00
Ian Hickson
03eaf1d16e Fix hot reload (#5799)
I forgot that it was possible for the root view to get marked dirty
without getting a new widget. This fixes that case to work.
2016-09-09 15:20:03 -07:00
Ian Hickson
5c4c1b8d65 Cleaning up minor issues (#5779)
I did a pass through some of the code cleaning minor things up.
2016-09-09 14:25:41 -07:00
Ian Hickson
5bc8888e7d Make tests more realistic (#5762)
Previously, pumpWidget() would do a partial pump (it didn't trigger
Ticker callbacks or post-frame callbacks), and pump() would do a full
pump. This patch brings them closer together. It also makes runApp run a
full actual frame, rather than skipping the transient callback part of
the frame logic. Having "half-frames" in the system was confusing and
could lead to bugs where code expecting to run before the next layout
pass didn't because a "half-frame" ran first.

Also, make Tickers start ticking in the frame that they were started in,
if they were started during a frame. This means we no longer spin a
frame for t=0, we jump straight to the first actual frame.

Other changes in this patch:

* rename WidgetsBinding._runApp to WidgetsBinding.attachRootWidget, so
  that tests can use it to more accurately mock out runApp.

* allow loadStructuredData to return synchronously.

* make handleBeginFrame handle not being given a time stamp.

* make DataPipeImageProvider.loadAsync protected (rather than private),
  and document it. There wasn't really a reason for it to be private.

* fix ImageConfiguration.toString.

* introduce debugPrintBuildScope and debugPrintScheduleBuildForStacks,
  which can help debug problems with widgets getting marked as dirty but
  not cleaned.

* make debugPrintRebuildDirtyWidgets say "Building" the first time and
  "Rebuilding" the second, to make it clearer when a widget is first
  created. This makes debugging widget lifecycle issues much easier.

* make debugDumpApp more resilient.

* debugPrintStack now takes a label that is printed before the stack.

* improve the banner shown for debugPrintBeginFrameBanner.

* various and sundry documentation fixes
2016-09-08 13:54:21 -07:00
Ian Hickson
99a9bbbe7c Add a test for 5630 (#5768)
This issue got fixed by a recent check-in, but I had a test specifically
for this incarnation so we should probably keep it just in case.

Closes https://github.com/flutter/flutter/issues/5630
2016-09-08 12:14:24 -07:00
Ian Hickson
1f15e06e45 Handle stateful widgets in layout builders. (#5752)
Previously, if a StatefulWidget was marked dirty, then removed from the
build, then reinserted using the exact same widget under a widget under
a LayoutBuilder, it wouldn't rebuild.

This fixes that.

It also introduces an assert that's supposed to catch SizeObserver-like
behaviour. Rather than make this patch even bigger, I papered over two
pre-existing bugs which this assert uncovered (and fixed the other
problems it found):

   https://github.com/flutter/flutter/issues/5751
   https://github.com/flutter/flutter/issues/5749

We should fix those before 1.0 though.
2016-09-07 14:45:19 -07:00
Matt Perry
e47a421e42 Use slide-from-right transition only when doing back gesture
This eliminates all the issues around the horizontal page transition. I also improved the back gesture animation, and added fling support.

BUG=https://github.com/flutter/flutter/issues/5678
BUG=https://github.com/flutter/flutter/issues/5622
2016-09-07 13:34:50 -04:00
Dragoș Tiselice
dcda3d5ed8 Fixed a bug related to AnimtedCrossFade. (#5730)
Fixed a bug where the size of the AnimatedCrossFade would always
start from the size of the first child, irrespective of the
initial crossFadeState argument.
2016-09-02 16:41:09 -07:00