PopupMenuButton

6 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$99.99
List Price:  $139.99
You save:  $40
€91.99
List Price:  €128.79
You save:  €36.80
£78.70
List Price:  £110.19
You save:  £31.48
CA$136.12
List Price:  CA$190.57
You save:  CA$54.45
A$149.36
List Price:  A$209.11
You save:  A$59.75
S$134.57
List Price:  S$188.40
You save:  S$53.83
HK$779.70
List Price:  HK$1,091.62
You save:  HK$311.91
CHF 90.88
List Price:  CHF 127.24
You save:  CHF 36.35
NOK kr1,067.14
List Price:  NOK kr1,494.05
You save:  NOK kr426.90
DKK kr686.38
List Price:  DKK kr960.96
You save:  DKK kr274.58
NZ$163.32
List Price:  NZ$228.66
You save:  NZ$65.33
د.إ367.26
List Price:  د.إ514.18
You save:  د.إ146.92
৳11,670.06
List Price:  ৳16,338.55
You save:  ৳4,668.49
₹8,326.90
List Price:  ₹11,658
You save:  ₹3,331.09
RM468.45
List Price:  RM655.85
You save:  RM187.40
₦150,334.96
List Price:  ₦210,474.96
You save:  ₦60,140
₨27,760.43
List Price:  ₨38,865.72
You save:  ₨11,105.28
฿3,602.53
List Price:  ฿5,043.69
You save:  ฿1,441.16
₺3,220.12
List Price:  ₺4,508.30
You save:  ₺1,288.17
B$510.29
List Price:  B$714.43
You save:  B$204.14
R1,818.79
List Price:  R2,546.38
You save:  R727.58
Лв179.65
List Price:  Лв251.52
You save:  Лв71.86
₩135,856.19
List Price:  ₩190,204.11
You save:  ₩54,347.91
₪369.98
List Price:  ₪517.99
You save:  ₪148
₱5,788.84
List Price:  ₱8,104.60
You save:  ₱2,315.76
¥15,569.94
List Price:  ¥21,798.54
You save:  ¥6,228.60
MX$1,659.36
List Price:  MX$2,323.18
You save:  MX$663.81
QR363.44
List Price:  QR508.83
You save:  QR145.39
P1,350.41
List Price:  P1,890.63
You save:  P540.21
KSh13,098.69
List Price:  KSh18,338.69
You save:  KSh5,240
E£4,680.53
List Price:  E£6,552.93
You save:  E£1,872.39
ብር5,724.51
List Price:  ብር8,014.55
You save:  ብር2,290.03
Kz84,838.74
List Price:  Kz118,777.64
You save:  Kz33,938.89
CLP$89,276.78
List Price:  CLP$124,991.07
You save:  CLP$35,714.28
CN¥709.51
List Price:  CN¥993.35
You save:  CN¥283.83
RD$5,838.06
List Price:  RD$8,173.51
You save:  RD$2,335.45
DA13,448.41
List Price:  DA18,828.31
You save:  DA5,379.90
FJ$222.79
List Price:  FJ$311.92
You save:  FJ$89.12
Q774.26
List Price:  Q1,084
You save:  Q309.73
GY$20,849.79
List Price:  GY$29,190.54
You save:  GY$8,340.75
ISK kr13,827.61
List Price:  ISK kr19,359.21
You save:  ISK kr5,531.60
DH992.23
List Price:  DH1,389.16
You save:  DH396.93
L1,765.83
List Price:  L2,472.24
You save:  L706.40
ден5,662.25
List Price:  ден7,927.38
You save:  ден2,265.13
MOP$800.92
List Price:  MOP$1,121.33
You save:  MOP$320.40
N$1,823.35
List Price:  N$2,552.76
You save:  N$729.41
C$3,669
List Price:  C$5,136.75
You save:  C$1,467.74
रु13,286.84
List Price:  रु18,602.11
You save:  रु5,315.27
S/372.17
List Price:  S/521.05
You save:  S/148.88
K387.03
List Price:  K541.86
You save:  K154.83
SAR375
List Price:  SAR525.01
You save:  SAR150.01
ZK2,543.81
List Price:  ZK3,561.44
You save:  ZK1,017.62
L457.65
List Price:  L640.73
You save:  L183.08
Kč2,272.97
List Price:  Kč3,182.25
You save:  Kč909.28
Ft35,512.48
List Price:  Ft49,718.89
You save:  Ft14,206.41
SEK kr1,068.43
List Price:  SEK kr1,495.85
You save:  SEK kr427.41
ARS$88,665.87
List Price:  ARS$124,135.76
You save:  ARS$35,469.89
Bs688.59
List Price:  Bs964.05
You save:  Bs275.46
COP$381,601.87
List Price:  COP$534,257.88
You save:  COP$152,656.01
₡51,006.90
List Price:  ₡71,411.70
You save:  ₡20,404.80
L2,467.63
List Price:  L3,454.78
You save:  L987.15
₲746,739.85
List Price:  ₲1,045,465.66
You save:  ₲298,725.81
$U3,879.22
List Price:  $U5,431.06
You save:  $U1,551.84
zł391.77
List Price:  zł548.49
You save:  zł156.72
Already have an account? Log In

Transcript

Hello in this video we are going to take a look at the pop up menu button. So simply put when you you know, initiate this button, it reveals a pop up menu that you can know you can obviously select item from. Okay, so what we are going to do and inside of here we're going to create an E name. I can get rid of these two variables there from before. So Nina, and we're gonna call this boy father and this is gonna have some random This is an example. You can change this and so you're reading Okay, so we need anything else.

This needs to be outside and put it there at the top anywhere. I started the classes flying in here, you can add a trip IOD and it is going to be a pop up menu button. And we're handled the item builder in a second. But before that, we need to specify that the type is going to be white father. And info here we're going to say on selected, so go to events on selected and on Cancel on selected, why bother? And this is basically going to be the result.

Set state so you change the state itself. And we are going to say underscore selection. Or sorry, we just need to create a variable here and this will allow us to essentially keep track track of what's happening. So we could say the ROI of school selection variable And obviously, you know, this could be, you don't have to use this, you could be a string, for example, who is going to use it like this. And we're going to say, on a school selection equal result. And obviously, you can do you know, any other code that you want here as well once you've selected decline item, we're not fussed about that.

Now we're going to go into the item builder, item builder, build context, on text and arrow operator, and here is a pop up menu entry. And it's going to be Wi Fi arena. And here I'm gonna put square brackets and this is where we're basically going to build up the item for the for items. He just put const pop up menu item, you specify Specify the email so why bother and inside the starting value is why of the harder you know we can do for each single one child is going to text we can have something else in the child who is going to keep it simple display some text and also work in a lot harder and to save some time because the rest are essentially just modification to this. I'm going to duplicate this. Two, three and four.

So we got our menu item wife, Father, this is going to be smarter, working been a lot. A lot smarter. This one is going to be cell start. This one is going to be trading short. And this one's gonna be placed in charge trading shorter, let's say real hot reload, and let's see what we get. So at the moment, that's a, we get these three buttons, and we can, you know, open them up.

And that's it. So we could obviously put this within our app bar as an extra task for you to figure out where to put it right here. You can modify that icon as well. So he's pretty open. I constantly could do icon, icons dot let's do add, for example. Okay, and instead, we've got the Add button that provides this whole menu item.

Now, it's totally you know, up to us, let me show you something else, what we could do is the footprint that we're getting the default selection, so we'll save that. And if you pay attention here, so open that up, click been asked Mater, we get the small 214 click on we should get the charter one we have charter, etc, etc. can change the icon. This is fantastic for the concealing some information. It's not a selector like a drop down necessarily, but it could be used to make you go to a separate page. So if you have a contact page, you know, like in a contact app, you have a list of contacts, you open up the contact, you will have one of these, you know, but 10 I'm gonna get rid of this because there's better with these three dots.

It looks better. So you have something If you click on it, it could say Edit because they delete because they share for example, and that would you know, in itself so here you would have some sort of if statements and so check to see what the actual, you know, pop up menu is movies selected. And from that you could, you know, go to the share menu, you could go to the Edit page, you could go, you know, maybe show the Delete dialog box. And you know, that way you could proceed through your application. But that's it for the pop up menu button. If you have any questions, feel free to drop me a message.

And as usual, I look forward to seeing you in the next video.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.