2714 Commits

Author SHA1 Message Date
xubaolin
778b3fa322
support updating dragDecices at runtime (#120336) 2023-02-13 21:38:27 +00:00
chunhtai
3fdd6ee46f
Reland "Overlay always applies clip (#113770)" (#116674)
* Reland "Overlay always applies clip (#113770)"

This reverts commit d0afbd72a782eb20657f01b082ef29a2517eee54.

* Root navigator will not clip
2023-02-09 18:38:47 +00:00
Christopher Fujino
b1c4d5686e
Fix widget inspector null check (#120143)
* add failing test

* fix

* remove extra whitespace

* fix test failure

* disable trackrebuilddirtywidgets in teardown

* remove no-shuffle annotation

* fix
2023-02-09 00:55:05 +00:00
Gabriel Terwesten
ec289f1eb4
Don't call PlatformViewCreatedCallbacks after AndroidViewController is disposed (#116854)
* Don't call `PlatformViewCreatedCallback`s after `AndroidViewController` is disposed

Before this change it was possible that, if a `AndroidViewController` was disposed before we got the notification that the platform view was created, `PlatformViewCreatedCallback`s where called even after calling `AndroidViewController.dispose`.

Also makes `_PlatformViewLinkState._onPlatformViewCreated` more carful to only call `setState` when mounted.

Closes #84628
Closes #96384

* Allow all widgets to remove listeners from controller

* Remove assert

* Add expectations to test
2023-02-08 18:51:50 +00:00
xubaolin
6e7f580370
fix a TextFormField bug (#120182)
* fix a TextFormField bug

* review feedback
2023-02-08 04:37:24 +00:00
Renzo Olivares
99b6bd8c05
Add support for extending selection to paragraph on ctrl + shift + arrow up/down on Non-Apple platforms (#120151)
* Add support for extending selection to paragraph on ctrl + shift + arrow up/down for common keyboard actions

* Add ctrl + shift + arrow up/down common text editing shortcuts/actions

* fix analyzer

---------

Co-authored-by: Renzo Olivares <roliv@google.com>
2023-02-08 02:55:26 +00:00
Justin McCandless
0b0450fbff
Web tab selection (#119583)
Correct selection behavior when tabbing into a field on the web.
2023-02-07 11:52:51 -08:00
Konstantin Sokolovskyi
a6ea64457a
Fix cut button creation in 'buttonItemsForToolbarOptions' (#119822)
* Fix cut button creation in buttonItemsForToolbarOptions

* Remove extra spaces in tests

* Replace fails with expects, Add periods in the comments
2023-02-07 08:45:50 -05:00
xubaolin
1d0cbbb244
fix a [SelectableRegion] crash bug (#120076)
* fix a crash bug

* review feedback
2023-02-07 06:10:06 +00:00
Haroon Awan
40b5e4cb5e
Added "insertAll" and "removeAll" methods to AnimatedList (#115545)
* Added "insertAll" and "removeAll" method to AnimatedList

* Fixed doc

* Changes in documentation asked by reviewwer

* Removed unnecessary asserts.

* Doc changes asked by reviewer.

* Doc changes.

---------

Co-authored-by: Rashid Khabeer <rkhabeer84@gmail.com>
2023-02-06 16:45:39 +00:00
Callum Moffat
3f02d4b4c3
Tweak to floating-cursor-end behaviour (#119893)
* Tweak to floating-cursor-end behaviour

* Simplify
2023-02-03 22:29:00 +00:00
Jonah Williams
69421c1682
[framework] use shader tiling instead of repeated calls to drawImage (#119495)
* [framework] use shader tiling instead of repeated calls to drawImage

* ++

* ++

* review and test updates

* ++

* Update decoration_image.dart

* Update decoration_image.dart

* ++

* ++

* ++

* ++

* ++

* Update painting.dart

* Update decoration_test.dart
2023-02-03 07:28:57 +00:00
Greg Spencer
c6264605d9
Make _focusDebug not interpolate in debug mode (#119680)
* Make _focusDebug not interpolate in debug mode

* Add test

* Revert undesired change

* Fix test to fail before too

* Remove accidental skips

* Switch to using a generating closure for arguments.

* Remove a word
2023-02-03 01:27:20 +00:00
Michael Goderbauer
b0f1714b7b
Make Flex,Row,Column const for real (#119673)
* Make Flex,Row,Column const for real

* dart fix --apply

* fix snippets

* fix integration test

* add comment
2023-02-02 19:33:57 +00:00
Jason Simmons
cd118dada9
Update a test expectation that depended on an SkParagraph fix (#119756)
This assertion had been disabled because a bug fix was pending in
SkParagraph.  This PR updates it to match the new behavior.

See https://github.com/flutter/flutter/pull/119653
2023-02-01 22:55:02 +00:00
Michael Goderbauer
7a926dcb03
Deprecate MediaQuery[Data].fromWindow (#119647)
* Deprecate MediaQuery[Data].fromWindow

* ++

* dart fix
2023-02-01 22:44:00 +00:00
Phil Quitslund
5613ab010d
remove unnecessary parens (#119736) 2023-02-01 19:19:13 +00:00
Jason Simmons
fbe9ff33e6
Disable an inaccurate test assertion that will be fixed by an engine roll (#119653)
https://skia-review.googlesource.com/c/skia/+/619838 fixes a bug in
SkParagraph.  One of the selectable region tests relies on the old
behavior.

After that Skia change rolls into the framework, the update to the test
in https://github.com/flutter/flutter/pull/118902 should be landed.
2023-01-31 22:17:43 +00:00
Tanay Neotia
0e22aca785
Add support for image insertion on Android (#110052)
* Add support for image insertion on Android

* Fix checks

* Use proper Dart syntax on snippet

* Specify type annotation on list

* Fix nits, add some asserts, and improve example code

* Add missing import

* Fix nullsafety error

* Fix nullsafety error

* Remove reference to contentCommitMimeTypes in docs

* Fix nits

* Fix warnings and import

* Add test for content commit in editable_text_test.dart

* Check that URIs are equal in test

* Fix nits and rename functions / classes to be more self-explanatory

* Fix failing debugFillProperties tests

* Add empty implementation to `insertContent` in TextInputClient

* Tweak documentation slightly

* Improve docs for contentInsertionMimeTypes and fix assert

* Rework contentInsertionMimeType asserts

* Add test for onContentInserted example

* Switch implementation to a configuration class for more granularity in setting mime types

* Fix nits

* Improve docs and fix doc tests

* Fix more nits (LongCatIsLooong)

* Fix failing tests

* Make parameters (guaranteed by platform to be non-nullable) non-nullable

* Fix analysis issues
2023-01-31 19:46:18 +00:00
Michael Goderbauer
6a5405925d
Make MultiChildRenderObjectWidget const (#119195) 2023-01-31 11:13:59 -08:00
Michael Goderbauer
2fccf4d471
Remove MediaQuery from WidgetsApp (#119377)
* Remove MediaQuery from WidgetsApp

* more

* fix test

* more deprecation notices.
2023-01-31 17:55:54 +00:00
Ian Hickson
d4c74858fd
Make Decoration.padding non-nullable (#119581)
The default implementation returns EdgeInsets.zero, the ShapeDecoration subclass already makes it non-nullable, and there isn't any benefit to returning null as far as I can tell.
2023-01-31 17:51:49 +00:00
LongCatIsLooong
1148a2a8ba
Migrate EditableTextState from addPostFrameCallbacks to compositionCallbacks (#119359)
* PostFrameCallbacks -> compositionCallbacks

* review

* review
2023-01-31 01:39:09 +00:00
Renzo Olivares
6c12e39947
Introduce ParagraphBoundary subclass for text editing (#116549)
* attempt to extend to paragraph

* second attempt

* clean up implementation

* clean up

* updates

* updates

* Fix implementation

* remove old

* update docs

* update docs

* fix analyzer

* Fix bug where new line character was selected and backwards selection failed

* remove print

* Add test for paragraph boundary

* Add text editing test for extending selection to paragraph for mac and ios

* rename to ExtendSelectionToParagraphBoundaryIntent

* fix analyzer

* Should default to downstream when collapsing selection

* get rid of _getParagraphAtOffset and move into getTextBoundaryAt

* Search for all line terminators

* iterate through code units instead of characters

* Address some reviewer comments"

* Add separate implementations for leading and trailing paragraph boundary methods

* Do not break after a carriage return if it is followed by a line feed

* test carriage return followed by a line feed

* more tests

* Do not continue if the line terminator is at the target text offset

* add hack to extend highlight to line terminator

* Revert "add hack to extend highlight to line terminator"

This reverts commit b4d3c434539b66c3c81c215e87c645b425902825.

* Revert "Do not continue if the line terminator is at the target text offset"

This reverts commit 789e1b838e54e7c25600bfa8852e59431ccaf5dc.

* Update ParagraphBoundary with latest TextBoundary changes

* Update implementation to iterate through indexes

* update getTrailingTextBoundaryAt to include the line terminator

* Updates

* more updates

* more updates

* updates

* updates

* Lets try this again

* clean up

* updates

* more updates

* updates

* fix

* Re-implement using custom paragraph boundary applying method

* Revert "Re-implement using custom paragraph boundary applying method"

This reverts commit cd2f7f4b6eb6726b28f82a43708812e06a49df95.

* Revert "fix"

This reverts commit 8ec1f8f58935cfb3eb86dc6afd2894537af4cf7b.

* updates

* Revert "updates"

This reverts commit 9dcca4a0031fe18ada9d6ffbbe77ba09918e82ae.

* Revert "Revert "fix""

This reverts commit 9cc1332cd3041badc472d0d223a106203e46afb8.

* Revert "Revert "Re-implement using custom paragraph boundary applying method""

This reverts commit 1acb606fb743fd840da20cca26d9a7c26accb71d.

* Fix paragraph boundaries

* Add failing test

* Address some comments

* group tests and fix analyzer

* fix typo

* fix remaining test

* updates

* more fixes and logs

* clean up and add another test

* Fix last test

* Add new test

* Clean up

* more clean up

* clean up comments

* address comments

* updates

* return null when position is out of bounds and 0 or end of text if appropriate

* Clean up cases

* Do not return null when OOB in the direction of iteration

* clean up

* simplify implementation thanks to LongCatIsLooong feedback

* Address comments

* Add line and paragraph separator

* Use _moveBeyondTextBoundary instead of custom _moveToParagraphBoundary

* Change some intent names and revert fromPosition change

* clean up docs

---------

Co-authored-by: Renzo Olivares <roliv@google.com>
2023-01-30 22:44:26 +00:00
Kate Lovett
e69ea6dee4
Support flipping mouse scrolling axes through modifier keys (#115610)
* Maybe maybe

* Nit

* One more nit

* ++

* Fix test

* REview feedback

* Add comment about ios

* ++

* Doc nit

* Handle trackpads

* Review feedback
2023-01-30 19:34:48 +00:00
Justin McCandless
17eb2e8aeb
Ability to disable the browser's context menu on web (#118194)
Enables custom context menus on web
2023-01-30 09:03:03 -08:00
Michael Goderbauer
e9ca9cc146
Remove references to dart:ui's window singelton (#119296) 2023-01-27 21:36:54 +00:00
Michael Goderbauer
0417f6621e
Fix nullability of TableRow.children (#119285)
* Fix nullablility of TableRow.children

* fix test
2023-01-27 17:30:46 +00:00
Michael Goderbauer
05fc29fe71
Rename DeviceGestureSettings.fromWindow to DeviceGestureSettings.fromView (#119291) 2023-01-27 00:34:39 +00:00
Todd Volkert
b319938ecd
Add more flexible image API (#118966)
This updates the framework to provide higher level wrappers around ui.instantiateImageCodecWithSize(). Functionally, this doesn't change anything (other than deprecating the older loadBuffer() method in favor of loadImage()), but it sets the stage for a simpler change that will allow us to provide a more flexible way to load sized images.

#118543
2023-01-25 21:21:28 -08:00
Michael Goderbauer
a45727d813
Add MediaQuery to View (#118004)
* Add MediaQuery to View

* unify API

* fix test

* add test

* comment

* better doc

* Apply suggestions from code review

Co-authored-by: Greg Spencer <gspencergoog@users.noreply.github.com>

Co-authored-by: Greg Spencer <gspencergoog@users.noreply.github.com>
2023-01-25 22:22:00 +00:00
Michael Goderbauer
0dd63d3310
Export View (#117475) 2023-01-25 18:58:23 +00:00
Ahmed Ashour
c35efdaa68
Remove superfluous words. (#119008)
* Remove superfluous words.

* Update packages/flutter/lib/src/widgets/slotted_render_object_widget.dart

Co-authored-by: Michael Goderbauer <goderbauer@google.com>
2023-01-24 01:57:00 +00:00
Samina Rahman Purba
80658873bc
Add transform flip (#116705)
* Added Transform.flip

* Add tests for Transform.flip

* fix: failing tests

* fix the failing test

* fix test according to review

* Make z component constant, update doc

* Disabled changing alignment

* Apply suggested definition

Co-authored-by: Greg Spencer <gspencergoog@users.noreply.github.com>

Co-authored-by: nayeemtby <nayeemtby@gmail.com>
Co-authored-by: Nayeem Hasan <71181265+nayeemtby@users.noreply.github.com>
Co-authored-by: Greg Spencer <gspencergoog@users.noreply.github.com>
2023-01-21 19:20:28 +00:00
Michael Goderbauer
bb73121cb4
Remove unnecessary null checks in flutter/test (#118905) 2023-01-20 22:09:06 +00:00
Michael Goderbauer
11d21e066b
Add @pragma('vm:entry-point') to RestorableRouteBuilder arguments (#118738) 2023-01-18 22:56:24 +00:00
Bruno Leroux
0eaa83ad63
Fix some Focus related documentation typos (#118576)
* Fix focus area documentation typos

* Restore intentional spaces that illustrate bigger buttons
2023-01-18 00:01:18 +00:00
Greg Spencer
ae7b99efb5
Rename _*Marker classes to be _*Scope, for consistency (#118070)
* Rename _*Marker classes to be _*Scope, for consistency

* [EMPTY] Commit to refresh the tree that is currently red (#118062)

* Fix remaining tests

Co-authored-by: Drew Roen <102626803+drewroengoogle@users.noreply.github.com>
2023-01-17 18:55:22 +00:00
Daniel Chevalier
cc7845e71a
Post a ToolEvent when selecting widget for inspection (#118098)
Changes our inspection behaviour so that it also sends a postEvent on the ToolEvent stream.
2023-01-17 08:44:08 -05:00
Bernardo Ferrari
0752af841e
Add allowedButtonsFilter to prevent Draggable from appearing with secondary click. (#111852)
* DragTarget part 1.

[WIP] Change GestureRecognizer. Sorry.

[WIP] Move from GestureRecognizer to MultiDragGestureRecognizer.

Make it a `Set<int>?`

Get bitwise operations working.

Fix test. Rename to allowedInputPointers.

Convert into a builder.

Improve code with default funciton.

Refactor everything again.

Rename to buttonEventFilter.

Use static function.

Fix analyzer.

Fix private reference.

Use // in private method.

* Fix Renzo request.

* Add `allowedButtonsFilter` everywhere.

* Refactor monoDrag for multi pointer support.

* Fix tests?

* Change default to always true.

* Fix PR comments.

* Completely refactor long press.

* Add forgotten class.

* Revert "Completely refactor long press."

This reverts commit 5038e8603e250e8c928b0f1754fb794b7b75738b.

* Add default value to LongPress

* Refactor doubleTap.

* Relax double tap.

* Write comment in LongPress.

* Use template.
2023-01-13 05:45:49 +00:00
Taha Tesser
5d96d619d8
Add MaterialStateProperty overlayColor & mouseCursor and fix hovering on thumbs behavior (#116894) 2023-01-10 13:40:04 +00:00
Yegor
4205357554
add closed/open focus traversal; use open on web (#115961)
* allow focus to leave FlutterView

* fix tests and docs

* small doc update

* fix analysis lint

* use closed loop for dialogs

* add tests for new API

* address comments

* test FocusScopeNode.traversalEdgeBehavior setter; reverse wrap-around

* rename actionResult to invokeResult

* address comments
2023-01-10 02:08:34 +00:00
Lucas.Xu
478d1dae77
remove the unused check in selectable_text (#117716) 2023-01-09 16:03:34 +00:00
Callum Moffat
7ddf42eae5
InteractiveViewer parameter to return to pre-3.3 trackpad/Magic Mouse behaviour (#114280)
* trackpadPanShouldActAsZoom

* Address feedback

* Move constant, add blank lines
2023-01-06 22:44:44 +00:00
LongCatIsLooong
0a2e0a4730
Avoid using TextAffinity in TextBoundary (#117446)
* Avoid affinity like the plague

* ignore lint

* clean up

* fix test

* review

* Move wordboundary to text painter

* docs

* fix tests
2023-01-05 17:04:15 +00:00
Renzo Olivares
9080d1acc5
Reland "Add support for double tap and drag for text selection #109573" (#117502)
* Revert "Revert "Add support for double tap and drag for text selection (#109573)" (#117497)"

This reverts commit 39fa0117a919bd401c4c8734c97ddb46fbc45cb7.

* Allow TapAndDragGestureRecognizer to accept pointer events from any devices -- the TapGestureRecognizer it replaces was previously doing this

Co-authored-by: Renzo Olivares <roliv@google.com>
2023-01-04 00:54:10 +00:00
Tae Hyung Kim
a7942e80d4
Add convenience constructors for SliverList (#116605)
* init

* lint

* add the other two slivers

* fix lint

* add test for sliverlist.separated

* add3 more

* fix lint and tests

* remove trailing spaces

* remove trailing spaces 2

* fix lint

* fix lint again
2023-01-03 22:33:55 +00:00
Michael Goderbauer
fdc25a1700
Reland "Remove single-view assumption from ScrollPhysics (#117503)" (#117916)
This reverts commit c956121ac098b91061bfc0a93c930121ff3279ba.
2023-01-03 21:34:08 +00:00
Xilai Zhang
c956121ac0
Revert "Remove single-view assumption from ScrollPhysics (#117503)" (#117647)
This reverts commit 999356b776f70132d569a37f13f65333a1bb0779.
2022-12-27 21:22:16 +00:00
Michael Goderbauer
6eb002a167
Reland "Remove single-view assumption from widgets library (#117480)" (#117549)
* Revert "Revert "Remove single-view assumption from widgets library (#117480)" (#117545)"

This reverts commit b8d5d9c46ca084a707caa1e994d896cb977662d2.

* check for mounted
2022-12-22 22:05:25 +00:00