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

Gradient colors overlapping with each other #83

Closed
wajahat414 opened this issue May 19, 2022 · 15 comments
Closed

Gradient colors overlapping with each other #83

wajahat414 opened this issue May 19, 2022 · 15 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@wajahat414
Copy link

wajahat414 commented May 19, 2022

The following assertion was thrown during paint():
RenderBox was not laid out: RenderViewport#bc66b NEEDS-PAINT
'package:flutter/src/rendering/box.dart':
Failed assertion: line 1979 pos 12: 'hasSize'


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: 
  ListView ListView:file:///C:/Users/akram/myapp/lib/presentation/history/History.dart:127:28
When the exception was thrown, this was the stack: 
#2      RenderBox.size (package:flutter/src/rendering/box.dart:1979:12)
#3      RenderBox.paintBounds (package:flutter/src/rendering/box.dart:2617:41)
#4      PaintingContext._repaintCompositedChild (package:flutter/src/rendering/object.dart:140:56)
#5      PaintingContext.repaintCompositedChild (package:flutter/src/rendering/object.dart:100:5)
#6      PaintingContext._compositeChild (package:flutter/src/rendering/object.dart:198:7)
#7      PaintingContext.paintChild (package:flutter/src/rendering/object.dart:185:7)
#8      RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:140:15)
#9      RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2477:7)
#10     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:187:13)
#11     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:140:15)
#12     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2477:7)
#13     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:187:13)
#14     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:140:15)
#15     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2477:7)
#16     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:187:13)
#17     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:140:15)
#18     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2477:7)
#19     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:187:13)
#20     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:140:15)
#21     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2477:7)
#22     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:187:13)
#23     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:140:15)
#24     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2477:7)
#25     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:187:13)
#26     RenderBoxContainerDefaultsMixin.defaultPaint (package:flutter/src/rendering/box.dart:2844:15)
#27     RenderFlex.paint (package:flutter/src/rendering/flex.dart:1078:7)
#28     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2477:7)
#29     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:187:13)
#30     RenderBoxContainerDefaultsMixin.defaultPaint (package:flutter/src/rendering/box.dart:2844:15)
#31     RenderCustomMultiChildLayoutBox.paint (package:flutter/src/rendering/custom_layout.dart:408:5)
#32     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2477:7)
#33     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:187:13)
#34     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:140:15)
#35     _RenderInkFeatures.paint (package:flutter/src/material/material.dart:598:11)
#36     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2477:7)
#37     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:187:13)
#38     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:140:15)
#39     PaintingContext.pushLayer (package:flutter/src/rendering/object.dart:387:12)
#40     RenderPhysicalModel.paint (package:flutter/src/rendering/proxy_box.dart:1951:15)
#41     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2477:7)
#42     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:187:13)
#43     RenderBoxContainerDefaultsMixin.defaultPaint (package:flutter/src/rendering/box.dart:2844:15)
#44     RenderCustomMultiChildLayoutBox.paint (package:flutter/src/rendering/custom_layout.dart:408:5)
#45     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2477:7)
#46     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:187:13)
#47     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:140:15)
#48     _RenderInkFeatures.paint (package:flutter/src/material/material.dart:598:11)
#49     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2477:7)
#50     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:187:13)
#51     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:140:15)
#52     PaintingContext.pushLayer (package:flutter/src/rendering/object.dart:387:12)
#53     RenderPhysicalModel.paint (package:flutter/src/rendering/proxy_box.dart:1951:15)
#54     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2477:7)
#55     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:187:13)
#56     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:140:15)
#57     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2477:7)
#58     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:187:13)
#59     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:140:15)
#60     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2477:7)
#61     PaintingContext._repaintCompositedChild (package:flutter/src/rendering/object.dart:141:11)
#62     PaintingContext.repaintCompositedChild (package:flutter/src/rendering/object.dart:100:5)
#63     PipelineOwner.flushPaint (package:flutter/src/rendering/object.dart:995:29)
#64     RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:506:19)
#65     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:892:13)
#66     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:370:5)
#67     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1146:15)
#68     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1083:9)
#69     SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:997:5)
#73     _invoke (dart:ui/hooks.dart:151:10)
#74     PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:308:5)
#75     _drawFrame (dart:ui/hooks.dart:115:31)
(elided 5 frames from class _AssertionError and dart:async)
The following RenderObject was being processed when the exception was fired: RenderIgnorePointer#e186c relayoutBoundary=up10
...  needs compositing
...  parentData: <none> (can use size)
...  constraints: BoxConstraints(0.0<=w<=392.7, 0.0<=h<=Infinity)
...  size: MISSING
...  ignoring: false
...  ignoringSemantics: false
RenderObject: RenderIgnorePointer#e186c relayoutBoundary=up10
  needs compositing
  parentData: <none> (can use size)
  constraints: BoxConstraints(0.0<=w<=392.7, 0.0<=h<=Infinity)
  size: MISSING
  ignoring: false
  ignoringSemantics: false
