CupertinoAlertDialog

4 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.37
List Price:  €127.92
You save:  €36.55
£76.50
List Price:  £107.11
You save:  £30.60
CA$137.69
List Price:  CA$192.77
You save:  CA$55.08
A$148.22
List Price:  A$207.51
You save:  A$59.29
S$130.49
List Price:  S$182.70
You save:  S$52.20
HK$776.47
List Price:  HK$1,087.09
You save:  HK$310.62
CHF 85.71
List Price:  CHF 120
You save:  CHF 34.28
NOK kr1,068.44
List Price:  NOK kr1,495.86
You save:  NOK kr427.42
DKK kr682.06
List Price:  DKK kr954.91
You save:  DKK kr272.85
NZ$163.67
List Price:  NZ$229.15
You save:  NZ$65.47
د.إ367.26
List Price:  د.إ514.18
You save:  د.إ146.92
৳11,956.14
List Price:  ৳16,739.08
You save:  ৳4,782.93
₹8,410.09
List Price:  ₹11,774.46
You save:  ₹3,364.37
RM428.70
List Price:  RM600.20
You save:  RM171.50
₦162,350.76
List Price:  ₦227,297.56
You save:  ₦64,946.80
₨27,772.22
List Price:  ₨38,882.22
You save:  ₨11,110
฿3,309.86
List Price:  ฿4,633.94
You save:  ฿1,324.07
₺3,427.15
List Price:  ₺4,798.15
You save:  ₺1,371
B$561.07
List Price:  B$785.52
You save:  B$224.45
R1,749.77
List Price:  R2,449.75
You save:  R699.98
Лв178.82
List Price:  Лв250.35
You save:  Лв71.53
₩134,918.50
List Price:  ₩188,891.30
You save:  ₩53,972.80
₪375.91
List Price:  ₪526.30
You save:  ₪150.38
₱5,722.42
List Price:  ₱8,011.62
You save:  ₱2,289.19
¥14,911
List Price:  ¥20,876
You save:  ¥5,964.99
MX$1,927.56
List Price:  MX$2,698.67
You save:  MX$771.10
QR364.07
List Price:  QR509.71
You save:  QR145.64
P1,327.77
List Price:  P1,858.93
You save:  P531.16
KSh12,898.71
List Price:  KSh18,058.71
You save:  KSh5,160
E£4,854.18
List Price:  E£6,796.05
You save:  E£1,941.86
ብር12,138.06
List Price:  ብር16,993.77
You save:  ብር4,855.71
Kz91,440.85
List Price:  Kz128,020.85
You save:  Kz36,580
CLP$92,658.73
List Price:  CLP$129,725.93
You save:  CLP$37,067.20
CN¥706.54
List Price:  CN¥989.19
You save:  CN¥282.64
RD$6,039.89
List Price:  RD$8,456.09
You save:  RD$2,416.20
DA13,292.24
List Price:  DA18,609.67
You save:  DA5,317.42
FJ$222.05
List Price:  FJ$310.88
You save:  FJ$88.83
Q773.61
List Price:  Q1,083.09
You save:  Q309.47
GY$20,932.21
List Price:  GY$29,305.94
You save:  GY$8,373.72
ISK kr13,663.63
List Price:  ISK kr19,129.63
You save:  ISK kr5,466
DH980.25
List Price:  DH1,372.39
You save:  DH392.14
L1,756.68
List Price:  L2,459.42
You save:  L702.74
ден5,632.70
List Price:  ден7,886.01
You save:  ден2,253.30
MOP$800.80
List Price:  MOP$1,121.15
You save:  MOP$320.35
N$1,748.82
List Price:  N$2,448.42
You save:  N$699.60
C$3,682.63
List Price:  C$5,155.83
You save:  C$1,473.20
रु13,453.80
List Price:  रु18,835.86
You save:  रु5,382.06
S/375.42
List Price:  S/525.60
You save:  S/150.18
K393.18
List Price:  K550.47
You save:  K157.29
SAR375.51
List Price:  SAR525.73
You save:  SAR150.22
ZK2,643.81
List Price:  ZK3,701.44
You save:  ZK1,057.63
L454.80
List Price:  L636.74
You save:  L181.94
Kč2,312.44
List Price:  Kč3,237.52
You save:  Kč925.07
Ft36,685.33
List Price:  Ft51,360.93
You save:  Ft14,675.60
SEK kr1,037.56
List Price:  SEK kr1,452.62
You save:  SEK kr415.06
ARS$97,410.47
List Price:  ARS$136,378.56
You save:  ARS$38,968.08
Bs693.86
List Price:  Bs971.44
You save:  Bs277.57
COP$419,638.10
List Price:  COP$587,510.13
You save:  COP$167,872.02
₡51,683.22
List Price:  ₡72,358.58
You save:  ₡20,675.35
L2,482.75
List Price:  L3,475.95
You save:  L993.20
₲780,864.73
List Price:  ₲1,093,241.87
You save:  ₲312,377.13
$U4,173.81
List Price:  $U5,843.51
You save:  $U1,669.69
zł392.18
List Price:  zł549.07
You save:  zł156.89
Already have an account? Log In

Transcript

Hello, in this video, I am going to show you how to implement a Cupertino alert dialog. So an alert dialog, something that pops up takes the attention, the focus of everything else in the application is good to give the user some warning and error alert. Or if you really need to give them some information. And puberty, no one just wants to start in the iOS format. First of all, I'm going to create a trial. And this is going to be important that that will trigger the alert.

So you can trigger it however you want sample rate button. That's the alert button that I'm choosing to men. So raise but then I'm going to say child for the child text widget, it will say click me. And then I'm going to unpressed and here it could call a separate method. The code inside here is what is important to uniquely show dialog. for a second.

So in sha Allah, the semicolon at the end with the context is equal to the context it is just this right here. So this is anything we created. And then you need to do builder. And it's often called bracket build context. Recall this context. The arrow operator thing you say Cupertino, Cupertino dialogue, right that bracket in here.

We can set it up for a few basic properties. The one we want to do is title and the title text here, and I'm going to say and we're going to have content which will provide some more information. Say phones To talk to them again that morning once on my iPhone for the first time I saw it and it was on the eyes and some actions and these are buttons inside of the dialogue. You just do them Cupertino, dialogue, Cupertino dialogue action. And for this, there's a few different properties. The first one is default action so put to true so you know if basically you can trigger some sort of enter return command, that's what this will be and child text.

And obviously on press, we can have a specific can be text all I want you to experiment with the other properties. So this is kind of compressed and I'm going to say print saved up, will get this button that pops up here, click that we get an alert phone is too hot. And I thought click Buy and you were thinking nothing is happening. Why isn't it happening? And that is because we need to handle it in here. We do.

Navigator. Don't do the context. Don't talk. Now if we save it so if I click it, as you can see now, it disappears. So if you want it to disappear, you need to have this so this is closes like the current thing that the part of navigation tab currently has been, you know tied to the focus. So what I want you to do as an extra task is figure out or you know, click it to figure out how to add more button.

Basically you just duplicate the Cupertino dialogue action Aleksey, this is an array of widgets, duplicate this. And you can change the title. So we say something different on pressed functionality could be something different, but Popham that that's all there is to Cupertino alert dialog. If you have any question, 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.