Alex Medinsh
ce058e0be0
Trigger CupertinoPicker haptics in the middle of the item ( #169670 )
...
Towards https://github.com/flutter/flutter/issues/169606
This PR only fixes the haptic behaviour of `CupertinoPicker`, which now
triggers only when passing the middle of the item. Haptic feedback is
now also not trigger when tapping on an item to scroll to.
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
2025-06-06 21:21:15 +00:00
Victor Sanni
b5c1bbef58
Align persistent nav bar leading widget ( #170095 )
...
| Before | After |
| --- | --- |
| <img width="381" alt="before leading"
src="https://github.com/user-attachments/assets/ffd22324-75a4-4ff8-a06c-87f9148c198c "
/> | <img width="381" alt="after leading"
src="https://github.com/user-attachments/assets/36a1cd49-856b-462f-b321-6a016ffed382 "
/> |
Fixes [CupertinoNavigationBar leading is too
high](https://github.com/flutter/flutter/issues/18536 )
2025-06-06 19:18:19 +00:00
Victor Sanni
b05da524ae
CupertinoSearchTextField and CupertinoSliverNavigationBar.search more fidelity updates ( #169708 )
...
This PR does the following:
## Show large title mid-transition if automaticallyImplyLeading is false
(see
https://github.com/flutter/flutter/pull/169708#issuecomment-2922792587 )
## Correct color for the CupertinoSearchTextField placeholder
(see
https://github.com/flutter/flutter/issues/163020#issuecomment-2660522169 )
| Dark mode | Light mode |
| --- | --- |
| <img width="381" alt="placeholder color dark mode"
src="https://github.com/user-attachments/assets/e37e23fa-9f4f-495e-8f02-b9c38a4faffb "
/> | <img width="381" alt="placeholder color light mode"
src="https://github.com/user-attachments/assets/16e24a61-2528-44e0-9afa-8431487cf5ff "
/> |
And also:
- Removes flaky mid-transition goldens
- Fixes a CupertinoTextField crash caused by
https://github.com/flutter/flutter/pull/166952 where size > constraints
Fixes [Improve fidelity of CupertinoSliverNavigationBar.search and
CupertinoSearchTextField](https://github.com/flutter/flutter/issues/163020 )
2025-06-03 23:16:41 +00:00
chunhtai
d0058ec361
Adds radio group widget r2 ( #168161 )
...
<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->
previous https://github.com/flutter/flutter/pull/167363
I have to factor out abstract class for RadioGroupRegistry and
RadioClient which are subclassed by RadioGroupState and RawRadio
respectively.
I have to do this because the RadioListTile that has 2 focusnode one for
listTile and one for the radio it builds. The issue is that RadioGroup's
keyboard shortcut has to tightly couples with the focus node of each
radio, but the radioListtile has to mute the radio's focusnode so it can
act as one control under keyboard shortcut
d582b35809/packages/flutter/lib/src/material/radio_list_tile.dart (L484)
Therefore i abstract the out the logic of RadioGroup so that another
widget can participate by implementing the interface.
fixes https://github.com/flutter/flutter/issues/113562
migration guide: https://github.com/flutter/website/pull/12080/files
## Pre-launch Checklist
- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-06-02 19:03:51 +00:00
Tong Mu
df5f865a6b
[Cupertino] Apply RSuperellipse to most Cupertino widgets ( #167784 )
...
This PR applies RSuperellipse to most Cupertino widgets. I got the list
by searching for `ClipRRect`, `drawRRect`, and `BoxDecoration` (with
`borderRadius`) through the package. They're replaced by
`ClipRSuperellipse`, `drawRSuperellipse`, and `ShapeDecoration`
respectively.
There are a few widgets that I didn't apply:
* `CupertinoTextField` as well as its related widget
`CupertinoSearchTextField`, because `CupertinoTextField` expects a
`BoxDecoration` argument. Migrating it is nontrivial and will take place
in a separate PR.
* `CupertinoTextSelectionToolbar`, because it seems complicated
(containing a lot of paths). I wonder if it's possible to replace the
clipPath with clipRRect/clipRSe for better performance.
* `CupertinoSwitch`. I suspect it's not an squircle since it tightly
contains a full circle.
Fixes https://github.com/flutter/flutter/issues/13914 .
## Pre-launch Checklist
- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-05-26 21:55:10 +00:00
Victor Sanni
16e5318e26
Correct calculation for CupertinoTextSelectionToolbar vertical position ( #169308 )
...
[Size CupertinoTextSelectionToolbar to
children](https://github.com/flutter/flutter/pull/133386 ) made a slight
mistake when calculating if the toolbar should be above or below the
text field.
Doubling the toolbar arrow height in the `_isAbove `calculation added a
buffer of its height (7.0) within which the toolbar would be positioned
below the text but have its arrow still pointing downwards. This is why
[I was only able to reproduce the bug within a 7.0 height
range](https://github.com/flutter/flutter/issues/154812#issuecomment-2774094819 ).
| Before | After |
| --- | --- |
| <img width="377" alt="toolbar pos before"
src="https://github.com/user-attachments/assets/11f63cf3-f352-4232-8230-f04da89b0b4c "
/> | <img width="377" alt="toolbar pos after"
src="https://github.com/user-attachments/assets/4a48c3bd-158e-468e-9c67-af125c7856a7 "
/> |
<details>
<summary>Sample code</summary>
```dart
import 'package:flutter/cupertino.dart';
void main() => runApp(const TextSelectionToolbarApp());
class TextSelectionToolbarApp extends StatelessWidget {
const TextSelectionToolbarApp({super.key});
@override
Widget build(BuildContext context) {
return CupertinoApp(
home: const CupertinoPageScaffold(
child: SafeArea(
child: ColoredBox(
color: Color(0x11ff0000),
child: Padding(
padding: EdgeInsets.symmetric(vertical: 56.0, horizontal: 8.0),
child: Column(
children: [
CupertinoTextField(),
],
),
),
),
),
),
);
}
}
```
</details>
Fixes [Cupertino Text Selection Toolbar has wrong
position](https://github.com/flutter/flutter/issues/154812 )
2025-05-24 04:23:06 +00:00
Victor Sanni
3df4a3c6a5
Baseline-align CupertinoTextField placeholder ( #166952 )
...
| Before | After |
| --- | --- |
| <img width="348" alt="non baseline aligned placeholder"
src="https://github.com/user-attachments/assets/62f779cc-1d16-41f3-92f8-a2de16a04895 "
/> | <img width="348" alt="baseline aligned placeholder"
src="https://github.com/user-attachments/assets/e43d200f-ef47-4d10-a74a-a2c6998b44f5 "
/> |
Fixes [Can't align placeholder of CupertinoTextField with min lines to
top](https://github.com/flutter/flutter/issues/138794 )
2025-05-24 04:23:06 +00:00
Victor Sanni
df3d1bdc3d
Replace goldens in test/cupertino/nav_bar_transition_test.dart ( #169172 )
...
Fixes [Replace golden tests in
test/cupertino/nav_bar_transition_test.dart](https://github.com/flutter/flutter/issues/169169 )
Removed one of the clipping tests because it is already covered by the
other test. The tests become a little more brittle (now using type
checks etc), but no more flaky goldens.
2025-05-22 22:35:13 +00:00
Renzo Olivares
c31247a7b3
Fix crash on two finger selection gesture ( #168598 )
...
This change blocks two selection handles from being able to be dragged
simultaneously on iOS and the web, this matches the native behavior. On
native Android both handles can still be dragged simultaneously this is
the behavior observed on Google Keep/ Google Messages and Android's
EditText.
Also fixes an issue on iOS where the magnifier would not return after
hiding when double tapping and dragging to select and then dragging
outside the TextField area. The cause of this issue was because
editableText.showMagnifier decides whether to update the magnifier
position or show a new one based on whether it was visible, so when it
was hidden and we attempt to update it's position, it would try to show
a new magnifier which left the magnifier in a broken state. This change
makes editableText.showMagnifier depend on whether a magnifier exists
instead of just checking it's visibility. Similarly
editableText.hideMagnifier now does not depend on the magnifier
visibility, instead it internally (selectionOverlay.hideMagnifier)
checks if the magnifier exists.
Fixes #168578
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
---------
Co-authored-by: Renzo Olivares <roliv@google.com>
2025-05-22 21:43:54 +00:00
Mohellebi abdessalem
ffe8554f4a
refactor the usage of MediaQuery.sizeOf(context).height to use the new .heightOf(context) ( #168894 )
...
Replace the usage of MediaQuery.sizeOf(context).height with
MediaQuery.hieghtOf(context)
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-05-22 16:51:10 +00:00
Onnimanni Hannonen
4065d3c7ee
TextField magnifier stuck on long press cancel ( #167881 )
...
<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->
## Fixes #167879
This PR fixes bug where magnifier and floating cursor get stuck on
screen when long press is cancelled (eg. by closing the app).
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-05-16 22:39:54 +00:00
Renzo Olivares
6de5aed91f
Fix selection handles showing when using a mouse ( #168751 )
...
Fixes #168252
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
---------
Co-authored-by: Renzo Olivares <roliv@google.com>
2025-05-15 22:13:16 +00:00
Victor Sanni
736087e9a4
CupertinoSliverNavigationBar respects accessibility text scaling ( #168866 )
...
Dupe of https://github.com/flutter/flutter/pull/167313 (closed because
of issues with Google testing)
Fixes [Cupertino nav bars should respect accessibility text
scaling](https://github.com/flutter/flutter/issues/167248 )
Fixes [Title jumps during a CupertinoNavigationBar ->
CupertinoNavigationBar hero
transition](https://github.com/flutter/flutter/issues/90589 )
## Before
| Regular | Scaled |
| --- | --- |
| <img width="378" alt="Image"
src="https://github.com/user-attachments/assets/0e010c06-253f-41a5-9b23-18c6d1f75046 "
/> | <img width="378" alt="Image"
src="https://github.com/user-attachments/assets/7033f879-3e68-4e5e-94d1-cc84383d6d5d "
/> |
## After
| Regular | Scaled |
| --- | --- |
| <img width="375" alt="flutter nav bar unscaled"
src="https://github.com/user-attachments/assets/ff761339-358e-4fa5-a0c2-b0f43f6cea2e "
/> | <img width="376" alt="flutter after 2 textscale"
src="https://github.com/user-attachments/assets/11d46451-bd46-4c65-9f3a-fb2b0da0d77c "
/> |
## Native
| Regular | Scaled |
| --- | --- |
| <img width="376" alt="Image"
src="https://github.com/user-attachments/assets/5775f9f1-d1f9-446b-9ec8-e77073a8887e "
/> | <img width="376" alt="Image"
src="https://github.com/user-attachments/assets/76bf6263-d94c-4136-bd53-d91bb0d88437 "
/> |
2025-05-15 02:28:18 +00:00
Victor Sanni
cd3b0a5a86
Reland "Clip search artifacts in CupertinoSliverNavigationBar searchable-to-searchable transitions" ( #168772 )
...
Fixes https://github.com/flutter/flutter/issues/168494
2025-05-14 19:04:06 +00:00
Mitchell Goodwin
0cf1d34e9b
Make Cupertino sheet set the systemUIStyle through an AnnotatedRegion ( #168182 )
...
#164680 caused a regression where the systemUIStyle would not be set
correctly if the previous page has a navbar.
https://github.com/user-attachments/assets/656d171c-d768-4481-bf64-4c93463752a2
This happens because the RenderView is constantly watching for
AnnotatedRegions at the top of the bottom of the screen to set the UI
style. So the sheet when initialized would set the style, but during the
transition the previous pages navbar is still at the top of the screen,
so the RenderView immediately sets the style back to where it was.
This PR fixes that by adding an AnnotatedRegion behind the previous page
through the delegatedTransition with the style set correctly for the
sheet. That way when the previous page drops low enough, the systemUI
switches over.
https://github.com/user-attachments/assets/e600e23b-aad3-4059-9009-c3037a15a2bd
The RenderView is watching for right around the midpoint of the systemUI
so it switches back and forth at a good point when the transition is
manually dragged back and forth.
https://github.com/user-attachments/assets/a299c0fd-0bbe-40f2-b235-a593f8b5a885
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-05-14 19:02:11 +00:00
auto-submit[bot]
9bdbf497bc
Reverts "Clip search artifacts in CupertinoSliverNavigationBar searchable-to-searchable transitions ( #168510 )" ( #168775 )
...
<!-- start_original_pr_link -->
Reverts: flutter/flutter#168510
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: victorsanni
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: Tree is red.
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: victorsanni
<!-- end_original_pr_author -->
<!-- start_reviewers -->
Reviewed By: {MitchellGoodwin}
<!-- end_reviewers -->
<!-- start_revert_body -->
This change reverts the following previous change:
In https://github.com/flutter/flutter/pull/166705 , non-searchable
transitions were clipped. This PR also clips searchable-to-searchable
transitions.
Also replaces type check to detect searchable-to-searchable transitions.
| Before | After |
| --- | --- |
| <img width="377" alt="before bottom search artifactsd"
src="https://github.com/user-attachments/assets/a0726905-6dc1-463e-8cbb-bf1f5626fb1a "
/> | <img width="379" alt="nav bar search artifacts bottom"
src="https://github.com/user-attachments/assets/9474b3e5-a7a9-4a0e-9395-5f62106e65ad "
/> |
| <img width="379" alt="before top search artifacts"
src="https://github.com/user-attachments/assets/adf2b34d-ffa9-4c86-bee5-6683b06ec44f "
/> | <img width="379" alt="nav bar search artifacts top"
src="https://github.com/user-attachments/assets/a7a8edd8-0c66-4e3d-8958-3152bf55e42a "
/> |
Fixes [Transition between two CupertinoSliverNavigationBar.search routes
shows search artifacts mid-transition if one is collapsed and one is
extended](https://github.com/flutter/flutter/issues/168494 )
<!-- end_revert_body -->
Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
2025-05-13 23:04:47 +00:00
Victor Sanni
40e990fd17
Clip search artifacts in CupertinoSliverNavigationBar searchable-to-searchable transitions ( #168510 )
...
In https://github.com/flutter/flutter/pull/166705 , non-searchable
transitions were clipped. This PR also clips searchable-to-searchable
transitions.
Also replaces type check to detect searchable-to-searchable transitions.
| Before | After |
| --- | --- |
| <img width="377" alt="before bottom search artifactsd"
src="https://github.com/user-attachments/assets/a0726905-6dc1-463e-8cbb-bf1f5626fb1a "
/> | <img width="379" alt="nav bar search artifacts bottom"
src="https://github.com/user-attachments/assets/9474b3e5-a7a9-4a0e-9395-5f62106e65ad "
/> |
| <img width="379" alt="before top search artifacts"
src="https://github.com/user-attachments/assets/adf2b34d-ffa9-4c86-bee5-6683b06ec44f "
/> | <img width="379" alt="nav bar search artifacts top"
src="https://github.com/user-attachments/assets/a7a8edd8-0c66-4e3d-8958-3152bf55e42a "
/> |
Fixes [Transition between two CupertinoSliverNavigationBar.search routes
shows search artifacts mid-transition if one is collapsed and one is
extended](https://github.com/flutter/flutter/issues/168494 )
2025-05-13 16:56:59 +00:00
Renzo Olivares
cba2e86350
[iOS] Do not hide selection handles when platform hides system context menu ( #168678 )
...
Fixes an issue where selection handles would be hidden when the system
hides the platform context menu on iOS.
Before:
https://github.com/user-attachments/assets/61afecd8-7558-41fb-bba3-74b6e8e47f13
After:
https://github.com/user-attachments/assets/0c6f83de-cb20-46ce-97d3-86d8873da3aa
Fixes #168636
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
---------
Co-authored-by: Renzo Olivares <roliv@google.com>
2025-05-13 16:52:09 +00:00
Victor Sanni
b772c17f0d
Nav bar back label is not clipped mid-transition ( #168194 )
...
### Before
https://github.com/user-attachments/assets/fe354e67-c36d-4ce6-bf0f-0ca559962bfd
### After
https://github.com/user-attachments/assets/e57b91a0-00ed-493a-92b4-549dc8ab330a
Fixes [CupertinoNavigationBar flickers when previousPageTitle more than
4 characters](https://github.com/flutter/flutter/issues/149905 )
2025-05-12 18:23:20 +00:00
Victor Sanni
00dc13b3a5
Remove CupertinoSliverNavigationBar background box when large title is extended ( #168407 )
...
### Before
https://github.com/user-attachments/assets/436e49a7-015b-4383-9670-11917945c659
### After
https://github.com/user-attachments/assets/6ea5aaa3-7d9f-42be-969b-a03119c8c0d8
### Native
https://github.com/user-attachments/assets/7b8c0f5d-9b72-48b6-8ec5-6c994c24a4ad
Fixes [CupertinoSliverNavigationBar with extended large title doesn't
have a transparent background with
transitionBetweenRoutes](https://github.com/flutter/flutter/issues/168406 )
2025-05-12 17:51:02 +00:00
Alex Medinsh
7592aeaa90
Add CupertinoSlider haptic feedback ( #167362 )
...
<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->
Fixes https://github.com/flutter/flutter/issues/165847
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
2025-05-09 23:05:05 +00:00
Sebastine Odeh
7326addb6a
Cupertino sheet MediaQuery values ( #168041 )
...
<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->
There's an issue with the Cupertino sheet route in the current stable
version of Flutter. However, it was partly fixed in master. This PR
addresses passing the appropriate bottom padding values to the page
content, which ensures widgets placed in Safe Areas are laid out
correctly.
Before

After

Fixes [#167943 ](https://github.com/flutter/flutter/issues/167943 )
## Pre-launch Checklist
- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [X] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-05-05 17:15:34 +00:00
Justin McCandless
9f42991d77
MediaQuery picks up view data changes ( #166498 )
...
This fixes a bug in MediaQuery's update logic and removes some
now-unnecessary workaround code.
Fixes https://github.com/flutter/flutter/issues/165519
Discovered in
https://github.com/flutter/flutter/pull/165354#discussion_r1999849170
2025-05-02 23:32:32 +00:00
Victor Sanni
5bd0fb73f1
Implement CupertinoCollapsible/CupertinoExpansionTile ( #165606 )
...
### Flutter fade
https://github.com/user-attachments/assets/0cfd3759-3e8d-4e5e-af55-20dfa1494bb5
### Native iOS fade
https://github.com/user-attachments/assets/ce8799d8-78bd-49e7-9d64-bb818fc6667e
### Flutter scroll
https://github.com/user-attachments/assets/04291449-147c-4b8c-900e-c6e3989ef0e8
### Native iOS scroll
https://github.com/user-attachments/assets/a5917e64-6e67-45f0-a580-2fda80d16c32
<details>
<summary>Sample code</summary>
```dart
import 'package:flutter/cupertino.dart';
void main() => runApp(const CollapsibleApp());
class CollapsibleApp extends StatelessWidget {
const CollapsibleApp({super.key});
@override
Widget build(BuildContext context) {
return CupertinoApp(
home: CupertinoPageScaffold(
backgroundColor: CupertinoColors.systemGroupedBackground,
child: CustomScrollView(
slivers: [
CupertinoSliverNavigationBar(
stretch: true,
largeTitle: Text('Lists'),
leading: CupertinoButton(
alignment: Alignment.centerLeft,
padding: EdgeInsets.zero,
child: const Text('Edit'),
onPressed: () {},
),
trailing: CupertinoButton(
alignment: Alignment.centerRight,
padding: EdgeInsets.zero,
child: const Text('Add List'),
onPressed: () {},
),
),
SliverToBoxAdapter(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: const CollapsibleExample(),
),
),
],
),
),
);
}
}
class CollapsibleExample extends StatefulWidget {
const CollapsibleExample({super.key});
@override
State<CollapsibleExample> createState() => _CollapsibleExampleState();
}
class _CollapsibleExampleState extends State<CollapsibleExample> {
@override
Widget build(BuildContext context) {
return CupertinoCollapsible(
title: Text(
' iPhone',
style: CupertinoTheme.of(context)
.textTheme
.navLargeTitleTextStyle
.copyWith(fontSize: 21, fontWeight: FontWeight.w600),
),
child: CupertinoListSection.insetGrouped(
margin: EdgeInsets.symmetric(horizontal: 0.0),
children: <CupertinoListTile>[
CupertinoListTile(
title: const Text('All iPhone'),
leading: Icon(
CupertinoIcons.person_3,
size: 30.0,
),
trailing: const CupertinoListTileChevron(),
additionalInfo: const Text('6'),
onTap: () {}),
CupertinoListTile(
title: const Text('Friends'),
leading: Icon(CupertinoIcons.person_2),
trailing: const CupertinoListTileChevron(),
additionalInfo: const Text('1'),
onTap: () {}),
CupertinoListTile(
title: const Text('Work'),
leading: Icon(CupertinoIcons.person_2),
trailing: const CupertinoListTileChevron(),
additionalInfo: const Text('0'),
onTap: () {}),
],
),
);
}
}
```
</details>
Fixes https://github.com/flutter/flutter/issues/153937
2025-05-01 21:47:22 +00:00
Ricardo Dalarme
a152df8357
fix(ios): correctly inherits the handle color from the theme ( #166507 )
...
## Description
If specified, apply the `selectionHandleColor` from the theme to the iOS
handle.
## Related Issue
- https://github.com/flutter/flutter/issues/166506
#### Minimum reproducible example
```dart
import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
theme: ThemeData(
textSelectionTheme: TextSelectionThemeData(
selectionHandleColor: Colors.yellow,
),
),
home: Scaffold(body: Center(child: TextField())),
),
);
}
```
#### Visual Reference
| Previous | Now |
|--------|--------|
| <img
src="https://github.com/user-attachments/assets/91e49e07-ef4a-47ab-b65a-b147f441f252 "
/> | <img
src="https://github.com/user-attachments/assets/fd27d602-6f7c-4d7d-a310-97f417bde819 "
/> |
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
2025-05-01 20:03:39 +00:00
chunhtai
b982d42749
Relands "backfill custom painter semantics properties ( #166375 )" ( #168113 )
...
This reverts commit 80d0409d137acdd55af4124b7622915c062c9d21.
<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->
previous pr was merge with older branch which doesn't migrate new tests
added later
## Pre-launch Checklist
- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-05-01 18:15:49 +00:00
Victor Sanni
96d1b99211
Condense nav bar large title in landscape mode ( #166956 )
...
## Rotation demo
https://github.com/user-attachments/assets/b59d6875-dff7-4b40-9525-565dfd8a2554
### Portrait mode .automatic
https://github.com/user-attachments/assets/88f4f3a2-0f13-4c92-b601-20c20e13f7dc
### Landscape mode .automatic
https://github.com/user-attachments/assets/dd5e2373-82e3-41fc-8e83-4002ce5e848e
### Portrait mode .always
https://github.com/user-attachments/assets/623d131a-f71b-430d-b84c-0b4519919f56
### Landscape mode .always
https://github.com/user-attachments/assets/5980e8fe-a981-482d-9f77-97f9ab7495c7
Fixes [CupertinoSliverNavigationBar doesn't become compact in landscape
mode](https://github.com/flutter/flutter/issues/39254 )
<details>
<summary>Sample code</summary>
```dart
import 'package:flutter/cupertino.dart';
void main() => runApp(const NavBarBlueApp());
class NavBarBlueApp extends StatelessWidget {
const NavBarBlueApp({super.key});
@override
Widget build(BuildContext context) {
return CupertinoApp(
theme: CupertinoThemeData(),
home: MainPage(),
);
}
}
class MainPage extends StatelessWidget {
const MainPage({super.key});
@override
Widget build(BuildContext context) {
return CupertinoPageScaffold(
child: SafeArea(
child: CustomScrollView(
slivers: [
CupertinoSliverNavigationBar.search(
stretch: true,
searchField: CupertinoSearchTextField(
suffixMode: OverlayVisibilityMode.always,
suffixIcon: Icon(
CupertinoIcons.mic_solid,
)),
largeTitle: Text('Lists'),
bottomMode: NavigationBarBottomMode.always,
),
SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
return CupertinoListTile(
title: Text('Entry $index'),
);
},
childCount: 20,
),
),
],
),
),
);
}
}
```
</details>
2025-05-01 04:42:56 +00:00
Srivats Venkataraman
87753f3840
165369 - support other widget states for CupertinoButton ( #166088 )
...
<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->
This PR is a continuation of
https://github.com/flutter/flutter/pull/164196 . With this PR other
widget states such as pressed, and focused have been added to cupertino
button. This will resolve the following issue:
https://github.com/flutter/flutter/issues/165369
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-04-30 23:55:04 +00:00
auto-submit[bot]
80d0409d13
Reverts "backfill custom painter semantics properties ( #166375 )" ( #168103 )
...
<!-- start_original_pr_link -->
Reverts: flutter/flutter#166375
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: chunhtai
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: bad merge due to branch out of date and new tests
were not migrated
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: chunhtai
<!-- end_original_pr_author -->
<!-- start_reviewers -->
Reviewed By: {hannah-hyj}
<!-- end_reviewers -->
<!-- start_revert_body -->
This change reverts the following previous change:
<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->
fixes https://github.com/flutter/flutter/issues/166374
## Pre-launch Checklist
- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
<!-- end_revert_body -->
Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
2025-04-30 21:50:48 +00:00
masato
b714d8b34c
Add barrierColor property to showCupertinoDialog ( #166911 )
...
implimented https://github.com/flutter/flutter/issues/166910
https://github.com/user-attachments/assets/fe9aa2ce-b8a5-4458-b04a-781763959169
## How to Verify
- Set enableDrag: false in CupertinoSheetRoute or showCupertinoSheet.
```diff
showCupertinoDialog<void>(
context: context,
+ barrierColor: CupertinoColors.activeOrange.withValues(alpha: 0.5),
builder:
(BuildContext context) => CupertinoAlertDialog(
title: const Text('Alert'),
content: const Text('Proceed with destructive action?'),
actions: <CupertinoDialogAction>[
CupertinoDialogAction(
/// This parameter indicates this action is the default,
/// and turns the action's text to bold text.
isDefaultAction: true,
onPressed: () {
Navigator.pop(context);
},
child: const Text('No'),
),
CupertinoDialogAction(
/// This parameter indicates the action would perform
/// a destructive action such as deletion, and turns
/// the action's text color to red.
isDestructiveAction: true,
onPressed: () {
Navigator.pop(context);
},
child: const Text('Yes'),
),
],
),
);
```
- The following is a screenshot of
`examples/api/lib/cupertino/dialog/cupertino_alert_dialog.0.dart` after
adding `barrierColor: CupertinoColors.activeOrange.withValues(alpha:
0.5),`.
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-04-30 18:43:49 +00:00
chunhtai
bc293af1b1
backfill custom painter semantics properties ( #166375 )
...
<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->
fixes https://github.com/flutter/flutter/issues/166374
## Pre-launch Checklist
- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-04-30 18:43:49 +00:00
Tosemite
9218243c61
add directionality to CupertinoDialog ( #167403 )
...
Fixes `CupertinoDialog` not respecting Directionality for actions
Issue refers to AlertDIalog.adaptive, but I have found that problem
occurs only in `CupertinoDialog`.
## Related Issues
* Fixes [Dialog actions do not respect Directionality
#166880 ](https://github.com/flutter/flutter/issues/166880 )
## Tests
Added 1 test
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
2025-04-28 18:11:12 +00:00
Kishan Rathore
434cb54e77
Feat: Add equality to NoDefaultCupertinoThemeData ( #166655 )
...
Feat: Add equality to NoDefaultCupertinoThemeData
fixes : #165455
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
2025-04-17 21:35:40 +00:00
Kishan Rathore
2f30429b96
Fix: Update sheet route bottom padding with top padding ( #164473 )
...
Fix: Update sheet route bottom padding with top padding
fixes : #163572
fixes : #164087
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
2025-04-15 20:04:07 +00:00
Victor Sanni
77c42fbd22
Persistent CupertinoListTile leading and trailing ( #166799 )
...
The bug occurs because the background color passed into the underlying
`Container` changes from null to `backgroundColorActivated`. Under the
hood, the `Container` wraps its child in a `ColoredBox` only if the
color is non-null. So the extra wrapping with a `ColoredBox` happening
mid-animation breaks reparenting, causing the widgets to be
replaced/inflated instead of updated.
### Before
https://github.com/user-attachments/assets/ca0b657a-1340-405f-8c1d-34b34366b994
### After
https://github.com/user-attachments/assets/8445c55c-0d5d-4b5f-96d2-4f12d908bdec
Fixes [CupertinoListTile animations are not running when pressing
longer](https://github.com/flutter/flutter/issues/153225 )
<details>
<summary>Sample code</summary>
```dart
import 'package:flutter/cupertino.dart';
void main() => runApp(const ListTileApp());
class ListTileApp extends StatelessWidget {
const ListTileApp({super.key});
@override
Widget build(BuildContext context) {
return CupertinoApp(home: const ListTileExample());
}
}
class ListTileExample extends StatefulWidget {
const ListTileExample({super.key});
@override
State<ListTileExample> createState() => _ListTileExampleState();
}
class _ListTileExampleState extends State<ListTileExample> {
bool _pushedToggle = false;
void _toggle() {
setState(() {
_pushedToggle = !_pushedToggle;
});
}
@override
Widget build(BuildContext context) {
return CupertinoPageScaffold(
child: Center(
child: SizedBox(
height: 40,
child: CupertinoListTile(
onTap: _toggle,
title: Center(
child: Text(
'Toggle',
),
),
leading: CupertinoSwitch(
value: _pushedToggle,
onChanged: (_) {},
),
trailing: CupertinoSwitch(
value: _pushedToggle,
onChanged: (_) {},
)),
),
),
);
}
}
```
</details>
2025-04-15 01:04:00 +00:00
Victor Sanni
8703147add
Correct max height calculation to fade and animate insets on scroll in CupertinoSearchTextField ( #166569 )
...
Fixes [CupertinoSliverNavigationBar.search does not fade or animate
insets if search view scrolled in automatic
mode](https://github.com/flutter/flutter/issues/165152 )
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-04-15 00:45:37 +00:00
Victor Sanni
3d1f041d9e
Clip bottom widgets in nav bar transition ( #166705 )
...
Fixes [Search field icons shown mid-transition in
CupertinoSliverNavigationBar.search .automatic mode when
scrolled](https://github.com/flutter/flutter/issues/165689 )
### Before
https://github.com/user-attachments/assets/75fbc069-157e-4ee0-b03d-6f1ceb476892
### After
https://github.com/user-attachments/assets/22443186-2790-496c-9e88-e86d17d28efd
2025-04-15 00:45:37 +00:00
Jonah Williams
22bcb9d5ea
[framework] re-enable skipped impeller goldens. ( #166354 )
...
Fixes https://github.com/flutter/flutter/issues/143616
Maybe. Lets see if its stable.
Update: I've run this a few times and it seems stable.
2025-04-09 03:31:31 +00:00
Tong Mu
5e42c80fb4
Add RoundedSuperellipseBorder and apply it to CupertinoActionSheet ( #166303 )
...
This PR creates a new class `RoundedSuperellipseBorder`, which is the
main way to draw a rounded superellipse with filling and/or stroking.
The new class is very similar to `RoundedRectangleBorder` and shares a
lot of private code, therefore they reside in the same file.
For demonstration purposes, the rounded superellipse is also applied to
`CupertinoActionSheet`, whose cancel button was drawn with the border
class.
https://github.com/user-attachments/assets/39599dcf-5cf1-46e1-ab34-8c477cbef9d4
(Sadly this demo wouldn't fit for dartpad because rounded superellipses
are not yet supported on Web.)
## Pre-launch Checklist
- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-04-08 00:05:23 +00:00
Kishan Rathore
b44137f078
Fix: CupertinoSheetTransition moves SystemUIOverlayStyle to outside of delegatedTransition and only changes top bar ( #164680 )
...
Fix: CupertinoSheetTransition should set the SystemUIOverlayStyle in
init state
fixes : #164633
Fixes https://github.com/flutter/flutter/issues/164134
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
2025-04-07 19:39:40 +00:00
Kishan Rathore
4503f2f459
Fix: DelegateTransition for cupertino sheet route ( #164675 )
...
Fix: DelegateTransition for cupertino sheet route
fixes : #163954
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
2025-04-02 21:27:07 +00:00
masato
71be3b14f9
Add enableDrag property to CupertinoSheetRoute and showCupertinoSheet ( #163923 )
...
Implemented. (flutter#163852)
This PR adds the `enableDrag` option to showCupertinoSheet and
CupertinoSheetRoute, allowing developers to control whether the sheet
can be dismissed by dragging.
## How to Verify
- Set enableDrag: false in CupertinoSheetRoute or showCupertinoSheet.
```dart
CupertinoSheetRoute<void>(
builder: (BuildContext context) => const _SheetScaffold(),
enableDrag: false,
),
// or
showCupertinoSheet<void>(
context: context,
useNestedNavigation: true,
pageBuilder: (BuildContext context) => const _SheetScaffold(),
enableDrag: false,
);
```
- The following is a screenshot of
`examples/api/lib/cupertino/sheet/cupertino_sheet.0.dart` after adding
`enableDrag: false`.
https://github.com/user-attachments/assets/315fb0e5-ceee-4150-be6e-dd919a7c2317
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
---------
Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
2025-03-25 21:15:48 +00:00
Jason Simmons
0af426f37c
Animate a CupertinoButton based on tap move events only if the move happens between a tap down and a tap up ( #165729 )
...
Fixes https://github.com/flutter/flutter/issues/165724
2025-03-25 21:15:48 +00:00
Kouki Badr
2c58a631fe
feat(CupertinoDatePicker): add a two points time seperator column ( #163417 )
...
<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->
This pull request adds a flag attribute to cupertino date picker to
show/hide the two points seperator ":" between minutes and hours, this
feature add more customization to the cupertino date picker widget.
This new flag is by default set to false and it's an optional flag, the
default cupertino date picker behavior stays the same.
**CupertinoDatePIcker before:**
<img
src="https://github.com/user-attachments/assets/94f6722d-b466-4272-b90f-6ac3b358ba6d "
width="200"/> <img
src="https://github.com/user-attachments/assets/125386fd-2b7d-4988-a54e-8893a7f5907b "
width="200"/>
**CupertinoDatePicker After**
<img
src="https://github.com/user-attachments/assets/b5a703d9-6c43-410d-819f-f864e9dde159 "
width="200"/> <img
src="https://github.com/user-attachments/assets/26e828dd-81c4-456f-b8c7-7c116d691060 "
width="200"/>
*List which issues are fixed by this PR. You must list at least one
issue. An issue is not required if the PR fixes something trivial like a
typo.*
Here's the issue in question for more details about the proposal and the
use cases:
[Issue#163416](https://github.com/flutter/flutter/issues/163416 )
*If you had to change anything in the [flutter/tests] repo, include a
link to the migration guide as per the [breaking change policy].*
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-03-24 18:37:54 +00:00
Justin McCandless
8128f08603
Use SystemContextMenu by default on iOS ( #165354 )
...
With this change, widgets based on EditableText will show the system
context menu by default on iOS. Anyone with a custom contextMenuBuilder
will not be affected and will have to opt-in to using SystemContextMenu.
Also, this does not affect SelectionArea, which can't receive paste.
Fixes https://github.com/flutter/flutter/issues/163067
2025-03-24 16:53:04 +00:00
Victor Sanni
1fa9254076
Cupertino navigation bars transitionBetweenRoutes fidelity update ( #164956 )
...
In the before Flutter video, drag happens after the 17 second mark.
## Flutter before
https://github.com/user-attachments/assets/9fbcd59e-68aa-4975-9a66-f05e72071223
## Flutter after
https://github.com/user-attachments/assets/784d7f46-a8ce-4e5f-a849-3b19df6668c9
## Flutter back swipe drag gesture
https://github.com/user-attachments/assets/09d38c01-aeea-46c1-90b4-590861f8f3a2
## Native iOS
https://github.com/user-attachments/assets/f2ab96c0-766b-4452-b6d5-3f92e6b6785f
## Flutter scaled back chevron and large title after
https://github.com/user-attachments/assets/ba87add7-affa-4dcc-b2f0-abbc3487d677
## Native iOS scaled back chevron and large title
https://github.com/user-attachments/assets/5c7bfe5b-5789-4ab9-8e36-770cf802b1b1
Native iOS is probably using a spring simulation. This is the closest
curve we have to the native transition, but should be updated in the
future with the exact values.
Fixes [Cupertino navigation bars transitionBetweenRoutes fidelity
update](https://github.com/flutter/flutter/issues/164662 )
2025-03-20 19:54:59 +00:00
Srivats Venkataraman
d452d04a07
#163840 - CupertinoButton cursor doesn't change to clickable on desktop ( #164196 )
...
<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->
This PR addresses Issue number: 163840, where when hovering over a
Cupertino button the mouse cursor wouldn't switch to clickable and there
wasn't any option to configure it.
Adds Mouse cursor to CupertinoButton, CupertinoButton.Filled and
CupertinoButton.Tinted
Fixes https://github.com/flutter/flutter/issues/163840
Part of https://github.com/flutter/flutter/issues/58192
Demo of the changes
https://github.com/user-attachments/assets/2e5d874e-cdfe-44bf-9710-bbbde99be3f7
Code snippet showing new behavior
```dart
import 'package:flutter/cupertino.dart';
void main() => runApp(
// const Center(child: Text('Hello, world!', key: Key('title'), textDirection: TextDirection.ltr)),
CupertinoApp(
theme: const CupertinoThemeData(
brightness: Brightness.light,
),
home: Center(
child: Column(
spacing: 5.0,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
CupertinoButton(
onPressed: (){},
child: const Text('Default Cursor'),
),
CupertinoButton(
onPressed: (){},
mouseCursor: SystemMouseCursors.grab,
child: const Text('Custom Cursor'),
),
CupertinoButton.filled(
onPressed: (){},
mouseCursor: SystemMouseCursors.copy,
child: const Text('Custom Cursor 2'),
),
CupertinoButton.tinted(
onPressed: (){},
mouseCursor: SystemMouseCursors.help,
child: const Text('Custom Cursor 2'),
),
],
)
),
),
);
```
*List which issues are fixed by this PR. You must list at least one
issue. An issue is not required if the PR fixes something trivial like a
typo.*
*If you had to change anything in the [flutter/tests] repo, include a
link to the migration guide as per the [breaking change policy].*
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
---------
Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
Co-authored-by: Tirth <pateltirth454@gmail.com>
Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
2025-03-11 02:12:05 +00:00
Victor Sanni
cd433d4d36
Align nav bar bottom transition with large title animation ( #162097 )
...
Makes the bottom widget sync up with the large title in hero transitions
between nav bars.
## Before
https://github.com/user-attachments/assets/3f8c67c3-20c2-4751-b29b-7db8d3f3409f
## After
https://github.com/user-attachments/assets/5e4c966f-1818-4851-87a1-0bf613ebda0b
## Native searchable-to-searchable:
https://github.com/user-attachments/assets/56cf93e0-e529-4ca8-9f49-4e40f710e5ed
## Flutter searchable-to-searchable:
https://github.com/user-attachments/assets/a98d9f53-8d4b-44cf-afa9-541751c21172
Fixes [CupertinoSliverNavigationBar/CupertinoNavigationBar bottom is not
displayed during nav bar flying hero
transitions](https://github.com/flutter/flutter/issues/162203 )
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-03-10 19:36:04 +00:00
Kishan Rathore
b44f717d57
Fix: Update CupertinoSheetRoute transition rounded corner ( #163700 )
...
Fix: Update CupertinoSheetRoute transition rounded corner
fixes : #163334
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
2025-03-05 20:49:55 +00:00
Tong Mu
0357b45337
Add clipRSuperellipse, and use them for dialogs ( #161111 )
...
This PR makes Flutter support `clipRSuperellipse`, and apply it to
`CupertinoAlertDialog`.
Hit tests related to RSuperellipse are performed based on its bounding
box, since the computation is too complicated and pixel perfect hit test
is not needed practically.
Native:
<img
src="https://github.com/user-attachments/assets/8f9b472a-e624-4eef-9cea-e81b80f32b86 "
width="400"/>
Native vs before: (The two screenshots are stacked and offset by (1, 1)
pixels. See the bottom right corner for comparison.)
<img
src="https://github.com/user-attachments/assets/ffaf62fc-a82f-4c7a-9ff1-52374f4f2a67 "
width="400"/>
Native vs after:
<img
src="https://github.com/user-attachments/assets/3dfde2b0-bcc6-492a-8d97-ecabdf97f6f0 "
width="400"/>
After only:
<img
src="https://github.com/user-attachments/assets/32b2a665-a0da-498f-acdb-598553940964 "
width="400"/>
## Pre-launch Checklist
- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-03-05 02:06:12 +00:00