...  child: RenderViewport#bc66b NEEDS-PAINT
...    needs compositing
...    parentData: <none> (can use size)
...    constraints: BoxConstraints(0.0<=w<=392.7, 0.0<=h<=Infinity)
...    layer: OffsetLayer#bfdde DETACHED
...      handles: 1
...      offset: Offset(0.0, 0.0)
...    size: MISSING
...    axisDirection: down
...    crossAxisDirection: right
...    offset: ScrollPositionWithSingleContext#f6624(offset: 0.0, range: null..null, viewport: null, ScrollableState, AlwaysScrollableScrollPhysics -> BouncingScrollPhysics -> RangeMaintainingScrollPhysics, IdleScrollActivity#30f36, ScrollDirection.idle)
...    anchor: 0.0
...    center child: RenderSliverPadding#fc714 NEEDS-LAYOUT NEEDS-PAINT
...      parentData: paintOffset=Offset(0.0, 0.0)
...      constraints: MISSING
...      geometry: null
...      padding: EdgeInsets.zero
...      textDirection: ltr
...      child: RenderSliverList#aefd6 NEEDS-LAYOUT NEEDS-PAINT
...        parentData: paintOffset=Offset(0.0, 0.0)
...        constraints: MISSING
...        geometry: null
...        no children current live
====================================================================================================
@apgapg
Copy link
Owner

apgapg commented May 19, 2022

Okay I shall check. Can you please share sample code for reproduction?

@apgapg
Copy link
Owner

apgapg commented May 22, 2022

I tried checking but example code works fine. Please check if for length of gradient list.

@wajahat414
Copy link
Author

Sorry, the Problem Was with some other code, I thought Graph is causing the problem, but it was strange changing gradient length was actually affecting the behavior, you can close this issue,

@apgapg apgapg closed this as completed May 23, 2022
@wajahat414
Copy link
Author

Can you tell me How to avoid
color Overlap when we apply gradient at the union of two gradeints they mix up with each other , I think it is better if one of the gradients doesn't mix with each other

@wajahat414
Copy link
Author

In ring Shape
WhatsApp Image 2022-05-23 at 11 14 10 AM

@apgapg
Copy link
Owner

apgapg commented May 23, 2022

hm, never thought of this case. May be this is occurring due to rounded ends. I shall check this. Can you please share gradient list? this would make debug easy

@apgapg apgapg reopened this May 23, 2022
@apgapg apgapg changed the title Changing Gradient color giving error Gradient colors overlapping with each other May 23, 2022
@apgapg apgapg added good first issue Good for newcomers bug Something isn't working and removed waiting for customer response labels May 23, 2022
@wajahat414
Copy link
Author

final gradientList = <List>[
[Color.fromRGBO(255, 255, 255, 1.0),
Color.fromRGBO(251, 192, 14, 1.0),

],
[
Color.fromRGBO(41, 179, 255, 1.0),

Color.fromRGBO(255, 255, 255, 1.0),

],

];

@wajahat414
Copy link
Author

did you tested?

apgapg added a commit that referenced this issue May 26, 2022
Signed-off-by: Ayush P Gupta <[email protected]>
@apgapg
Copy link
Owner

apgapg commented May 26, 2022

Fixed. Releasing new version. Thanks for pointing this issue

@apgapg
Copy link
Owner

apgapg commented May 26, 2022

v5.3.1

Please reopen if issue still exists

@apgapg apgapg closed this as completed May 26, 2022
@wajahat414
Copy link
Author

Yes it is Working Fine but the Rounded effect is Gone Now , Edges are meeting straight

@apgapg
Copy link
Owner

apgapg commented May 26, 2022

I still cant figure out why we had overlap mixing issue. As gradient colors you mentioned doesnt have any transparency. I need to see that again.

@wajahat414
Copy link
Author

[]
Simulator Screen Shot - iPhone 13 Pro Max - 2022-05-26 at 17 30 31
(url)

@wajahat414
Copy link
Author

if the values point by line I think it will be More visually Appealing ,now we only have option of outside or inside

@apgapg
Copy link
Owner

apgapg commented May 26, 2022

You mean like in other pie charts values are having arrow towards their respective arc?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants