Enough-Software/enough_mail_app

widget lifecycle error on Linux

Opened this issue · 2 comments

maks commented

Sorry this is not a great bug report.

The error happens "a little while" after opening an email with some simple html content (a Github issue comment notification email) and it being displayed (successfully) displayed, after I hacked mime_messasge_viewer.dart to use HtmlWidget(htmlData); (from flutter_widget_from_html pkg) instead of a Webview (at line 300).

Given the nature of this error, I suspect that this maybe an issue with a Flutter SDK class on Linux but I thought I'd file it here as it does seem a bit strange. First off I can't really tell how Tooltip("Show menu") is related to MailAddressChip and I can't actually find where the code for that Tooltip widget is - I'm guessing it comes from another dependent pkg?

flutter: manichord.com S: + idling

════════ Exception caught by widgets library ═══════════════════════════════════
The following assertion was thrown building Tooltip("Show menu", dependencies: [_LocalizationsScope-[GlobalKey#f5b23], _InheritedTheme, _EffectiveTickerMode], state: _TooltipState#469dd(ticker inactive)):
A RenderObject was still attached when attempting to deactivate its RenderObjectElement: RenderMouseRegion#b8734 relayoutBoundary=up7
'package:flutter/src/widgets/framework.dart':
package:flutter/…/widgets/framework.dart:1
Failed assertion: line 5730 pos 7: '!renderObject.attached'

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

The relevant error-causing widget was
PlatformPopupMenuButton<_AddressAction>
lib/widgets/mail_address_chip.dart:29
When the exception was thrown, this was the stack
#2      RenderObjectElement.deactivate
package:flutter/…/widgets/framework.dart:5730
#3      _InactiveElements._deactivateRecursively
package:flutter/…/widgets/framework.dart:1901
#4      ComponentElement.visitChildren
package:flutter/…/widgets/framework.dart:4642
#5      _InactiveElements._deactivateRecursively
package:flutter/…/widgets/framework.dart:1903
#6      _InactiveElements.add
package:flutter/…/widgets/framework.dart:1915
#7      Element.deactivateChild
package:flutter/…/widgets/framework.dart:3667
#8      Element.updateChild
package:flutter/…/widgets/framework.dart:3378
#9      ComponentElement.performRebuild
package:flutter/…/widgets/framework.dart:4613
#10     StatefulElement.performRebuild
package:flutter/…/widgets/framework.dart:4763
#11     Element.rebuild
package:flutter/…/widgets/framework.dart:4311
#12     BuildOwner.buildScope
package:flutter/…/widgets/framework.dart:2578
#13     WidgetsBinding.drawFrame
package:flutter/…/widgets/binding.dart:882
#14     RendererBinding._handlePersistentFrameCallback
package:flutter/…/rendering/binding.dart:363
#15     SchedulerBinding._invokeFrameCallback
package:flutter/…/scheduler/binding.dart:1145
#16     SchedulerBinding.handleDrawFrame
package:flutter/…/scheduler/binding.dart:1082
#17     SchedulerBinding._handleDrawFrame
package:flutter/…/scheduler/binding.dart:996
#21     _invoke (dart:ui/hooks.dart:150:10)
#22     PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:270:5)
#23     _drawFrame (dart:ui/hooks.dart:114:31)
(elided 5 frames from class _AssertionError and dart:async)
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by widgets library ═══════════════════════════════════
A RenderObject was still attached when attempting to deactivate its RenderObjectElement: RenderMouseRegion#2cd7f relayoutBoundary=up7
'package:flutter/src/widgets/framework.dart':
package:flutter/…/widgets/framework.dart:1
Failed assertion: line 5730 pos 7: '!renderObject.attached'

The relevant error-causing widget was
PlatformPopupMenuButton<_AddressAction>
lib/widgets/mail_address_chip.dart:29
════════════════════════════════════════════════════════════════════════════════

For what it's worth, the PlatformPopupMenuButton is my code. Thanks for the report, I'll check it out.

as you might heard Flutter 2.10 was released earlier today with stable Windows support. On Windows I could not reproduce the problem. Can you try to recheck if the problem was solved in Flutter 2.10?