tp7309 / flutter_sticky_and_expandable_list

粘性头部与分组列表Sliver实现 Build a grouped list, which support expand/collapse section and sticky headers, support use it with sliver widget.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error '_debugCanPerformMutations': is not true in Flutter v2.5.1

palancana opened this issue · comments

An assertion is being thrown when opening a collapsed header using the latest stable Flutter version, v2.5.1.

Error description

════════ Exception caught by scheduler library ═════════════════════════════════
The following assertion was thrown during a scheduler callback:
'package:flutter/src/rendering/object.dart': Failed assertion: line 1607 pos 12: '_debugCanPerformMutations': is not true.
2

Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=2_bug.md

When the exception was thrown, this was the stack
#2      RenderObject.markNeedsLayout  package:flutter/…/rendering/object.dart:1607
#3      RenderBox.markNeedsLayout  package:flutter/…/rendering/box.dart:2320
#4      RenderExpandableSectionContainer.scrollable=.<anonymous closure> 
 package:sticky_and_expandable_list/src/expandable_section_container.dart:171
#5      SchedulerBinding._invokeFrameCallback  package:flutter/…/scheduler/binding.dart:1143
#6      SchedulerBinding.handleDrawFrame  package:flutter/…/scheduler/binding.dart:1088
#7      SchedulerBinding._handleDrawFrame  package:flutter/…/scheduler/binding.dart:996
#11     _invoke (dart:ui/hooks.dart:166:10)
#12     PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:270:5)
#13     _drawFrame (dart:ui/hooks.dart:129:31)
(elided 5 frames from class _AssertionError and dart:async)
════════════════════════════════════════════════════════════════════════════════

Steps to reproduce it

Use the example project and run it using Flutter 2.5.1. In any of the examples, collapse any header and open it again. It will throw an error.

The error happens in both iOS simulator and Android emulator. I checked it also happens if you are debugging from a real iOS device.

My configuration

> flutter --version
Flutter 2.5.1 • channel stable • https://github.com/flutter/flutter.git
Framework • revision ffb2ecea52 (9 days ago) • 2021-09-17 15:26:33 -0400
Engine • revision b3af521a05
Tools • Dart 2.14.2
Error.mp4

I will check it.

Fix done, use 1.0.2 version.

It works like a charm! Just tested it now with Flutter stable channel (v2.5.2).

Thank you!