Navigate with named routes

3 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, I'm going to show you how to do some custom routing. So we're going to show you how to navigate between pages with named routes. So instead of constantly doing first screen class, or second screen class or whatever is called tomorrow is split into separate file the Nagas method. That's what we're going to fix in this video, what we can do is is set in the routes and the benefit of that is one, you can name the class whatever you want, and you can constantly be raining obviously shouldn't be renaming the class but if you have two routes, which is you know, stayed the same, plus you can have a bit more of a descriptive name in the root member class you want it to be called something slightly different. And if you come from a web development background, this will feel right at home for you.

So what we want to do in the CLI talk and what we are going to put next Initial route missing something I'm missing. First of all inside of here we need to have an exterior lap. Instead, we would usually create like the first screen class and that's what we would invoke but inside of here, title demo, we are going to have the initial route. And this is gonna be fourth class, it's basically going to be the homepage. And we are going to have loops, curly braces in here, we're going to have the initial router for slash and we specify it on on text, and then the arrow operator and we'll say the screen and then any other routes, we just put comma, then the group name so close last second for a second. routes and context.

Whatever the class is called, that's it. Now to actually navigate to it to navigate from is still you know, dot pop context that to then turn to navigate to it, you do navigator. dot push name to the context and then you name it before slash, I mean, colon, speech marks, similar speech marks, quotation marks, and the second semicolon. And if we do a hot restart, for clicking on screen, printing running slow, obviously should be the slide. There you go, but we're using me. So this just refers to whatever this is pointing to.

Obviously your classes can be more complex than this. But apart from that, really all you need to Now if you have any questions, feel free to call me and message analgesia. 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.