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

[macos]: Failed assertion: line 267 pos 15: 'margin == null || margin.isNonNegative': is not true. #134

Open
kimmy-wang opened this issue Sep 13, 2022 · 8 comments

Comments

@kimmy-wang
Copy link

'package:flutter/src/widgets/container.dart': Failed assertion: line 267 pos 15: 'margin == null || margin.isNonNegative': is not true.
      #0      _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61)
      #1      _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5)
      #2      new Container (package:flutter/src/widgets/container.dart:267:15)
      #3      IntroSliderState.renderNav (package:intro_slider/src/intro_slider_widget.dart:664:34)
      #4      IntroSliderState.build (package:intro_slider/src/intro_slider_widget.dart:572:13)
      #5      StatefulElement.build (package:flutter/src/widgets/framework.dart:4992:27)
      #6      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4878:15)
      #7      StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5050:11)
      #8      Element.rebuild (package:flutter/src/widgets/framework.dart:4604:5)
      #9      StatefulElement.update (package:flutter/src/widgets/framework.dart:5082:5)
      #10     Element.updateChild (package:flutter/src/widgets/framework.dart:3570:15)
      #11     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4904:16)
      #12     Element.rebuild (package:flutter/src/widgets/framework.dart:4604:5)
      #13     StatelessElement.update (package:flutter/src/widgets/framework.dart:4956:5)
      #14     Element.updateChild (package:flutter/src/widgets/framework.dart:3570:15)
      #15     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4904:16)
      #16     Element.rebuild (package:flutter/src/widgets/framework.dart:4604:5)
      #17     StatelessElement.update (package:flutter/src/widgets/framework.dart:4956:5)
      #18     Element.updateChild (package:flutter/src/widgets/framework.dart:3570:15)
      #19     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4904:16)
      #20     Element.rebuild (package:flutter/src/widgets/framework.dart:4604:5)
      #21     ProxyElement.update (package:flutter/src/widgets/framework.dart:5228:5)
      #22     Element.updateChild (package:flutter/src/widgets/framework.dart:3570:15)
      #23     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4904:16)
      #24     Element.rebuild (package:flutter/src/widgets/framework.dart:4604:5)
      #25     ProxyElement.update (package:flutter/src/widgets/framework.dart:5228:5)
      #26     Element.updateChild (package:flutter/src/widgets/framework.dart:3570:15)
      #27     RenderObjectElement.updateChildren (package:flutter/src/widgets/framework.dart:5904:32)
      #28     MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6460:17)
      #29     Element.updateChild (package:flutter/src/widgets/framework.dart:3570:15)
      #30     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4904:16)
      #31     Element.rebuild (package:flutter/src/widgets/framework.dart:4604:5)
      #32     ProxyElement.update (package:flutter/src/widgets/framework.dart:5228:5)
      #33     Element.updateChild (package:flutter/src/widgets/framework.dart:3570:15)
      #34     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4904:16)
      #35     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5050:11)
      #36     Element.rebuild (package:flutter/src/widgets/framework.dart:4604:5)
      #37     StatefulElement.update (package:flutter/src/widgets/framework.dart:5082:5)
      #38     Element.updateChild (package:flutter/src/widgets/framework.dart:3570:15)
      #39     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4904:16)
      #40     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5050:11)
      #41     Element.rebuild (package:flutter/src/widgets/framework.dart:4604:5)
      #42     StatefulElement.update (package:flutter/src/widgets/framework.dart:5082:5)
      #43     Element.updateChild (package:flutter/src/widgets/framework.dart:3570:15)
      #44     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4904:16)
      #45     Element.rebuild (package:flutter/src/widgets/framework.dart:4604:5)
      #46     ProxyElement.update (package:flutter/src/widgets/framework.dart:5228:5)
      #47     Element.updateChild (package:flutter/src/widgets/framework.dart:3570:15)
      #48     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4904:16)
      #49     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5050:11)
      #50     Element.rebuild (package:flutter/src/widgets/framework.dart:4604:5)
      #51     StatefulElement.update (package:flutter/src/widgets/framework.dart:5082:5)
      #52     Element.updateChild (package:flutter/src/widgets/framework.dart:3570:15)
      #53     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6307:14)
      #54     Element.updateChild (package:flutter/src/widgets/framework.dart:3570:15)
      #55     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4904:16)
      #56     Element.rebuild (package:flutter/src/widgets/framework.dart:4604:5)
      #57     ProxyElement.update (package:flutter/src/widgets/framework.dart:5228:5)
      #58     Element.updateChild (package:flutter/src/widgets/framework.dart:3570:15)
      #59     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6307:14)
      #60     Element.updateChild (package:flutter/src/widgets/framework.dart:3570:15)
      #61     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4904:16)
      #62     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5050:11)
      #63     Element.rebuild (package:flutter/src/widgets/framework.dart:4604:5)
      #64     StatefulElement.update (package:flutter/src/widgets/framework.dart:5082:5)
      #65     Element.updateChild (package:flutter/src/widgets/framework.dart:3570:15)
      #66     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4904:16)
      #67     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5050:11)
      #68     Element.rebuild (package:flutter/src/widgets/framework.dart:4604:5)
      #69     StatefulElement.update (package:flutter/src/widgets/framework.dart:5082:5)
      #70     Element.updateChild (package:flutter/src/widgets/framework.dart:3570:15)
      #71     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4904:16)
      #72     Element.rebuild (package:flutter/src/widgets/framework.dart:4604:5)
      #73     ProxyElement.update (package:flutter/src/widgets/framework.dart:5228:5)
      #74     Element.updateChild (package:flutter/src/widgets/framework.dart:3570:15)
      #75     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4904:16)
      #76     Element.rebuild (package:flutter/src/widgets/framework.dart:4604:5)
      #77     ProxyElement.update (package:flutter/src/widgets/framework.dart:5228:5)
      #78     Element.updateChild (package:flutter/src/widgets/framework.dart:3570:15)
      #79     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4904:16)
      #80     Element.rebuild (package:flutter/src/widgets/framework.dart:4604:5)
      #81     ProxyElement.update (package:flutter/src/widgets/framework.dart:5228:5)
      #82     Element.updateChild (package:flutter/src/widgets/framework.dart:3570:15)
      #83     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4904:16)
      #84     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5050:11)
      #85     Element.rebuild (package:flutter/src/widgets/framework.dart:4604:5)
      #86     StatefulElement.update (package:flutter/src/widgets/framework.dart:5082:5)
      #87     Element.updateChild (package:flutter/src/widgets/framework.dart:3570:15)
      #88     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4904:16)
      #89     Element.rebuild (package:flutter/src/widgets/framework.dart:4604:5)
      #90     ProxyElement.update (package:flutter/src/widgets/framework.dart:5228:5)
      #91     Element.updateChild (package:flutter/src/widgets/framework.dart:3570:15)
      #92     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4904:16)
      #93     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5050:11)
      #94     Element.rebuild (package:flutter/src/widgets/framework.dart:4604:5)
      #95     StatefulElement.update (package:flutter/src/widgets/framework.dart:5082:5)
      #96     Element.updateChild (package:flutter/src/widgets/framework.dart:3570:15)
      #97     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4904:16)
      #98     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5050:11)
      #99     Element.rebuild (package:flutter/src/widgets/framework.dart:4604:5)
      #100    BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2667:19)
      #101    WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:882:21)
      #102    RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:378:5)
      #103    SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1175:15)
      #104    SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1104:9)
      #105    SchedulerBinding.scheduleWarmUpFrame.<anonymous closure> (package:flutter/src/scheduler/binding.dart:881:7)
      #106    Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:18:15)
      #107    _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398:19)
      #108    _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429:5)
      #109    _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12)
