Skip to content

flexible_space_bar.dart': Failed assertion: line 475 pos 12: 'needsCompositing': is not true. is thrown when scrolling down in the list and then up  #135698

Closed

Description

@CardosoShlomo

this issue is also represented at #135486

Code sample
main() => runApp(MaterialApp(
    home: NestedScrollView(
      headerSliverBuilder: (context, _) => [SliverOverlapAbsorber(
        handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
        sliver: SliverAppBar(
          expandedHeight: 300,
          pinned: true,
          flexibleSpace: FlexibleSpaceBar(background: SizedBox()),
        ),
      )],
      body: SizedBox(),
    ),
  ));

Why it happens

the cause for the issue is that RenderOpacity use _alpha to override alwaysNeedsCompositing
and _RenderFlexibleSpaceHeaderOpacity doesn't use it before the needCompositing assertion.

RenderOpacity
RenderOpacity({
    double opacity = 1.0,
    bool alwaysIncludeSemantics = false,
    RenderBox? child,
  }) : assert(opacity >= 0.0 && opacity <= 1.0),
       _opacity = opacity,
       _alwaysIncludeSemantics = alwaysIncludeSemantics,
       _alpha = ui.Color.getAlphaFromOpacity(opacity),
       super(child);

  @override
  bool get alwaysNeedsCompositing => child != null && _alpha > 0;

My Recommended solution

_RenderFlexibleSpaceHeaderOpacity:

before
if (opacity == 0) {
  layer = null;
  return;
}
assert(needsCompositing);
after
if (ui.Color.getAlphaFromOpacity(opacity) == 0) {
  layer = null;
  return;
}
assert(needsCompositing);

Logs

Logs
======== Exception caught by rendering library =====================================================
The following assertion was thrown during paint():
'package:flutter/src/material/flexible_space_bar.dart': Failed assertion: line 467 pos 12: 'needsCompositing': is not true.


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.yml

The relevant error-causing widget was: 
  FlexibleSpaceBar FlexibleSpaceBar:file:///C:/Users/shlom/StudioProjects/imagine-ai/lib/pages/settings_page/cloud_page/cloud_app_bar.dart:27:24
