feat: add Page.theme_animation_style for customizing theme transitions#6476
Merged
Conversation
Exposes Flutter's `MaterialApp.themeAnimationStyle` as a new `Optional[AnimationStyle]` property on `Page`, letting apps override the duration and curve of the cross-fade between `theme` and `dark_theme`, or disable it entirely via `AnimationStyle.no_animation()`. Adds a showcase example under `examples/controls/core/types/theme_animation_style/` that toggles between Default, Custom, and None styles alongside a Switch Theme Mode button.
Deploying flet-examples with
|
| Latest commit: |
3e7ff60
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://99664ba7.flet-examples.pages.dev |
| Branch Preview URL: | https://theme-animation-style.flet-examples.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Page.theme_animation_style: Optional[AnimationStyle], exposing Flutter'sMaterialApp.themeAnimationStyleso apps can tune the duration/curve of the cross-fade betweenthemeanddark_theme— or disable it entirely viaAnimationStyle.no_animation().MaterialApp(...)andMaterialApp.router(...)constructions inpackages/flet/lib/src/controls/page.dart(CupertinoApp branches are unchanged — Flutter has no equivalent there).sdk/python/examples/controls/core/types/theme_animation_style/showcase/that lets the user pick between Default, Custom (2 s easeInOutCubic), and None styles, with a "Switch Theme Mode" button that toggles light/dark so the chosen transition is observable.Test plan
cd sdk/python/examples/controls/core/types/theme_animation_style/showcase && flet run main.pycore/types/theme_mode/showcase) still runs unchanged withtheme_animation_styledefaulting toNoneSummary by Sourcery
Expose configurable theme animation style on Page and showcase its usage.
New Features:
Documentation:
Tests: