Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setState textAlign for an input field throws error in textPainter #36640

Closed
kkacquah opened this issue Jul 21, 2019 · 3 comments
Closed

setState textAlign for an input field throws error in textPainter #36640

kkacquah opened this issue Jul 21, 2019 · 3 comments
Labels
a: text input Entering text in a text field or keyboard related problems f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Comments

@kkacquah
Copy link

Steps to Reproduce

Bellow is a starter app with the error, press the icon button in the lower right corner to see the error.

https://gist.github.com/kkacquah/ca9cbea9fdd34dbc5fe15396bbb8bc97

Logs

╞═════════════════════════════════════════════════════════
[   +3 ms] I/flutter ( 9087): The following assertion was thrown during paint():
[        ] I/flutter ( 9087): 'package:flutter/src/painting/text_painter.dart': Failed assertion: line 765 pos 12:
[        ] I/flutter ( 9087): '!_needsLayout': is not true.
[        ] I/flutter ( 9087):
[        ] I/flutter ( 9087): Either the assertion indicates an error in the framework itself, or we should provide
substantially
[        ] I/flutter ( 9087): more information in this error message to help you determine and fix the underlying
cause.
[        ] I/flutter ( 9087): In either case, please report this assertion by filing a bug on GitHub:
[        ] I/flutter ( 9087):   https://github.com/flutter/flutter/issues/new?template=BUG.md
[        ] I/flutter ( 9087):
[        ] I/flutter ( 9087): When the exception was thrown, this was the stack:
[        ] I/flutter ( 9087): #2      TextPainter._computeCaretMetrics
(package:flutter/src/painting/text_painter.dart:765:12)
[        ] I/flutter ( 9087): #3      TextPainter.getOffsetForCaret
(package:flutter/src/painting/text_painter.dart:739:5)
[        ] I/flutter ( 9087): #4      RenderEditable._updateSelectionExtentsVisibility
(package:flutter/src/rendering/editable.dart:308:45)
[        ] I/flutter ( 9087): #5      RenderEditable._paintContents
(package:flutter/src/rendering/editable.dart:1742:7)
[        ] I/flutter ( 9087): #6      RenderEditable.paint (package:flutter/src/rendering/editable.dart:1774:7)
[        ] I/flutter ( 9087): #7      RenderObject._paintWithContext
(package:flutter/src/rendering/object.dart:2089:7)
[        ] I/flutter ( 9087): #8      PaintingContext.paintChild (package:flutter/src/rendering/object.dart:172:13)
[        ] I/flutter ( 9087): #9
_RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.paint
(package:flutter/src/rendering/proxy_box.dart:123:15)
[        ] I/flutter ( 9087): #10     RenderObject._paintWithContext
(package:flutter/src/rendering/object.dart:2089:7)
[        ] I/flutter ( 9087): #11     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:172:13)
[        ] I/flutter ( 9087): #12
_RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.paint
(package:flutter/src/rendering/proxy_box.dart:123:15)
[        ] I/flutter ( 9087): #13     PaintingContext.pushLayer (package:flutter/src/rendering/object.dart:369:12)
[        ] I/flutter ( 9087): #14     RenderLeaderLayer.paint
(package:flutter/src/rendering/proxy_box.dart:4624:13)
[  +13 ms] I/flutter ( 9087): #15     RenderObject._paintWithContext
(package:flutter/src/rendering/object.dart:2089:7)
[        ] I/flutter ( 9087): #16     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:172:13)
[        ] I/flutter ( 9087): #17
_RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.paint
(package:flutter/src/rendering/proxy_box.dart:123:15)
[        ] I/flutter ( 9087): #18     RenderObject._paintWithContext
(package:flutter/src/rendering/object.dart:2089:7)
[        ] I/flutter ( 9087): #19     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:172:13)
[        ] I/flutter ( 9087): #20
_RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.paint
(package:flutter/src/rendering/proxy_box.dart:123:15)
[        ] I/flutter ( 9087): #21     RenderObject._paintWithContext
(package:flutter/src/rendering/object.dart:2089:7)
[        ] I/flutter ( 9087): #22     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:172:13)
[   +1 ms] I/flutter ( 9087): #23
_RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.paint
(package:flutter/src/rendering/proxy_box.dart:123:15)
[   +8 ms] I/flutter ( 9087): #24     RenderPointerListener.paint
(package:flutter/src/rendering/proxy_box.dart:2669:11)
[        ] I/flutter ( 9087): #25     RenderObject._paintWithContext
(package:flutter/src/rendering/object.dart:2089:7)
[        ] I/flutter ( 9087): #26     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:172:13)
[        ] I/flutter ( 9087): #27
_RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.paint
(package:flutter/src/rendering/proxy_box.dart:123:15)
[        ] I/flutter ( 9087): #28     RenderPointerListener.paint
(package:flutter/src/rendering/proxy_box.dart:2669:11)
[        ] I/flutter ( 9087): #29     RenderObject._paintWithContext
(package:flutter/src/rendering/object.dart:2089:7)
[        ] I/flutter ( 9087): #30     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:172:13)
[        ] I/flutter ( 9087): #31
_RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.paint
(package:flutter/src/rendering/proxy_box.dart:123:15)
[        ] I/flutter ( 9087): #32     RenderObject._paintWithContext
(package:flutter/src/rendering/object.dart:2089:7)
[        ] I/flutter ( 9087): #33     PaintingContext._repaintCompositedChild
(package:flutter/src/rendering/object.dart:127:11)
[        ] I/flutter ( 9087): #34     PaintingContext.repaintCompositedChild
(package:flutter/src/rendering/object.dart:95:5)
[        ] I/flutter ( 9087): #35     PipelineOwner.flushPaint (package:flutter/src/rendering/object.dart:858:29)
[        ] I/flutter ( 9087): #36
_WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding
&RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:348:19)
[        ] I/flutter ( 9087): #37
_WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding
&RendererBinding&WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:701:13)
[        ] I/flutter ( 9087): #38
_WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding
&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:285:5)
[        ] I/flutter ( 9087): #39
_WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback
(package:flutter/src/scheduler/binding.dart:1016:15)
[   +1 ms] I/flutter ( 9087): #40
_WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame
(package:flutter/src/scheduler/binding.dart:958:9)
[  +16 ms] I/flutter ( 9087): #41
_WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._handleDrawFrame
(package:flutter/src/scheduler/binding.dart:874:5)
[        ] I/flutter ( 9087): #45     _invoke (dart:ui/hooks.dart:236:10)
[        ] I/flutter ( 9087): #46     _drawFrame (dart:ui/hooks.dart:194:3)
[        ] I/flutter ( 9087): (elided 5 frames from class _AssertionError and package dart:async)
[        ] I/flutter ( 9087):
[        ] I/flutter ( 9087): The following RenderObject was being processed when the exception was fired:
RenderEditable#ce36a relayoutBoundary=up19:
[        ] I/flutter ( 9087):   creator: _Editable-[GlobalKey#aa79f] ← Semantics ← CompositedTransformTarget ←
[        ] I/flutter ( 9087):     IgnorePointer-[GlobalKey#c578a] ← Semantics ← Listener ←
[        ] I/flutter ( 9087):     RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#692a3] ← Listener ←
_ScrollableScope
[   +1 ms] I/flutter ( 9087):     ← RepaintBoundary ← CustomPaint ← RepaintBoundary ← ⋯
[        ] I/flutter ( 9087):   parentData: <none> (can use size)
[        ] I/flutter ( 9087):   constraints: BoxConstraints(w=371.4, 0.0<=h<=Infinity)
[        ] I/flutter ( 9087):   size: Size(371.4, 19.0)
[        ] I/flutter ( 9087):   cursorColor: Color(0x004285f4)
[        ] I/flutter ( 9087):   showCursor: ValueNotifier<bool>#5cc24(true)
[        ] I/flutter ( 9087):   maxLines: 1
[        ] I/flutter ( 9087):   minLines: null
[        ] I/flutter ( 9087):   selectionColor: Color(0xff90caf9)
[   +8 ms] I/flutter ( 9087):   textScaleFactor: 1.0
[        ] I/flutter ( 9087):   locale: en_US
[        ] I/flutter ( 9087):   selection: TextSelection(baseOffset: -1, extentOffset: -1, affinity:
TextAffinity.downstream,
[        ] I/flutter ( 9087):     isDirectional: false)
[        ] I/flutter ( 9087):   offset: ScrollPositionWithSingleContext#5e446(offset: 0.0, range: 0.0..0.0,
viewport: 371.4,
[        ] I/flutter ( 9087):     ScrollableState, ClampingScrollPhysics, IdleScrollActivity#4936c,
ScrollDirection.idle)
[        ] I/flutter ( 9087): This RenderObject had the following child:
[        ] I/flutter ( 9087):     text: TextSpan
[        ] I/flutter ( 9087):
    info - The value of the field '_counter' isn't used - lib\main.dart:47:7 - unused_field
   info - The method '_incrementCounter' isn't used - lib\main.dart:50:8 - unused_element
   info - Set literals weren't supported until version 2.2, but this code must be able to run on earlier versions -
          lib\main.dart:107:26 - sdk_version_set_literal
[√] Flutter (Channel stable, v1.7.8+hotfix.3, on Microsoft Windows [Version 10.0.17134.885], locale en-US)
    • Flutter version 1.7.8+hotfix.3 at C:\Users\aquar\flutter
    • Framework revision b712a172f9 (12 days ago), 2019-07-09 13:14:38 -0700
    • Engine revision 54ad777fd2
    • Dart version 2.4.0


[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at C:\Users\aquar\AppData\Local\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
    • All Android licenses accepted.

[√] Android Studio (version 3.4)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 35.3.1
    • Dart plugin version 183.6270
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

[√] Connected device (1 available)
    • Pixel 2 • HT7BY1A01742 • android-arm64 • Android 9 (API 28)

• No issues found!

@LongCatIsLooong LongCatIsLooong added a: text input Entering text in a text field or keyboard related problems f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels Jul 22, 2019
@huangbinjie
Copy link

still happen to me.

@mdebbar
Copy link
Contributor

mdebbar commented Nov 11, 2019

Duplicate of #20611

@mdebbar mdebbar marked this as a duplicate of #20611 Nov 11, 2019
@mdebbar mdebbar closed this as completed Nov 11, 2019
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: text input Entering text in a text field or keyboard related problems f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

No branches or pull requests

4 participants