530 Commits

Author SHA1 Message Date
LongCatIsLooong
76be55813b
Move caret/highlight painting to custom painters (#72828) 2021-02-01 14:41:04 -08:00
Alexandre Ardhuin
d546e1d311
fix for upcoming lint use_named_constants (#74788) 2021-01-27 20:20:44 +01:00
Jia Hao
8a5ace25a5
Improve performance of Widget Tests (#70730) 2021-01-12 17:29:03 -08:00
Nathan Walker
b65a235139
SliverAppBar with ShrinkWrap Patch (#73195) 2021-01-07 10:39:02 -08:00
Todd Volkert
e2a0d03b79
Avoid null check operator failure in RenderFlex._hasOverflow (#72122)
Fixes https://github.com/flutter/flutter/issues/71972
2020-12-17 19:25:28 -08:00
J-P Nurmi
803c07fe3b
Fix EditableText.enableInteractiveSelection on desktop & web (#70972)
selectionEnabled was not taken into account in:

key movement handling in RenderEditable
mouse drag handling in TextSelectionGestureDetectorBuilder
2020-12-17 16:56:47 -08:00
Justin McCandless
fb3dba74b7
Correct text selection pivot points (#71756) 2020-12-14 11:18:05 -08:00
Jia Hao
bf8313f8fc
Add a test for intrinsic size checks (#71539) 2020-12-03 08:48:04 -08:00
LongCatIsLooong
df28355b0c
Raw keyboard shortcuts & deletions should not read from _plainText (#71236) 2020-12-02 17:13:04 -08:00
xubaolin
543d3cfa57
Add a [valid] property of [MouseTrackerAnnotation] indicates the annotation states. (#69866) 2020-11-17 08:03:02 -08:00
Jason Simmons
a56584857f
Ignore text selection boxes when assembling semantics for placeholder runs (#70487) 2020-11-16 10:28:03 -08:00
Michael Goderbauer
786d0306db
Assert for RenderFlex intrinsics if using baseline alignment (#70139) 2020-11-10 14:29:41 -08:00
David Garcia
03a3457f10
fix(itemExtent): Fix rounded issue using precisionErrorTolerance (#68199) 2020-11-02 13:23:04 -08:00
Michael Goderbauer
0490fd75aa
Make Theme.of non-nullable (#68922) 2020-11-02 09:20:42 -08:00
Michael Goderbauer
c83dd3cc75
Fix build (#69426) 2020-10-30 11:34:18 -07:00
Jacek Marchwicki
32b9af6996
Use the correct pleace for the system navigation bar color adjustment (#68102) 2020-10-30 10:48:03 -07:00
stuartmorgan
3da995adec
Handle backspace in text fields (#68812)
Currently the framework handles delete, but not backspace, so embeddings
all have to implement backspace handling themselves. This eliminates
that inconsistency and allows simplified code in embeddings by adding
backspace handling.

It also fixes a bug uncovered in the delete handling where deleting a
selection would also delete the next character after the selection.
2020-10-22 13:51:07 -07:00
Michael Goderbauer
42f3709a5a
Sound null safety for framework and flutter_test (#68642) 2020-10-21 10:09:11 -07:00
YeungKC
c706abf075
Fix error cursor position for left and right arrow event after text selection (#68402) 2020-10-19 12:42:03 -07:00
HeavenOSK
66cf8d47a3
[Improvement] Add prefix Alignment. for toString of Alignment (#67860)
* modify: add prefix `Alignment.` for toString of Alignment
2020-10-14 13:47:28 +08:00
Alexandre Ardhuin
4acc790252
enable lint cast_nullable_to_non_nullable (#67629) 2020-10-08 21:05:43 +02:00
Alexandre Ardhuin
0d8d4f77aa
unnecessary null comparison (#67525) 2020-10-08 09:26:30 +02:00
Kate Lovett
019e90f7df
[NNBD] Migrates some rendering tests (#67449) 2020-10-07 16:27:06 -07:00
Darren Austin
af0c7aed1c
Migrate framework tests for rendering, semantics, widgets to null safety (#67453)
Migrate framework tests for rendering, semantics, widgets to null safety.
2020-10-07 10:06:32 -07:00
Michael Goderbauer
b3bd9e6924
Migrate more tests to null safety (#67360) 2020-10-05 19:52:03 -07:00
Michael Goderbauer
8998167d0f
Make FlutterErrorDetails.exception non-nullable as documented (#67364) 2020-10-05 18:07:02 -07:00
Tong Mu
2cdf2f0059
Treat hover events as normal pointer events, and bring them back to Listener (#63834) 2020-10-05 12:12:04 -07:00
Dan Field
2cdec25877
Reland dispose images when done (#67100) (#67177)
* Reland dispose images when done (#67100)

Changes since last time:

- Test for CanvasKit image rendering
  (https://github.com/flutter/flutter/pull/67176)
- Fix CanvasKit dispose impl
  (https://github.com/flutter/engine/pull/21555)
- Update internal google3 customer with a problematic ImageStream
  Listener impl (cl/335091311, cl/335459002)

This reverts commit 473358d93dd9522970afa82512a4d05685345b3b.
2020-10-05 12:03:27 -07:00
Michael Goderbauer
cbf1e135c4
Migrate non-test files in flutter/test (#67098) 2020-10-02 21:57:04 -07:00
Tong Mu
74fe6bff84
Lazily compute PointerEvent's transformed positions (#63813)
* PointerEvent.local* properties are calculated lazily; other properties are delegated to original.
* Transformed PointerEvent becomes a subclass of its original class.
* Unnamed constructors no longer accepts transform and origin.
2020-10-02 15:09:23 -07:00
Jason Simmons
70973e0214
Handle empty selection box lists in RenderParagraph.assembleSemanticsNode (#67017) 2020-10-02 10:57:05 -07:00
Dan Field
473358d93d
Revert dispose images when done (#67100)
* Revert "docs for image disposal (#67066)"

This reverts commit bcb2ac5a55b90b2ccfd50de4684c0cbb8aca9290.

* Revert "Dispose of images after using them (#66688)"

This reverts commit a7954691dad4788f985cf17e81ce6c474a72e84e.
2020-10-01 16:53:50 -07:00
Dan Field
a7954691da
Dispose of images after using them (#66688)
* Dispose of images after using them
Adds ImageInfo.clone, ImageInfo.dispose, and ImageInfo.isCloneOf.
Makes all stateful holders of ui.Image objects properly clone and dispose of them.
Behavior change for ImageStreamCompleter: Removing the last listener after registering at least one listener results in the object being disposed, and new listeners cannot be added, unless a keepAlive handle is created.
Makes all non-stateful holders of ui.Image (i.e. paintImage and RawImage) assert that whoever gave the image to them has not disposed it on them.
2020-10-01 09:48:54 -07:00
Jonah Williams
90d83e37a6
[flutter_tools] register service worker after first frame event (#66082)
Registering the service worker immediately after the documented has loaded may cause SW initialization to compete with framework initialization. It was recommended to us that we defer the service worker setup until after the framework is done with setup, which should be sometime after the first frame.

To implement this, I augmented the binding setup to dispatch an event on the document after the binding has initialized. I don't see any obvious risks with this setup.

Fixes #66066
2020-09-23 18:58:05 -07:00
LongCatIsLooong
525e76bc7c
Positioning IME bars on iOS (#61981) 2020-09-22 18:32:05 -07:00
Dan Field
7eb8447485
Allow new methods to be added to ui.Image for tests (#65876)
Remove fake image implementations, add createTestImage to flutter_test
2020-09-22 11:55:39 -07:00
Michael R Fairhurst
7f3c9b6bda
Remove unused 'dart:async' imports. (#65568) 2020-09-16 14:14:06 -07:00
Alexandre Ardhuin
b007a81ad4
Reland "Nnbd widgets" (#65528)
* Reland "Nnbd widgets (#64672)"

This reverts commit 127e67902e8bbb0dcbfb3351b8fd00f7cbdf0178.

* remove non-nullable enforcement on AsyncSnapshot

* make data param non-nullable for AsyncSnapshot.withData

* make some Text params non-nullable
2020-09-15 16:42:00 +02:00
Anatoly Pulyaevskiy
bb59993ac6
Expose 3 new methods with text metrics in RenderParagraph (#65150) 2020-09-09 15:45:03 -07:00
Michael Goderbauer
127e67902e
Revert "Nnbd widgets (#64672)" (#65488)
This reverts commit e682ec711a8c05fe78157595240b392de339fa32.
2020-09-09 15:18:54 -07:00
Alexandre Ardhuin
e682ec711a
Nnbd widgets (#64672)
* migrate widget to nullsafety

* remove double blank line after license

* address review comments in actions.dart

* nullable ObjectKey.value

* use local variable oldElement

* make State.build non-nullable

* make State.context non-nullable

* newline at eof

* make ProxyWidget.child non-nullable

* make _InactiveElements.debugContains non-nullable

* make Element.depth non-nullable

* make ProxyElement.build non-nullable

* make StatefulElement.state non-nullable

* remove 'Notice that'

* avoid cast of list in RenderObjectElement.updateChildren

* make IndexedSlot.value non-nullable

* avoid cast of list in MultiChildRenderObjectElement.mount

* make some WidgetsApp parameters non-nullable

* hitTest take non-nullable position

* make ScrollableState.position non-nullable

* use _pixels instead of pixels

* make ViewportOffset.pixels non-nullable

* make param and return type of IndexedWidgetBuilder non-nullable

* unused_import

* make context param non-nullable for Builder in animated_list.dart

* make ScrollMetrics.viewportDimension non-nullable

* make ScrollMetrics.{min,max}ScrollExtent non-nullable

* make _Location.file non-nullable

* _WidgetForTypeTests.createElement throw UnimplementedError

* update _NullWidget.build error message

* make _ShortcutsState.manager non-nullable

* Fix childCount issues for NNBD

* fix childCount computation on web

* increase max value on js side to compute childCount

* make aspect parameter of dependOnInheritedWidgetOfExactType nullable

* merge has{min,max}ScrollExtent into hasScrollExtents

* update focus_manager.dart

* address review comments in icon.dart

* address review comments in image.dart

* address review comments in routes.dart

* address review comments in scroll_activity.dart

* update doc comments

* make UserScrollNotification.direction non-nullable and required

* rename hasScrollExtents to hasContentDimensions

* unnecessary late

Co-authored-by: Ian Hickson <ian@hixie.ch>
2020-09-09 10:52:27 +02:00
Chris Bracken
c0ea00ed3f
Prefer moreOrLessEquals over closeTo (#64915)
Flutter's `moreOrLessEquals` has a few advantages over `closeTo` from
the `matcher` package:

   * It emits the epsilon value in the test result on failure.
   * It uses a named parameter for epsilon, which improves readability
     at the call site.
   * It has a reasonable default for epsilon in cases where something
     more specific isn't required.

Using it also has the nice property that it aids in its own discovery
when when people go looking for such functionality in new tests.

This change also includes a couple unrelated whitespace formatting cleanups.
2020-08-30 22:20:16 -07:00
Chris Bracken
8fa5c55e54
Match lerped values using moreOrLessEquals (#64908)
Several of our tests make use of numbers without an exact floating point
representation (frequently 0.x where x!=5) which, when scaled, also
scale the error. The end result is that some of these tests currently
implicitly rely on an implementation detail of floating point math and
are sensitive to differences in the ~15th decimal place.

This patch reduces the sensitivity of some of these tests, checking
values using `moreOrLessEquals` from the flutter_test package
rather than requiring en exact match.
2020-08-30 19:05:20 -07:00
LongCatIsLooong
fe55dc2b13
Reland "Prevent viewport.showOnScreen from scrolling the viewport if the specified Rect is already visible. (#56413)" reverted in #64091 (#64513) 2020-08-28 22:13:04 -07:00
Ian Hickson
8a6a76a334
migrate rendering to nullsafety (#64621) 2020-08-27 16:38:10 -07:00
LongCatIsLooong
6536f65048
Revert "Warns when single line text fields overflow (#63639)" (#64573)
This reverts commit 0ab5ecc86b1f13854ecc0cb4a89fbdc9938c5212.
2020-08-25 11:11:15 -07:00
chunhtai
39d7a019c1
Reland "fix wrap intrinsic height calculation (#63420)" (#64276) 2020-08-25 10:01:07 -07:00
LongCatIsLooong
0ab5ecc86b
Warns when single line text fields overflow (#63639) 2020-08-24 18:16:05 -07:00
LongCatIsLooong
7d6ffc7cc9
Add rect logic to getOffsetToReveal when onlySlivers is true (#64295) 2020-08-24 12:36:04 -07:00
Tong Mu
fb0b982324
Change MouseTracker's interface for clarity. Simplify MouseRegion's implementation. (#64119)
* Redesigns the interface between MouseTracker and RendererBinding&RenderView.
* Simplifies the structure of RenderMouseRegion.
* Extracts the common utility code between mouse_tracker_test and mouse_tracker_cursor_test.
2020-08-19 18:51:56 -07:00