Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Eric Seidel
@eseidelGoogle
That's a very common pattern :)
Well, the alternative is to wrap it in a MyColumn StatelessWidget
blehn
@blehn
yeah i thought so but was having trouble finding more examples in the docs
that would mean making a custom MyColumn widget?
(or "ButtonColumn")
@blehn intellij even has a quick-action (option-enter) for wrapping something in a widget iirc
blehn
@blehn
ok I'll take a look, thanks
speaking of intellij, sometimes tab completion inserts a snippet while simultaneously overwriting a bunch of text below... what's up with that?
Luke
@lukef
can you mask a flutter widget with a shape?
Devon Carew
@devoncarew
@blehn, In IntelliJ, completing with enter will insert, completing with tab will overwrite
so, two different insert modes...
Eric Seidel
@eseidelGoogle
@lukef i'm not sure what you mean. The layout system most widgets use is rectilinear
@lukef but with say a CustomPainter you can paint whatever you like :)
Luke
@lukef
lets say you have 2 views stacked on top of each other and i want to cut a hole in the top one so the bottom one is revealed
Reekdeb Mal
@reekdeb
media-20170426.jpg
Hello! Is there any way to disable auto suggestion for text fields?
Adam Barth
@abarth
@reekdeb please file a bug. that sounds like something we should do automatically when you flip the "obscure text" flag
@lukef You can use a ClipPath to do that
just make a path for the clip that includes everything that's not the hole
Kyle Bradshaw
@Skylled
I'm switching from premade JSON data to Firebase data, with http package. Is there anything special to know about using Futures in widget generation, other than using setState when making changes? I've verified my ListView's list is getting populated with ListTiles, but they're not actually getting displayed.
Adam Barth
@abarth
one tricky thing is that when your await finishes, you probably want to check mounted to see if your widget has been removed from the tree while you were waiting
there's a FutureBuilder widget that helps with that
Kyle Bradshaw
@Skylled
I'll look into FutureBuilder, thanks!
Eric Seidel
@eseidelGoogle
@reekdeb @abarth looks like flutter/flutter#6760 is on file, there may be one for iOS too
@Skylled @collinjackson was working on some helper classes for dealing with firebase, but I'm not sure the status of those
Kyle Bradshaw
@Skylled
@eseidelGoogle I saw those, and I'm very excited. I can't imagine they would be sync instead of async though, so my predicament wouldn't change much. I think flutter/flutter#9553 would have me covered though. I'll focus elsewhere in the meantime.
Eric Seidel
@eseidelGoogle
@Skylled generally the pattern with async widget updates is that you make your request, when it comes back you call setState to tell your widget to rebuild, and it should "just work". build() typically reads directly from your (possibly locally cached) model objects.
@Skylled flutter/flutter#9236 is also requesting more network/json documentation, but some of the linked examples might be helpful to you
Kyle Bradshaw
@Skylled
@eseidelGoogle I've been doing that, I believe. I've been printing when setState gets run, when build() gets run, and the .length of the list being passed to ListView, but only the test object I added before the async code gets displayed.
Eric Seidel
@eseidelGoogle
ah! Are you mutating the list and passing the same list?
Kyle Bradshaw
@Skylled
Exactly that.
Eric Seidel
@eseidelGoogle
Common gotcha. See flutter/flutter#8952
@Skylled https://github.com/flutter/flutter/issues/8952#issuecomment-288837913 is the explanation. List.== is a shallow check. Flutter checks if the arguments passed to the Widget are the same as the last Widget rendered there, and if so skips all further work.
Kyle Bradshaw
@Skylled
Makes sense! I'll work around that now! Even easier than the other options I was looking at.
Kyle Bradshaw
@Skylled
@eseidelGoogle Worked around it by creating a new List in build() and filling it with my other list's items. Solved everything!
I absolutely adore the support you are all offering for Flutter. It really speaks to the passion you have for it. I'm excited to see what the future holds. Thanks again!
Luke
@lukef
@abarth awesome thanks!
Collin Jackson
@collinjackson
@Skylled if your list has a lot of data that you don't want to copy on each build, consider using listview.builder... it will rebuild your visible cells on each call to setstate if you pass an anonymous builder function in your build function, presumably because that function won't == your previous anonymous builder function.
Dwayne Slater
@ds84182
For those who work on flutter/engine, is the canvas->clear in gpu_rasterizer.cc needed? https://github.com/flutter/engine/blob/1c07ea530f2c78b7e303c96b19994ff897498c2a/shell/gpu/gpu_rasterizer.cc#L136
I would like to use a FlutterView as an overlay over an existing view on Android, but can't since the canvas automatically gets cleared to black.
Dwayne Slater
@ds84182
Actually... nevermind. Apparently setZOrderOnTop is STILL needed in this day and age. Thank you, Android.
Adam Barth
@abarth
@ds84182 I don't think so. I think we can clear it to transparent if you'd prefer
Dwayne Slater
@ds84182
It would make this a bit easier (since right now I'm force clearing the canvas from a RenderObject)
Adam Barth
@abarth
would you be willing to file a bug? It's easy to change and a bug will help me remember to do it
Eric Seidel
@eseidelGoogle
@ds84182 others have asked about being able to use FlutterView over another OEM view (e.g. MapView, etc.) so if you're trying that and running into bugs, we'd love to see them!
Dwayne Slater
@ds84182
Done, #9627
Dwayne Slater
@ds84182
Well, my stuff works
I just have to do some hacky things to pass input events through Flutter to the view underlay
Adam Barth
@abarth
I'd be curious how you solve that