Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Adam Barth
@abarth
or putting some parts in different functions
depend on what's most aesthetic
to answer your question
we could add a padding attribute to every widget
each widget could start with if (padding != null) return new Padding(padding: padding, child: <whatever it would return otherwise>)
a couple widgets that can do something more efficient than that do have a padding attribute
otherwise, you might as well put the Padding outside the widget
because otherwise you'll be constantly checking whether the client wants padding even though they usually don't
you can try out different styles with your own widgets
and form your own conclusions about what patterns are more effective
but we've found that having simpler widgets that compose easily is a more effective pattern than having big complex widgets that are more difficult to compose
Container itself is a bit of a beginner tool. It's very useful to give beginner a foothold into the system, but most developers end up using the component pieces directly as they become more advance because that's the more flexible/powerful approach
Padding tends to be the stepping stone in that direction
Adam Barth
@abarth
hence the long design discussion in the docs for Padding
blehn
@blehn
gotcha, thanks
Donny Velazquez
@donnyv
@eseidel do you have a sample anywhere with that?
Eric Seidel
@eseidelGoogle
@donnyv I'm forgetting the question? Which sample are you looking for? :)
Jaap Vermeulen
@jacoplane
@cortexdesign I presume the Firebase plugin will work soon since there's an event about Flutter & Firebase in less than a month at I/O: https://events.google.com/io/schedule/?section=may-19&sid=496d01fb-2139-4fd6-84b2-e585d1a20e61
Donny Velazquez
@donnyv
@eseidelGoogle adding a WebView
Hadrien Lejard
@lejard-h
@donnyv I am working on a webview plugin, I hope it will be available soon (at least for Android), but to be sure what are your needs ? Having a fullscreen web view in a different activity or, a full screen web view with flutter widgets on top ?
Donny Velazquez
@donnyv
Having a full screen WebView in its own activity is fine. I can always add additional UI elements using html. I know you can't add flutter widgets right now but is there a way for javascript code in a WebView to reach back out to Dart code?
Ghost
@ghost~584d0d9dd73408ce4f3c36b5
Hi
it appears to me that it's impossible to change a TextEditingController from its listener
is this expected or a bug?
Eric Seidel
@eseidelGoogle
@christian-lefty @abarth would know. Or you can ask on stackoverflow.com/questions/tagged/flutter if he's not around
@donnyv I don't currently have an example of adding a webview, but I'll add it to the list of samples we should provide
Adam Barth
@abarth
I think it should be possible
what goes wrong?
Ghost
@ghost~584d0d9dd73408ce4f3c36b5
flutter/flutter#9582
Donny Velazquez
@donnyv
@eseidelGoogle I know you can't add flutter widgets right now but is there a way for javascript code in a WebView to reach back out to Dart code?
Ian Hickson
@Hixie
flutter/flutter#9581 <- loosen constraints of non-positioned Stack children (and give a property to control this)
Ian Hickson
@Hixie
flutter/flutter#9584 <- CustomPaint improvements
blehn
@blehn
Does a GridView require GridTiles as children?
blehn
@blehn
Ah, I think I found some older discussion about this. I'm trying to put a GridView inside a ScrollView, but it's not working for some reason. I don't need the GridView to scroll, but I'd prefer to use it instead of a Row because (a) I want it to flow to multiple rows if there are enough children, and (b) GridView has properties for item spacing that Row doesn't have
Is there a different class I should be using?
Adam Barth
@abarth
You might want Wrap
GridView does not require its children to be GridTiles
taylorren
@taylorren
Hello
In a Fltter app's Stateful widget, where is the right place to put a call to fetch remote API?
blehn
@blehn
@abarth shrinkWrap: true on the GridView seems to fix my issue. Is Wrap a better solution?
Adam Barth
@abarth
@blehn depends if you want the children to line up vertically as well as horizontally
if you do, grid is a good choice
blehn
@blehn
yeah, I do
Adam Barth
@abarth
if you want them to line up horizontally but not necessarily vertically, then wrap is a good choice
then I'd go with Grid
GridView
blehn
@blehn
k thanks... and is shrinkWrap the right property to use to render a GridView within a ScrollView?
Adam Barth
@abarth
yep
taylorren
@taylorren
Hi there
A quick question, I am looking at the Flutter example and noticed this section: