Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
In the last section, we wrote out four comments to guide us through the process of getting some content
to show on the screen of our device in the section, we're going to tackle step number one, which is
to import some code into our project so that we can actually work with our mobile device and get some
content to show up.
So before we write any code for this, I want to tell you a little bit more about how import statements
work.
All right, so quick diagram right here.
OK, so in the very, very center of this diagram is our application, and right now our entire application
consists of just the main file.
Outside of our application, we have access to a ton of different code, so we have access to the entire
darte standard library, which we took a little bit of a glance at the documentation for.
And we also have the entire flutter standard library as well, which includes a lot of default widgets
and things to help us build out mobile applications in order to get access to any of this code inside
of our application, we have to first import it into our project or more specifically, import it into
the file that we're working on.
So if I want to say import a file from the Flutter Standard Library into my main file, I have to write
out an import statement that tries to specifically go into the flutter standard library package, find
some module inside of here, and then specifically add that module to my main file.
Now, there's some very specific syntax around this.
So let's look back over to our code editor.
We're going to add our import statement and then we'll talk about how that syntax works.
All right, so underneath this first comment, I'm going to write out imports and then going to put
a set of single quotes, I'll say package Colin Flutter.
Flash material, dot dart like so.
OK, so that's our first import statement now before we talk about the exact syntax of this import statement,
I want to let you know one very important thing here in Darte, there are three different types of import
statements.
The syntax around the import state import statement is going to change slightly depending upon where
we are importing code from.
So what you're seeing right here is how we write an import statement to import code from a third party
package.
If we're writing an import statement to import code from the standard library or to import code from
a file that you and I have written inside of our project directory, then this syntax is going to change
just a little bit.
So this is one form of syntax.
And very shortly we'll see those other two forms as well.
OK, so now let's break down the syntax right here and talk about what's going on.
All right, here we go.
So here's that entire line of code broken down step by step.
So the first word, I think you get a good sense of what's going on there.
It's an import keyword.
It's telling darte.
We want to import some other file into this one.
Then inside of that string is where things start to get really interesting.
So the first word is package and then a colon.
The word package specifically tells darte that we're trying to import code from a third party library
that has been installed into our project.
If we are importing code from the standard library or from a file that you and I wrote, then we're
not going to have this word there.
But we'll talk more about those import statements later on when we actually make use of them.
After we write out package and then our colon, we then place the name of the library that we want to
import code from.
So in this case, we are trying to import some code from the flutter library.
We then place a slash and then the name of the file that we're trying to import, so in this case we're
trying to import the material file from the flutter library.
Now, this last part right here might seem a little bit scary.
You might be thinking, well, Stephen, how will I know what file I want to import from this library?
And for that, don't sweat it.
The documentation for the flutter for me, for the library that you're using is always going to tell
you more or less exactly what file you want to import into your project.
So in general, if you read the documentation, you're going to have a good idea of exactly what file
you're trying to import.
OK, so that's what's going on with this line of code right here.
So now that we've imported this file into our project, which has some helpers to get the content on
the screen, we'll continue in the next section where we'll define our main function and then continue
on with the rest of our steps.
So quick break and I'll see you in just a minute.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.