When the exception was thrown, this was the stack: 
#2      _RenderFlexibleSpaceHeaderOpacity.paint (package:flutter/src/material/flexible_space_bar.dart:467:12)
#3      RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3155:7)
#4      PaintingContext.paintChild (package:flutter/src/rendering/object.dart:252:13)
#5      RenderBoxContainerDefaultsMixin.defaultPaint (package:flutter/src/rendering/box.dart:2875:15)
#6      RenderStack.paintStack (package:flutter/src/rendering/stack.dart:639:5)
#7      PaintingContext.pushClipRect.<anonymous closure> (package:flutter/src/rendering/object.dart:535:83)
#8      ClipContext._clipAndPaint (package:flutter/src/painting/clip.dart:25:12)
#9      ClipContext.clipRectAndPaint (package:flutter/src/painting/clip.dart:53:5)
#10     PaintingContext.pushClipRect (package:flutter/src/rendering/object.dart:535:7)
#11     RenderStack.paint (package:flutter/src/rendering/stack.dart:645:38)
#12     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3155:7)
#13     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:252:13)
#14     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:129:13)
#15     PaintingContext.pushClipRect.<anonymous closure> (package:flutter/src/rendering/object.dart:535:83)
#16     ClipContext._clipAndPaint (package:flutter/src/painting/clip.dart:25:12)
#17     ClipContext.clipRectAndPaint (package:flutter/src/painting/clip.dart:53:5)
#18     PaintingContext.pushClipRect (package:flutter/src/rendering/object.dart:535:7)
#19     RenderClipRect.paint (package:flutter/src/rendering/proxy_box.dart:1530:25)
#20     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3155:7)
#21     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:252:13)
#22     _RenderLayoutBuilder.paint (package:flutter/src/widgets/layout_builder.dart:338:15)
#23     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3155:7)
#24     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:252:13)
#25     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:129:13)
#26     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3155:7)
#27     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:252:13)
#28     RenderBoxContainerDefaultsMixin.defaultPaint (package:flutter/src/rendering/box.dart:2875:15)
#29     RenderStack.paintStack (package:flutter/src/rendering/stack.dart:639:5)
#30     RenderStack.paint (package:flutter/src/rendering/stack.dart:655:7)
#31     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3155:7)
#32     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:252:13)
#33     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:129:13)
#34     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3155:7)
#35     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:252:13)
#36     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:129:13)
#37     _RenderInkFeatures.paint (package:flutter/src/material/material.dart:664:11)
#38     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3155:7)
#39     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:252:13)
#40     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:129:13)
#41     RenderPhysicalModel.paint.<anonymous closure> (package:flutter/src/rendering/proxy_box.dart:2049:15)
#42     PaintingContext.pushClipRRect (package:flutter/src/rendering/object.dart:561:14)
#43     RenderPhysicalModel.paint (package:flutter/src/rendering/proxy_box.dart:2036:21)
#44     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3155:7)
#45     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:252:13)
#46     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:129:13)
#47     PaintingContext.pushLayer (package:flutter/src/rendering/object.dart:472:12)
#48     RenderAnnotatedRegion.paint (package:flutter/src/rendering/proxy_box.dart:5045:13)
#49     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3155:7)
#50     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:252:13)
#51     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:129:13)
#52     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3155:7)
#53     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:252:13)
#54     RenderSliverPersistentHeader.paint (package:flutter/src/rendering/sliver_persistent_header.dart:311:15)
#55     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3155:7)
#56     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:252:13)
#57     RenderSliverOverlapAbsorber.paint (package:flutter/src/widgets/nested_scroll_view.dart:1827:15)
#58     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3155:7)
#59     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:252:13)
#60     RenderViewportBase._paintContents (package:flutter/src/rendering/viewport.dart:690:17)
#61     PaintingContext.pushLayer (package:flutter/src/rendering/object.dart:472:12)
#62     PaintingContext.pushClipRect (package:flutter/src/rendering/object.dart:532:7)
#63     RenderViewportBase.paint (package:flutter/src/rendering/viewport.dart:665:38)
#64     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3155:7)
#65     PaintingContext._repaintCompositedChild (package:flutter/src/rendering/object.dart:168:11)
#66     PaintingContext.repaintCompositedChild (package:flutter/src/rendering/object.dart:111:5)
#67     PipelineOwner.flushPaint (package:flutter/src/rendering/object.dart:1144:31)
#68     RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:496:19)
#69     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:918:13)
#70     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:360:5)
#71     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1297:15)
#72     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1227:9)
#73     SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1085:5)
#74     _invoke (dart:ui/hooks.dart:170:13)
#75     PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:401:5)
#76     _drawFrame (dart:ui/hooks.dart:140:31)
(elided 2 frames from class _AssertionError)
The following RenderObject was being processed when the exception was fired: _RenderFlexibleSpaceHeaderOpacity#07433
...  parentData: top=-39.5; right=0.0; left=0.0; height=295.5; offset=Offset(0.0, -39.5) (can use size)
...  constraints: BoxConstraints(w=345.6, h=295.5)
...  layer: OpacityLayer#dd7ac DETACHED
...    engine layer: OpacityEngineLayer#091af
...    handles: 2
...    offset: Offset(0.0, -30.9)
...    alpha: 156
...  size: Size(345.6, 295.5)
...  opacity: 0.0
...  alwaysIncludeSemantics
RenderObject: _RenderFlexibleSpaceHeaderOpacity#07433
  parentData: top=-39.5; right=0.0; left=0.0; height=295.5; offset=Offset(0.0, -39.5) (can use size)
  constraints: BoxConstraints(w=345.6, h=295.5)
  layer: OpacityLayer#dd7ac DETACHED
    engine layer: OpacityEngineLayer#091af
    handles: 2
    offset: Offset(0.0, -30.9)
    alpha: 156
  size: Size(345.6, 295.5)
  opacity: 0.0
  alwaysIncludeSemantics

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel beta, 3.13.0-0.3.pre, on Microsoft Windows [Version 10.0.22621.2283], locale en-IL)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.5.5)
[√] Android Studio (version 4.1)
[√] Android Studio (version 2021.2)
[√] Android Studio (version 2023.1)
[√] VS Code (version 1.82.2)
[√] Connected device (4 available)
[√] Network resources

