2681 Commits

Author SHA1 Message Date
Ian Hickson
596eb033c7 Loosen the constraints for Stack non-positioned children. (#9581)
Also:

 * Add three explicit sizing modes to Stack for non-positioned
   children: loose, expand, and passthrough. (All three are used.)

 * Fix a bug whereby layers would try to paint in the same frame as
   they were removed from layout (but not detached).

 * Fix a bug whereby Offstage wasn't properly marking the parent dirty
   when changing its sizedByParent flag.

 * Explicitly make Overlay expand non-positioned children.

 * Explicitly have InputDecoration pass through the constraints from
   its Row to its Stack children.
2017-04-25 15:06:02 -07:00
Ian Hickson
24b40d87d6 Make getVelocity never return null (#9583)
Fixes https://github.com/flutter/flutter/issues/8425
2017-04-25 12:23:43 -07:00
Alexandre Ardhuin
31828609dc add @required (#9579) 2017-04-25 08:59:43 +02:00
Adam Barth
c288c7064f Refactor scrolling code to prepare for nested scrolling (#9575)
This patch reworks some of the guts of scrolling to make it easier to
implement nested scrolling effects. The actually nested scrolling effect
will be included in a later patch.
2017-04-24 23:32:55 -07:00
Ian Hickson
57648ba0e4 New Placeholder widget. (#9565) 2017-04-24 14:06:07 -07:00
Ian Hickson
3492350653 Remove Placeholder. It has no clients. (#9563) 2017-04-24 12:40:27 -07:00
Adam Barth
55f334681b FocusNode.requestFocus should show the keyboard (#9558)
This patch introduces the notion of a keyboard token, which generalizes the
logic in EditableText for distinguishing between gaining focus by default and
gaining focus because of an explicit use action.

Fixes #7985
2017-04-24 09:46:49 -07:00
Alexandre Ardhuin
83fce211a3 More const immutable classes (#9544)
* more widget const constructors

* prefer const constructors

* address review comments
2017-04-23 22:37:29 +02:00
Alexandre Ardhuin
ad496e142b enable lint overridden_fields (#9527)
* enable lint overridden_fields

* address review comment
2017-04-22 10:27:03 +02:00
xster
76ecb0b9a1 Remove InputField (#9520) 2017-04-21 14:12:14 -07:00
Adam Barth
a57018a4bb Add GridView.builder (#9522)
This constructor makes it easier to use a GridView with a builder
callback.

Fixes #8952
2017-04-21 14:09:53 -07:00
Alexandre Ardhuin
9541848272 make @immutable const classes (#9532)
* make @immutable const

* fix build
2017-04-21 23:09:42 +02:00
Adam Barth
1abb6f5d74 Explain why the Padding widget exists (#9523)
Fixes #5166
2017-04-21 14:09:35 -07:00
Adam Barth
930183916c Box/Sliver mismatches should have better error messages (#9525)
We now attempt to explain what went wrong.

Fixes #9509
2017-04-21 14:09:25 -07:00
Hans Muller
39d9bcdae8 ListView.Builder() handles appends when scrolled to the end (#9533) 2017-04-21 14:07:41 -07:00
Ian Hickson
df45aac166 Don't paint on unattached layers. (#9519) 2017-04-21 13:39:55 -07:00
Ian Hickson
a591628cab Reorganise the drag related gesture files. (#9487)
Move the Drag*Details classes into drag_details.dart.
Move the one-gesture drag recognizers into monodrag.dart.
Move Drag into drag.dart.

Adjust the comments to claim that Drag is used by other things than
MultiDragGestureRecognizer. (Right now this is a lie but it will
hopefully be true soon.)
2017-04-21 13:13:20 -07:00
Adam Barth
31b1964a23 Document that you can call runApp again (#9526)
This is such a fundamental property of the system that we forgot to
document it.

Fixes #6818
2017-04-21 09:32:32 -07:00
Alexandre Ardhuin
c794221f96 enable lint prefer_adjacent_string_concatenation (#9493) 2017-04-21 08:52:07 +02:00
Alexandre Ardhuin
35803c2297 comprehensive list of lints (#9330)
* comprehensive list of lints
* add comments to commented out lint
* fix unnecessary_this lints
* exclude prefer_final_fields
2017-04-20 09:38:57 +02:00
Alexandre Ardhuin
03c54abd5f make some widgets const (#9477) 2017-04-20 08:59:05 +02:00
Hans Muller
92e40b5c45 Image color blend mode (#9486) 2017-04-19 17:46:00 -07:00
Jason Simmons
da7867be0e Request a layout when a paragraph's overflow mode is changed (#9485)
A change in overflow mode requires calculation of the text size and resetting
the overflow shader
2017-04-19 17:06:58 -07:00
Jason Simmons
a657428b5c Capture didExceedMaxLines after doing text layout with constraints (#9457)
Subsequent operations like debugAssertDoesMeetConstraints() may do layout
operations that alter _textPainter's state.

Fixes https://github.com/flutter/flutter/issues/9372
2017-04-19 16:04:47 -07:00
Chinmay Garde
9b90ec4846 Remove FadeTransition from _MountainViewFadeTransition. (#9472)
* Remove FadeTransition from _MountainViewFadeTransition.
* Update tests.
2017-04-19 15:12:40 -07:00
xster
3cf23fcb20 Remove deprecated (#9474) 2017-04-19 12:50:51 -07:00
Hans Muller
2366cf73bc Dimissing the system keyboard shouldn't defeat scrolling (#9470) 2017-04-19 11:10:34 -07:00
Ian Hickson
0252622869 Promote Layer to full AbstractNode status (#9456) 2017-04-19 10:04:58 -07:00
Adam Barth
7be9115a43 Deploy @immutable in more places (#9462)
Turns out we have many immutable classes.

Fixes #6892
2017-04-19 09:30:43 -07:00
Ian Hickson
a6a8d997a3 Some clean-up of the Heroes code (#9428) 2017-04-18 14:42:56 -07:00
Hans Muller
1e4151691a Fix PageSelector, page selector gallery demo (#9448) 2017-04-18 14:15:32 -07:00
Hans Muller
4906297c28 Scrollable TabBar shows initialIndex (#9402) 2017-04-18 13:11:35 -07:00
Ian Hickson
115a04765e Be more detailed in assert messages from _paintWithContext (#9409) 2017-04-18 12:29:36 -07:00
xster
8ed175411b Make Cupertino page transition elevation animated too (#9166)
* Make Cupertino page transition elevation animated too

* Rename and change physical model to a decorated box

* Tests

* Add a comment

* still need to handle null in the tween somewhere

* nits

* Tweens evaluate to the actual begin/end instances. Let them be non-null

* Rename no decoration to none
2017-04-18 11:27:21 -07:00
Mikkel Nygaard Ravn
945cfc3ee2 Make naming consistent across channel APIs (#9270) 2017-04-18 15:23:15 +02:00
Hans Muller
b52d659406 Disallow unsafe ancestor methods (#9425) 2017-04-17 15:44:41 -07:00
Hans Muller
d05d36101a Enforce didUpdateWidget() @mustCallSuper (#9421) 2017-04-17 10:35:00 -07:00
Dwayne Slater
0d152a6ba9 fix DefaultTextStyle not notifying updates for some changes (#9416) 2017-04-16 19:01:37 -07:00
Ian Hickson
14e728d01d Support chaining await calls on controllers (#9389)
With this patch, you can do:

```dart
   Future<Null> foo() async {
     try {
       await controller.forward().orCancel;
       await controller.reverse().orCancel;
       await controller.forward().orCancel;
     } on TickerCanceled {
       // did not complete
     }
   }
```

...in a State's async method, and so long as you dispose of the
controller properly in your dispose, you'll have a nice way of doing
animations in sequence without leaking the controller. try/finally
works as well, if you need to allocate resources and discard them when
canceled.

Simultaneously, you can do:

```dart
   Future<Null> foo() async {
     await controller.forward().orCancel;
     await controller.reverse().orCancel;
     await controller.forward().orCancel;
   }
```

...and have the same effect, where the method will just silently hang
(and get GC'ed) if the widget is disposed, without leaking anything,
if you don't need to catch the controller being killed.

And all this, without spurious errors for uncaught exceptions on
controllers.
2017-04-14 18:27:31 -07:00
Hans Muller
dbfa747b37 TabBarView scroll handling should factor in scroll physics tolerance (#9390) 2017-04-14 15:23:47 -07:00
Adam Barth
ea71bdca20 Start using @immutable annotations (#9152)
There are more places we can use this annotation, but this patch just gets us
started.
2017-04-14 10:38:58 -07:00
Hans Muller
c96201a3c9 Scaffold appBar is-a PreferredSizeWidget, etc (#9380)
* Scaffold appBar is-a PreferredSizeWidget, etc

* Updated

* Updated per review feedback
2017-04-13 13:04:51 -07:00
Ian Hickson
8fdd2066b3 DefaultTextStyle.merge and IconTheme.merge improvements (#9358)
I can't figure out if this is genius or a giant hack.

This lets you use DefaultTextStyle.merge and IconTheme.merge without
specifying a BuildContext. It automatically merges in at the
appropriate place in the tree using a Builder widget.
2017-04-13 10:26:40 -07:00
xster
ecdfe65828 Create DecoratedBoxTransition AnimatedWidget (#9369) 2017-04-12 23:13:32 -07:00
xster
8aacc288ce Simplify change notifier toString and handle nulls (#9368) 2017-04-12 23:09:40 -07:00
xster
819bb539f1 Slight efficiency improvement on all page transitions (#9356)
Remove intermediate animation listener
2017-04-12 16:25:12 -07:00
Hans Muller
28bb89c6f6 Support for snapping floating app bars (#9156) 2017-04-12 15:15:01 -07:00
Ian Hickson
bf017b79b3 Move Point to Offset (#9277)
* Manually fix every use of Point.x and Point.y

Some of these were moved to dx/dy, but not all.

* Manually convert uses of the old gradient API

* Remove old reference to Point.

* Mechanical changes

I applied the following at the root of the Flutter repository:

git ls-files -z | xargs -0 sed -i 's/\bPoint[.]origin\b/Offset.zero/g'
git ls-files -z | xargs -0 sed -i 's/\bPoint[.]lerp\b/Offset.lerp/g'
git ls-files -z | xargs -0 sed -i 's/\bnew Point\b/new Offset/g'
git ls-files -z | xargs -0 sed -i 's/\bconst Point\b/const Offset/g'
git ls-files -z | xargs -0 sed -i 's/\bstatic Point /static Offset /g'
git ls-files -z | xargs -0 sed -i 's/\bfinal Point /final Offset /g'
git ls-files -z | xargs -0 sed -i 's/^\( *\)Point /\1Offset /g'
git ls-files -z | xargs -0 sed -i 's/ui[.]Point\b/ui.Offset/g'
git ls-files -z | xargs -0 sed -i 's/(Point\b/(Offset/g'
git ls-files -z | xargs -0 sed -i 's/\([[{,]\) Point\b/\1 Offset/g'
git ls-files -z | xargs -0 sed -i 's/@required Point\b/@required Offset/g'
git ls-files -z | xargs -0 sed -i 's/<Point>/<Offset>/g'
git ls-files -z | xargs -0 sed -i 's/[.]toOffset()//g'
git ls-files -z | xargs -0 sed -i 's/[.]toPoint()//g'
git ls-files -z | xargs -0 sed -i 's/\bshow Point, /show /g'
git ls-files -z | xargs -0 sed -i 's/\bshow Point;/show Offset;/g'

* Mechanical changes - dartdocs

I applied the following at the root of the Flutter repository:

git ls-files -z | xargs -0 sed -i 's/\ba \[Point\]/an [Offset]/g'
git ls-files -z | xargs -0 sed -i 's/\[Point\]/[Offset]/g'

* Further improvements and a test

* Fix minor errors from rebasing...

* Roll engine
2017-04-12 15:06:12 -07:00
Ian Hickson
2a54524337 Fix tests to use Ahem, and helpful changes around that (#9332)
* Fix tests to use Ahem, and helpful changes around that

- Fix fonts that had metric-specific behaviours.

- LiveTestWidgetsFlutterBinding.allowAllFrames has been renamed
  to LiveTestWidgetsFlutterBinding.framePolicy.

- LiveTestWidgetsFlutterBinding now defaults to using a frame policy
  that pumps slightly more frames, to animate the pointer crosshairs.

- Added "flutter run --use-test-fonts" to enable Ahem on devices.

- Changed how idle() works to be more effective in live mode.

- Display the test name in live mode (unless ahem fonts are enabled).

- Added a toString to TextSelectionPoint.

- Style nit fixes.

* Roll engine to get Ahem changes.

* Update tests for dartdoc changes.

* Fix flutter_tools tests
2017-04-12 13:33:02 -07:00
Jason Simmons
c12c019bcc Throw an exception with the asset key if a string asset load fails (#9325)
Fixes https://github.com/flutter/flutter/issues/7715
2017-04-11 13:48:04 -07:00