124 Commits

Author SHA1 Message Date
Adam Barth
81b76c2bb8 Make CircularProgressIndicator's stroke width configurable (#9794)
Fixes #9062
2017-05-19 21:56:07 -07:00
Ian Hickson
63cfe1e30d Add strokeWidth to the paints matcher (#10121) 2017-05-16 14:17:41 -07:00
Ian Hickson
abeb164fe2 Add intrinsic dimensions to RenderEditable (#10093)
Also:

* Make TextPainter.preferredLineHeight honour root fontSize

* Remove bogus docs.

* More aggressively track dirty state for RenderEditable.

* Some tests.
2017-05-15 14:06:58 -07:00
Ian Hickson
e5e5f61c66 Improve error messages from slivers. (#9971)
Also, fix some logic in SliverPadding.
2017-05-10 17:34:17 -07:00
Ian Hickson
c7469e005d Fix many dartdoc typos (#9822) 2017-05-04 19:54:06 -07:00
Ian Hickson
e8c46927c4 Flush microtasks after transient callbacks are run. (#9702)
This splits the frame pipeline into two, beginFrame and drawFrame.

As part of making this change I added some debugging hooks that helped
debug the issues that came up:

 * I added debugPrintScheduleFrameStacks which prints a stack whenever
   a frame is actually scheduled, so you can see why frames are being
   scheduled.

 * I added some toString output to EditableText and RawKeyboardListener.

 * I added a scheduler_tester.dart library for scheduler library tests.

 * I changed the test framework to flush microtasks before pumping.

 * Some asserts that had the old string literal form were replaced by
   asserts with messages.

I also fixed a few subtle bugs that this uncovered:

 * setState() now calls `ensureVisualUpdate`, rather than
   `scheduleFrame`. This means that calling it from an
   AnimationController callback does not actually schedule an extra
   redundant frame as it used to.

 * I corrected some documentation.
2017-05-02 09:27:53 -07:00
Ian Hickson
36052e68dd BoxDecoration API changes: backgroundColor -> color et al (#9648)
backgroundColor -> color
backgroundImage -> image
BackgroundImage -> DecorationImage
2017-04-27 14:19:01 -07:00
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
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
Ian Hickson
0252622869 Promote Layer to full AbstractNode status (#9456) 2017-04-19 10:04:58 -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
Ian Hickson
ebe6da5b17 Rename BlockBody to ListBody. (#9291)
Nobody knew what a Block was.
2017-04-07 17:14:54 -07:00
Ian Hickson
2144a8964f Fill in the test for button color splash and highlights (#9224)
Fixes https://github.com/flutter/flutter/pull/8643

Fixes https://github.com/flutter/flutter/issues/8804 by adding a test
to verify that Material elevation changes animate.

Also tweak some dartdocs, add some trailing commas, improve some
toString output, make the inkwell test agnostic to the PhysicalModel
logic, and move the material buttons test to the material test
directory.
2017-04-05 22:46:58 -07:00
Ian Hickson
9be0fc7422 Fill in the test for rounded rectangle splash and highlights (#9092)
Fixes https://github.com/flutter/flutter/issues/9031

Also some updates to mock_canvas that were needed to do this.
2017-04-01 17:47:18 -07:00
Phil Quitslund
ab6df3af40 Bump to Dart SDK 1.23.0-dev.10 (#9051)
* Bump to Dart SDK 1.23.0-dev.10

* allows us to understand flutter usage via telemetry
* brings in `@immutable`

Fixes: #9042

* completer fix

* Update to platform 1.1.1.
2017-03-28 14:53:03 -07:00
Hans Muller
90799e4479 Fix selected tab indicator tap animation (#8939) 2017-03-22 10:40:10 -07:00
Adam Barth
d443d598c2 Align TextEditingValue and InputValue (#8922)
This patch prepares us to remove InputValue in favor of TextEditingValue.
2017-03-20 17:18:35 -07:00
Chris Bracken
46291903e0 Declare locals final where not reassigned (tests) (#8566) 2017-03-03 17:43:22 -08:00
Alexandre Ardhuin
8c043d06de fix lints for directives_ordering rule (#8382) 2017-02-23 13:37:26 -08:00
Adam Barth
e0b12ca17e Two becomes one (#8253)
Rename all the "2" classes related to scrolling to remove the "2". Now that the
old scrolling code is gone, we don't need to use the suffix.
2017-02-17 14:06:15 -08:00
Adam Barth
90574b0478 Remove Scrollable1 (#8225)
All the clients have migrated to Scrollable2.
2017-02-16 16:41:24 -08:00
Ian Hickson
8ecaff2906 Positioned.fromRelativeRect (#8123)
Since RelativeRect's whole purpose in life is to make work with Stack
easier, it's silly that you can't directly use it with Positioned.

Also, tests for RelativeRect.
And fixes for the bugs that found...
2017-02-14 14:34:33 -08:00
Alexandre Ardhuin
d1d1c50cbe prefer const constructors (#8024) 2017-02-09 00:57:38 -08:00
Adam Barth
3ca921610c Remove ScrollableGrid (#8020)
All the clients have migrated to GridView.  Also, remove RenderGrid,
which isn't needed by GridView.
2017-02-08 22:08:56 -08:00
Adam Barth
311e77ab7c Fix main stocks screen (#8008)
We weren't triggering a relayout when the number of children changed.

Fixes #8001
2017-02-08 20:40:07 -08:00
Ian Hickson
471e91d46f SliverBlock->SliverList (#7872) 2017-02-03 17:14:00 -08:00
Adam Barth
f2ea7304c8 PageView shouldn't squish when overscrolled (#7870)
This patch passes down the viewportMainAxisExtent so that RenderSliverPage can
pick it up and size its children appropriately.
2017-02-03 16:43:04 -08:00
Ian Hickson
5928d221d4 ShrinkWrap Viewport (#7790) 2017-02-02 14:50:04 -08:00
Adam Barth
695302029f Revert "Revert "Add SliverGrid and ScrollGrid"" (#7780) 2017-02-01 10:18:48 -08:00
Ian Hickson
32784d35f9 Revert "Add SliverGrid and ScrollGrid" (#7769) 2017-01-31 17:34:02 -08:00
xster
fa1b8d5821 A low scope error message height fix for #3091 (#7685)
* Print the error message multiple times to avoid overlap with status bar and add paragraph to mock_canvas
2017-01-31 11:28:52 -08:00
Adam Barth
9119969ad2 Add SliverGrid and ScrollGrid (#7745)
This patch adds grid supports to slivers and introduces a ScrollGrid
convenience class for making the common types of scrollable grids.

This patch also deploys ScrollGrid in an example in the Flutter Gallery.
2017-01-30 17:27:51 -08:00
Adam Barth
098af18393 Add SliverList (#7727)
Add SliverList

A SliverList is a linear layout of box children in a viewport that all
have a common, fixed extent along the scroll axis. The layout is similar
to a SliverBlock but more efficient.
2017-01-30 00:40:50 -08:00
Ian Hickson
512a9af6a0 deprecate needsLayout (#7718)
The needsLayout getter is prone to misuse. See discussion on #3083.
2017-01-28 14:26:08 -08:00
Ian Hickson
7c40446a69 proxy_box tests (#7658) 2017-01-26 08:00:24 -08:00
Adam Barth
600c75cb11 Viewport2 should clip visual overflow (#7641)
When you put a box in a Viewport2, it might paint outside its allocated bounds.
This patch teaches Viewport2 to clip when that happens.
2017-01-25 15:54:46 -08:00
Ian Hickson
9ff2e978cd Sliver Padding (#7628) 2017-01-25 15:00:57 -08:00
Adam Barth
0eb8f94b1c Fix display list harness diagnostics (#7634) 2017-01-25 10:08:11 -08:00
Ian Hickson
58348612a3 Factor out debugPaintPadding and test it (#7598)
I plan to use this to implement similar logic in SliverPadding.

To make this easier to test I extended the paints matcher to accept a
function that takes a canvas. While I was at it I also made it accept
a Finder, it'll go and find the render object for you.

Also added support for paints..path and fixed some grammar in the
error messages.

Also improved the docs for debugPaint*.
2017-01-24 16:08:27 -08:00
Adam Barth
559621ca5a Add SingleChildScrollView (#7620)
This widget is a replacement for ScrollableViewport that uses the new
Scrollable2 machinery. The widget is not based on Slivers but does use the new
scroll behavior classes.
2017-01-24 15:16:01 -08:00
Ian Hickson
f683abd757 Sliver Block (#7618) 2017-01-24 15:06:53 -08:00
Ian Hickson
84c0b34782 Test some of the sliver helper classes (#7574) 2017-01-23 13:36:44 -08:00
Adam Barth
99822088a7 Add operator== and hashCode to TextTheme (#7586)
Teach `paints` matches about `drawRect` and how to `paintChild`.

Also, improve test coverage.
2017-01-23 00:06:58 -08:00
Ian Hickson
2e196037f5 Improve the order of members in the mock_canvas file. (#7573)
This will make it easier to understand what this file does.
2017-01-20 22:31:41 -08:00
Ian Hickson
63160b3dab Scrolling Refactor (#7420) 2017-01-20 16:18:56 -08:00
Ian Hickson
c5fcaf6dea Introduce a paints matcher, and convert the previous customers of (#7567)
MockCanvas to use it instead.

Currently it only supports a very limited set of drawing features, but
adding new ones is easy.

Once the feature set is more complete, and we've used this a bunch, if
it feels right, this API will get promoted to flutter_test.
2017-01-20 15:28:00 -08:00
Matt Perry
75f39789c7 Add support for specifying maxLines for Text. (#7493)
Overflow handling works with clipping, adding an ellipsis on the last
line, or fading the last line.

Fixes https://github.com/flutter/flutter/issues/7271
2017-01-18 12:34:34 -05:00
Jason Simmons
3b702448fd Do not paint a RenderFittedBox with an empty size (#7489)
If the size is empty, then _updatePaintData will produce an invalid transform
that yields a NaN canvas bounds rectangle

Fixes https://github.com/flutter/flutter/issues/7431
2017-01-13 15:12:30 -08:00