• No issues found!

Activity

  1. changed the title [-]'package:flutter/src/material/flexible_space_bar.dart': Failed assertion: line 467 pos 12: 'needsCompositing': is not true.[/-] [+]Failed assertion: line 467 pos 12: 'needsCompositing': is not true.[/+] on Sep 28, 2023
  2. added
    in triagePresently being triaged by the triage team
    on Sep 29, 2023
  3. huycozy commented on Sep 29, 2023

    @huycozy
    Member

    Hi @CardosoShlomo
    Could you share the steps to reproduce this issue? I can't reproduce it on the latest Flutter channels with your sample code above. Verifying on Android platform.

    flutter doctor -v (stable, beta, master)
    [✓] Flutter (Channel stable, 3.13.6, on macOS 14.0 23A344 darwin-x64, locale en-VN)
        • Flutter version 3.13.6 on channel stable at /Users/huynq/Documents/GitHub/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision ead455963c (2 days ago), 2023-09-26 18:28:17 -0700
        • Engine revision a794cf2681
        • Dart version 3.1.3
        • DevTools version 2.25.0
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
        • Android SDK at /Users/huynq/Library/Android/sdk
        • Platform android-34, build-tools 32.0.0
        • ANDROID_HOME = /Users/huynq/Library/Android/sdk
        • Java binary at: /Applications/Android Studio Giraffe.app/Contents/jbr/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 15.0)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Build 15A240d
        • CocoaPods version 1.11.3
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2022.3)
        • Android Studio at /Applications/Android Studio Giraffe.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    
    [✓] Android Studio (version 2022.2)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    
    [✓] VS Code (version 1.82.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.72.0
    
    [✓] Connected device (2 available)
        • macOS (desktop) • macos  • darwin-x64     • macOS 14.0 23A344 darwin-x64
        • Chrome (web)    • chrome • web-javascript • Google Chrome 117.0.5938.132
    
    [✓] Network resources
        • All expected network resources are available.
    
    • No issues found!
    [!] Flutter (Channel master, 3.15.0-11.0.pre.43, on macOS 14.0 23A344 darwin-x64, locale en-VN)
        • Flutter version 3.15.0-11.0.pre.43 on channel master at /Users/huynq/Documents/GitHub/flutter_master
        ! Warning: `flutter` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
        ! Warning: `dart` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 96e6f18cf3 (24 minutes ago), 2023-09-28 23:19:12 -0400
        • Engine revision 2052515c44
        • Dart version 3.2.0 (build 3.2.0-210.0.dev)
        • DevTools version 2.28.1
        • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
        • Android SDK at /Users/huynq/Library/Android/sdk
        • Platform android-34, build-tools 32.0.0
        • ANDROID_HOME = /Users/huynq/Library/Android/sdk
        • Java binary at: /Applications/Android Studio Giraffe.app/Contents/jbr/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 15.0)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Build 15A240d
        • CocoaPods version 1.11.3
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2022.3)
        • Android Studio at /Applications/Android Studio Giraffe.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    
    [✓] Android Studio (version 2022.2)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    
    [✓] VS Code (version 1.82.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.72.0
    
    [✓] Connected device (2 available)
        • macOS (desktop) • macos  • darwin-x64     • macOS 14.0 23A344 darwin-x64
        • Chrome (web)    • chrome • web-javascript • Google Chrome 117.0.5938.132
    
    [✓] Network resources
        • All expected network resources are available.
    
    ! Doctor found issues in 1 category.
    [!] Flutter (Channel beta, 3.15.0-15.2.pre, on macOS 14.0 23A344 darwin-x64, locale en-VN)
        • Flutter version 3.15.0-15.2.pre on channel beta at /Users/huynq/Documents/GitHub/flutter_beta
        ! Warning: `flutter` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_beta. Consider adding /Users/huynq/Documents/GitHub/flutter_beta/bin to the front of your path.
        ! Warning: `dart` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_beta. Consider adding /Users/huynq/Documents/GitHub/flutter_beta/bin to the front of your path.
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 0d074ced6c (7 days ago), 2023-09-21 10:24:15 -0700
        • Engine revision 453411bcf3
        • Dart version 3.2.0 (build 3.2.0-134.1.beta)
        • DevTools version 2.27.0
        • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
        • Android SDK at /Users/huynq/Library/Android/sdk
        • Platform android-34, build-tools 32.0.0
        • ANDROID_HOME = /Users/huynq/Library/Android/sdk
        • Java binary at: /Applications/Android Studio Giraffe.app/Contents/jbr/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 15.0)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Build 15A240d
        • CocoaPods version 1.11.3
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2022.3)
        • Android Studio at /Applications/Android Studio Giraffe.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    
    [✓] Android Studio (version 2022.2)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    
    [✓] VS Code (version 1.82.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.72.0
    
    [✓] Connected device (2 available)
        • macOS (desktop) • macos  • darwin-x64     • macOS 14.0 23A344 darwin-x64
        • Chrome (web)    • chrome • web-javascript • Google Chrome 117.0.5938.132
    
    [✓] Network resources
        • All expected network resources are available.
    
    ! Doctor found issues in 1 category.
  4. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Sep 29, 2023
  5. ThHareau commented on Oct 4, 2023

    @ThHareau
    Contributor

    Hey, I can repro as well, but with an example a bit more complex:

    Disclaimer: I'm relatively new to flutter, maybe I do not understand something here

    import 'package:flutter/material.dart';
    
    void main() {
      runApp(MaterialApp(
        home: NestedScrollView(
          headerSliverBuilder: (context, _) => [
            SliverOverlapAbsorber(
              handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
              sliver: const SliverAppBar(
                expandedHeight: 300,
                pinned: true,
                flexibleSpace: FlexibleSpaceBar(background: SizedBox()),
              ),
            )
          ],
          body: ListView(
            children: List.filled(
              32,
              const Card(
                color: Colors.amber,
                child: Padding(
                  padding: EdgeInsets.all(32.0),
                  child: Text('123'),
                ),
              ),
            ),
          ),
        ),
      ));
    }

    Then to repro, on android, scroll down in the list and then up. When scrolling up in the list the exception should occur.

    I tried on dart pad or linux sdk, I wasn't able to repro.

    My flutter doctor:

    flutter doctor                                         stable
    Doctor summary (to see all details, run flutter doctor -v):
    [✓] Flutter (Channel stable, 3.13.6, on Fedora Linux 38 (Workstation Edition)
        6.4.15-200.fc38.x86_64, locale fr_FR.UTF-8)
    [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    [✗] Chrome - develop for the web (Cannot find Chrome executable at
        google-chrome)
        ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
    [✓] Linux toolchain - develop for Linux desktop
    [✓] Android Studio (version 2023.1)
    [✓] Connected device (2 available)
    [✓] Network resources
    
  6. huycozy commented on Oct 5, 2023

    @huycozy
    Member

    Thank @ThHareau for the sample code and steps to reproduce, I also can reproduce it on the latest master channel.

    Output exception
    ======== Exception caught by rendering library =====================================================
    The following assertion was thrown during paint():
    'package:flutter/src/material/flexible_space_bar.dart': Failed assertion: line 475 pos 12: 'needsCompositing': is not true.
    
    
    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.yml
    
    The relevant error-causing widget was: 
      FlexibleSpaceBar FlexibleSpaceBar:file:///Users/huynq/Documents/NEVERCODE.IO/RepoduceProjects/reproduce_issues_2/lib/failed_135698.dart:12:28
    When the exception was thrown, this was the stack: 
    #2      _RenderFlexibleSpaceHeaderOpacity.paint (package:flutter/src/material/flexible_space_bar.dart:475:12)
    #3      RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3208:7)
    #4      PaintingContext.paintChild (package:flutter/src/rendering/object.dart:250:13)
    #5      RenderBoxContainerDefaultsMixin.defaultPaint (package:flutter/src/rendering/box.dart:2882:15)
    #6      RenderStack.paintStack (package:flutter/src/rendering/stack.dart:640:5)
    #7      PaintingContext.pushClipRect.<anonymous closure> (package:flutter/src/rendering/object.dart:549:83)
    #8      ClipContext._clipAndPaint (package:flutter/src/painting/clip.dart:25:12)
    #9      ClipContext.clipRectAndPaint (package:flutter/src/painting/clip.dart:53:5)
    #10     PaintingContext.pushClipRect (package:flutter/src/rendering/object.dart:549:7)
    #11     RenderStack.paint (package:flutter/src/rendering/stack.dart:646:38)
    #12     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3208:7)
    #13     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:250:13)
    #14     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:129:13)
    #15     PaintingContext.pushClipRect.<anonymous closure> (package:flutter/src/rendering/object.dart:549:83)
    #16     ClipContext._clipAndPaint (package:flutter/src/painting/clip.dart:25:12)
    #17     ClipContext.clipRectAndPaint (package:flutter/src/painting/clip.dart:53:5)
    #18     PaintingContext.pushClipRect (package:flutter/src/rendering/object.dart:549:7)
    #19     RenderClipRect.paint (package:flutter/src/rendering/proxy_box.dart:1532:25)
    #20     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3208:7)
    #21     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:250:13)
    #22     _RenderLayoutBuilder.paint (package:flutter/src/widgets/layout_builder.dart:333:15)
    #23     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3208:7)
    #24     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:250:13)
    #25     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:129:13)
    #26     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3208:7)
    #27     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:250:13)
    #28     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:129:13)
    #29     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3208:7)
    #30     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:250:13)
    #31     RenderBoxContainerDefaultsMixin.defaultPaint (package:flutter/src/rendering/box.dart:2882:15)
    #32     RenderStack.paintStack (package:flutter/src/rendering/stack.dart:640:5)
    #33     RenderStack.paint (package:flutter/src/rendering/stack.dart:656:7)
    #34     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3208:7)
    #35     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:250:13)
    #36     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:129:13)
    #37     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3208:7)
    #38     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:250:13)
    #39     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:129:13)
    #40     _RenderInkFeatures.paint (package:flutter/src/material/material.dart:662:11)
    #41     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3208:7)
    #42     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:250:13)
    #43     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:129:13)
    #44     RenderPhysicalModel.paint.<anonymous closure> (package:flutter/src/rendering/proxy_box.dart:2043:15)
    #45     PaintingContext.pushClipRRect (package:flutter/src/rendering/object.dart:575:14)
    #46     RenderPhysicalModel.paint (package:flutter/src/rendering/proxy_box.dart:2030:21)
    #47     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3208:7)
    #48     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:250:13)
    #49     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:129:13)
    #50     PaintingContext.pushLayer (package:flutter/src/rendering/object.dart:486:12)
    #51     RenderAnnotatedRegion.paint (package:flutter/src/rendering/proxy_box.dart:5027:13)
    #52     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3208:7)
    #53     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:250:13)
    #54     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:129:13)
    #55     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3208:7)
    #56     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:250:13)
    #57     RenderSliverPersistentHeader.paint (package:flutter/src/rendering/sliver_persistent_header.dart:311:15)
    #58     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3208:7)
    #59     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:250:13)
    #60     RenderSliverOverlapAbsorber.paint (package:flutter/src/widgets/nested_scroll_view.dart:1831:15)
    #61     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3208:7)
    #62     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:250:13)
    #63     RenderViewportBase._paintContents (package:flutter/src/rendering/viewport.dart:757:17)
    #64     PaintingContext.pushLayer (package:flutter/src/rendering/object.dart:486:12)
    #65     PaintingContext.pushClipRect (package:flutter/src/rendering/object.dart:546:7)
    #66     RenderViewportBase.paint (package:flutter/src/rendering/viewport.dart:732:38)
    #67     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3208:7)
    #68     PaintingContext._repaintCompositedChild (package:flutter/src/rendering/object.dart:166:11)
    #69     PaintingContext.repaintCompositedChild (package:flutter/src/rendering/object.dart:109:5)
    #70     PipelineOwner.flushPaint (package:flutter/src/rendering/object.dart:1156:31)
    #71     PipelineOwner.flushPaint (package:flutter/src/rendering/object.dart:1166:15)
    #72     RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:593:23)
    #73     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:986:13)
    #74     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:457:5)
    #75     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1325:15)
    #76     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1255:9)
    #77     SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1113:5)
    #78     _invoke (dart:ui/hooks.dart:312:13)
    #79     PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:383:5)
    #80     _drawFrame (dart:ui/hooks.dart:283:31)
    (elided 2 frames from class _AssertionError)
    The following RenderObject was being processed when the exception was fired: _RenderFlexibleSpaceHeaderOpacity#8dde3
    ...  parentData: top=-61.0; right=0.0; left=0.0; height=338.3; offset=Offset(0.0, -61.0) (can use size)
    ...  constraints: BoxConstraints(w=360.0, h=338.3)
    ...  size: Size(360.0, 338.3)
    ...  opacity: 0.0
    ...  alwaysIncludeSemantics
      child: RenderConstrainedBox#e48f1
        parentData: <none> (can use size)
        constraints: BoxConstraints(w=360.0, h=338.3)
        size: Size(360.0, 338.3)
        additionalConstraints: BoxConstraints(unconstrained)
    RenderObject: _RenderFlexibleSpaceHeaderOpacity#8dde3
      parentData: top=-61.0; right=0.0; left=0.0; height=338.3; offset=Offset(0.0, -61.0) (can use size)
      constraints: BoxConstraints(w=360.0, h=338.3)
      size: Size(360.0, 338.3)
      opacity: 0.0
      alwaysIncludeSemantics
      child: RenderConstrainedBox#e48f1
        parentData: <none> (can use size)
        constraints: BoxConstraints(w=360.0, h=338.3)
        size: Size(360.0, 338.3)
        additionalConstraints: BoxConstraints(unconstrained)
    ====================================================================================================
    flutter doctor -v (stable and master)
    [✓] Flutter (Channel stable, 3.13.6, on macOS 14.0 23A344 darwin-x64, locale en-VN)
        • Flutter version 3.13.6 on channel stable at /Users/huynq/Documents/GitHub/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision ead455963c (5 days ago), 2023-09-26 18:28:17 -0700
        • Engine revision a794cf2681
        • Dart version 3.1.3
        • DevTools version 2.25.0
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
        • Android SDK at /Users/huynq/Library/Android/sdk
        • Platform android-34, build-tools 32.0.0
        • ANDROID_HOME = /Users/huynq/Library/Android/sdk
        • Java binary at: /Applications/Android Studio Giraffe.app/Contents/jbr/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 15.0)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Build 15A240d
        • CocoaPods version 1.11.3
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2022.3)
        • Android Studio at /Applications/Android Studio Giraffe.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    
    [✓] Android Studio (version 2022.2)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    
    [✓] VS Code (version 1.82.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.72.0
    
    [✓] Connected device (2 available)
        • macOS (desktop) • macos  • darwin-x64     • macOS 14.0 23A344 darwin-x64
        • Chrome (web)    • chrome • web-javascript • Google Chrome 117.0.5938.132
    
    [✓] Network resources
        • All expected network resources are available.
    
    • No issues found!
    [!] Flutter (Channel master, 3.16.0-3.0.pre.33, on macOS 14.0 23A344 darwin-x64, locale en-VN)
        • Flutter version 3.16.0-3.0.pre.33 on channel master at /Users/huynq/Documents/GitHub/flutter_master
        ! Warning: `flutter` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
        ! Warning: `dart` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision a6fc4d28dd (60 minutes ago), 2023-10-04 23:39:17 -0400
        • Engine revision 3fea9117be
        • Dart version 3.2.0 (build 3.2.0-231.0.dev)
        • DevTools version 2.28.1
        • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
        • Android SDK at /Users/huynq/Library/Android/sdk
        • Platform android-34, build-tools 32.0.0
        • ANDROID_HOME = /Users/huynq/Library/Android/sdk
        • Java binary at: /Applications/Android Studio Giraffe.app/Contents/jbr/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 15.0)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Build 15A240d
        • CocoaPods version 1.11.3
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2022.3)
        • Android Studio at /Applications/Android Studio Giraffe.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    
    [✓] Android Studio (version 2022.2)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    
    [✓] VS Code (version 1.82.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.74.0
    
    [✓] Connected device (3 available)
        • RMX2001 (mobile) • EUYTFEUSQSRGDA6D • android-arm64  • Android 11 (API 30)
        • macOS (desktop)  • macos            • darwin-x64     • macOS 14.0 23A344 darwin-x64
        • Chrome (web)     • chrome           • web-javascript • Google Chrome 117.0.5938.132
    
    [✓] Network resources
        • All expected network resources are available.
    
    ! Doctor found issues in 1 category.
  7. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    p: material_uimaterial_ui package in flutter/packages
    f: scrollingViewports, list views, slivers, etc.
    a: error messageError messages from the Flutter framework
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    team-designOwned by Design Languages team
    and removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    in triagePresently being triaged by the triage team
    on Oct 5, 2023
  8. 1 remaining item

  9. changed the title [-]Failed assertion: line 467 pos 12: 'needsCompositing': is not true.[/-] [+]`flexible_space_bar.dart': Failed assertion: line 475 pos 12: 'needsCompositing': is not true.` is thrown when scrolling down in the list and then up [/+] on Oct 5, 2023
  10. self-assigned this
    on Oct 5, 2023
  11. Succi-c commented on Oct 10, 2023

    @Succi-c

    I have also encountered a similar problem. Does this error have a significant impact? Which official version can solve it?

  12. moved this from To do to PR submitted in Nevercodeon Oct 10, 2023
  13. added
    P2Important issues not at the top of the work list
    triaged-designTriaged by Design Languages team
    on Oct 10, 2023
  14. moved this from PR submitted to Done (PR merged) in Nevercodeon Oct 11, 2023
  15. added
    r: fixedIssue is closed as already fixed in a newer version
    on Oct 11, 2023
  16. github-actions commented on Oct 25, 2023

    @github-actions

    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.

  17. locked as resolved and limited conversation to collaborators on Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work lista: error messageError messages from the Flutter frameworkf: scrollingViewports, list views, slivers, etc.found in release: 3.13Found to occur in 3.13found in release: 3.16Found to occur in 3.16frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesr: fixedIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

Type

No type

Projects

  • Status
    Done (PR merged)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions