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
for example --debug turns on asserts which are useful, enables the JIT compiler (which makes hot-reload possible) and enables the debugger (which is insecure to ship with, but useful for debugging) and various other tradeoffs.
Adam Barth
@abarth
there's another mode we could expose
which is JIT without asserts
we just don't expose it to keep the matrix of configurations under control
otherwise it gets too confusing
Eric Seidel
@eseidelGoogle
lol. "under control". Our matrix is impressive as-is. :)
@blehn https://github.com/flutter/flutter/wiki/Flutter%27s-modes is a wiki page on the --debug vs. --release divide
blehn
@blehn
Thanks guys. I guess what's important to me is that debug mode isn't hampering scrolling, animations, etc... because I'd want to be able to evaluate that type of performance, without losing hot reloading.
Eric Seidel
@eseidelGoogle
@blehn which config are you using? simulator? device?
Adam Barth
@abarth
that's tough because support hot reload implies a performance trade-off
the --release code is going to run smoother than the debug code
because the compiler spends more time processing it and optimizing it
the hot reload runs the compiler for a tiny amount of time (that's why its so fast)
and doesn't optimize it much (that's how you're able to change it with out re-running the optimization pass on the rest of the code)
blehn
@blehn
I'm using both, but device currently. Android simulator just obliterates my CPU.
Eric Seidel
@eseidelGoogle
There is an old related bug: flutter/flutter#5581
blehn
@blehn
got it, thanks for the quick replies! I don't mean to suggest that hot reloading in release mode is essential... just wishful thinking, coming from the web world where hot reloading is taken for granted.
Eric Seidel
@eseidel
hot reload is a bit different on the web no? :)
I mean, you can reload
but it’s not really “hot”. state is not preserved
As abarth suggests, we could create a no-asserts debug mode which would be a little faster in some ways
Eh, I guess JS does have some sort of support for module reloading now, but the frameworks may not. The DOM doesn’t, etc. There are a lot of details (for better or worse) to make this all work nice :)
Regardless, the feedback is valuable, thank you!
Marian
@cortexdesign
is there any timeline when firebase will work with the current flutter version?
Ghost
@ghost~584d0d9dd73408ce4f3c36b5
natively not sure but you can already use Platform plugins if you wish
Marian
@cortexdesign
https://github.com/flutter/firebase_database is not working with the current flutter version. Is there any other plugin?
Ghost
@ghost~584d0d9dd73408ce4f3c36b5
hum I wasn"t aware of this plugin we wrote our own calls
Donny Velazquez
@donnyv
Is there a WebView in flutter? Was going to use this to show a map using MapboxGL
blehn
@blehn
It's not clear to me why padding isn't a property of any widget. The Container widget seems like the spacer.gif of Flutter... adding extra nodes and complexity where there shouldn't be
Eric Seidel
@eseidelGoogle
@donnyv you can put up a full-screen mapview, or full-screen WebView, it's not currently possible to layout a WebView or MapView inside other flutter content.
blehn
@blehn
@eseidelGoogle so I'd still have to nest a widget inside a Padding class like I would with a Container?
The docs seem to suggest it's not much different from a Container. My issue is that it forces you to create wrapper Containers/Paddings solely for the sake of padding
Adam Barth
@abarth
@blehn yes, the framework works by composition
it's very common to wrap widgets with other widgets
blehn
@blehn
I get that, but let's say I wrap a two Columns inside a Row. In order to get a sensible layout, I have to wrap the two Columns inside a Padding and then wrap the contents of each Column inside a Padding. The nesting gets very hairy very quickly.
And that doesn't really answer the first question — if Container is a widget that accepts a padding attribute, why not let any widget accept a padding attribute?
Adam Barth
@abarth
It's common to have fairly deeply nested build functions. if you put trailing commas at the end of the argument lists, the formatter will format them pretty cleanly
you can alway break up complex build functions by extracting reusable components into widgets
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