Closed MitchellGoodwin closed 3 months ago
Latest commit: 0c19ea2406c097121cd0439291f4082569f01703
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Considering MaterialStatesController is deprecated, the failing "hook" should be deprecated too.
Does this PR have to land before https://github.com/rrousselGit/flutter_hooks/pull/421?
I'd rather:
useWidgetStatesController
using non-deprecated APIWidgetStatesController
in the test (rather than have the test depend on deprecated API)All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 98.36%. Comparing base (
15fdb4f
) to head (0c19ea2
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Does this PR have to land before https://github.com/rrousselGit/flutter_hooks/pull/421?
I saw that the Flutter PR broke the test in this package, so I wanted to add a fix for the test that would pass both before and after the change in Flutter. Theoretically #421 can land before flutter/142151, then a useWidgetStatesController
could be added anytime before MaterialStatesController
is removed after being marked deprecated.
But if you'd rather not adjust the upcoming broken test and add a useWidgetStatesController
right away, then that's fine too.
Awesome. I'd rather keep things are they are right now then. The failing test will serve as a reminder to switch to the new API once the CI fails :)
Thanks a lot for the heads up though!
No problem. I'll close the PR 👍
Flutter is moving MaterialState, and it's related functions outside of the Material library and changing it's name to WidgetState. MaterialState will still be available as is, just marked deprecated, and made a typedef of WidgetState. However this causes MaterialState debug functions to return with strings mentioning "WidgetState", and is a breaking change for packages using those functions. The PR that will add that change to Flutter is here, and the original issue is here.
Internal testing found this caused a breakage in this package, so this PR updates the test for
useMaterialStatesController
to pass both before and after that change is landed.