浏览代码

DetailedPage: rebuild on actual change of shouldDisableScroll value

Neeraj Gupta 3 年之前
父节点
当前提交
a8e9c9d6d5
共有 1 个文件被更改,包括 5 次插入3 次删除
  1. 5 3
      lib/ui/detail_page.dart

+ 5 - 3
lib/ui/detail_page.dart

@@ -141,9 +141,11 @@ class _DetailPageState extends State<DetailPage> {
           autoPlay: !_hasPageChanged,
           autoPlay: !_hasPageChanged,
           tagPrefix: widget.config.tagPrefix,
           tagPrefix: widget.config.tagPrefix,
           shouldDisableScroll: (value) {
           shouldDisableScroll: (value) {
-            setState(() {
-              _shouldDisableScroll = value;
-            });
+            if (_shouldDisableScroll != value) {
+              setState(() {
+                _shouldDisableScroll = value;
+              });
+            }
           },
           },
           playbackCallback: (isPlaying) {
           playbackCallback: (isPlaying) {
             _shouldHideAppBar = isPlaying;
             _shouldHideAppBar = isPlaying;