App Base Code

2 minutes
Share the link to this page
Copied
  Completed
Learn about the application setup code.

Transcript

Hello, in this flutter tutorial, I am going to cover some basic AP base code. So this first class that you have right here, so just, you know, to quickly go over it, we just importing the material dot Dart package, which just allows us to basically use some of the material know functionality. And using the Dart language. This main is always the, you know, the main entry point, the main method. So you always need that. And that essentially, is just invoking the run app.

And it is creating a new instance of this might. This might have class can think of it like, is the basics. And then the app side of things is really in this class, which is essentially you know, the state of the object. And then in here, you can add functionality and we'll be doing all of that in separate videos. During here are the two things I'm going to demonstrate. Before I go over to the screen, though, I'm doing on a Mac.

Process is exactly the same, we are doing no map specific functionality in these videos. And you know, after you've already set up on go setup video for all platform, the same if you want to do for iOS, you'll just have an iOS simulator or device, but apart from that it is exactly the same. So as you can see, it's got a blue bar, and it's a flutter demo homepage. So let's change both of them. So the color is white. So colors dot, let's say I want to change it to my favorite color, which is red, and a bunch of other colors as well.

So we could do like greens for example. And, you know, as you can see, I just typed in our just with the word order the whole, you know, bunch of them. And you know, and so let's just do regular read. And if I replace this with, you know, epic page, and I never click this button to hot reload it, which means it's not going to deploy the application all over again, it's a lot quicker, and I recommend doing that for most, you know, modification or if I'd save it Usually the the hot reload and as you see it, you know changed it for us. So that changed not only this color, the accent color on this bar here and the button as well. And the page title changed as well.

So that's basically the app base code. Really, you're not going to be doing much more in here than that and the rest of the code will be going into the other section. So it's just a little quick thing I recommend as an extra test, experiment, especially with a color Have a look at all the different color options. If you have any questions though, feel free to pop me a message. And as usual, I look forward to seeing you in the next video.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.