[MUSIC PLAYING]
KATE LOVETT: I think it is time for Andrew
and I to take some questions ourselves.
ANDREW BROGDEN: Yes.
Let's put our moderator to work here.
KATE LOVETT: So make sure you're using your hashtag.
Yes.
John, do you have any questions for us?
JOHN RYAN: Yeah.
This question comes from Twitter.
It's from Javier Mendonza.
This person is from Stockholm, Sweden,
and the question is, if you want to achieve a native look
and feel on iOS and Android, how do I do that in a good way
without putting if/else statements all across my app,
for example?
KATE LOVETT: Interesting.
That's a really good question.
Well, of course, there are a lot of things that automatically
are taken care of for you when you are working
across multiple platforms, such as with iOS and Android,
you'll see scroll behavior and list views
that are what you would expect.
Like, in iOS, you'll get an overscroll.
In Android, you'll get a nice glow.
But there are some cases where you're
going to want to make decisions for yourself how it's
going to look on different platforms, which you talked
about it a little in I/O, didn't you?
ANDREW BROGDEN: Yes.
Yes, I did.
We had a talk on iOS development and I/O this year.
And I sort of tried to squeeze it
a little bit about this at the end,
and I wish I'd had more time.
I think if/then, which was the if/then statement, which
is sort of the crux of this whole thing--
like, if you want different behavior
on different platforms, right, somebody somewhere
has to write an if statement, or a switch statement,
or something like that.
And so the question is, where does that if/then live?
You know, where does that statement live, right?
And so in the cases that Kate was just mentioning,
the SDK for some things can write that if statement
for you, right?
The list scrolling physics, right?
Everybody on iOS, more than likely,
is going to want to have the bounce-- more than likely.
Everybody on Android, they're going
to want the material glow that everybody's
familiar-- with that's 99% of your devs.
And so that if/then is baked right into the Flutter SDK.
But there are so many other ways that you
can adapt to the platform, and different apps
are going to want to make different decisions.
So one of the ways that we've seen people have success
is to make a widget whenever you have one of those decision
points to encapsulate the decision
that you make as a developer.
So for example, if you wanted different navigation
on iOS versus Android--
so you wanted a material drawer on Android, but for iOS,
you wanted, like, a bottom navigation
bar with separate navigation stacks for each one--
you can make a widget that checks the platform
and then builds one thing on one platform
and the other on the other.
And then they both turn around and build the same content
to go into those navigation panes.
You know?
KATE LOVETT: It really kind of encapsulates it
and keeps it clean that way.
ANDREW BROGDEN: Yes.
Encapsulate is a great way to put it.
So you have the widget.
Should be single-purpose, should handle its one little job.
And a good job for widget is to encapsulate
that kind of decision.
So you can build it once in one widget
and then use that widget all over the place.
You don't have a bunch of if/thens scattered everywhere.
So thank you, Javier, for asking that question.
It's a topic near and dear to my heart.
I think we have time for one more.
Maybe a short question.
John?
JOHN RYAN: Yeah.
So this question comes from Ethiopia.
The person is Nabio Mohammed Ama.
And the question is, what's the status of 3D game
development in Flutter?
KATE LOVETT: 3D gaming.
ANDREW BROGDEN: Salaam, Ethiopia, by the way.
Please tweet injera recipes.
My wife would love that.
KATE LOVETT: I would, too.
ANDREW BROGDEN: She wishes I could cook it for her.
But yeah, let's-- we have a little bit of time.
Let me-- so the Flutter team is mostly
focused on the app experience, building the 2D UIs that people
use for applications.
But the Flutter team is only one group of people building things
for Flutter, right?
There's a whole bunch of people out there in the community.
KATE LOVETT: I like to think of everyone
as part of the Flutter team.
It's an open source project.
Everyone who's a part of the Flutter community
is part of the Flutter team.
And I've actually seen a number of really cool plugins
that are playing with 3D widgets.
Is it possible to look one up?
ANDREW BROGDEN: Let's go into the--
what was it?
It was Flutter and Unity I saw somebody--
let me just Google Flutter Unity package.
Yep.
So right here in the laptop, we have
somebody who's made a package for combining
Flutter with Unity.
I remember seeing a spinning cube
or something like that somebody had in the demo.
KATE LOVETT: Yeah.
ANDREW BROGDEN: There's also a couple more.
Flame is a 2D engine that somebody wrote on Flutter.
And things like that.
So again, Flutter is a community project.
It has hundreds upon hundreds of contributors, thousands when
you get out to the ecosystem, and they're all
doing great stuff.
So even though it's not something
that people in Mountain View are working on right now,
there are very talented engineers
building out things like that right now as well.
[MUSIC PLAYING]