10689 Commits

Author SHA1 Message Date
Justin McCandless
98aaf00a09
Fix the position of the Android-style spell check toolbar (#124897)
The spell check menu now appears directly below the misspelled word on Android.
2023-04-24 10:26:47 -07:00
Callum Moffat
e84daf3b70
Adjust selection rects inclusion criteria (#125022)
Include rects with any overlap instead of only when top-left or bottom-right included. The previous criteria didn't send any selection rects when text was taller than the text box and scroll offset was not zero.

Part of #30476
2023-04-22 01:40:20 +00:00
Luccas Clezar
f86b9220a3
Update Cupertino desktop text selection toolbar (#121829)
Visual fidelity of the right-click context menu on MacOS.
2023-04-21 16:03:34 -07:00
chunhtai
8a815c1d1d
Remove unecessary reference to ClipboardStatusNotifier (#125255)
fixes https://github.com/flutter/flutter/issues/99360
2023-04-21 22:38:06 +00:00
Hugo
d93ffc10c4
Fix the divider_theme space documentation problem (#125195)
In the specific implementation, the Divider uses the "space" field as the height for horizontal dividers, and the "space" field as the width for VerticalDivider , which is different from the documentation description.
2023-04-21 21:59:08 +00:00
Greg Spencer
11f8ee5bb0
Add docs for kIsWeb on defaultTargetPlatform (#125313)
## Description

Adding some see also links to connect `defaultTargetPlatform` and `kIsWeb` docs.
2023-04-21 19:11:29 +00:00
Justin McCandless
8784eb1d8e
Red spell check selection on iOS (#125162)
iOS now hides the selection handles and shows red selection when tapping a misspelled word, like native.
2023-04-21 09:15:08 -07:00
Bruno Leroux
d4f884e000
Make selectable text mouse cursor configurable (#125133)
## Description

This PR introduces `DefaultSelectionStyle.mouseCursor` to configure the mouse cursor over selectable text.
It also applies this solution to `InkResponse` to make the mouse cursor win over the default one provided by selectable `Text` for many Material components (such as buttons). 

### Before

https://user-images.githubusercontent.com/840911/233627729-ddf98e2a-444d-4c6d-a6d5-f521982f48dd.mov

### After

https://user-images.githubusercontent.com/840911/233627718-8871a68f-d33c-44cf-b4a1-91bb1fcdf076.mov

## Related Issue

Fixes https://github.com/flutter/flutter/issues/104595

## Tests

Adds 6 tests.
2023-04-21 13:43:37 +00:00
Hans Muller
5d3c1ca870
Updated the BottomNavigationBar API doc to link to NavigationBar (#125240)
The BottomNavigationBar API doc now makes it clear that NavigationBar is preferred in new M3 applications.

Fixes https://github.com/flutter/flutter/issues/124687
2023-04-20 23:21:05 +00:00
Chris Bobbe
58e30852e6
BottomAppBar doc: Fix doc about surfaceTintColor (#124563) 2023-04-20 15:39:24 -07:00
Renzo Olivares
01b4dd5eee
Toolbar should re-appear on drag end (#125165)
#125151 introduced the magnifier on touch drag gestures, but when showing the magnifier the toolbar is implicitly hidden, this change makes the toolbar re-appear on drag end for double tap + drag.
2023-04-20 22:34:35 +00:00
Ian Hickson
55825f166e
Remove dynamic calls (#125238)
I don't know what I was thinking when I wrote this code back in 2017 but this is so trivially fixable...
2023-04-20 20:09:12 +00:00
Tae Hyung Kim
9caabdd220
Revert "Sliver Constrained Cross Axis" (#125233)
Going to make some changes to the implementation so I'll revert in the meantime.

Reverts flutter/flutter#124337
2023-04-20 18:47:50 +00:00
9oya
0c7bc2f9c9
Implement CheckmarkableChipAttributes on ChoiceChip (#124743) 2023-04-20 11:43:49 -07:00
Justin McCandless
13f4fe4091
Show iOS menu on iOS for TextField by default (#124895)
Even in TextField using the Material library, iOS devices will still show the iOS-style spell check toolbar by default when using spell check.
2023-04-20 11:09:37 -07:00
xubaolin
9f2e708831
DropdownMenu.width should support updating at runtime (#124847)
Fixes https://github.com/flutter/flutter/issues/120567
2023-04-20 11:39:25 +00:00
Qun Cheng
3315b25740
Make search view shape clip the view content (#125161)
Fixes #124426

This PR is to make the search view shape clip the view content.

Before: the highlight and the "i" of "item 9" are not clipped by the shape.

<img width="350" alt="Screenshot 2023-04-19 at 12 09 48 PM" src="https://user-images.githubusercontent.com/36861262/233201222-468820a9-8717-4b6c-8528-8125a40fc161.png">

After:

<img width="350" alt="Screenshot 2023-04-19 at 2 13 52 PM" src="https://user-images.githubusercontent.com/36861262/233201609-81f5a942-2390-4081-a9c7-c9523a7f9e72.png">
2023-04-20 04:50:52 +00:00
Renzo Olivares
8ed26d8b8e
Show magnifier on touch drag gestures (#125151)
This change shows the magnifier on touch drag gestures for Android and iOS and hides it when the drag ends.

Fixes #118268
2023-04-20 04:49:05 +00:00
xubaolin
73f7945ba2
fix DropdownMenu crash when resize window during menu showing (#124855) 2023-04-19 14:21:49 -07:00
chunhtai
14e191fa75
Revert selectable update back to be a postframecallback or microtask (#125140)
The regression was caused by the previous pr https://github.com/flutter/flutter/pull/124624 changes postframecallback to scheduleframecallback. The reason is that if a new postframecallback was scheduled when running a postframecallback. The newly added postframecallback will be execute on the next frame. However, adding postframecallback will not schedule a new frame. So if there isn't other widget that schedule a new frame, the newly added postframecallback will never gets run.

After changing to scheduleframecallback, it causes an issue that transient callback may be called when rendering tree contains dirty layout information that are waiting to be rebuilt.

Therefore, I use microtask to get around of the postframecallback issue instead of scheduleframecallback.

fixes https://github.com/flutter/flutter/issues/125065
2023-04-19 19:48:12 +00:00
Qun Cheng
4c6929d4c9
Dismiss the docked search view when the window size is changed (#125071) 2023-04-19 11:23:20 -07:00
Justin McCandless
3128df832a
Disableable ContextMenuButtonItems (#124253)
Fixes https://github.com/flutter/flutter/issues/124247

| Native | Flutter before | Flutter after |
| --- | --- | --- |
| <img width="248" alt="Screenshot 2023-04-05 at 9 26 16 AM" src="https://user-images.githubusercontent.com/389558/230177116-154999e8-eef3-441d-9fe9-7063839a6b99.png"> | <img width="240" alt="Screenshot 2023-04-05 at 11 18 01 AM" src="https://user-images.githubusercontent.com/389558/230177125-1680e851-223e-4956-b5b6-1a24e11dc22a.png"> | <img width="226" alt="Screenshot 2023-04-05 at 11 17 36 AM" src="https://user-images.githubusercontent.com/389558/230177123-bde82134-67e1-4ce2-8eec-719eeb779bf4.png"> |

Also, it's now possible for anyone to create disabled buttons like this by setting ContextMenuButtonItem.onPressed to `null`.
2023-04-19 00:09:34 +00:00
Mitchell Goodwin
bd2617ecb9
Adaptive alert dialog (#124336)
Fixes #102811. Adds an adaptive constructor to AlertDialog, along with the adaptive function showAdaptiveDialog.

<img width="357" alt="Screenshot 2023-04-06 at 10 40 18 AM" src="https://user-images.githubusercontent.com/58190796/230455412-31100922-cfc5-4252-b8c6-6f076353f29e.png">
<img width="350" alt="Screenshot 2023-04-06 at 10 42 50 AM" src="https://user-images.githubusercontent.com/58190796/230455454-363dd37e-c44e-4aca-b6a0-cfa1d959f606.png">
2023-04-18 23:00:03 +00:00
Srujan Gaddam
6edbc19597
Remove package:js/dart:js_interop conflicts (#124879)
dart:js_interop and package:js will start conflicting, since they both have an `@JS` annotation. Until we're ready to only use dart:js_interop (which will require updating the SDK constraints of every package), we should hide the `@JS` annotation from dart:js_interop. Due to shadowing, this is the behavior today, so there should be no functional change.

Unblocks https://dart-review.googlesource.com/c/sdk/+/294130/8 and prevents confusing shadowing of dart:js_interop annotations like we do today.

- [Mentioned CL that is unblocked] I listed at least one issue that this PR fixes in the description above.
- [Need test-exemption] I added new tests to check the change I am making, or this PR is [test-exempt].
- [Need to run] All existing and new tests are passing.
2023-04-18 22:15:53 +00:00
Greg Spencer
4b39f071f3
Add controller argument to SubmenuButton (#125000)
## Description

This adds an optional argument to the `SubmenuButton` that allows the creator to supply a `MenuController` for controlling the menu.

## Related Issues
 - Fixes https://github.com/flutter/flutter/issues/124988

## Tests
 - Added tests for new argument.
2023-04-18 21:09:53 +00:00
Justin McCandless
f04a5afb58
Limit the number of Material spell check suggestions to 3 (#124899)
Fixes a bug where the spell check menu could overflow.
2023-04-18 12:50:12 -07:00
Michael Goderbauer
df811c6d79
Remove unused getRootRenderObject and getSelectedRenderObject service extensions (#124805)
These are currently unused and will not work in a multi-view environment where we will have multiple render trees.

Work towards https://github.com/flutter/flutter/issues/121573.
2023-04-18 18:54:27 +00:00
Justin McCandless
9d6883135a
Remove unused context parameter (#124254)
Tidying up the spell check API.
2023-04-18 10:31:05 -07:00
Justin McCandless
39becb7770
iOS spell check cursor placement (#124875)
Fixes the cursor location after selecting a spell check result on iOS.
2023-04-18 10:18:41 -07:00
Tirth
5de716f7f8
[InputDatePickerFormField] adds acceptEmptyDate to InputDatePickerFormField Widget (#124143)
Adds `acceptEmptyDate` property to `InputDatePickerFormField`.

Fixes: #117511

| `acceptEmptyDate` is **false** | `acceptEmptyDate` is **true** |
| --- | ---|
| ![acceptemptydate_false](https://user-images.githubusercontent.com/13456345/229893658-280ecdee-d509-4579-b53c-9d8d485c61b4.gif) | ![acceptemptydate__true](https://user-images.githubusercontent.com/13456345/229895144-115e71bd-e5bb-4653-8db2-9f57dd8262aa.gif) |
2023-04-18 09:33:30 +00:00
Viren Khatri
3ba249a6b3
relayout active ListWheelScrollView children every performLayout (#124476)
during performLayout, active children's constraints were updated, but they weren't laid out again w.r.t their parent (ListWheelScrollView).

Fixes #123497
2023-04-18 05:16:33 +00:00
Kate Lovett
e867d1c686
Add optional axis specifier to static scrollable methods (#124894)
This is motivated by part of the 2D scrolling proposal: [flutter.dev/go/2D-Foundation](https://flutter.dev/go/2D-Foundation)

This is one of the last little PRs to prep for the 2D scrolling foundation. 
This adds an optional `axis` parameter to the static Scrollable methods `[of, maybeOf, recommendDeferredLoadingForContext]`. This allows developers that are nesting scrollables (or one day using 2D scrolling) to look them up instead by a particular axis.

In general, even outside the context of 2D, I think this is helpful. I am often asked how to get the outer scrollable when nesting. Now it can be done.

There is also a small semantic refactor here in ScrollableState.build, this just creates a private method (_buildChrome) that will be overridden in 2D later. It is easier to add now than in the really big PR that will be.
2023-04-18 00:08:07 +00:00
Qun Cheng
6e85113418
Add an example for SearchBar (#124992)
This PR is to: 
* Update API doc for `SearchBar`.
* Add an example to show how to use a `SearchBar` as the builder of the `SearchAnchor`.
2023-04-17 23:23:57 +00:00
chunhtai
cc9ffd3f3b
SelectionContainer's listeners can remove itself during listener call… (#124624)
When swapping out delegate of  selectioncontainer, if the newly passed in delegate doesn't have any selectable content(which is usually the case), the selectioncontainerstate will notify all of the listeners. One of the listener would be SelectionRegistrant._updateSelectionRegistrarSubscription, and since it doesn't have content, it would remove itself from the listener which causes concurrent modification
2023-04-17 23:19:11 +00:00
Taha Tesser
15cb1f84d7
Fix Chip highlight color isn't drawn on top of the background color (#124673) 2023-04-17 13:41:55 -07:00
chunhtai
7424f3448d
Deprecates string for reorderable list in material_localizations (#124711)
deprecates the these strings since they are now moved into widgetslocalizations

migration guide https://github.com/flutter/website/pull/8543/files
2023-04-17 20:03:06 +00:00
hangyu
2f45458e2c
Fix a null crash in SelectableRegion Widget (#124736)
issue #123378
2023-04-17 19:59:06 +00:00
Mubarak Bakarman
df8d819410
Customize color and thickness of connected lines in Stepper.dart (#122485) 2023-04-17 12:52:48 -07:00
Jonah Williams
00495da0b5
Revert "[framework] use shader tiling instead of repeated calls to drawImage" (#124640)
Reverts flutter/flutter#119495

We'll managed to optimize almost all of the cases that made this slow. Actually, it will soon be harder to optimize shader tiling...
2023-04-15 22:04:20 +00:00
Jonah Williams
d1d426e5a8
[cupertino] improve cupertino picker performance by using at most one opacity layer (#124719)
Fixes https://github.com/flutter/flutter/issues/124703

Rather than applying an opacity layer per picker item, apply them to all partially opaque picker items at once. This dramatically improves performance for impeller, by reducing the number of required subpasses and texture allocations signficantly.

Before:
Doesn't finish, 100s of passes

After:

![image](https://user-images.githubusercontent.com/8975114/231569280-91f55c9a-53a5-4b75-8728-59a4dceebe81.png)

![image](https://user-images.githubusercontent.com/8975114/231569309-7c82e5ff-46c7-4f00-80f0-9b4096aa4b14.png)

See also:

https://github.com/flutter/flutter/issues/124658
2023-04-15 22:00:48 +00:00
hangyu
4d6ef78ca5
Add optional labelText and semanticLabel to Checkbox (#124555)
Re-open from https://github.com/flutter/flutter/pull/116551

This PR added optional labelText (which will be  rendered side by side with Checkbox in the future, and thus is also announced by default by screen readers), and semanticLabel(which will be announced by screen reader if provided, overrides labelText, in order to do that we might want to wrap the Text widget inside ExcludeSemantics in the future).

Issues fixed:
[b/239564167]
2023-04-14 22:40:10 +00:00
Justin McCandless
119744a63c
iOS context menu shadow (#122429)
Update the visuals of the iOS context menu to match iOS 16.3.1 more closely.
2023-04-14 10:43:17 -07:00
Tirth
aa8cc44e03
[CupertinoListSection] adds new property separatorColor (#124803)
Adds new property `separatorColor` to `CupertinoListSection` widget.

Fixes: #124744

### `separatorColor` property is null

<img src="https://user-images.githubusercontent.com/13456345/231840875-22605c23-ee9f-464f-a005-c9fce1b641a7.png" width=350>

### `separatorColor` property is not-null

| Color.fromARGB(255, 136, 13, 207) | Color.fromARGB(255, 13, 62, 207) | Color.fromARGB(255, 29, 207, 13) |
| --- | --- | --- |
| ![a](https://user-images.githubusercontent.com/13456345/231840832-6027cf86-e9c0-4206-b6f8-23556471c1bd.png) | ![b](https://user-images.githubusercontent.com/13456345/231840862-dcc30212-14f8-44af-a8cb-d04b22b7a078.png) | ![c](https://user-images.githubusercontent.com/13456345/231840870-d9fafe23-e9a4-423a-a25c-b71835991d07.png) |
2023-04-14 17:19:19 +00:00
Taha Tesser
4c41c0dbcd
Fix CupertinoContextMenu throws exception on route animation (#124785)
Fix `CupertinoContextMenu` throws exception on route animation
2023-04-14 01:59:11 +00:00
Taha Tesser
55dc9f93ea
Refactor SliverAppBar.medium & SliverAppBar.large to fix several issues (#122542)
Refactor `SliverAppBar.medium` & `SliverAppBar.large` to fix several issues
2023-04-13 18:54:08 +00:00
Justin McCandless
62cb61d3f3
Improve the docs around the TextSelectionHandleControls deprecations (#123827)
Explain how to do the two-step migration to the context menus feature.
2023-04-13 10:13:13 -07:00
Justin McCandless
8abeefef91
Localize the 'No Replacements Found' spell check string (#124259)
Localize the 'No Replacements Found' spell check string
2023-04-12 22:15:05 +00:00
Bernardo Ferrari
2e4d976bde
SemanticsFlag/SemanticsAction cleanup (part 4) (#123329)
`SemanticsFlag`/`SemanticsAction` cleanup (part 4)
2023-04-12 19:07:08 +00:00
Nabeel Parkar
6d01ae1377
Bug report 2 issue template (#122385)
Bug report 2 issue template
2023-04-12 11:06:16 +00:00
Bernardo Ferrari
56e4f8e0ff
Add StrokeCap to CircularProgressIndicator (#122664)
Add `StrokeCap` to `CircularProgressIndicator`
2023-04-12 00:35:46 +00:00