 Hey everybody, this is Brian and welcome to the 37th Flutter Tutorial. Man, we're getting close to 40, we're cranking through these and we're doing it very quickly which shows just how fast and easy Flutter is. I don't mean to sound all evangelical about it, but Flutter is actually pretty awesome. So today we are going to do the floating action button. It's a little red button here. I'm sure you've seen it in like email applications or maybe Facebook or something like that. So we're going to go here, we're going to use our live template which we created in tutorial 35 and you should know what all of this means. We have our main, we have our my app which extends stateful and we have the state of the my app. If you have no idea what any of those means, please rewind, watch the previous tutorials. All right, so now that we have our bare basic application here, what we're going to do is start working on the state. So we're going to say string, oops, and we'll call this last press equal and we're just going to say never. So what we're going to do is really just print on the screen when they actually press the button. So let's get this in here and we'll say last pressed. I got to say while I'm kind of typing this crud out, I'm really, really, really surprised at the feedback I've gotten on Flutter for something that's an alpha and not very well known. My inbox has been pretty well flooded. All right, so now that we've got kind of a rough idea of what this is going to do, how do we add the button? Well, in the scaffold, this is why we love the scaffold. There's a floating action button property and we just simply just say like kind of like the drawer, new floating action button. You know how there's an on press because this is a button and we need to manage that button press. So we're going to just pop that down, so we can work with this a little bit here. And we're going to say child new because we want to add an icon in there. I'm going to say icons dot really know what to add timer. Why not timer? And then we're going to just change the color. So we're going to say background color equal colors dot red. Why not? And then we just simply fill in the on pressed and we need to make a function here. So let's put this back to null. And this is where the magic is really going to happen here. We're going to say print just for debug purposes. And then we're going to say set state and we're going to say date time current equal new date time dot now that we get the current time. And then we're just going to simply say last press equal current dot two string just raw unformatted two string. There we go. And that should actually, I don't know, we got to fill in our little on press here. Nothing's going to happen. And voila, we will run this in our emulator here. Pull our emulator over while this is loading. And this should work without any problems. So one thing that I really love about Flutter while this is loading, and it seems like the more I do these tutorials, the more I fall in love with Flutter is that it's very streamlined. It's very easy to use. It follows a very simple design pattern. You notice almost every single tutorial is followed a similar design pattern to the point I actually had to make a live template. So here's our button and we click it. You can see there's our last pressed and there's pressed. One thing I haven't figured out how to do and I see this in my email program is you should be able to click and drag that around the screen to reposition it. So if there's an element here on the screen, you need to tap underneath it. Haven't quite figured out how to do that. That may be a future tutorial. I'm sure it's a simple animation or something. They seem to have thought of everything with Flutter. So anyways, that is the floating action button. Very simple, very easy to use. If you found this tutorial helpful, the source code for it and all other tutorials is out on my website voidrumbs.com. There's a link right out to GitHub and you can just crack that open and it takes you right out to the tutorials. Also, if you're so inclined, be sure to join the Voidrumbs Facebook group. There's 1700 and growing other members out there. We can help you with all, I mean not just Flutter, but I mean all different languages. And last but not least, if you're still watching this site is 100% funded by your donations. That's why I do not have annoying advertisements in the videos. So if you are working with a company or your startup, you have a few extra bucks, feel free to donate it and I will help fund the website. That's it. Thank you for watching.