File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ class ImageEmojiWidget extends StatelessWidget {
89
89
required this .size,
90
90
this .textScaler = TextScaler .noScaling,
91
91
this .errorBuilder,
92
+ this .neverAnimate = false ,
92
93
});
93
94
94
95
final ImageEmojiDisplay emojiDisplay;
@@ -105,13 +106,20 @@ class ImageEmojiWidget extends StatelessWidget {
105
106
106
107
final ImageErrorWidgetBuilder ? errorBuilder;
107
108
109
+ /// Whether to show an animated emoji in its "still (non-animated)" variant
110
+ /// only, even if device settings permit animation.
111
+ ///
112
+ /// Defaults to false.
113
+ final bool neverAnimate;
114
+
108
115
@override
109
116
Widget build (BuildContext context) {
110
117
// Some people really dislike animated emoji.
111
118
final doNotAnimate =
119
+ neverAnimate
112
120
// From reading code, this doesn't actually get set on iOS:
113
121
// https://github.com/zulip/zulip-flutter/pull/410#discussion_r1408522293
114
- MediaQuery .disableAnimationsOf (context)
122
+ || MediaQuery .disableAnimationsOf (context)
115
123
|| (defaultTargetPlatform == TargetPlatform .iOS
116
124
// TODO(upstream) On iOS 17+ (new in 2023), there's a more closely
117
125
// relevant setting than "reduce motion". It's called "auto-play
You can’t perform that action at this time.
0 commit comments