Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,960 --> 00:00:05,530
In the last section, we got our scaffold and our appart widgets to show up on the screen.
2
00:00:05,790 --> 00:00:09,030
However, the Alkmaar widget is not currently showing any text.
3
00:00:09,360 --> 00:00:14,430
And if you look back at our mockup for the average trying to build, we definitely showed some text
4
00:00:14,430 --> 00:00:15,340
inside the bar.
5
00:00:15,690 --> 00:00:18,330
So in this section, we're going to figure out how we add some text.
6
00:00:19,060 --> 00:00:24,420
I'm going to first get started by pulling up the documentation for the app bar on the flutter documentation
7
00:00:24,420 --> 00:00:24,870
page.
8
00:00:25,790 --> 00:00:31,040
So here's where we were looking at these scaffold class to pull up the documentation for the APA, you
9
00:00:31,040 --> 00:00:36,350
can either find the link just a little bit down right here or you can go to this search interface on
10
00:00:36,350 --> 00:00:40,070
the top right hand side and search for APSA class.
11
00:00:42,670 --> 00:00:48,640
So I'll go to the APA documentation on the right hand side, you're going to see that the APA has a
12
00:00:48,640 --> 00:00:53,770
lot of documentation, very similar to all the documentation we saw back when we were looking at that
13
00:00:53,770 --> 00:00:54,570
list class.
14
00:00:54,580 --> 00:00:56,460
That was a part of the Dart Standard Library.
15
00:00:57,010 --> 00:01:00,870
So the APA is a widget, but it's still a dart class.
16
00:01:01,030 --> 00:01:05,700
So it has its own set of properties and it has its own set of methods as well.
17
00:01:06,670 --> 00:01:11,380
In order to get some text inside that bar, let's take a look at the constructor and see if there's
18
00:01:11,380 --> 00:01:14,760
some way to assign some text to it when we first create it.
19
00:01:15,430 --> 00:01:16,690
So I'll scroll down a little bit.
20
00:01:18,750 --> 00:01:25,380
I'll find the constructor's section here it is right here and here's the list of all the named parameters
21
00:01:25,410 --> 00:01:27,510
that we can pass to the app, our constructor.
22
00:01:28,320 --> 00:01:33,590
If you take a real close look, you'll see that there's one particular parameter called title.
23
00:01:34,320 --> 00:01:39,060
So if we pass in a title for the name parameter, we can pass in some text.
24
00:01:39,270 --> 00:01:43,410
And that text will be used as the sort of title of our app bar.
25
00:01:44,190 --> 00:01:48,510
Now, one thing I want to point out here is that you'll notice that there's really nothing inside of
26
00:01:48,510 --> 00:01:54,090
this constructor documentation that says, oh, yeah, the title property is what's used for getting
27
00:01:54,090 --> 00:01:56,580
some text into the upper right.
28
00:01:56,590 --> 00:02:00,620
There's nothing in that constructor documentation that says here's how you get a title here.
29
00:02:00,960 --> 00:02:04,330
So how would we know that's how we're supposed to get a title in there?
30
00:02:04,980 --> 00:02:09,000
Well, honestly, again, this comes down to experience with using the app our class.
31
00:02:09,750 --> 00:02:15,390
You can also take a look at some of the documentation up here at the top, in particular, this diagram
32
00:02:15,390 --> 00:02:19,080
right here that will tell you, oh, yeah, here's where that title gets used.
33
00:02:19,500 --> 00:02:23,970
And if you read through all this stuff right here somewhere, it will probably also tell you, yeah,
34
00:02:23,970 --> 00:02:26,580
pass in a text widget for the title property.
35
00:02:26,730 --> 00:02:28,560
And that's how you get some text to show on the screen.
36
00:02:29,420 --> 00:02:33,530
So a lot of this stuff around flutter, I can't say it enough, I said in the last section, I'll say
37
00:02:33,530 --> 00:02:33,800
it again.
38
00:02:33,800 --> 00:02:37,790
Now, it really comes down to reading the documentation closely.
39
00:02:38,700 --> 00:02:43,040
Throughout this course, I'll definitely give you a lot of very distinct pointers on where to look,
40
00:02:43,050 --> 00:02:48,240
but in general, I'm going to do my best to show you how we read this documentation to figure out exactly
41
00:02:48,240 --> 00:02:48,900
what's going on.
42
00:02:49,790 --> 00:02:53,900
OK, so now that we know how to make use of this app, our class to get some text to show up.
43
00:02:55,270 --> 00:03:00,480
I'll flip back over to my code editor, I'm going to find where we are creating that app, our widget,
44
00:03:01,150 --> 00:03:08,500
I'm going to expand that parentheses and then I'm going to pass in a named parameter of title and I'm
45
00:03:08,500 --> 00:03:12,480
going to assign to that a text widget with the text.
46
00:03:13,120 --> 00:03:14,220
What do we want to say?
47
00:03:14,380 --> 00:03:15,380
What was the markup?
48
00:03:15,550 --> 00:03:16,630
Let's see some images.
49
00:03:17,870 --> 00:03:25,910
OK, so in those quotes, we'll do let's see some images like so and then again, I'll put a comma at
50
00:03:25,910 --> 00:03:28,190
the end, a line that this line does not collapse.
51
00:03:29,030 --> 00:03:30,650
OK, so then I'll save this.
52
00:03:31,340 --> 00:03:32,780
I'll pull up in my emulator.
53
00:03:33,470 --> 00:03:35,120
I will restart my app.
54
00:03:38,350 --> 00:03:41,470
And I will then see that new text up here inside the APA.
55
00:03:42,590 --> 00:03:44,120
All right, looks good.
56
00:03:45,140 --> 00:03:46,920
So we're making a little bit of progress.
57
00:03:47,050 --> 00:03:51,680
Let's come back to the next section and we'll continue by trying to get this action buttoned down here
58
00:03:51,680 --> 00:03:54,150
to appear on the right bottom hand side of the screen.
59
00:03:54,650 --> 00:03:56,690
It's a quick break and I'll see you in just a minute.
5900
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.