[TONE]
[MUSIC PLAYING]
ANDREW: OK, so you're now looking
at a terminal that's in the root directory of the project,
and you know how to publish things.
I do not, so I'm actually-- this is-- sidebar,
I'm going to be learning, too.
EMILY: I'm going to post on Andrew's behalf.
ANDREW: Yeah.
[LAUGHS] Because I'm ignorant.
EMILY: No, it's going to be-- it's
going to be really complicated.
Get ready.
So we're going to do flutter packages pub publish.
And, actually, there's an east egg in there.
If you do "pub lish," that should also work.
ANDREW: [SNORTS] [LAUGHS]
EMILY: Because we're fun like that.
OK, so publish, and then we'll do dry run, just
to make sure there's nothing--
ANDREW: I like a nice dry run, yeah, that's nice.
EMILY: OK, so that's our--
we're seeing the outline of this thing.
And we have some problems.
ANDREW: Uh-oh.
EMILY: OK.
So let's see.
We need to have a upper publish--
or published packages.
We have an upper bound constraint for SDK.
We can add that in our little pubspec.yaml.
ANDREW: Mhm.
EMILY: And then we have some suggestions.
"package doesn't depend on barometer_example."
Well, yeah.
Have we implemented--
ANDREW: We've implemented no tests.
EMILY: OK.
Let's just take--
ANDREW: Just remove?
[LAUGHTER]
EMILY: Yup.
Excellent engineering practices in action.
ANDREW: Yeah, I mean I ran it once and it worked.
What tests do we need really?
EMILY: Yeah.
OK, so let us go back to the studio,
and here's a less, like, horrible way of doing this.
Let's just comment it out.
ANDREW: OK.
EMILY: Oh wait.
But we still have to do this thing.
Ugh.
OK, maybe we do need to--
it's probably going to be--
so I will say, when you publish things,
there's also a package scoring system
so that you can see how--
ANDREW: Oh yeah, do you want to show the pub website just
so people know what we're talking about?
EMILY: OK, yeah.
So Flutter pub.
So there's Flutter packages, and there's also Dart packages,
because this is just the Dart ecosystem.
You can specify whether you want Flutter-specific
packages, or web, or anything.
And there are a whole bunch of packages.
For example, here's good old Cupertino Icons.
ANDREW: Yeah, many of which we're already using.
EMILY: And what do you know?
It is written by the Flutter team.
ANDREW: Oh yeah, Xiao.
EMILY: And so there are a chunk of packages
that are written by us.
And oh, here's the score right here--
score of 100.
ANDREW: Oh, I didn't know you could get a breakdown.
EMILY: Yeah.
So it's based on how popular-- are people using it?
Because you could write the most beautiful,
well-tested package, but if it's not useful?
ANDREW: Then nobody can, yeah.
EMILY: Health is involved-- like, how frequently are you
updating it?
And also it does some, presumably, code analysis
of like, are you writing good style Dart code?
Or are you adding tests?
ANDREW: Generating hundreds of warnings any time
it is compiled.
EMILY: And maintenance-- oh, maybe
that's part of, actually, the errors.
ANDREW: Oh, tidiness.
EMILY: Yes.
And I will say, so by design these are a little bit general,
because we don't want people to game the system.
So it's just like these high-level things
that you-- you want to have published packages that
have good style code, but we're not saying it's
this metric, because then people could game the system.
So that package has 100 of a score.
It's between 0 and 100, so 100 is the best.
Obviously all of these are going to be really high.
I can show you a package that I wrote that does not have 100.
ANDREW: Oh, there we go.
EMILY: Let's see.
What is it called?
It's called coverflow, I think.
Simple_coverflow, that's the one.
ANDREW: Oh, it's all the way down at 91.
EMILY: OK, well, yeah.
All right, so that's one.
ANDREW: Is your tidiness not up to par?
EMILY: Yeah.
I'm actually curious.
I don't know if I've looked at why.
Oh, popular.
ANDREW: Popularity is killing you.
EMILY: We can't all be very popular, oh well.
Anyway, so those are the things.
And so this back here is doing a dry run
to see if we have these things.
As we had this long--
ANDREW: Digression?
EMILY: Digression, basically that
was a long way to say that if we take out this test,
it will probably get a low popularity score,
but we can deal with that.
ANDREW: OK.
EMILY: So I've taken out these tests.
Let's do another dry--
ANDREW: Were there two sets of tests?
EMILY: Oh, no, just the one.
I just copied that.
ANDREW: OK.
EMILY: Or I commented out.
ANDREW: I was thinking the example might have had one.
EMILY: Ah, you're right.
ANDREW: And the plugin itself might have
had one, although I don't know.
EMILY: You're right.
This is in the example directory,
so maybe it's not even this test.
ANDREW: No, you're in example there.
No, you were right.
But I think if we scrolled down below lib here,
maybe there's another--
no?
EMILY: It doesn't look like it.
ANDREW: What am I thinking?
EMILY: I mean, this did say it was example test, so I think.
ANDREW: You're right.
I'm getting confused.
EMILY: So I think it's still going
to complain about the upper bound constraint,
but I think everything else should be OK.
And then we can go add that.
Oh, look at that.
OK, example test.
ANDREW: Oh, we're not using anything
involving tests anymore.
EMILY: Oh.
ANDREW: So you take out the import.
EMILY: OK.
ANDREW: There we go.
EMILY: OK, so now we need to add our SDK constraint.
And OK, so in that we're going to open our pubspec.
And so this is just information about the plugin.
So we actually don't want to use this constraint,
because we want to say that it's valid for Dart 2.0.
But I'm just copying it to have a starting point.
Oh wait, in environment.
So do we have an environment?
No, we don't.
I believe we put this under--
ANDREW: You can always look at coverflow.
EMILY: Oh, good call.
What did past Emily do?
ANDREW: Past Emily got things done.
That's what she did.
EMILY: Past Emily knew how to do this.
ANDREW: [LAUGHS] There it is.
EMILY: All right, so yeah.
It's just a standalone thing.
We'll just copy that.
That looks like good version constraints.
ANDREW: Yeah, piece of cake.
EMILY: Good job, past Emily.
OK, so now let's try a dry run again.
ANDREW: What will it yell at us for this time?
EMILY: Will it say we're good to go?
ANDREW: [GASP] Author and homepage.
EMILY: OK.
All right, so author, Andrew Brogdon.
ANDREW: You transposed the D and the G.
EMILY: Oh, I'm sorry.
ANDREW: It's OK.
EMILY: I said it correctly.
ANDREW: You did.
Sometimes I get confused.
EMILY: This is very--
ANDREW: Sometimes.
EMILY: There you go.
All right.
ANDREW: A plethora of contributors.
EMILY: Yes.
And homepage.
Yeah, let's just do Flutter.io.
ANDREW: Pick Flutter.io for now.
EMILY: OK All right, I think that's all.
Let's try that again.
I actually wonder what I put for my homepage.
ANDREW: I don't know.
EMILY: I don't remember.
Your pubspec-- oh, jeez.
Really?
OK, we need to fix this.
This is a bug.
I'm going to file a bug report after this.
Come on, people.
ANDREW: It's going to give out-- we didn't-- you didn't fix
the email one that was right below it.
There was another one.
EMILY: Oh, OK.
ANDREW: Name, bracket, email.
EMILY: Oh my gosh.
ANDREW: Is it an array?
Could you put in an array of?
EMILY: OK, I can do my quirky--
ANDREW: [LAUGHS]
EMILY: Yeah?
Oh, I did it again.
I misspelled.
It's like I can't-- there we go.
ANDREW: You just did it again.
EMILY: There we go.
ANDREW: I'm getting flashbacks to my high school graduation.
EMILY: Oh, I'm so sorry.
OK.
Yes.
ANDREW: OK, let's try this again.
EMILY: OK, are we ready?
ANDREW: Sure.
EMILY: Zero warnings.
Get ready.
ANDREW: [LAUGHS] We're going live with our moderately useful
plugin.
Didn't--
EMILY: Oh yeah.
Are we ready?
ANDREW: We're ready.
Let's turn both the keys at once.
[LAUGHS]
EMILY: Waiting for your authoriz-- oh yes.
Oh great.
I wonder if we actually--
ANDREW: Whoa, so there's like a--
EMILY: So this is showing that you are actually
uploading every half.
So now--
ANDREW: Oh wow.
EMILY: We might not show this on the--
ANDREW: Yeah, we might actually take
the rare step of blurring something out here,
which we don't normally do.
EMILY: Go log in.
I don't know your password.
But meanwhile, we can talk about--
look.
ANDREW: Yeah, let's talk about-- everybody
pay attention to Dash.
EMILY: Dash is here.
We have a guest appearance.
Dash also is not the strongest on Objective C coding,
but she is learning as well.
She is a fan of packages.
ANDREW: [SNORT] Long walks on the beach.
EMILY: [LAUGHS]
ANDREW: Flying among cartoon clouds.
EMILY: Two-factor authentication.
ANDREW: Yeah, two-factor authentication,
as I'm putting in my auth code.
All right, so pub authorized successfully.
EMILY: OK, so let's go back to--
ANDREW: That is cool.
So could we search for it?
EMILY: Well, hold on.
See if it actually went through.
Go back to--
ANDREW: I believe anything that I see in a web browser.
I don't understand.
EMILY: There might be another step.
Oh, invalid, what?
ANDREW: No pubspec.yaml file?
EMILY: What?
What?
We just wrote one.
Hold on.
Go back to Android Studio, where we were editing
said pubspec.yaml.
ANDREW: There it is.
Looks like a pubspec.
EMILY: It does.
ANDREW: I can zoom in.
Still looks like a pubspec.
EMILY: We saved.
We did save.
For grins, let's just try it again.
ANDREW: All right.
I wonder if I took too long.
EMILY: Because there it is.
Yeah.
Yes, we are ready.
All that buildup, and then really--
ANDREW: I know.
EMILY: Oh.
ANDREW: What?
EMILY: [LAUGHS] Ugh.
Really?
OK, yeah, time to ask the internet.
So I see a number I've been browsing,
and I see a number of solutions.
I don't like their options.
The solutions that people have said is, one was like,
I created a new project and replaced the files,
and then it worked.
If that's the case, we have some bugs in our development team
to work on.
ANDREW: It's probably just my fault. Like, a lot of things
are just my fault.
EMILY: Well, we will investigate,
and we will get back with you.
But we'll just pretend.
ANDREW: You've seen all of the correct steps, ironically
enough.
Like, we got to the last step and did it correctly.
EMILY: So if you are not Andrew, you
could follow all these steps and you can see success
in uploading your package.
ANDREW: There you go.
EMILY: So do we want to do the outline for the Dart streams
interface, or are we going to call it good for today?
ANDREW: Let's look at the Dart interface for the next one
and do that.
Yeah, so OK, so call it quits on the publishing section here.
And we're going to switch seats, and we can
look at some actual Dart code.
All right.
[MUSIC PLAYING]