1509 Commits

Author SHA1 Message Date
Ian Hickson
0903cb5fef Refactor Inherited to avoid all the tree walks during build. 2016-01-23 18:21:02 -08:00
Ian Hickson
5494323db9 Move us to HashSet to avoid the overhead of tracking the order 2016-01-23 18:13:13 -08:00
Ian Hickson
b9716b84db Reimplement Inherited.notifyDescendants to use a registration list
...instead of a deep walk.
2016-01-23 18:13:13 -08:00
Adam Barth
5f3b2d4835 Add errorColor to ThemeData
That way folks can customize it if they want (and it makes the code a
bit more self-documenting).
2016-01-23 17:47:09 -08:00
Adam Barth
7faee3e18e Add implicit animations to Input
Now the label animates from its inline position to above the text and
the focus highlight grows into place.
2016-01-23 12:22:15 -08:00
Adam Barth
61f82ee18c Improve the factoring between Input and RawEditableLine
RawEditableLine is now responsible for the scrolling behavior, which
removes the need for callbacks between RawEditableLine and Input. It
also fixes a bug whereby the whole Input widget (including its icon)
would scroll when the text got long.
2016-01-23 01:09:22 -08:00
Adam Barth
432bfb4729 Add material design features to Input
Properly support labels, hints, icons, and custom typography.
2016-01-23 00:21:18 -08:00
Adam Barth
4e83a5ccdb Add the ability to lose focus
Fixes #1308
2016-01-22 14:01:51 -08:00
Adam Barth
d081dc677b Merge pull request #1347 from abarth/editable_line
Input widget shrinks when typing a space
2016-01-22 13:35:06 -08:00
Adam Barth
bdef1038e9 Input widget shrinks when typing a space
This patch restructures how we size the editing region of the Input widget. Now
RenderEditableLine understands that it's a single-line editing widget and sizes
itself correctly.
2016-01-22 13:18:24 -08:00
Adam Barth
82e30c8649 Simplify colorizing icons
Now you can colorize an Icon simply by proving a Color for the Icon.
2016-01-22 12:07:45 -08:00
Hans Muller
8218ff683f Change Block children to be a named parameter 2016-01-22 08:04:21 -08:00
Hans Muller
05f79b4e45 Merge pull request #1333 from HansMuller/sublist
Added TwoLevelList et al, a Material Expand/Collapse List Control

A TwoLevelList can can contain TwoLevelListItems, essentially ordinary list items, or TwoLevelSublists which have a list of items of their own. Tapping on a TwoLevelSublist causes it to expand, showing its items. Tapping again causes it to collapse.
2016-01-21 16:36:50 -08:00
Adam Barth
7c8e504eb2 Merge pull request #1337 from abarth/scroll_focus_into_view
Scroll focused input widgets into view
2016-01-21 16:27:50 -08:00
Hans Muller
5ae1b41ca4 Added TwoLevelList 2016-01-21 16:27:18 -08:00
Adam Barth
dd5df79e7b Scroll focused input widgets into view
When opening the keyboard or focusing an input widget, we should scroll the
widget into view so that the user can see what they're typing.
2016-01-21 16:20:54 -08:00
kgiesing
964c155014 Fix up MediaQuery's operator= and hashCode 2016-01-21 16:17:01 -08:00
kgiesing
4d73cf5cba Add device pixel ratio to MediaQuery 2016-01-21 16:03:04 -08:00
Adam Barth
72931955c8 Merge pull request #1332 from abarth/no_autofocus
Don't autofocus Input widgets by default
2016-01-21 14:53:37 -08:00
krisgiesing
740b612205 Merge pull request #1335 from krisgiesing/asset_close
Remove unused close method from AssetBundle
2016-01-21 14:50:30 -08:00
kgiesing
dab7dde3dd Remove unused close method from AssetBundle 2016-01-21 14:27:51 -08:00
Adam Barth
f176ed27de Don't autofocus Input widgets by default
Instead, require the developer to opt-in to autofocusing because autofocusing
can be disruptive.

