All language subtitles for 33. Introducing Mapsf

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

Original subtitles

Passing our function down to the answer

buttons

works. As a next step, I want to make sure that we show some meaningful text here instead of always answer

1

and as a little stylistic thing, I want to adjust the text color and

we can do this by setting the text color argument on the RaisedButton and there, we can set this to

colors.white, again colors is this utility class which groups a bunch of predefined color codes so

to say and I assign this color code to text color which will unsurprisingly color this text white.

But now let's make sure we have different texts here which we pass down

and for that, our question here now has to become a bit more complex because now a question should not

just be a string,

the question itself, it should also contain information about the available answers.

Now of course as long as our question is just a string, we can't put any additional info in there other

than the question text.

So what we need now in here is a more complex object which can group multiple pieces of information

together, the text for the question but also the texts for the answers

and what could be used for that?

We could create a new class which has all these features we need and use that class to create objects

here and that would be a perfectly liable way of managing this, would be perfectly fine.

However since you're also taking this course to learn a little bit about Dart, I'll actually show you

a different data structure that's also built into Dart which can also be useful if you have relatively

trivial data structures which yet are more complex than just some text

and that would be a map.

You create a map with curly braces or by using the map class like this

but let's use the curly brace syntax.

So it's a little bit like a list which you create with square brackets but a map now is not a list of

values but instead a collection of key-value pairs.

You have a key to identify a value,

for example here, you could have the question text key and you put the key between quotes, double or

single quotes,

doesn't matter,

just be consistent

and then the value is assigned by adding a colon after the key and then you have your value, in this

case it's also a string but your value could be anything, could be a number, could be another map, could

be a list,

really any value can be used in here.

The key also doesn't have to be a string,

you could also have a number as a key, like one but often you will have strings because then you have a

very human readable way of accessing the different pieces of information in that map.

So now, one question here in our list of questions is no longer a string but instead a map and that map

right now has a question text but now it shouldn't just have a question text, it should also have a list

of answers and therefore, I'll add a comma to add another key-value pair to this map and I'll name this

key now

answers. These key names of course are totally up to you and now answers won't be a string but instead

a list,

as I mentioned, your values in the map can be anything. In this list,

I now want to have a list of answer texts which we can display and here we could have since I'm

asking for the favorite color,

we could have let's say black,

we also could have red, green and white here,

you could add more but I want to have four answers let's say

and with that if we now reformat this, we have this map with a question text and with an answer in here.

Now of course, I want to have more than one question in the quiz,

so I'll duplicate this and also add my second question here as a question text in the second map here,

remove that double quote at the end and then at the beginning and here my answer texts could be,

since I'm asking for animals, here I could be asking for a rabbit,

a snake, an elephant and let's say a lion and let's add one more question here by copying and pasting in

this map one more time and here, I'll ask for

who is your favorite instructor and I want to offer a couple of totally objective choices here

because that could be Max,

Max,

Max or Max.

Okay

of course enter whatever you want here.

So these are my three questions

and now we're using a map here, which just like everything else, every other value, is of course based

on an object, it's based on on the map class which is built into Dart, so map is a class built into Dart.

This is just a shorthand way of creating it, just as you have square brackets for lists

and it's perfect if you have more complex data which you want to manage as key-value pairs like we have

it here, where you could create your own class and your own object but if it is just such a simple collection

of key-value pairs, creating a custom class in object might be overkill, though you absolutely could do

it of course but it might be overkill and therefore creating such a little map here on the fly kind

of can be very nice and helpful.

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