Hello in this video I'm going to show you how to add a slider. slider is one of those things I'm sure you've seen before, if you use a music application, for example, you will have seen it. But that allows you to scrub essentially the timeline of a song. Or maybe on YouTube, you will have seen it where you can essentially you know, scrub the you know, the timeline of the video, we listen to Netflix. It's not just exclusive for media content like that, it could be used for volume for example, it could be used for brightness as the number one and pretty simple to incremental is that is the child slider. And here there are two required button to record property.
One is value. So this is the default value. So let's say server port zero, that's fine. We'll experiment then second and unchanged event we can do on change in and on change start as well. Only to experiment with the ease yourself. I'm going to change showing you on changed, which is the main one that you'll be dealing with.
This is a double suspension, you will be triggered every time you move it. So I'm just going to call this like Delta move. And in here, we can say that let's see what we get. So we have this slider. At the moment, you know, it's 25, but it's not really updated. So we need to handle all that ourselves.
We need to create a variable created the double on the slide, a man equal zero, replace this slide amount. Inside of here, we want to call the set state method which is built in and we're going to say slider amount, delta and now we run it Obviously, we can, you know, start sliding it. But let's actually print off. So we do, as you can see, we gain a bunch right there. So let me go back to start with it. That will be zero for go all the way to the end of it.
That is one, you may know wanted to start at zero, and one can change that by doing the minimax. So only keep the mean for zero. That's gonna change the math too often. And if we say that, yeah, so, as you can see, we're at $1 200, but the jumps are, you know, essentially in double, we may not want that either. So, again, there are a bunch of properties that you can modify like the color the inactive color, as an extra test or recommend that you you know, you know, Have a look at that have a look at the label on change now and change start with a while and show you division. Two pretty cool.
So if I say that and as you can see, it moves in jumps of 10. So every time it will only print out, you know or will only get you know 10 2030 4050 6070 8090 100 obviously zero as well at the start, if you want 100 Division so that way, it goes from zero to 100. You can do that. Well, as you can see the slight jumper, he did very minor. So it will be a faster on the device. So just bear that in mind.
And really, that's all there is to a slide that it's really really simple. Just a couple of things to note. These are required. Make sure you have the same set state as I've got right here. If I saw it this way Most likely, you want to use you know what current state, the slider is in, you will be referring to the slider amount, maybe on this screen to the bottom here. second page, you click Save, and you need to save whatever this is set to you're not saving, while this is a two because this sets this variable so this that you would be you know, saving or you would be doing something accordingly.
And that's it. If you have any questions, feel free to drop me a message and I look forward to seeing you in the next video.