Hello, in this video, we are going to go through and implement each one of the tabs. So once we've got one implemented, the other three should be easy to do, because all they are is gonna have two numbers or two. So you can, you know, take in numbers, we're gonna add them together, and then pump out the result from the difference in the operation. That's it. So to do this, and now contained actually before here, we're gonna create a few variables, let's say double number one. I wouldn't need an integer for this because the user might input you know, decimal values, if you want to restrict them to that point as well.
Double go to zero, and putting a zero because this is what's going to be displayed in our text, which is going to be the result and by default, instead of having, no we have no zero, this looks a bit better. Now in our container, we can create Take quantum. And in here I'm going to have a textfield. No pun intended, you know the children array first. So now textfield and this is going to be the first text field and the only thing in here that we're going to do say unchanged. Yes string value.
We're going to do no one is equal to double dot path will need to pass the string value and we'll copy and paste this for the next text field. And the only difference being here need a semi colon and difference here we're going to assign this to these seven. Now we are going to either button or raved buttons that you can do any sort of button you want to create, you know, a, an icon button if you want to or anything, child, and we'll say text. And this should be raised and say add. So we'll change that for the different tabs when I say on pressed, so when it is impressed, I'm going to change the state. And this will allow us to update, you know, our text which you know, will be displayed result, which is something we're going to implement.
We know one plus two. Now, last thing, we need to create the text. This is going to be strain is going to be dollar results. And that is it. I think we're ready to do you know, just to run it for the first tab. There we go.
So if I type in 50 A typing nine, we should get results 6073 added. Fantastic. Now, let's activate for all the other tabs. So for all I need to do is copy and paste the container, Copy that, before I do that, actually, instead of that, because inside of it, there's nothing you're referring to addition state or anything up and copy just the entire contents of the actual class. Look so and on the same for this one, I'm going to do the modifications in a second. So while this is still in my clipboard and paste it for the right to modification lane is do change this to subtract.
That's just a visual thing and then change the functionality and that's it. chain to do this to multiply multi ply and then changes to the asterisk for multiplication functionality changes to do ROI changes to a four slash for the division functionality. And if I rerun it, okay, so we got, you know, 58 nine, that works fine. We got to subtract 58 nine, we have 49 for the 58 times by nine, what would that be that we like 450 plus the 72. I'm saying 522. Okay, and 58 divided by nine gets a 6.45.
Okay, that's all pretty know well and good. What happens is, these tabs are persistent. So our focus is on this one. So if I go to this one, focus on there, go back to division. It removes all the content from the other tabs that's not good at all, in our calculator or in any application because what is actually happening is actually on the Lydda for a separate video. Next video, we're going to fix this problem, and I'll explain what actually is happening.
If you have any questions, feel free to pop me a message. And as usual, I look forward to seeing you in the next video.