What is flutter?
How to use flutter in the android studio so first things first what is flutter exactly well flutter
is a mobile UI framework and we use it to create native apps for ios and Android devices now those apps that would create they're going to get access to
platform APIs like the camera or the microphone and the great thing is is that
when we use flutter to create these apps we only have to use a single code base
and then those apps they're going to run on both of these different operating
systems iOSand Android now that single codebase that we use and creates that is
created using a programming language called dart and we're going to learn all
about darts later on in the article now there's loads and loads of different benefits to using flutter to create native apps but I'm just going to run through a few of
them right here so, first of all, like you've already said we only use one code
base using that darts programming language and this is really good because then
we don't have to write a separate code base for iOS and a separate code base for
Android then when we come to update something.
we don't have to update it twice
just once just one single code base so that's awesome secondly we can use a good layout methodology when we use flutter board right from the responsive web so you're gonna
find it really easy to make clean and responsive apps that are going to suit many
different device sizes so that is awesome we're also going to get a very smooth
and quick experience when we're running these flutter in the android studio and it also works really
well with firebase as aback-end which as a firebase fanboy is bruce Lee bonus
for me because I absolutely love implementing firebase into a lot of my different
websites or apps it also uses dart like I've already said which is a really easy
language topics up if you already know the basic principles of another programming language and we're going to see that later on in the article it uses material design out with the box so your apps are going to look awesome without
you even trying to make them look good and finally, there are some great docs and guides on the flutter website as well so if you do ever get stuck just check out the website it's gonna be really really helpful.
first, flutter in the android studio. you have at least a basic understanding of another programming language before you start here or at least a good grasp of programming principles in general now inflate we use a language called dart which is pretty
easy to pick up if you already know another programming language whether that be
JavaScript or Python or something else to the points where you understand what
classes are what functions are variables asynchronous code API's and all the building blocks of programming in general because dart uses much of the same building
blocks so if you are comfortable with another language or programming in general
then you should be fine picking up darts as we go along and I will give you a
very quick primer before we start to and we'll pick up the rest as we go forward
however, if you're completely new to programming in general then this is not the best place to start your learning path I would advise you to start by learning
the basics of programming first then come back here to tackle flutter now if you
want to learn another programming language.
I'm going to be using flutter in the android studio the reason I'm
doing this is because we can install a couple of nice packages which are really
going to help us when we're creating apps with flutter now you don't have to use
Android studio you can use your own preferred text editor like code or
something else the choice is entirely yours but if you want to follow along exactly as I'm doing I would advise you strongly to download Android studio right
here you can get it from this address developer.android.com forward slash studio
and it will leave all of these links down below, by the way, okay then so next we
need to install git no git is a version control system and we use it for
tracking changes to our code you do not necessarily mean to knowhow to use git
for this article.
Calling platform services from Flutter
it's always good to know but it's not essential for this article we just need it on our computer because flutter depends on it and we'll use it to install flutter in the android studio so make sure you goto this address git - SCM comm forward-slash downloads and download it for your operating system make sure you download this and install it before you go to the next step which is to install flutter so if
you go to flutter dev forward-slash dogs forward-slash get started the forward-slash install again all these links down below you can choose your operating system I'm
on windows and then it's going to give me a guide on how to install this so first
of all the system requirements and you can see down here get for Windows is a requirement which is why we just installed it and if we scroll down a bit we can
see down here get the flutter SDK this is how we install flutter onto the
computer so what we're going to be doing is using it to clone a repository onto our computer what that means is basically getting a load of code from the fluttered GitHub and then putting it on our computer that's essentially installing flutter to our computer what it does say is that we don't want to clone this into any kind of directory that requires elevated privileges like Program Files instead just do it directly into the C Drive in some kind of folded like source now I'vealready
gone into my C Drive right here and created this folder that is where I am going
to clone the GitHub repo to so all we need to do is copy this dude and then we're
going to use CMD or command prompt to install this so the first thing we need to
do is navigate into this source folder right here because this is where we're
going to install flutter so I need to get to my C Drive then inside the source
folder.
I need to see D up a couple of levels so
C D dot that means change directory then change directory space and then go into
the source folder so this is where we want to install flutter now I'm just gonna
paste in that line we copied from this website over here and press Enter that is
going to clone that Github repository from a flutter to our computer okay so once that's installed we can open up this flutter folder inside the source folder and now if
we go down to the flutter in the android studio console if we run this we're going to get this flutter
console right here so what we can essentially do now is run flutter commands
inside this console and what I'm going to do is say flutter dr.and this
basically runs a little diagnostic for us on flutter and make sure it's installed
correctly.
What is flutter SDK?
I suppose now when you first run this it's going to take a couple of
minutes and that because it's checking the dart SDK version or rather
downloading Flutter SDK and it's just going to take a couple of minutes before it gives
you some feedback all right and so once that's all complete hopefully at the top you're going to get a green tick to say flutter is installed and we have a version number right there and also Android studio if you've installed that as well so hopefully those are green ticks it doesn't matter so much if these are not green ticks at the bottom we know now we have flutter installed on our computer now at the minute flutter can be wrong inside this flutter console but
it might be that if you try to run floor to elsewhere on your computer it doesn't
work for example if we open up another command prompt and press enter if you try
to write flutter right here and then say for example the version so Double Dash
and then version this might work for you it might not work if it does work then
you don't need to do anything else if it doesn't work then you're gonna need to
edit the path of the variable on your environment variables so that you can use
flutter elsewhere on your computer you can see right here this worked because it told me what version of flutter.
Link- https://flutter.io/

No comments:
Thanks for visiting!