Fixes #1307
2016-01-21 14:11:50 -08:00
Adam Barth
da7e1e5d4d Scaffold should respect window.padding.bottom
The space for the keyboard is now represented as bottom padding for the window.
By teaching the scaffold to respect the bottom window padding, we move the
floating action button and snackbars out of the way of the keyboard.

This currently works on Android. I'll need to see how to get the keyboard
geometry on iOS for a similar effect.

Fixes #103
2016-01-21 13:30:16 -08:00
Adam Barth
5065339ce3 Move scroll_behavior into widgets
Previously this code was in the animation layer, which didn't make much
sense because scrolling is a widget concern.
2016-01-20 23:21:11 -08:00
Adam Barth
89320ee233 Rename Performance to Animation in a couple more places
These should be the last references to the old "performance" name.
2016-01-20 20:51:43 -08:00
Adam Barth
d59da41bfc Use parent consistently for parent animation
Some of the Animation classes that we converted from performances use
the term "master" to refer to the animation upon which they're based.
This patch changes them to use the term "parent", which is consistent
with the rest of the animation classes.
2016-01-20 20:47:15 -08:00
Adam Barth
67c4ff99e8 Fix analyzer warning 2016-01-20 17:55:24 -08:00
Adam Barth
fc8ac4ebdf Merge simulationStepper into AnimationController
Now that we've decided that Animation<double> isn't confined to the interval
0.0 to 1.0, we can expand AnimationController to cover the use cases that used
to require SimulationStepper.

This patch merges SimulationStepper into AnimationController and ports the one
stand-alone client of simulation stepper over to using AnimationController.
2016-01-20 16:42:15 -08:00
Adam Barth
87ab798daf Move ClampedSimulation into newton
ClampedSimulation makes more sense at the newton layer because it's dealing
entirely with newton concepts.
2016-01-20 15:58:05 -08:00
Adam Barth
b988a875ad Remove Performance and AnimatedValue
This patch removes Performance and AnimationValue now that we've ported the
framework over to AnimationController and Tween. This patch also cleans up the
names of the AnimationController classes now that they don't have to avoid
conflicts with the old animation API. Specifically, I've made the following
renames:

 * Animated -> Animation
 * Evaluatable -> Animatable
 * PerformanceStatus -> AnimationStatus

This patch is just renames and moving code around. There aren't any changes in
behavior.
2016-01-20 13:49:35 -08:00
Adam Barth
e459e7124a Port the remainder of the framework to AnimationController
There should be no more uses of Performance or AnimatedValue in the framework
or the examples.
2016-01-20 13:29:05 -08:00
Adam Barth
24872f6931 Port most of widgets to AnimationController
I've left transitions and enter_exit_transition out of this patch, but I've
converted the rest.
2016-01-20 13:24:43 -08:00
Adam Barth
08b27fd79d Finish porting material.dart to AnimationController
After this patch, there aren't any direct uses of Performance in material.dart.
2016-01-20 10:38:34 -08:00
Adam Barth
d25951c517 AnimatedBuilder should have a child
Providing a pre-built child is more efficient because we don't need to rebuild
the child every tick of the animation.
2016-01-20 09:10:34 -08:00
Adam Barth
715af6ebe8 Port Tooltip to AnimationController 2016-01-20 08:43:04 -08:00
Adam Barth
6cea5dc80d Switch Navigator over to using AnimationController
This patch moves Navigator and related code over to using
AnimationController.
2016-01-20 08:43:04 -08:00
Adam Barth
0b098ee2e5 Move Scaffold over to using AnimationController
Also, clean up the class hierarchy for AnimationController now that
we've renamed progress to value. That means everything in the hierarchy
now has a value, include Watchable. This patch renames Watchable to
Animated<T>, which lets us use that type almost everywhere.

