All language subtitles for 15. Designing the Result Page

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French Download
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranî)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu
Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated: 0 1 00:00:00,150 --> 00:00:06,990 All right. So most of our input page is now complete and all of the components now work on this page 1 2 00:00:07,410 --> 00:00:08,800 as expected. 2 3 00:00:08,820 --> 00:00:11,520 Now there's just a couple of styling things to tidy up. 3 4 00:00:11,520 --> 00:00:18,060 For example at the bottom here, we've got this calculate button and ideally we'd like to maybe format 4 5 00:00:18,090 --> 00:00:20,820 that text to make it look a little bit better. 5 6 00:00:20,850 --> 00:00:24,180 So let's go ahead and add a style to this. 6 7 00:00:24,240 --> 00:00:27,940 And of course we're going to create it as a constant in here. 7 8 00:00:28,290 --> 00:00:35,490 So I'm going to create a new const called kLargeButtonText style or you could call it anything 8 9 00:00:35,490 --> 00:00:36,270 you like. 9 10 00:00:36,270 --> 00:00:39,790 And it's going to be a text style widget. 10 11 00:00:40,080 --> 00:00:46,890 And I'm going to set the font size as probably 25 and the font weight as bold. 11 12 00:00:50,880 --> 00:00:55,920 And now I'm going to apply this constant to my text here. 12 13 00:00:55,920 --> 00:01:01,190 So k It was LargeButtonText. 13 14 00:01:01,370 --> 00:01:03,770 All right let's check that out. 14 15 00:01:03,990 --> 00:01:05,340 So that looks a lot better. 15 16 00:01:05,460 --> 00:01:13,710 And now all I need is to center my text into that container so that it's right in the middle here rather 16 17 00:01:13,710 --> 00:01:17,230 than all the way to the left. 17 18 00:01:17,320 --> 00:01:23,740 Now there's just one last thing which is our calculate text widget is just a little bit too close to 18 19 00:01:23,740 --> 00:01:24,410 the bottom. 19 20 00:01:24,430 --> 00:01:29,380 It would be nice, especially on an iPhone where we know that this is an interactive area, 20 21 00:01:29,420 --> 00:01:34,960 it would be nice to bring that word up a little bit so that the user target area is a little bit higher 21 22 00:01:35,000 --> 00:01:36,820 so they don't accidentally quit the app. 22 23 00:01:37,270 --> 00:01:44,290 So in order to do that, we can add a little bit of padding to our container. And we're going to add some 23 24 00:01:44,290 --> 00:01:48,200 padding that only adds it to the bottom. 24 25 00:01:48,340 --> 00:01:50,830 And I'm going to put 20 pixels of padding here. 25 26 00:01:51,280 --> 00:01:57,520 So now when I hit save, you can see it pushes it right up so that it's actually properly within the safe 26 27 00:01:57,520 --> 00:01:58,720 area. 27 28 00:01:58,720 --> 00:02:02,020 And that's pretty much our input page complete now. 28 29 00:02:02,110 --> 00:02:08,260 So we're ready to move on to the next page in our application which is the result page. 29 30 00:02:08,290 --> 00:02:13,270 So that's what we're going to be doing mostly in this lesson and we're going to be building it out so 30 31 00:02:13,270 --> 00:02:20,350 that it can look like the one that we have in our demo here, where we have a card and we have the results 31 32 00:02:20,440 --> 00:02:27,310 and we have another button to head back so that we can recalculate our result as necessary. 32 33 00:02:27,460 --> 00:02:33,910 We've already created a result page that looks really really simple. And we can get to it to look at 33 34 00:02:33,910 --> 00:02:35,860 it by clicking on the calculate button. 34 35 00:02:36,460 --> 00:02:39,630 So we don't actually really need this text in the middle. 35 36 00:02:39,640 --> 00:02:44,060 That was just to make sure that we can tell that this is the second screen. 36 37 00:02:44,260 --> 00:02:48,790 But what we do need are all of the components that's going to make up this page. 37 38 00:02:48,790 --> 00:02:50,740 So let's go ahead and build it out. 38 39 00:02:50,800 --> 00:02:54,490 Firstly it's going to be a top-to-bottom vertical layout. 39 40 00:02:54,550 --> 00:03:01,600 So I'm going to add my column as usual, and my column is going to be spaced out evenly. 40 41 00:03:01,630 --> 00:03:07,540 So I'm going to go for a space evenly for my main axis alignment. 41 42 00:03:07,540 --> 00:03:11,990 And if you forgot about what that does, just hit CONTROL + J or CONTROL + 42 43 00:03:11,990 --> 00:03:19,000 Q On Windows and it tells you exactly what it is that this particular selection will do. 43 44 00:03:19,000 --> 00:03:25,960 Now we're ready to add our children to our column. And the first child is going to be an expanded widget 44 45 00:03:26,410 --> 00:03:35,650 which is going to contain just a container. And our container is going to have a child that is a little 45 46 00:03:35,650 --> 00:03:37,050 bit of text. 46 47 00:03:37,330 --> 00:03:42,270 The text is just going to say the words 'Your Result'. 47 48 00:03:42,310 --> 00:03:47,410 So if we hit save we can see that it just shows up as a little bit of body text. 48 49 00:03:47,410 --> 00:03:50,050 So we're going to need to style it up a little bit. 49 50 00:03:50,050 --> 00:03:56,980 Now while I'm going along creating the entire user interface for the second page, all that I'm doing is 50 51 00:03:56,980 --> 00:04:02,350 just following along with the design that I'm seeing on this page. Although I've simplified it a little 51 52 00:04:02,350 --> 00:04:07,810 bit so that we don't spend ages adding loads of little components, I still kept most of the design 52 53 00:04:07,810 --> 00:04:10,010 consistent with what we see here. 53 54 00:04:10,060 --> 00:04:16,210 Now if you want to simply create this design all by yourself then feel free to just use this screen 54 55 00:04:16,330 --> 00:04:20,680 as your guide to create the design from scratch by yourself. 55 56 00:04:20,680 --> 00:04:25,900 But if you want to follow along with me, then I'm gonna quickly style it out so that we have the same 56 57 00:04:25,900 --> 00:04:29,000 code and we stay consistent with each other. 57 58 00:04:29,050 --> 00:04:34,990 So now that I've added my text, I want to add a little bit of style. And when I'm adding a style, it's 58 59 00:04:35,050 --> 00:04:40,240 easier to simply just add it to my constants because I might want to use it a little bit later on. 59 60 00:04:40,270 --> 00:04:43,570 So let's add a little bit of style for that title. 60 61 00:04:43,570 --> 00:04:54,490 So I'm going to add a const kTitleTextStyle and this is going to be a text style widget. And the 61 62 00:04:54,490 --> 00:05:05,840 font size I'm going to set to quite large, maybe a 50 and then the font weight is going to be bold. All 62 63 00:05:05,850 --> 00:05:06,000 right. 63 64 00:05:06,090 --> 00:05:15,670 So now I can use this kTitleTextStyle in my result page as long as I import the constants file. 64 65 00:05:15,780 --> 00:05:20,700 So let's go ahead and add that in. 65 66 00:05:20,780 --> 00:05:21,050 All right. 66 67 00:05:21,320 --> 00:05:28,690 So now that I've added this we can check it out and it should look a lot bigger like this. Let's go ahead 67 68 00:05:28,690 --> 00:05:31,930 and add our next widget inside our column. 68 69 00:05:31,930 --> 00:05:37,930 So after the expanded widget, I'm going to add another expanded widget but this one is going to be a 69 70 00:05:37,930 --> 00:05:38,830 lot larger. 70 71 00:05:38,830 --> 00:05:45,550 I want it to take up more space in this column so that it takes up maybe five times as much as this one 71 72 00:05:45,580 --> 00:05:47,020 or this one. 72 73 00:05:47,020 --> 00:05:51,390 And in order to do that, I'm going to use the flex property. 73 74 00:05:51,460 --> 00:05:55,670 So by default all expanded widgets get a flex of 1, 74 75 00:05:55,750 --> 00:05:57,800 so they're laid out evenly. 75 76 00:05:58,030 --> 00:06:05,140 But in this case I'm going to give this one a flex of 5, so that it takes up more space. And the child 76 77 00:06:05,140 --> 00:06:11,050 that's going to be in this expanded widget is going to be a reusable card widget which we can only get 77 78 00:06:11,050 --> 00:06:15,220 access to if we import the reusable card widget. 78 79 00:06:15,550 --> 00:06:18,450 So we're only adding in the files that we actually need. 79 80 00:06:18,460 --> 00:06:20,810 So let's create our reusable card 80 81 00:06:21,130 --> 00:06:24,830 and it has color as a required property. 81 82 00:06:24,850 --> 00:06:29,220 So I'm going to put in the constant that's the active card color. 82 83 00:06:29,290 --> 00:06:33,850 Let's check that out and make sure that it's taking up as much space as we want it to. 83 84 00:06:34,270 --> 00:06:38,530 So at the moment this is taking up 1 times the available space on the screen, 84 85 00:06:38,530 --> 00:06:42,110 and this is going to take up five times the height of this one. 85 86 00:06:42,160 --> 00:06:47,080 Now I'm ready to add a card child to my reusable card. 86 87 00:06:47,380 --> 00:06:50,210 And this is going to contain another column. 87 88 00:06:50,290 --> 00:06:53,350 So it's gonna be a column inside a column. 88 89 00:06:53,350 --> 00:06:58,450 And in this column, we have a main axis that is going to be again spaced evenly. 89 90 00:06:59,200 --> 00:07:06,970 And we're also going to add a cross alignment that is going to center everything in the horizontal axis. 90 91 00:07:06,970 --> 00:07:11,060 And then we're ready to add our children which is going to be some text widgets. 91 92 00:07:11,560 --> 00:07:18,140 So the first text widget is going to be the result of the BMI, so we'll say overweight, normal or underweight. 92 93 00:07:18,820 --> 00:07:24,880 And then the second text widget is going to be the actual reading rounded to one decimal place. 93 94 00:07:24,880 --> 00:07:30,490 And finally we have an interpretation for their weight so that the user can actually understand what 94 95 00:07:30,490 --> 00:07:32,430 this BMI means. 95 96 00:07:32,470 --> 00:07:38,320 Let's go ahead and add our first text widget which is simply going to be a result. 96 97 00:07:38,350 --> 00:07:46,560 So I'm gonna start out with just the string of maybe normal over here. And then we're gonna give it a 97 98 00:07:46,560 --> 00:07:54,060 style which is going to be relatively large and I'm going to call it resultTextStyle. 98 99 00:07:57,130 --> 00:08:03,500 So this is going to be a green color as I've picked it out from this particular design. 99 100 00:08:03,520 --> 00:08:11,890 So the color is going to be a custom hex code and it's going to be 0xFF, so fully opaque and then 100 101 00:08:12,190 --> 00:08:22,270 24D876. And you can see that it shows up as a nice bright limy me sort of green. 101 102 00:08:22,270 --> 00:08:29,620 Now I've got my color down, I'm going to add some font size. Let's keep it about 22, should do. 102 103 00:08:30,220 --> 00:08:33,910 And then the font weight is going to be again bold. 103 104 00:08:38,040 --> 00:08:39,700 Forgot to add the k here 104 105 00:08:39,960 --> 00:08:43,380 so let's just change that to kResultTextStyle. 105 106 00:08:43,380 --> 00:08:43,620 All right. 106 107 00:08:43,710 --> 00:08:48,900 So now we can go ahead and apply this to our results page right here. 107 108 00:08:48,930 --> 00:08:51,650 So it's going to be the kResultTextStyle. 108 109 00:08:52,200 --> 00:08:55,500 Let's check that out. 109 110 00:08:55,610 --> 00:08:55,910 All right. 110 111 00:08:55,940 --> 00:09:02,390 So it's looking pretty good. But our card is now shrunken to a very small size. 111 112 00:09:02,420 --> 00:09:09,560 So if we want to stretch it out, all we have to do is add a cross axis alignment property and make it 112 113 00:09:09,680 --> 00:09:11,900 stretch across the screen. 113 114 00:09:11,900 --> 00:09:15,920 So now our card will take up as much width as it possibly can. 114 115 00:09:16,070 --> 00:09:20,190 And in the center we've got that normal interpretation. 115 116 00:09:20,270 --> 00:09:26,210 So this is the first text widget and the second one is going to be the actual BMI reading, 116 117 00:09:26,210 --> 00:09:34,360 so it's going to be another text widget inside the column. And let's start this one out with a , I don't know, 117 118 00:09:34,500 --> 00:09:37,530 18.3 or whatever number comes to your mind. 118 119 00:09:37,740 --> 00:09:43,080 And it's going to be as a string rather than as a number because that's what we need inside the text 119 120 00:09:43,080 --> 00:09:47,260 widget. And then we're going to style this one up as well, 120 121 00:09:47,610 --> 00:09:49,800 and it's gonna go at the bottom here. 121 122 00:09:50,190 --> 00:09:59,350 So this is going to be the kBMITextStyle and this is going to be quite large. 122 123 00:10:01,420 --> 00:10:08,410 So we're going to change the font size to maybe about 100 just to make it super large and also change 123 124 00:10:08,410 --> 00:10:17,960 the font weight to bold as well, just so that it has the biggest emphasis on the screen. So that's the 124 125 00:10:17,990 --> 00:10:24,520 kBMITextStyle. And you can see it's absolutely massive. 125 126 00:10:24,530 --> 00:10:28,060 You can't miss that when you head over to the screen. 126 127 00:10:28,130 --> 00:10:33,610 Now all we need is the final text widget which is going to be the interpretation. 127 128 00:10:33,770 --> 00:10:41,810 And in this case I'm just gonna write a little bit of 'Your BMI result is quite low. 128 129 00:10:42,020 --> 00:10:46,520 You should eat more'. 129 130 00:10:46,940 --> 00:10:51,520 And we're of course going to style this up as well. 130 131 00:10:51,650 --> 00:10:53,830 So let's add a k 131 132 00:10:54,050 --> 00:10:55,880 BodyTextStyle 132 133 00:10:56,840 --> 00:11:06,320 and this is going to be a slightly smaller style so the font size is gonna be about 22 and we're not 133 134 00:11:06,320 --> 00:11:16,570 gonna change anything else about it. So let's go ahead and add the KBodyTextStyle and if we hit save 134 135 00:11:16,570 --> 00:11:22,570 right now, you can see that by default all text is aligned to the left. 135 136 00:11:22,600 --> 00:11:27,670 So if we wanted to change the text alignment we have to do that inside the text widget. 136 137 00:11:27,730 --> 00:11:36,390 So we'll check the text align and we'll will make it centered. And this way it goes right in the middle 137 138 00:11:36,720 --> 00:11:44,180 so that it looks more consistent with our design. Now the final thing that we need is that button at 138 139 00:11:44,180 --> 00:11:49,790 the bottom here telling the user that they can recalculate their BMI result if they think that they 139 140 00:11:49,790 --> 00:11:51,740 inputted something wrong. 140 141 00:11:51,740 --> 00:11:57,830 This is going to be exactly the same as the button that we had earlier which is the calculate button. 141 142 00:11:57,830 --> 00:12:03,920 So instead of creating it from scratch again, let's go ahead and select the widget that we want to extract 142 143 00:12:04,430 --> 00:12:06,250 and go into our Flutter outline 143 144 00:12:06,290 --> 00:12:12,980 and it's also highlighted over here and you can see it the last one in our tree in our column. 144 145 00:12:12,980 --> 00:12:16,480 So let's right click on it and extract our widget. 145 146 00:12:16,550 --> 00:12:19,460 I'm simply going to call it the bottom button. 146 147 00:12:19,520 --> 00:12:21,830 You can call anything else you like. 147 148 00:12:21,980 --> 00:12:23,510 And we're going to click refactor. 148 149 00:12:23,960 --> 00:12:29,290 So now it takes our bottom button out and we can delete that new keyword if it pops up for you. 149 150 00:12:29,300 --> 00:12:34,490 If it doesn't, then it means the Flutter team updated the tooling and it's no longer using the earlier 150 151 00:12:34,490 --> 00:12:35,180 version of Dart. 151 152 00:12:35,510 --> 00:12:38,190 So the latest version Dart there is no new. 152 153 00:12:38,300 --> 00:12:45,890 And then we're going to delete the the constructor for our bottom button and we're going to set it up 153 154 00:12:46,010 --> 00:12:54,290 with a custom onTap and some custom text because these are the parts that will differ between the first 154 155 00:12:54,290 --> 00:12:55,540 page and the second. 155 156 00:12:56,000 --> 00:12:58,670 So let's go ahead and add some properties in here. 156 157 00:12:58,670 --> 00:13:03,440 So we've got a final function that's going to be called onTap, 157 158 00:13:03,500 --> 00:13:09,560 and we're also going to have a final string that's going to be the buttonTitle. 158 159 00:13:10,550 --> 00:13:16,850 So now we can create our custom constructor which is going to be bottomButton 159 160 00:13:16,850 --> 00:13:26,240 and this is going to take two inputs and both of them should be required because it's a button. 160 161 00:13:26,300 --> 00:13:30,230 It probably needs some text and it probably needs to handle a tap. 161 162 00:13:30,230 --> 00:13:38,710 So this.onTap and also add required this.buttonTitle. 162 163 00:13:39,020 --> 00:13:46,660 Now we can go into our gesture detector and I'm going to simply cut out all of this because I'm going 163 164 00:13:46,660 --> 00:13:52,400 to need it a little bit later on. And instead I'm going to use the onTap that gets passed in to the 164 165 00:13:52,460 --> 00:14:00,040 bottomButton. And I'm also going to use the text that's passed in from the buttonTitle. 165 166 00:14:00,310 --> 00:14:02,530 Now this is completely refactored. 166 167 00:14:02,530 --> 00:14:06,370 We can go into here and add those properties in. 167 168 00:14:06,400 --> 00:14:13,600 So we've got our button title which is going to be the word CALCULATE in all caps, and then we're going 168 169 00:14:13,600 --> 00:14:18,790 to have onTap which is where I'm going to paste in everything that I had from before. 169 170 00:14:19,270 --> 00:14:26,800 So it's that callback which pushes the next screen, which is the result page, onto the navigation stack. 170 171 00:14:26,920 --> 00:14:34,230 And if you find it helpful, you can add some commas so that Dart will reformat it properly for you. 171 172 00:14:34,240 --> 00:14:42,250 So now I'm going to take all of this out of my input page. And let's create a new Dart file and we'll 172 173 00:14:42,250 --> 00:14:50,860 call it bottom_button and now I'm going to be have to paste in that entire class. 173 174 00:14:51,070 --> 00:14:52,840 So let's add that into here. 174 175 00:14:52,930 --> 00:15:01,930 And again import our material package so that everything works and also import our constants so that 175 176 00:15:02,020 --> 00:15:05,680 we know what these colors and sizes and styles are. 176 177 00:15:05,740 --> 00:15:11,190 And while I'm at it, I might as well separate out my round icon button as well just in case I need it 177 178 00:15:11,200 --> 00:15:12,190 somewhere else too. 178 179 00:15:12,220 --> 00:15:16,720 Doesn't make sense to keep it inside the input page and hold on to it there. 179 180 00:15:17,140 --> 00:15:27,750 So let's create our round_icon_button and here I'm going to cut this out and paste it into this new 180 181 00:15:27,750 --> 00:15:29,090 file. 181 182 00:15:29,100 --> 00:15:34,190 Now we can again import our material package and that's all we need. 182 183 00:15:35,490 --> 00:15:46,230 Now I can go into my import page and import the bottom_button.dart so that it knows what the bottom 183 184 00:15:46,230 --> 00:15:55,530 button is, and also import my round_icon_button.dart file so that it knows what the round buttons 184 185 00:15:55,530 --> 00:15:55,710 are. 185 186 00:15:55,950 --> 00:16:03,210 So we have no more errors in this page and this entire page is now dedicated to the user interface and 186 187 00:16:03,210 --> 00:16:07,770 the functionality of the inputs screen in our app. 187 188 00:16:07,770 --> 00:16:14,070 If you want you can actually quite easily add a folder to organize your lib because as you can imagine, 188 189 00:16:14,430 --> 00:16:19,510 as you create more custom components and more screens it can get a little bit messy. So you can go into 189 190 00:16:19,530 --> 00:16:30,150 file, new and we can select new directory. And we can call this maybe components, and we can also create 190 191 00:16:30,210 --> 00:16:36,800 a new one that is going to hold on to our screens so we'll call this one screens. 191 192 00:16:37,140 --> 00:16:44,700 And now we can move our input page and our result page into screens and make sure that you keep the 192 193 00:16:44,730 --> 00:16:49,320 search for references checked so that everything gets moved along correctly. 193 194 00:16:49,320 --> 00:16:51,530 And we're also going to move our components, 194 195 00:16:51,540 --> 00:16:58,890 so the bottom button, the icon content, the reusable card and round icon button into our components 195 196 00:16:58,890 --> 00:17:02,300 folder just so that everything looks a lot neater. 196 197 00:17:02,310 --> 00:17:03,290 We've got components, 197 198 00:17:03,300 --> 00:17:09,990 we've got our screens but we've also got some errors. And the errors are because it no longer can see 198 199 00:17:10,020 --> 00:17:12,320 constants in the same folder 199 200 00:17:12,330 --> 00:17:12,640 right? 200 201 00:17:12,960 --> 00:17:20,280 Whereas previously, the bottom_button.dart and the constants, they were all inside the same folder. 201 202 00:17:20,280 --> 00:17:22,890 Now it's actually at a different level. 202 203 00:17:22,890 --> 00:17:27,420 So all you have to do is delete that and retype it. 203 204 00:17:27,450 --> 00:17:34,200 So start out with constants and we can search for it and we'll be able to find it inside our package 204 205 00:17:34,260 --> 00:17:39,390 bmi_calculator/constants and now all your errors will go away. 205 206 00:17:40,020 --> 00:17:46,530 So let's go ahead and copy this and replace it everywhere where there's an error for finding the constants 206 207 00:17:46,680 --> 00:17:52,200 file and even in our screens we've got also the same issue up here. 207 208 00:17:52,380 --> 00:17:57,010 We've got our icon content that is now moved inside the components folder, 208 209 00:17:57,060 --> 00:17:59,650 the reusable card that's been moved 209 210 00:17:59,760 --> 00:18:01,770 so we have to restructure all of these 210 211 00:18:05,110 --> 00:18:12,560 and also do the same for all of the other places where we're using components. 211 212 00:18:12,610 --> 00:18:17,790 So now we no longer have any errors with our imports and all our code will work just fine. 212 213 00:18:17,810 --> 00:18:20,430 So the final one is our results page. 213 214 00:18:20,430 --> 00:18:31,740 So let's go ahead and add the location of our constants and also our reusable card. 214 215 00:18:32,070 --> 00:18:32,340 All right. 215 216 00:18:32,370 --> 00:18:39,390 So now that we've refactored and tidied everything up, it's now time to actually add in that final component 216 217 00:18:39,480 --> 00:18:40,740 into our column here. 217 218 00:18:41,370 --> 00:18:45,980 So after that last expanded widget, we're going to add that bottom button. 218 219 00:18:46,020 --> 00:18:53,100 So again we have to import that bottom button that's inside our components folder, and we'll be able 219 220 00:18:53,100 --> 00:18:57,820 to use it down here to add a bottom button widget. 220 221 00:18:58,140 --> 00:19:05,370 And we're going to add a button title which is going to say RE-CALCULATE. 221 222 00:19:06,410 --> 00:19:07,600 So a little bit different 222 223 00:19:07,620 --> 00:19:14,830 so it indicates that we go back. And then we're going to have a onTap which is going to have a callback. 223 224 00:19:14,860 --> 00:19:22,590 Now when the user taps on this bottom button, what we want to happen is to pop off this second screen, 224 225 00:19:22,590 --> 00:19:30,080 this result screen, and go back to this previous screen so that they can add new inputs and recalculate. 225 226 00:19:30,180 --> 00:19:36,690 So as we saw earlier when we learned about navigation and route, it's really really simple to destroy 226 227 00:19:36,720 --> 00:19:39,560 and pop off the screen that's at the very top. 227 228 00:19:39,660 --> 00:19:45,270 All we need to do is write Navigator.pop and pass in the current context. 228 229 00:19:45,690 --> 00:19:50,730 So now if we hit save and we calculate our BMI, we click on recalculate, 229 230 00:19:50,730 --> 00:19:57,780 we can go back to the input screen. The very last thing that we're going to do is simply to just tweak 230 231 00:19:57,840 --> 00:20:03,780 this top text widget just so that it comes down a little bit closer to the card and have a little bit 231 232 00:20:03,780 --> 00:20:05,640 of margin from the left. 232 233 00:20:05,640 --> 00:20:13,980 So let's go into that container widget and let's go ahead and add some padding, maybe around 15 of padding 233 234 00:20:15,050 --> 00:20:22,700 so that it comes away a little bit from the top and the left. And then I'm also going to add some alignment 234 235 00:20:22,940 --> 00:20:28,910 just so that it goes down a little bit maybe down to the bottom left. 235 236 00:20:28,930 --> 00:20:30,300 So now let's hit save. 236 237 00:20:30,370 --> 00:20:36,970 And now it looks a lot more coherent. It's closer to the card and further away from the top and it looks 237 238 00:20:36,970 --> 00:20:39,460 like it's all grouped nicely together. 238 239 00:20:39,460 --> 00:20:46,420 Now that we have pretty much all of our design done both for the input page as well as for the result 239 240 00:20:46,420 --> 00:20:52,960 page, there's only one thing that's missing and that's some actual functionality. The actual ability to 240 241 00:20:52,960 --> 00:20:54,260 calculate the BMI. 241 242 00:20:54,640 --> 00:20:57,580 So for all of that and more, I see on the next lesson. 27154

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.