Skip to content

Failed assertion: line x pos y: '!_needsLayout': is not true. #78172

Closed
@Octofoxy

Description

@Octofoxy

I got an error message, which asks me to file a bug report. You can find the lib folder and pubspec.yaml in the zip.

�[38;5;248m════════ Exception caught by rendering library ═════════════════════════════════�[39;49m
�[38;5;244mThe following assertion was thrown during paint():�


[39;49m
'package:flutter/src/painting/text_painter.dart': Failed assertion: line 488 pos 12: '!_needsLayout': is not true.

�[38;5;248mEither 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=BUG.md
�[39;49m

�[38;5;244mThe relevant error-causing widget was�[39;49m
�[38;5;248mSlider�[39;49m
�[38;5;244mWhen the exception was thrown, this was the stack�[39;49m
�[38;5;244m#2      TextPainter.width�[39;49m
�[38;5;244m#3      _PaddleSliderValueIndicatorPathPainter.paint�[39;49m
�[38;5;244m#4      PaddleSliderValueIndicatorShape.paint�[39;49m
�[38;5;248m#5      ThumbShape.paint�[39;49m
�[38;5;244m#6      _RenderSlider.paint�[39;49m
�[38;5;244m...�[39;49m
�[38;5;244mThe following RenderObject was being processed when the exception was fired: _RenderSlider#dc1b6�[39;49m
�[38;5;244mRenderObject: _RenderSlider#dc1b6�[39;49m
    �[38;5;244mparentData: <none> (can use size)�[39;49m
    �[38;5;244mconstraints: BoxConstraints(0.0<=w<=411.4, 0.0<=h<=Infinity)�[39;49m
    �[38;5;244msize: Size(411.4, 48.0)�[39;49m
�[38;5;248m════════════════════════════════════════════════════════════════════════════════�[39;49m

�[38;5;248m════════ Exception caught by rendering library ═════════════════════════════════�[39;49m
'package:flutter/src/painting/text_painter.dart': Failed assertion: line 488 pos 12: '!_needsLayout': is not true.
�[38;5;244mThe relevant error-causing widget was�[39;49m
�[38;5;248mSlider�[39;49m
�[38;5;248m════════════════════════════════════════════════════════════════════════════════�[39;49m

�[38;5;248m════════ Exception caught by rendering library ═════════════════════════════════�[39;49m
'package:flutter/src/painting/text_painter.dart': Failed assertion: line 488 pos 12: '!_needsLayout': is not true.
�[38;5;244mThe relevant error-causing widget was�[39;49m
�[38;5;248mSlider�[39;49m
�[38;5;248m════════════════════════════════════════════════════════════════════════════════�[39;49m

�[38;5;248m════════ Exception caught by rendering library ═════════════════════════════════�[39;49m
'package:flutter/src/painting/text_painter.dart': Failed assertion: line 488 pos 12: '!_needsLayout': is not true.
�[38;5;244mThe relevant error-causing widget was�[39;49m
�[38;5;248mSlider�[39;49m
�[38;5;248m════════════════════════════════════════════════════════════════════════════════�[39;49m

�[38;5;248m════════ Exception caught by rendering library ═════════════════════════════════�[39;49m
'package:flutter/src/painting/text_painter.dart': Failed assertion: line 488 pos 12: '!_needsLayout': is not true.
�[38;5;244mThe relevant error-causing widget was�[39;49m
�[38;5;248mSlider�[39;49m
�[38;5;248m════════════════════════════════════════════════════════════════════════════════�[39;49m

Short explanation of what you will find in the zip:
I built a widget, "MultiSlider", which uses the standard Flutter sliders. The widgets returns a master slider and a number of subsliders. The sum of the subsliders values can never exceed the value of the masterslider. The widget itself works fine without errors.

I also have a custom thumb button, which itself works fine and without errors on the example slider from the Flutter documentation. However, when I introduced SliderTheme() to use the custom thumb button with the sliders contained in my MultiSlider widget, I got those errors.
lib.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: error messageError messages from the Flutter frameworkf: material designflutter/packages/flutter/material repository.found in release: 2.1Found to occur in 2.1frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: solvedIssue is closed as solvedteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions