Fixes#119401
This PR is to:
* add `Card.filled` and `Card.outlined` factory methods so that we can use tokens for these two types of cards to generate default theme instead of providing hard-corded values in example.
* update card.2.dart example.
* add test file for card.2.dart example.
* fix some mismatch caused by editing the auto-generated defaults by hand in navigation_bar.dart and navigation_drawer.dart.
Reverts flutter/flutter#137550
Initiated by: Piinks
This change reverts the following previous change:
Original Description:
This PR removes `ButtonBar` usage from `framework_test.dart` class and update other references in preparation for `ButtonBar` deprecation
related to https://github.com/flutter/flutter/issues/127955
This PR removes `ButtonBar` usage from `framework_test.dart` class and update other references in preparation for `ButtonBar` deprecation
related to https://github.com/flutter/flutter/issues/127955
This reverts commit d36a843335aae6f6b60acb6b6d005e47d61f1c6e
(https://github.com/flutter/flutter/pull/136809)
This fails even tho golden files were approved and `golden test` pending
was cleared and green and `autosubmit` successfully merged the PR.
```console
02:42 +4618 ~5: C:/b/s/w/ir/x/w/flutter/packages/flutter/test/material/outlined_button_test.dart: Material3 - OutlinedButton, OutlinedButton.icon defaults
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following SkiaException was thrown while running async test code:
Skia Gold received an unapproved image in post-submit
testing. Golden file images in flutter/flutter are triaged
in pre-submit during code review for the given PR.
Visit https://flutter-gold.skia.org/ to view and approve
the image(s), or revert the associated change. For more
information, visit the wiki:
https://github.com/flutter/flutter/wiki/Writing-a-golden-file-test-for-package:flutter
Debug information for Gold --------------------------------
stdout: Given image with hash 37275e74c51f98d7abd7f301c5c94ac1 for test
material.outlined_button.ink_sparkle.default
Expectation for test: 531f5fa74908d2e6db2b8fd86a6b8662 (positive)
Expectation for test: 683e368ff51d947a3d63c2a5f4568cf6 (positive)
Expectation for test: 749241ff0fa21595b2c6cb551fd40b68 (positive)
Expectation for test: aaf9ac1328614d6c9f4540308bc86f62 (positive)
Expectation for test: b31a50440c7dd31b10cacd9e7b5c6b86 (positive)
Expectation for test: c0a7c8c625b69ddc695a770f28abd403 (positive)
Expectation for test: f1f66ce931c2ef33ebcb699a637025a6 (positive)
Expectation for test: 2d32e34efc1d7ca4cd12965402fb76ff (positive)
Untriaged or negative image:
https://flutter-gold.skia.org/detail?grouping=name%3Dmaterial.outlined_button.ink_sparkle.default%26source_type%3Dflutter&digest=37275e74c51f98d7abd7f301c5c94ac1
stderr: Test: material.outlined_button.ink_sparkle.default FAIL
result-state.json: No result file found.
When the exception was thrown, this was the stack:
#0 SkiaGoldClient.imgtestAdd (package:flutter_goldens_client/skia_client.dart:243:7)
<asynchronous suspension>
#1 MatchesGoldenFile.matchAsync.<anonymous closure> (package:flutter_test/src/_matchers_io.dart:118:32)
<asynchronous suspension>
<asynchronous suspension>
(elided one frame from dart:async)
The exception was caught asynchronously.
════════════════════════════════════════════════════════════════════════════════════════════════════
02:42 +4618 ~5 -1: C:/b/s/w/ir/x/w/flutter/packages/flutter/test/material/menu_anchor_test.dart: Menu functions keyboard directional traversal works
02:42 +4618 ~5 -1: C:/b/s/w/ir/x/w/flutter/packages/flutter/test/material/outlined_button_test.dart: Material3 - OutlinedButton, OutlinedButton.icon defaults [E]
Test failed. See exception logs above.
The test description was: Material3 - OutlinedButton, OutlinedButton.icon defaults
02:42 +4619 ~5 -1: C:/b/s/w/ir/x/w/flutter/packages/flutter/test/material/menu_anchor_test.dart: Menu functions keyboard directional traversal works
```
## 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].
- [ ] 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/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#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/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
Updated unit tests for `CircleOutlinedButton` to have M2 and M3 versions.
More info in #127064
This also gets rid of unnecessary `fromSwatch` usage (part of https://github.com/flutter/flutter/issues/132584 documentation and test cleanup)
The color of the TextField's cursor in error state is the same as the error text color by default. However we should be allowed to customize it
Fixes#135580
Fixes#136735
This PR is to add a searchCallback to allow users to customize the search algorithm. This feature is used to fix b/305662376 which needs an exact match algorithm.
## Description
This converts the `MenuAnchor` class to use `OverlayPortal` instead of directly using the overlay.
## Related Issues
- Fixes https://github.com/flutter/flutter/issues/124830
## Tests
- No tests yet (hence it is a draft)
Consider a scenario where the background color and indicator's background color are the same.
Adding a stroke color to the value indicator would be a valuable for the following reasons:
- **Visual Clarity:** It would allow developers to make the value indicator stand out more against the background, making it easier for users to notice.
- **Customization:** It would provide more flexibility in customizing the appearance of the sliding widget, allowing developers to match the design requirements of their apps.
- **Accessibility:** Improved visual distinction can enhance the accessibility of the sliding widget for users with various needs.
*List which issues are fixed by this PR. You must list at least one issue.*
Fixes#135984
Fixes https://github.com/flutter/flutter/issues/135747
Before this change, the render object was storing the `context.canvas` and using it after painting children. If those children were composited (e.g. because of an `Opacity` layer), the canvas it stored was disposed and not valid for use anymore.
### Description
- Fixes https://github.com/flutter/flutter/issues/134205.
### Tests
- Removes ignoring the `_RestorableRouteInformation` leak from `cupertino/app_test.dart`;
- Removes ignoring the `_RestorableRouteInformation` leak from `material/app_test.dart`;
- Removes ignoring the `_RestorableRouteInformation` leak from `widgets/app_test.dart`;
- Removes ignoring the `_RestorableRouteInformation` leak from `widgets/route_notification_messages_test.dart`;
- Removes ignoring the `_RestorableRouteInformation` leak from `widgets/router_restoration_test.dart`;
- Updates `widgets/router_test.dart` to use `testWidgetsWithLeakTracking`.
## Description
In order for `MenuAnchor` menus to be able to not pass on the taps that close their menus, `TapRegion` needed a way to consume them. This change adds a flag to the `TapRegion`, `consumeOutsideTap` that will consume taps that occur outside of the region if the flag is set (it is false by default). The same flag is added to `MenuAnchor` to allow selecting the behavior for menus.
`TapRegion` consumes the tap event by registering with the gesture arena and immediately resolving the tap as accepted if any regions in a group have `consumeOutsideTap` set to true.
This PR also deprecates `MenuAnchor.anchorTapClosesMenu`, since it is a much more limited version of the same feature that only applied to the anchor itself, and even then only applied to closing the menu, not passing along the tap. The same functionality can now be implemented by handling a tap on the anchor widget and checking to see if the menu is open before closing it.
## Related Issues
- https://github.com/flutter/flutter/issues/135327
## Tests
- Added tests for `TapRegion` to make sure taps are consumed properly.
This PR is adding a listener to the `SearchController`, so that the `suggestionBuilder` can be updated when the `SearchController` changes.
Another method we can possibly do is have an update method on `SearchController`, so that the user can manually update the suggestions instead of us doing it automatically.
Fixes#132161
fixes [`flexible_space_bar.dart': Failed assertion: line 475 pos 12: 'needsCompositing': is not true.` is thrown when scrolling down in the list and then up](https://github.com/flutter/flutter/issues/135698)
This PR updates unit tests from bottom sheet tests for M3 migration.
More info in https://github.com/flutter/flutter/issues/127064
It also contains in bottom_sheet.dart where a default value took precedence over a theme attribute.
Fixes https://github.com/flutter/flutter/issues/134656
`_skipMarkNeesLayout` was meant to only skip `markNeedsLayout` calls. Re-painting is still needed when a child gets added/removed from the `Overlay`.
This PR mainly fixes several memory leaks in the `DateRangePickerDialog`.
### Description
- Fixes https://github.com/flutter/flutter/issues/136033 by:
1) adding a disposal of several `RestorableValue`;
2) creating a separate `_DayItem` stateful widget that creates/updates/disposes internal `MaterialStatesController`.
- Marks https://github.com/flutter/flutter/issues/136036.
### Tests
- Updates `test/material/date_picker_theme_test.dart` to use `testWidgetsWithLeakTracking`;
- Updates `test/material/date_range_picker_test.dart` to use `testWidgetsWithLeakTracking`.
## Description
This PR updates `_TabBarViewState.didUpdateWidget` in order to react to `TabBarView.viewportFraction`change.
## Related Issue
Fixes https://github.com/flutter/flutter/issues/135557.
## Tests
Adds 1 test.