@kimmy-wang kimmy-wang changed the title [log] 'package:flutter/src/widgets/container.dart': Failed assertion: line 267 pos 15: 'margin == null || margin.isNonNegative': is not true. [macos]: Failed assertion: line 267 pos 15: 'margin == null || margin.isNonNegative': is not true. Sep 13, 2022
@ozhankucuk
Copy link

I have same problem.Is there any solution
thanks
my version is below

intro_slider: ^3.0.4

sdk: ">=2.12.0 <3.0.0"

@duytq94
Copy link
Owner

duytq94 commented Sep 22, 2022

@kimmy214 which version you are using?
@kimmy214 @ozhankucuk can you guys explain the step to reproduce this issue

@ozhankucuk
Copy link

I added library as example.I changed asset file only.

List slides = [];

@OverRide
void initState() {
super.initState();

slides.add(
  Slide(
    title: "ERASER",
    description:
        "Allow miles wound place the leave had. To sitting subject no improve studied limited",
    pathImage: "images/photo_eraser.png",
    backgroundColor: const Color(0xfff5a623),
  ),
);
slides.add(
  Slide(
    title: "PENCIL",
    description:
        "Ye indulgence unreserved connection alteration appearance",
    pathImage: "images/photo_pencil.png",
    backgroundColor: const Color(0xff203152),
  ),
);
slides.add(
  Slide(
    title: "RULER",
    description:
        "Much evil soon high in hope do view. Out may few northward believing attempted. Yet timed being songs marry one defer men our. Although finished blessing do of",
    pathImage: "images/photo_ruler.png",
    backgroundColor: const Color(0xff9932CC),
  ),
);

}

void onDonePress() {
// Do what you want
print("End of slides");
}

@OverRide
Widget build(BuildContext context) {
return IntroSlider(
slides: slides,
onDonePress: onDonePress,
);
}

@duytq94
Copy link
Owner

duytq94 commented Sep 22, 2022

oh, I see [macos] at the title thread, did you guys mean the issue happening when run macOS (desktop) environment?

@ozhankucuk
Copy link

macos, I guess IOS smilator.

I decided to use other library.

@duytq94
Copy link
Owner

duytq94 commented Sep 22, 2022

Thanks, @ozhankucuk for your report, but I can't reproduce the issue.
Needing more info from other developers or details step case, device, environment...

@ozhankucuk
Copy link

thanks :)

@enilsonfilho
Copy link

enilsonfilho commented Feb 25, 2023

I had the same problem, and I ended up discovering that the cause was not in the IntroSlider, but in my logic... The List(Slide) was empty, which ended up generating this problem :')

For some reason, when building the screen, the List(Slide) didn't have time to fill in, which causes the problem...

I forced it into an async method using await, and it worked (with FutureBuilder), because in my case the information is not static.

Pay attention to @initstate setting the information correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants