All right, it's time to create the pop -up menu button to show if no photo was selected.
Let me just scroll up all the way up here.
Let's just collapse the stack so that we
can see what we're doing.
So we said if the photo is not empty,
that means we're going to show the stack all the code that we've done so far.
Otherwise, if there is no photo, what do we want to do?
So let's go ahead and start adding the actual real tag here, okay?
So let's do that.
We're going to say review entry edit
logic, right?
Review entry edit logic, review mode.
It's a review mode, right?
If it equals review mode add, review mode
dot add, right?
That means we're adding a new review, right?
And what do we want to do here?
If we're adding a new review, then we're
going to get the tag of add review entry as the tag.
Otherwise, we're just going to leave it blank, okay?
That's very good.
Save that.
All right.
And of course, it's no longer going to be
a constant value, okay?
And the size box, we're going to remove this.
That was just our placeholder, right?
So we're going to actually replace that
with a pop -up menu button.
So pop -up menu button, right?
What is the icon going to be?
Icon.
All right.
So it's going to be a const icon because
it will not change icons.
Add a photo outline.
That's the one I like right there.
Yeah, that looks good.
And let's put a position.
The position we want it to be also under
like before.
So pop -up menu position.
So pop -up menu position under.
All right.
Very good.
Scroll up a little bit more.
Tool tip.
And I want to put this tool tip actually
up here.
Tool tip.
It's going to be, let's just say menu.
All right.
Position.
Item builder.
Build context, right?
Build context.
Context.
We'll do the fed arrow.
And open and close square brackets.
So we're going to now put our list of pop
-up menu items, right?
So pop -up menu item.
And what is the type going to be?
That's right.
Menu items photo.
Just like before, right?
Okay.
And the value.
The value is going to be menu items photo.
Menu items photo dot camera.
Okay.
So this is when the user is going to pick.
Says, hey, I want to take a picture.
Child.
It's going to be our row.
Children.
Going to be const.
Okay.
The icon is going to be icons photo camera.
There it is.
We're going to do a size box so that we have a little room in between.
Let's do the width of 8 pixels.
8 .0.
And then the text is going to say what?
Just take a photo.
Take a photo.
That looks good.
Let me see.
That's looking really good.
So now we want to put another pop -up menu item, right?
The one to add from a photo album, right?
So we're going to say pop -up menu button.
Menu item.
Pop -up menu item.
And it's going to be a type of what?
Menu items photo.
That's right.
Menu items photo.
Beautiful.
All right.
So we're going to put value.
Value is going to be menu.
Menu items photo.
Gallery, right?
Because here we're going to pick from our photo album, from the device photo album.
Let's put a row.
Children.
It's going to be cons because this is not going to change, right?
Let's put the icon as icons photo album.
There it is.
That looks good.
Size box.
Width 8 pixels.
Let's give it a nice little space between the icon and the text, right?
And here we're just going to say add from photo album.
And that looks good.
And after the square brackets, let's
handle the unselected, right?
Because now the user is going to select.
What are we going to do when they select?
So let's set this selected.
Okay.
Curly brackets.
Let's work.
Let's do our switch statement.
Switch.
We're going to say selected, right?
Case.
Menu items photo.
If it's camera, we're going to take a picture.
What are we going to do?
Review edit.
Entry logic, right?
Take an image.
And the image source is going to be,
that's right, image source camera.
Image source dot camera.
Very good.
Then, dot then, the value is just, we'll
just call this photo.
So we want to say what?
We want to do the notifier now, right?
So the photo notifier value equals photo.
Photo.
Close it up.
And break.
All right.
Next.
Case.
What's the next case, right?
That's the photo album, right?
So menu items photo gallery.
We're going to say review entry edit logic.
Take image.
Image source.
Image source gallery.
And then we're going to say then photo.
And we're going to say photo notifier
value, that value, equals photo.
Close it up.
Break.
Excellent.
That's looking really good.
So you created the pop -up menu button to
take a photo or add a photo from a photo album, right?
This is the case when the user is adding a new review.
Now next, you will create the review entry edit date picker widget.