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 @@ -98,6 +98,7 @@ class ImageEmojiWidget extends StatelessWidget {
98
98
required this .size,
99
99
this .textScaler = TextScaler .noScaling,
100
100
this .errorBuilder,
101
+ this .neverAnimate = false ,
101
102
});
102
103
103
104
final ImageEmojiDisplay emojiDisplay;
@@ -114,13 +115,20 @@ class ImageEmojiWidget extends StatelessWidget {
114
115
115
116
final ImageErrorWidgetBuilder ? errorBuilder;
116
117
118
+ /// Whether to show an animated emoji in its still (non-animated) variant
119
+ /// only, even if device settings permit animation.
120
+ ///
121
+ /// Defaults to false.
122
+ final bool neverAnimate;
123
+
117
124
@override
118
125
Widget build (BuildContext context) {
119
126
// Some people really dislike animated emoji.
120
127
final doNotAnimate =
128
+ neverAnimate
121
129
// From reading code, this doesn't actually get set on iOS:
122
130
// https://github.com/zulip/zulip-flutter/pull/410#discussion_r1408522293
123
- MediaQuery .disableAnimationsOf (context)
131
+ || MediaQuery .disableAnimationsOf (context)
124
132
|| (defaultTargetPlatform == TargetPlatform .iOS
125
133
// TODO(upstream) On iOS 17+ (new in 2023), there's a more closely
126
134
// relevant setting than "reduce motion". It's called "auto-play
You can’t perform that action at this time.
0 commit comments