All language subtitles for 005 Functions in Dart_en

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
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
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

Original subtitles

In the last section, we broke down this line of code right here, remember, the VA name is referred

to as variable declaration because it creates a new variable then the equals.

My name is referred to as variable initialization because it assigns a value to that new variable that

was just created.

At the end of this line, we had a call to the my name function, which was defined down here at the

bottom of the file.

So in this section, we're going to start to take a look at this function declaration down here.

Now, I don't have a terribly large amount to say about functions, mostly because they work almost

identically to how they work and just about every other style language out there, every function we

create can have a name assigned to it.

So in this case, the name of our function is simply my name.

After the name of the function, we then place a set of parentheses which denotes the argument list,

so any time we call a function, we can pass in some number of arguments to it.

We then have a set of curly braces which form the function body.

So inside those curly braces is where we add all the code that's going to be executed any time we call

this function.

And where things start to get a little bit interesting is the word string over here to the left hand

side.

So any time our function returns a value, we can annotate that function with the type of value that

is going to be returned in this case, we are returning a string from the function.

So we wrote out the left hand side of the function name string, because that is the type of value that

we're going to return any time this function gets called.

We're going to have a discussion about type's in just a second, but before we do, I want to mention

one other thing about functions in darte.

Back over here, you'll notice that we had a function called Main, and then we had also defined a second

function called my name in general.

You and I can name functions, anything we wish.

But there's exactly one exception to that rule, and that is the main function in darte.

The main function is a very special function that has to be defined inside of every darte program that

we ever put together.

The main function right here is automatically invoked by darte any time our program is executed.

And so you can kind of think of the flow of operations as being something like this.

So we're up here at the top.

Our program starts up darte, is going to look over all the code inside of our application and try to

find a function called main.

If it finds it, it's then going to run it.

And from that main function, you and I can add some code to do some actual up of our application and

accomplish whatever app is really trying to do.

Now, one thing I want to mention here is that every darte program we put together has to have a main

function.

So, for example, if I take this entire main function back here and delete it and then click run again.

You'll notice that I get an error message over here on the right hand side that says uncaught and essentially

it's an error message that's complaining that there's no main function defined inside of my project.

If I go back to having the main function and run it again, I'll then see the expected output of my

name is Stephen.

So in closing, functions for the most part behave very similar to how they do in just about every other

language out there.

The one requirement of every program is that we have to have one function called main.

The only thing that's kind of unexpected about these functions is that they have to annotate their return

type with a type being listed just to the left of the function name.

Now, let's take a pause right here.

We're going to come back to the next section and we're going to start talking a lot more about how types

work in DART.

So a 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.