image anim patch

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-05-15 19:53:52 +08:00
parent 04b8d92ff7
commit 6310a4ffaf
4 changed files with 18 additions and 5 deletions

View File

@@ -390,9 +390,7 @@ class _ImageState extends State<Image> with WidgetsBindingObserver {
void didChangeDependencies() { void didChangeDependencies() {
_resolveImage(); _resolveImage();
_isPaused = _isPaused = !TickerMode.valuesOf(context).enabled;
!TickerMode.valuesOf(context).enabled ||
(MediaQuery.maybeDisableAnimationsOf(context) ?? false);
if (_isPaused && _frameNumber != null) { if (_isPaused && _frameNumber != null) {
_stopListeningToStream(keepStreamAlive: true); _stopListeningToStream(keepStreamAlive: true);

View File

@@ -0,0 +1,13 @@
diff --git a/packages/flutter/lib/src/widgets/image.dart b/packages/flutter/lib/src/widgets/image.dart
index 30429ea5e02..b58f4343440 100644
--- a/packages/flutter/lib/src/widgets/image.dart
+++ b/packages/flutter/lib/src/widgets/image.dart
@@ -1148,7 +1148,7 @@ class _ImageState extends State<Image> with WidgetsBindingObserver {
_updateInvertColors();
_resolveImage();
- _isPaused = !TickerMode.of(context) || (MediaQuery.maybeDisableAnimationsOf(context) ?? false);
+ _isPaused = !TickerMode.of(context);
if (_isPaused && _frameNumber != null) {
_stopListeningToStream(keepStreamAlive: true);

View File

@@ -22,7 +22,9 @@ $PaddingPatch = "lib/scripts/padding.patch"
# https://github.com/flutter/flutter/issues/56239 # https://github.com/flutter/flutter/issues/56239
# ref https://github.com/flutter/flutter/pull/184549 # ref https://github.com/flutter/flutter/pull/184549
$ImagePatch = "lib/scripts/image.patch" $ImageCachePatch = "lib/scripts/image_cache.patch"
$ImageAnimPatch = "lib/scripts/image_anim.patch"
# TODO: remove # TODO: remove
# https://github.com/flutter/flutter/issues/90223 # https://github.com/flutter/flutter/issues/90223
@@ -37,7 +39,7 @@ Set-Location $env:FLUTTER_ROOT
$picks = @() $picks = @()
$reverts = @() $reverts = @()
$patches = @($ModalBarrierPatch, $TextSelectionPatch, $MouseCursorPatch, $patches = @($ModalBarrierPatch, $TextSelectionPatch, $MouseCursorPatch,
$NavigationBarPatch, $PaddingPatch, $ImagePatch) $NavigationBarPatch, $PaddingPatch, $ImageCachePatch, $ImageAnimPatch)
switch ($platform.ToLower()) { switch ($platform.ToLower()) {
"android" { "android" {