 Hello guys, in this video, we are going to see how to implement segmented button. So for this, if you're looking for starter code, I have already added the link in the description. And let me quickly go through what we have done. So I have used one plugin that is sync fusion flutter calendar. Let me show you over here. This is basically used for displaying the different type of calendars. So you can go through if you want, let's go back. What we have done is first of all, we have created one controller for calendar. Okay. And then we have done what inside the body, we have used this sync fusion calendar. And we have passed the control. So that's it. What we have done so far, because of this, you are able to see this calendar be on the screen. So let's do what let's get started with segmented button first of all. Let's create segmented button. And this is expecting two things. That is segments. The segments is what it is a list of button segments. Let's create one list and button segment for button segment. We need to pass some value of something. Let me show you. So this value should be of any type. So for example, I just use a string. So I will be using the view for three segments, day, week and month. So let's give it day. And let me use what comma. And if you want, you can add label as well for label, I will be using text. And I will be saying day. And if you want, you can use icon as well for icon. We can use icon, icon start. There is a calendar view day. And I add comma. So we need to add const here since everything is constant. And same way we can just copy this button segment. And I will create two more. That is for week. And that is for, let me try week. And this is for month. And we need to change this as well. Let's quickly change. And month with this segments are done. Now we need to implement this. That is, it is expecting one set of strings. So let's go up and create one value for the same. That would be a set of string. Let's give it day. This would be your initial value. And you can market over here as well. And here, this is already passed. So now you can save it and you would be able to see three segments. You can see now, but you cannot change it. Fine. Before that, you need to implement one more property offer here. That is on selection change. And you can see this is expecting one function. That function is a set of string. Let's copy this. Implement the same over here so that you can better understand. So this would be a new selected value. Fine. You can give it whatever name you want. So once you implement this, you need to change this selected value with this value for that I will be doing what set state and I will be saying selected is equal to this. That is new selected. Let me just change. Save this. Now you can see is enabled and you can select these values. Whatever is selected, the icon is replaced with tick. The thing is the view is not changed based on these things before that we need to add more logic over here. So let's take a look on the logic. So we will add a condition if whatever is selected, that selected value is what that is a dictionary. So out of dictionary, I will take first value if that first value is what day, then my controller would have the view of day. Fine. Copy this, go back here and paste it. Otherwise, otherwise we need to add one more condition. If the view is the selector value is weak, the view should be weak and same way else we will be doing this copy, paste and change this to month and save this. Okay, so let me quickly restart this. Okay, let's check it again. No change, no change or something is wrong here. Let me delete this and let's save it and try it again. It is causing this issue. Okay, let's check the week. Now you can see this is showing the week view or to the month, it is showing demand to you. Okay, so that is what the issue was here. We were giving that in the build, we were assigning this view. That's why we were facing that problem once it is removed. It is working fine. So that is all for this video. This is how we can use segmented button with button segments. So you should have at least two button segments. Do remember this thing. Otherwise you will be having problem. So that is all for this video. If you have any doubt, do comment in the comment section. Otherwise, like here and subscribe. Thank you.