I've added some ducktape to modal bottom sheets to avoid having to
refactor all of Navigator to use AnimationController. I'll remove the
ducktape in the next patch.
2016-01-20 08:43:04 -08:00
Adam Barth
fc978c1aa8 Port examples to the new animation API
These now use Animation and AnimationController instead of PerformanceView and
Performance.
2016-01-19 16:03:31 -08:00
Adam Barth
1e70dc9ba1 Localize curve direction concern
The curve direction is now a concern of ACurve alone.
2016-01-19 14:33:57 -08:00
Adam Barth
bc20871cb9 Introduce Tween and the new animation API
This patch removes state from the animation system, which was causing problems
as we were scaling the use of animated values.

Now the "tween" objects are stateless and can watch animations, which creates a
new object that holds both the tween and the animation instead of mutating the
tween every tick of the animation.

This patch ports one client as a proof-of-concept.

Fixes #215
2016-01-19 14:26:05 -08:00
Devon Carew
0e99d2fd41 fix two null-aware-operator issues 2016-01-19 09:32:35 -08:00
Ian Hickson
0bf6170c29 Merge pull request #1297 from Hixie/dialog-PENDING
StackParentData.toString() fix, RenderOpacity default
2016-01-18 22:17:31 -08:00
Ian Hickson
03dcd2686a Move RenderObjectWidgets down
It's confusing to have non-render-object widgets on either side of the
render object ones.
2016-01-18 21:32:01 -08:00
Ian Hickson
32cd916e00 StackParentData.toString() fix, RenderOpacity default 2016-01-18 21:14:51 -08:00
Ian Hickson
60d9ab7e7b Fix some intrinsic constraints contract violations.
RenderBlock wasn't constraining the results.
RenderPadding wasn't constraining the results (which matters
especially when the constraints can't fit the padding in the first
place).
RenderViewport wasn't constraining the results.

Add a test for the block case.

To catch this kind of thing in the future, add some asserts to
debugDoesMeetConstraints() that all four intrinsic functions return
values that are within the constraints.

RenderBlockViewport doesn't support returning intrinsics, so turn off
the "no intrinsic support" asserts (and return zero) when we're doing
this new assert.

This new assert screwed up the custom layout classes' tests, so adjust
those tests to ignore the callbacks invoked from these asserts.

Add to the _debugReportException() method a short summary of the
descendants of this node. It's important to have this information when
debugging errors like these intrinsic constraints contract violations
because often nodes just pass the values through to their child so you
have to go several steps down to find the actual problem.

Fixes https://github.com/flutter/flutter/issues/1210
2016-01-18 13:54:45 -08:00
Ian Hickson
aa701d44f6 Merge pull request #1257 from Hixie/shadows
More elaborate RenderBox example
2016-01-18 13:53:22 -08:00
Ian Hickson
73c9ebab19 Reimplement the theme transition animation by actually animating the Theme.
As part of this:
 - A lot of classes got new lerp functions, including e.g. TextStyle.
 - Theme's constructor story got overhauled. You can now configure
   everything if you really want to, and we're better about defaults.
 - Material no longer automatically animates its background color.
   (It still does for its shadow.)
 - Tabs try to get the indicator color from the theme.
 - The fields in ThemeData got reordered for sanity.
 - Theme.== and Theme.hashCode got fixed.
 - Typography got a bit of a spring cleaning.

Fixes #613.
2016-01-18 13:07:39 -08:00
Ian Hickson
eb53ec313b Merge pull request #1288 from Hixie/ViewConstraints-rename
Rename ViewConstraints to ViewConfiguration
2016-01-17 22:34:37 -08:00
Ian Hickson
a566afcbb1 Merge pull request #1287 from Hixie/scaffold
Rename _Child to _ScaffoldSlot for clarity.
2016-01-17 22:34:24 -08:00
Ian Hickson
9d155bdce5 Merge pull request #1285 from Hixie/activity
Activity clean-up
2016-01-17 22:33:59 -08:00