Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,950 --> 00:00:05,810
In the last section, we got our title to appear underneath the image, but the title is just a little
2
00:00:05,810 --> 00:00:06,710
bit too close there.
3
00:00:06,710 --> 00:00:09,360
So I want to add on just a little bit of padding now.
4
00:00:09,360 --> 00:00:15,410
When I say padding, you might immediately think of using another container element, wrapping our text
5
00:00:15,410 --> 00:00:21,620
or the image with it, and then using the containers, padding property to add a little bit of spacing
6
00:00:21,620 --> 00:00:21,800
in.
7
00:00:22,010 --> 00:00:23,240
And that's definitely an option.
8
00:00:23,540 --> 00:00:26,480
But very quickly, I want to show you something in the documentation.
9
00:00:27,050 --> 00:00:29,840
So I'm going to go back to the Layout Widgets page.
10
00:00:30,110 --> 00:00:34,450
Again, this is at Flitter Widgets Layout.
11
00:00:35,120 --> 00:00:38,930
So inside of here, we just saw those single child layout widgets.
12
00:00:39,410 --> 00:00:41,240
We made use of container right here.
13
00:00:41,480 --> 00:00:43,280
But you'll notice that there's another.
14
00:00:44,170 --> 00:00:49,540
Which are right here called padding, so the sole purpose of this padding widget is to add a little
15
00:00:49,540 --> 00:00:56,260
bit of spacing around some child widget, which is essentially exactly what you and I need to do now
16
00:00:56,260 --> 00:00:59,650
before you run off thinking like, OK, yeah, padding is perfect here.
17
00:00:59,680 --> 00:01:07,660
Well, you might notice that adding some spacing around an element is kind of exactly what the container
18
00:01:07,660 --> 00:01:09,040
was doing for us anyways.
19
00:01:09,610 --> 00:01:13,060
So you'll notice that these two widgets are kind of doing the exact same thing.
20
00:01:13,690 --> 00:01:16,750
Well, in fact, if you look at the documentation for padding.
21
00:01:17,940 --> 00:01:23,520
You can scroll down a little bit, and right here you'll see a big section about what the difference
22
00:01:23,520 --> 00:01:27,770
is between a padding widget and a container with some padding property.
23
00:01:28,460 --> 00:01:33,360
So if you want to, you could definitely read this thing right here, get a better idea of what's going
24
00:01:33,360 --> 00:01:35,570
on just to get a little bit of variety.
25
00:01:35,610 --> 00:01:39,810
We're going to use a padding widget because that definitely kind of suits the goal of what you and I
26
00:01:39,810 --> 00:01:41,250
are trying to do right now anyways.
27
00:01:41,910 --> 00:01:49,430
So to use this padding widget, we can create a new padding widget we pass in a child to display inside
28
00:01:49,440 --> 00:01:49,890
this thing.
29
00:01:50,190 --> 00:01:54,390
And then we're also going to give it a padding prop., which, again, is going to be another one of
30
00:01:54,420 --> 00:01:55,960
those etch in sets thing.
31
00:01:56,790 --> 00:02:04,230
So back inside of my editor, I'm going to wrap my image right here with that padding widget we were
32
00:02:04,230 --> 00:02:04,950
just looking at.
33
00:02:05,630 --> 00:02:09,360
So this is going to involve a little bit of heavy duty refactoring.
34
00:02:09,660 --> 00:02:14,090
I want you to make sure that you don't accidentally, like, remove any commas or anything like that
35
00:02:14,100 --> 00:02:15,350
that should not be missing.
36
00:02:15,360 --> 00:02:17,720
So let's just follow me for a little bit here.
37
00:02:17,970 --> 00:02:20,400
So we're going to add in a new padding.
38
00:02:22,210 --> 00:02:26,050
I'm going to give this thing a child property, and then here's the part where the refactor is going
39
00:02:26,050 --> 00:02:27,050
to get a little bit nasty.
40
00:02:27,520 --> 00:02:31,060
I'm going to take my network image, the entire line right there.
41
00:02:31,690 --> 00:02:35,830
I'm going to cut it and I'm going to assign it to child like so.
42
00:02:37,540 --> 00:02:43,780
Then I'll put a comma after padding, so now padding has a child of the network image, and then we
43
00:02:43,780 --> 00:02:46,840
also need to specify that padding property as well.
44
00:02:48,640 --> 00:02:52,870
Do pouting and just like before, we're probably going to want a insets.
45
00:02:54,760 --> 00:03:03,010
Now, before we use EJ INSETs all, we supplied some padding around all sides of that element, but
46
00:03:03,010 --> 00:03:07,770
this time we probably don't want to add additional padding on all sides of this image.
47
00:03:08,110 --> 00:03:11,000
We probably only want to have some padding at the very bottom.
48
00:03:11,680 --> 00:03:15,480
So there's another named constructor that's a part of INSETs right here.
49
00:03:16,210 --> 00:03:19,060
We can provide the only constructor.
50
00:03:19,570 --> 00:03:25,320
So this means to say that we want to add some padding only on some given sides of this element.
51
00:03:26,110 --> 00:03:31,560
So when we use this only constructor, rather than passing it just a double right here, we can actually
52
00:03:31,570 --> 00:03:36,550
we can just hover over this thing and they'll tell us very simply so we can pass in some name parameters
53
00:03:36,550 --> 00:03:39,720
to specify which sites we want to add this padding to.
54
00:03:40,180 --> 00:03:45,670
Now we can add padding to all four sides or just one or two or three or however many want.
55
00:03:46,330 --> 00:03:49,570
So for us, we want to add some padding just on the bottom edge.
56
00:03:49,870 --> 00:03:51,790
So I'm going to add in a named parameter.
57
00:03:52,900 --> 00:03:55,620
Of bottom, and I'll give it, actually.
58
00:03:55,650 --> 00:03:59,890
How about just like eight and remember, eight right here is a double, so it gets the decimal.
59
00:04:01,160 --> 00:04:06,350
Now, we could definitely put the comma on here and leave the line expanded or we can remove the comma
60
00:04:06,350 --> 00:04:08,750
and let it collapse like so it's totally up to you.
61
00:04:09,740 --> 00:04:13,160
But I think we're ready to do a test here, so I'm going to refresh.
62
00:04:15,520 --> 00:04:22,750
And as usual, we got that like 20 second wait, I'm so sorry, so sorry, I know these pauses are awful,
63
00:04:22,750 --> 00:04:25,900
but it's like just long enough where I don't want to stop the video.
64
00:04:26,290 --> 00:04:27,430
I guess there's the restart.
65
00:04:27,830 --> 00:04:28,780
I like my plus.
66
00:04:29,900 --> 00:04:35,390
And now we've got just a little bit more padding there on the bottom eight pixels worth, is it enough?
67
00:04:35,630 --> 00:04:36,170
I don't know.
68
00:04:36,300 --> 00:04:37,190
It probably is.
69
00:04:37,400 --> 00:04:41,780
If you want to, you could definitely add on some more padding there, but I think it's enough for me
70
00:04:41,780 --> 00:04:42,530
to be happy with.
71
00:04:43,190 --> 00:04:45,160
OK, so that's pretty much it.
72
00:04:45,170 --> 00:04:46,820
That is our application.
73
00:04:47,120 --> 00:04:49,080
We've got our list of images being displayed.
74
00:04:49,100 --> 00:04:51,080
We've got a little board around each one.
75
00:04:51,320 --> 00:04:53,600
We got the text, I think recompletion.
76
00:04:54,110 --> 00:04:55,790
So let's take a quick pause right here.
77
00:04:55,910 --> 00:05:01,070
We're going to come back to the next section and we'll do a quick review on some of the big highlights
78
00:05:01,280 --> 00:05:02,720
of the project that we just finished up.
79
00:05:02,950 --> 00:05:04,870
So quick break and I'll see you in just a minute.
7657
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.