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 finished up our first project, but there's still a lot for us to learn about
Flutter.
So in this section we're going to start working on our next big project.
We're going to first generate a new project at our terminal using the flutter CLI and we'll talk about
what we're going to built so that my terminal and you'll notice that I've changed into a sort of workspace
directory.
So I'm no longer inside of the pix folder that we had previously generated.
So inside this workspace directory, I'm going to generate a new project by running Flutter Create and
then the name of our project, which is going to be log-in, underscore, stateful like so.
So run that command that's going to generate a bunch of different files and folders and start installing
a couple of dependencies while that runs, we'll talk about what we're going to build here.
All right, so here's what we're going to be making.
We're going to make a login form or kind of a sign up form of sorts.
A user is going to be presented with an email field where they can enter in some email and a password
field where they can enter in some password.
Then they'll click on the submit button and that's pretty much it.
Now, this application might seem very simple and straightforward in nature, but in reality, there's
going to be a lot of hidden complexity in here that we'll talk about in just a moment.
The one thing I want to mention is that when a user enters an email and password and then clicks on
simit, we need to make sure that we validate both the inputs that they enter in.
So we need to make sure that they actually entered a valid email and a valid password.
So maybe the password has to have some minimum number of characters inside of it to be considered valid.
To be clear, we are not wiring up authentication here at all.
OK, so there's really no idea of actually assigning in a user or anything like that.
We're just focused on building a form and validating some inputs that a user provides.
Now, let's talk about why this is going to be a little bit more complex app or a little bit more complicated
than it might seem at first glance.
OK, so at this point, we've spoken a fair amount about something called stateful widgets inside a
flood of applications, remember flutter or something, stateful widgets are used any time we have some
data that's going to change over time.
And whenever that data changes, we would want the UI to update.
In the last application we put together, we used a stateful widget to handle that interaction.
We had a stateful widget that would update some data and whenever that updated poof, the screen magically
changed.
The problem with the stateful widget is that it doesn't really scale up to larger applications that
have multiple different screens, in essence with a stateful widget, it's kind of challenging to pass
around data from one screen to another inside of your application.
So the stateful widget is kind of seen as kind of an introductory level way of managing state in a flutter
application.
It's a perfectly fine way to manage state if you have a simple app.
But as soon as your app starts to grow in nature or grow in size, well, it starts to get a little
bit complicated and a little bit more challenging.
As a solution to this flutter, designers came up with something called the block pattern, and this
is an alternate way of managing state in a flutter application.
Now, there's definitely a lot of different ways to manage state inside of a flutter app.
But we're going to be focusing on this block pattern thing right here, because this is the way that
is supposedly highly recommended by the flutter team.
And in fact, even in a recent video published by the Flutter team talking about state management,
they say very clearly, yeah, we really recommend checking out the block pattern is just the best way
of doing things.
So the reason I'm kind of mentioning the fact that the Flutter team is endorsing this is that there
are actually many different means of state management inside a flutter right now, a lot of different
ways of doing it.
And no one's really got the expertise to say which way is better than the other.
However, the Flutter team has publicly endorsed this block pattern, which is why we are going to go
in that direction.
Now, the reason I'm showing you this diagram right here is kind of tied back to the application we're
going to build.
So the block pattern is definitely the way we want to design applications, but it's rather challenging,
that's rather complicated to understand.
So to give you a really smooth introduction into this block pattern thing, we're going to first build
out this login form or the sign up form application using the more classic stateful widget approach,
the approach that we just learned in our last application.
So we're going to build out the entire application with that approach and then we're going to rebuild
the entire app a second time, but instead use the block pattern.
So essentially, we're making this two times, but with radically different approaches.
So with these two approaches, you'll have your own ability to kind of compare and contrast the two
and you'll have your own opinion on which way you like the most and whether you want to stick with the
more classic but simple stateful widget approach or use the fancier but kind of harder to understand
block pattern instead.
So that's the idea, we're going to build the same out two times, and that's going to give you a really
strong opinion in which way is best for building any particular application.
So let's take a quick pause right here.
We'll continue in the next section and get started with our application.
So quick break and we'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.