Decoupling Material and Cupertino (with dart fixes)#11669
Decoupling Material and Cupertino (with dart fixes)#11669justinmc wants to merge 7851 commits intoflutter:mainfrom
Conversation
…78613) This is my attempt to handle flutter/flutter#6537 for the CupertinoTabBar widget. Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com> Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
…… (#178566) This is my attempt to handle flutter/flutter#6537 for the CupertinoLinearActivityIndicator widget. Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com> Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
…178451) This is my attempt to handle flutter/flutter#6537 for the TimePickerDialog widget. Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com> Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
…… (#178516) This is my attempt to handle flutter/flutter#6537 for the UserAccountsDrawerHeader widget. Co-authored-by: Victor Sanni <victorsanniay@gmail.com> Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
## 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. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- 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
This is my attempt to handle flutter/flutter#6537 for the Stepper widget. --------- Co-authored-by: Victor Sanni <victorsanniay@gmail.com> Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
This is my attempt to handle flutter/flutter#6537 for the SearchAnchor widget. --------- Co-authored-by: Victor Sanni <victorsanniay@gmail.com> Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
…readablity (#178909) ## 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. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- 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
This is a reland of #177570, which was reverted in #178744 due to test failures. The original PR introduced `hitTestBehavior` to the semantics framework but incorrectly applied `opaque` behavior to `ModalRoute`, which blocked platform views from receiving pointer events. Instead of making the entire modal opaque, we: 1. Keep `ModalRoute` without explicit `hitTestBehavior` (defaults to `defer`) 2. Make only the dialog/sheet content opaque (blocks clicks to barrier) 3. Platform views remain clickable because they're outside the opaque content boundary Fixes #149001 Original PR: #177570 Revert: #178744
…8817)" (#179100) <!-- start_original_pr_link --> Reverts: flutter/flutter#178817 <!-- end_original_pr_link --> <!-- start_initiating_author --> Initiated by: Piinks <!-- end_initiating_author --> <!-- start_revert_reason --> Reason for reverting: change was landed during tree closure <!-- end_revert_reason --> <!-- start_original_pr_author --> Original PR Author: flutter-zl <!-- end_original_pr_author --> <!-- start_reviewers --> Reviewed By: {chunhtai} <!-- end_reviewers --> <!-- start_revert_body --> This change reverts the following previous change: This is a reland of #177570, which was reverted in #178744 due to test failures. The original PR introduced `hitTestBehavior` to the semantics framework but incorrectly applied `opaque` behavior to `ModalRoute`, which blocked platform views from receiving pointer events. Instead of making the entire modal opaque, we: 1. Keep `ModalRoute` without explicit `hitTestBehavior` (defaults to `defer`) 2. Make only the dialog/sheet content opaque (blocks clicks to barrier) 3. Platform views remain clickable because they're outside the opaque content boundary Fixes #149001 Original PR: #177570 Revert: #178744 <!-- end_revert_body --> Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
WIP Commits separated as follows: - Update lints in analysis_options files - Run `dart fix --apply` - Clean up leftover analysis issues - Run `dart format .` in the right places. Local analysis and testing passes. Checking CI now. Part of flutter/flutter#178827 - Adoption of flutter_lints in examples/api coming in a separate change (cc @loic-sharma) ## 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]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- 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
I recommend reviewing each commit individually. The following were suppressed instead of migrated to minimize the time the tree is closed: 1. The [`Radio` -> `RadioGroup` migration](https://docs.flutter.dev/release/breaking-changes/radio-api-redesign). Tracked by: flutter/flutter#179088. Part of: flutter/flutter#178827 ## 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]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- 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
…… (#178565) This is my attempt to handle flutter/flutter#6537 for the CupertinoActivityIndicator widget.
## Description This PR updates some comments in AppBar, Banner and BottomAppBar to reflect the changes related to Theme normalization. ## Related Issue Related to flutter/flutter#91772 ## Tests - Documentation only
- Fix flutter/flutter#178719 - See flutter/flutter#178719 (comment) for details of debugging and proposal. <details open> <summary>Demo (after the fix)</summary> https://github.com/user-attachments/assets/cecb470f-d98c-47b0-a34d-fc858cfb0dd4 </details> ## 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]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- 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 Signed-off-by: huycozy <huy@nevercode.io>
This change fixes a crash in `EditableText` that occurs when the text editing value changes between two scrolls, when the second scroll ends `_dataWhenToolbarShowScheduled` will be invalidated. If the second scroll ends before the post frame callback scheduled by the first scroll has a chance to execute, there will be a crash because `_dataWhenToolbarShowScheduled` is being accessed while null. This change also invalidates a scheduled toolbar if the text editing value has changed before the post-frame callback has a chance to run. Fixes #179164 ## 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>
Migrates some - but not all - samples to use the new `RadioGroup` widget. See: [https://docs.flutter.dev/release/breaking-changes/radio-api-redesign](https://docs.flutter.dev/release/breaking-changes/radio-api-redesign) Part of: flutter/flutter#179088 ## 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]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- 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
…on (#179404) ## Description This PR updates [BottomNavigationBar.selectedItemColor] and [BottomNavigationBar.unselectedItemColor] documentation to reflect the changes related to theme normalization. It also fixes the [BottomNavigationBar.selectedItemColor] documentation to mention the correct default values. ## Related Issue Related to flutter/flutter#91772 ## Tests - Documentation only
## Description This PR adds `DropdownMenu.selectOnly`. This property allows users to get the DropdownMenu behave as a 'select' component. It is meant as a future replacement for `DropdownMenu.requestFocusOnTap`. ## Motivation On mobile, a dropdown menu widget is usually used as a ‘select’ widget because opening the keyboard for searching/filtering is not convenient. In Flutter, this is currently implemented through `DropdownMenu.requestFocusOnTap` which defaults to false on mobile and true on desktop. The `DropdownMenu.requestFocusOnTap` property is currently used to set `FocusNode.canRequestFocus`. This leads do difficulties mainly related to focus traversal: - Keyboard traversal requires workarounds (for instance relying on the trailing icon to be focusable). - Keyboard shortcuts require also a workaround (currently relying on a Focus widget in a Stack). - The `DropdownMenu` decoration does not reflect the focus state. This PR proposes a new property named `DropdownMenu.selectOnly` which does not require `DropdownMenu.requestFocusOnTap` to be false to make the `DropdownMenu` behave like a select widget. With this property the `DropdownMenu`: - Supports keyboard navigation on mobile and desktop. - Has a correct decoration when focused. - Does not rely on the trailing icon to be focusable (see flutter/flutter#174096). In the future this property could be used as a replacement for `DropdownMenu.requestFocusOnTap`. For the moment, for compatibility, it does not replace `DropdownMenu.requestFocusOnTap`. ## Related Issue Fixes [Allow DropdownMenu to be non-editable and focusable (select control) ](flutter/flutter#178009) Also related to [Make DropdownMenu's trailing icon not focusable by default](flutter/flutter#174096) and [[Material3] DropdownMenu Keyboard Accessibility](flutter/flutter#123797). ## Tests - Adds 9 tests.
…om Android 12. (#173849) Fixed an issue #169659 This PR improves the StretchingOverscrollIndicator to better match native Android behavior. - Previously, the stretch effect worked well only for slow dragging, and during fast flings it was absent or felt clipped. - Implemented a Simulation-based animation that responds naturally to both slow drags and high-velocity flings. - The result closely resembles the native Android overscroll behavior while maintaining Flutter's performance characteristics. This change ensures that momentum-based gestures produce a more natural and intuitive overscroll experience, especially for users accustomed to native Android scroll views. ## Fling [fling](https://github.com/user-attachments/assets/3944eef3-baaa-47df-82ca-9c49d4283fe4) ## Pull And Reduce Also, a very similar animation is implemented when pulling as well. [pull](https://github.com/user-attachments/assets/2a3025dc-0996-403d-b58b-d07f25487cda) ## 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: Tong Mu <dkwingsmt@users.noreply.github.com> Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
## Description This PR updates some comments in various widgets to reflect the changes related to Theme normalization. ## Related Issue Related to flutter/flutter#91772 ## Tests - Documentation only
…(#179442) This is my attempt to handle flutter/flutter#6537 for the CupertinoScrollbar widget. Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
…t (#178857) This is my attempt to handle flutter/flutter#6537 for the CupertinoTimerPicker widget. Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
…78629) This is my attempt to handle flutter/flutter#6537 for the CupertinoButton widget. Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
This is my attempt to handle flutter/flutter#6537 for the CupertinoApp widget. Co-authored-by: Victor Sanni <victorsanniay@gmail.com> Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
…#178630) This is my attempt to handle flutter/flutter#6537 for the CupertinoCheckbox widget. Co-authored-by: Victor Sanni <victorsanniay@gmail.com> Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
This is my attempt to handle #179094. Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
…t (#179235) This is my attempt to handle flutter/flutter#6537 for the CupertinoNavigationBar widget. Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
…… (#179165) This is my attempt to handle flutter/flutter#6537 for the CupertinoListTileChevron widget. Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
…t (#178858) This is my attempt to handle flutter/flutter#6537 for the CupertinoAlertDialog widget. Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
I think the conflicts were files that were added with a freeze override since I last tried this PR.
One was deleted because its dart fix is actually in widgets, not material.
drag_target deleted because it is widgets-only. Many widgets-only fixes were removed from cupertino.dart.
|
@Piinks I've created a new PR to include the dart fixes, which was easy enough. I spent some time cleaning up the dart fixes so they use the new imports. As of right now all the tests pass: cd packages/material_ui/test_fixes # Or packages/cupertino_ui/test_fixes
dart fix --compare-to-goldenHowever I did remove some fixes that seemed to be related exclusively to the Widgets library. Those are still covered in flutter/flutter. |
There was a problem hiding this comment.
Code Review
This pull request transitions the Cupertino library into a standalone package, incorporating source code for core widgets, a comprehensive set of API examples, and a robust suite of tests. It also adds dart fix metadata to assist with future migrations. Feedback identifies critical issues in dialog.dart where undefined classes and properties are used, along with pervasive syntax errors in the example files regarding enum member references. Additionally, several components are missing definitions, and the SDK constraint in the examples' pubspec.yaml must be updated to support the features used in the code.
|
|
||
| // TODO(davidhicks980): Set `bounded` to true on ImageFilterConfig.blur after | ||
| // https://github.com/flutter/flutter/issues/182066 is resolved. | ||
| ImageFilterConfig? _buildFilter(Brightness? brightness) { |
There was a problem hiding this comment.
| return ClipRSuperellipse( | ||
| borderRadius: _clipper, | ||
| child: BackdropFilter(filterConfig: filter, child: contents), | ||
| ); |
| @override | ||
| Widget build(BuildContext context) { | ||
| return const CupertinoApp( | ||
| theme: CupertinoThemeData(brightness: .light), |
There was a problem hiding this comment.
The syntax .light is invalid in Dart for referring to an enum member in this context. It should be Brightness.light. This issue is pervasive throughout the example files (e.g., .center, .spaceEvenly, .all, .only, .symmetric, .date, .time, .w600).
| theme: CupertinoThemeData(brightness: .light), | |
| theme: const CupertinoThemeData(brightness: Brightness.light), |
| /// This example shows how to use [CupertinoExpansionTile] with different transition modes. | ||
| /// | ||
| /// ** See code in examples/api/lib/cupertino/expansion_tile/cupertino_expansion_tile.0.dart ** | ||
| /// {@end-tool} |
| SingingCharacter? _character = .lafayette; | ||
|
|
||
| @override | ||
| Widget build(BuildContext context) { |
| version: 1.0.0 | ||
|
|
||
| environment: | ||
| sdk: ^3.10.0-0 |
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| import 'package:material_ui/material_ui.dart'; |
This is a single super mega PR attempting to migrate all Material and Cupertino code from flutter/flutter to material_ui and cupertino_ui.
To create this PR I used:
I then cherry picked everything I could from the previous PR (#11568).
For both Material and Cupertino, I'm importing:
TODOs
package:flutter_api_samplesimport).git blameappears the same in both repos on various files. (Yes, but the SHAs are different, as expected.)Open questions
workspace. Similar to how flutter/flutter's flutter_api_samples works.How to try using these packages
Add the local packages to your project:
Then import the packages instead of the libraries in the SDK:
Resources
git filter-repocommands.