RxDart Explained - The Flutter Way

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

I'm sorry, but he sounds way too much in a hurry. He should take his time to pronounce stuff, maybe cut multiple takes together and focus on pronouncing. Not everyone is a native English speaker, and strange accents are fucking difficult to follow when you have your own accent to deal with.

Also, humans are able to produce intonation. No one should speak in such a monotonous way.

👍︎︎ 1 👤︎︎ u/NatoBoram 📅︎︎ Mar 10 2020 🗫︎ replies
Captions
yeah what's the best welcome back and as you can see in the tire we are going to talk about our ik start in this video and because you guys have already asked me so many times that when I'm gonna publish video on rx start so here it is we will talk about artic start what it is I will talk about stream so we'll talk about different operators which you can use so if you're already scared with are you start and don't be because we will try to explain in a very easy way okay so that's that's the target and as you can see it's a very simple application this is just a one-page application where we have you know this this text field and a list view which is fetching some like stream data and then we have a button here in the bottom which will be helping us in you know trying few things in the console so I will talk about that in the pub spec knotty ml if you'll see we have just one dependency that is our X dot zero point one two three point one it's kind of a stable version but you know in the future there can be few changes with the syntax but the idea is to learn the concept so if you will see this demo dot dot then we have two strings hello strings welcome strings and two methods to return those strings and then in the main dot dot we have like you know the homepage a simple homepage which have this column inside the column we have a text field and then our stream build are having a list view we will talk about that as well and then when we click on this particular button then we call learn stream which is our stream a method to learn about streams so what we are going to do now if you will see here then we have some commented code as well so we try to learn all of these things and operators so let's start with this particular logic here we will talk about this first and then we will proceed so basically when we talk about the streams so stream basically means that this is a flow of data if you have seen any kind of video which is like on which you're viewing online which means like with the Internet then it's streaming streaming means that there is always in like you know microseconds milliseconds the data is coming so there is continuous flow of data and that's what we call stream so that's the idea and now to control these streams there is a stream controller now there are two kind of stream controller one is normal stream controller like this and another one is like this dot broadcast so this stream controller the normal one which means that you know only one person can subscribe to it or they can have only one subscriber which means let's say if you are like you have a private plane okay that means only you can board it so that means you will use stream controller this is a very bad example but just understand it in that way that you know if only one person or one subscriber can access it that means it's a stream controller but if many people or many subscribers can like access it let's say YouTube there is one channel which can be accessed with many people like Tata Sky or any other DTH and a lot of people are accessing it there are a lot of subscriber that means it's a broadcast that's why you will hear in TV that you know this channel is broadcasted by all this like particular TV show is broadcasted by this particular brand so something like that so that's a stream controller broadcast and when we talk about the RX dot then it is it's kind of addition in like on the top of these streamers stream controller there are some helpful methods and in like when we talk about our X dot then this stream controller dot broadcast can be said replace object behavior subject or publish subject so let me just change it to publish subject so what are the difference so there is a minor difference between these three but the idea is that all of these three are strip controller of broadcast type okay so this idea right now when I say subscribe subscribe means like you know in different languages they talk about different things so in thick I am talking here in terms of streams so maybe in if you'll go to rx Java then it they will talk in terms of observable so these are the same thing when we say subscribe then it means listen so let's say there are this listen means someone is listening like one subscriber is listening let's say if I have to listen here so if I say to listen so one is on the top and another one is at the bottom at line number one one three and one zero five these are two listened statements which means it has been subscribed two times so now if i try to press this button then you will say it's a broadcast so that's not a problem right but let's remove this and let's make it a normal stream controller now if i try to listen to this there will be a shoe what is this shoe and this cannot tell you let's try to run this button and you will see that you know this stream has already been listened to which means someone has already listened it don't try to listen it again if i remove this line then if i try to hit this then you will see that you know something happened and it's all working fine so that's the idea if I'll make it like you know a stream control dot broadcast then everything will work fine so as you can see everything looks good so that's the idea now this is stream controller dot broadcast we are not going to use we are going to use our X or dot and we will use first of all publish subject so what is the difference between publish subject or behavior subject and replay subject so let's say this is the stream and it is listening to this particular subject so subject dot is string dot listen so this is the first time it is listening and it will add whatever it will listen to this particular first stream okay so what it is adding first of all it is adding item number one then item number two and then after addition of item number two another stream is listening listen it's not should be like stream let's say first sub subscriber and second subscriber not stream okay so first subscriber goes listening then two items were added one and two and then second subscribe is started listening then two more items were added let's remove this one because it can create confusion so let's say one item was inserted which is item three okay now if I'll try to run this then what will happen I will click on this button then you will see that item one was added to first subscriber item three who was added to second subscriber and item two and three was added to first subscriber so basically this first subscriber got all three items one two as well as three but this second subscriber got only one item that is item number three and because it's a synchronous approach so aiya the order can be different and now the thing is that the second subscriber only got item three the reason being is that we are using publish subject publish subject means that once you subscribe you will receive only the items which will be added after your subscription so basically it means that when second subscriber subscribed the only item which was inserted or added was item 3 so that's why second subscriber only got item 3 but because first subscribers subscribed before and any addition of the item so that's why he got all three items but let's say this second subscriber was saying okay that's fine you got you gave me item 3 but also give me the last item which was inserted before I subscribe which means item 2 so it won't to access the last item as well because it's subscribed late okay so let's say what what is happening this there are three exams so person is giving three exams so this student which is first student he came early and they have to give three exams in one day right so this guy came early it could view exam 1 exam 2 exam 3 but this guy actually came before the beginning of third exam so that's why he could give only exam number 3 but this guy is saying that I want at least give me the chance to give examine umber 2 as well because I kind of like you know came around that time so please allow me to give at least eye exam 2 in that case we can use behavior subjects so behavior subject what it will do it will also supply the last event before the subscription to that another subscriber or the subscriber will also get the last item which was published to any subscriber so now if I click here then you will see the ayat the second subscriber here got item 2 and item 3 okay but let's say there is third student or third which came late and he saying that he's saying that he wants to give all the three exams okay but because he came late he should given like he should be having this permission to give example number three only or item three but he wants to give all the exams or he want to access all the items so what he can use in that case he can use a replay subject so replay subject is for that purpose so replay subject is there now if I try to like run this then you will see item 1 was added to both item 2 was added to both and item 3 was added to both so which means that whenever you are like listening to that particular one whenever you are subscribing to that particular stream it doesn't matter when you are listening but all the items will be given to you all the exams you can give so that's the idea right so this this is the difference between behavior subject publish subject and you know replay subject so let's make it publish only and most of the time what we use is behavior subject so that because last item is most important items so that's why we I mean personally this is my opinion that I must be use behavior subject but there can be different situations so you have all the options available right now we will talk about the operators so different operators what is the purpose right when you are dealing with in fact the subjects then you can also skip this string keyword so we can remove this and it will work fine so if I try to run this now it is working fine right so basically our if start gives you this benefit as well so now let's say I remove this second subscription for the time being and now there are three items which is being added item one item two item three now what I want when I'm listening or when I'm subscribing I want data in some different format let's say I want to apply a map so purpose of map is converting from one form to another form so what I can say I want this event in all uppercase so to uppercase if I write that now this map will help me so if I hit this then you can see item 1 is all in uppercase so this is the purpose of map to convert from one one form to another now when I'm saying this there is one more cool method like or cool way which are a start provide is that you can chain these operators so I can again apply map and I can do something else right so now what I want I want to change their data types as well so as you can see this event is a string now I want to convert it to a number so how we can do that so basically let's say to convert it to a number first of all we want this last item one two and three so these numbers are there so I want to access that only so I can say event dotsub spring so we want to access the last item so I can say event dot length minus one so what it will do it will give me actually the last item so as you can see added one two and three but the thing is that this is still a string what I want I want a number so now I will apply another map here or in fact you can apply in the first one as well but let's for the simplicity of code and we can say num dot tryparse so we will just convert it from string to a number now if we will just press this then you can see added one two three now you might be wondering what is the difference like it was earlier also it was one two three but this time it's a number not a string so to check that what we can do we can just print here rather than value we can say well you dot run thing type so now if I try to hit this then you will see added into first subscription okay and add it in to first and then the last one would be again added into first okay so that's the thing so if you run again then you should get it okay so this is actually working fine now the thing is that if I remove this number then it's rather than integer it will show you string so if I try this now you can see added string to first subscription okay and because we are also dealing with some you know kind of issues here that is something accessing these two items not the third one for some reason it's something stupid so just ignore that for the time being okay so now we learned about you know mapping so mapping can be really helpful and now if I try to do this again then we got one two three all of them right so what else we can do so I have I have shown you the string two number but we can also convert it to some other class so let's say we have a custom class person here which we have where we have a string name and we are overriding this two string method so what we could say so this rather than this number we could actually say dot map event and then here we could say let's say it's a type of person and here I could make a new object of this person and you could say let's say pk and also the event and now if you will try to write this value this is of percent type now if you will just click on this button then you will see added PK 1 PK 2 PK 3 so just think about something you are fetching from your database or maybe something from API and you want to use your model or something like that then you can definitely use this operator map operator to actually provide different types right now let's say let's say we were fetching just our data which was this number right so the number we were getting so number we have 1 2 3 now let's say we just want order number or let's say we just want even number then we can have a where operator so I can apply this operator okay and what it will do it will actually let's say we can say event modulous 2 if it is equal to equal to 0 that means it's an odd number so just give me oh sorry that's an even number so just give me even number so now if I click here then you will see added to to first subscription so from one to three only two is even number so that's where you can use where operator now let's remove this as well now let's talk about another operator which is very interesting that is scan operator so what is can do it takes the first value click previous value it takes the current value and then you can also provide an index and you can provide an operation as well so what we can do let's say we can rather than accumulated I will say a and from value we will say B so what we can do we can say a plus B okay the operation would be a plus B and the default value is zero so what it will do first off type like first time because the item are one two three so it will add one plus two plus zero so zero plus one plus two okay so that will be our first output then it will add two plus one so previous value it will take the previous value whatever it is and it will add it with the new value and you can also provide default value which all which will also be added to explain this let's try to run this and we got some error some serious error the reason being we have to actually just run it again that should be fine yes so first time we got one because previous value was 0 so 1 plus 0 is 1 then it added 2 plus 1 which is 3 and then it added 3 plus 3 which is 6 so let's say if there is another item let's say item 4 then another last item will be added which should be 10 right if I add 5 as well then last item would be 15 so that's the idea if you will I will change from 0 to 1 then you will see one more addition to all of them so 2 4 7 11 so that's what is skander's right so that's the purpose of scan and I'll move to another operator and this time the operator would be which one you want so there are lot of operators right there is a sink map as well which you can use to actually you know this is same to map but this time you can make this method or synchronous and you can do an a synchros synchronous operation right so that's again the same thing you can right now you can leave it but let's say you want to fetch some data right from here so let's say I want to get this data which is fetch welcome strings so let's try to do this so I wait and we can say fetch welcome strings right right so it will fetch this like data and it will give me the value right so now let's try to run it so if you you will run it then you will see added welcome string one welcome string two three four so this is what is the purpose of a sync map so yeah this does not matter that what previous value we were getting but yes it can do some operation a synchronous operation now we will talk about debounce so debounce time we can specify our time after which you know you know the data will be actually listened so let's say we will say duration off let's say one second okay so seconds one so basically after one second also before one second whatever data will come it will just reject that data and after one second whatever data will come it will accept that so right now we have four items item 1 item 2 item 3 item 4 so before sec one second let's say how many item goes and it will only accept the items after one second so let's try this if you say only I item 4 was added after one second so if I reduce this time let's say if I say let's say milliseconds and I say let's say 600 milliseconds then if I try to run this then maybe we will get more items we didn't get it although let's make it 100 this time we should get more and you can see okay we are not getting anything let's try this way we will add like you know this particular line which means this item will be added after 2 seconds so this time we should right so if I try this then you can say added two and four so we got item two and four for some reason we got this one and this one not this one because say this is a synchronous so there can be issues like this is synchronous code so sometimes it will run and then it will oh wait and then it will move to another line so that happens unfortunately but if we will be like you know a waiting here let's say we move to a particular a synchronous method let's say we make a method here let's say fetch something okay and we make it a synchronous and here we write this particular logic right and yes and then we just say oh wait fetch something then you will see that we will get what we want so now if I run this then you will see okay this is interesting it's just added an item number to show that this okay this happens like you know this is the way it works is like you know it it can ignore if you think so this that's what you will read if you will just do not click here it will just try to read them then you will see that it can be it can throw some random orders so there are always this so without the soul sequence omitting another item okay so there is there is not necessary that there will be the sequence which will be followed so yeah that happens so unfortunately I could not explain you that how it should work but then it is a property this is the nature of this the bounds time okay so yes mostly when it is useful when you let's say you want to you know this is the text field you want to write something and let's say G and I'm writing Google but every time I want to fetch some items from the API then I can have this be bounce time which means that when I add entire Google or maybe after five seconds when I I have added three or four characters then only it should fetch the API so that's the idea right so this is what would be bombs time is for now and and just read that whether they are gonna give you in sequence data in sequence or not so all of these things are they are already okay now let's talk about so drain is basically if you don't want to get any data or maybe you also want to ignore the warnings and yeah we have a lot of so now to talk about the buffer so buffer is basically so buffer count so let's say how many buffers you want so let's say I want data in two buffers so basically that means is that two data will come at once so now if I click here then you will see one two came at once and three four came at like second the buffer and let's say if we add five as well then it will come in toward buffer so one two three four and five so that is the purpose of buffer and you can also specify time let's say in how many seconds like buffer will be made on the basis of time so time let's say duration we will give so duration seconds let's say one second is the duration so now buffer will come in term of let's say 1 2 3 4 5 all of them came in that time now let's saw away to this particular before adding 3 4 and 5 now if I will try to run this then you see 1 2 came and 3 4 5 which we added so this this is working fine that was the problem with debounce so actually that is the nature of the amount Stein so now 3 4 5 came to another buffer or this you can called it like in a batch so batching is kind of similar thing so buffer time buffer count you can use now we will talk about another interesting one that is buffer is there you can connect a twitch which means just combining them so I am just removing it default if empty this is another interesting one so if you want to have some default value let's say 5 or whatever 1 1 ok certify it is let's say not 1 let's make it hundred ok so let's say your stream is empty and you want to add some default value then you can definitely add it so let's say if I am just removing all these items I don't know why now if I try to run this so you will see added 100 to first serve which means there is no item basically right so that's the idea of default if empty so we can just provide an empty one now let's talk about hair skip any these are normal string or the list kind of operations which you can see I am just explaining those so distinct unit is another one which I'm just want to talk about so let's say we are adding item one two and item two again okay so two times item two so now if I try to run this then you can see added one two two and three and four five so this is a duplicate item but I don't want to like use it so we can use something called distinct unique which means it will remove the duplicate item now if I try to run this then you will see one two and three four five right so that means that we have actually removed the duplicate items so that is the purpose of distinct unique operator and then we have a lot of operators so done on data or done on do one done do one H two one error these are like you know when data like when you get data then do something when you get error then do something so these are the normal things now let's talk about something very interesting that is flat map and we will talk about to merge with switch map and the minimum max is all simple so let's let's talk about the simplest first and then we will move to this zip away then all that stuff right which is like most common so there are lot of operators I cannot explain all of them but yes we will try to explain most of them let's say if you want data in pair so you can use another operator which is pair wise so pair wise is like you know it will give item 1 in item 2 and let's remove this then 3 & 4 5 it's not buffer it's actually pair so it will always make a pair of two so 1 2 then 2 3 3 4 & 4 5 so it also takes the last item which was not happening in case of buffer right but it was only giving you the latest data but it is also giving you the previous data so pairwise is also some which you can definitely use now let's talk about the flat map and switch map these are very important and this is these are like you know generally used most of the time so what I'm gonna do I'm just gonna you know comment this thing and I'm just gonna use this one so let's talk about another kind of stream which it provides that stream is something which we called our range stream okay so range stream means so I am using this so that I can explain you this as well and other things as well right so let me just copy that first and there we can just say range stream so range stream so you have to provide the starting value and ending value inclusive which means it will also be included so let's say 1 to 5 so what I want I want to listen from 1 to 5 and I want to bring those values right this this will will not be uses or used now because there is no purpose of it right so now if I try to run this then you see 1 2 3 4 5 and if I just remove like if I just do 5 to 1 then it will go in opposite order so now if I try to run this then you will see 5 4 3 2 1 right so this is what is the purpose of range stream so range stream gives you items in that range now let's try to look how we can use flat map we used map right but in a map we were just using some operator but in flat map what we can do we can apply another stream to this operation so this is basically the value 5 to 1 now we can use some other stream to provide something else right so we will use some other stream which is a trimer stream okay so let's just for the sake of a stream i am using timers stream so it will take a value so this value it will take and it will also give this data in a particular duration so let's say value is only the deviation what does it mean so let's say seconds so basically it will go from 5 to 1 so first time the value will be 5 and duration of it will be 5 second second time the value will be four and duration will be four seconds so this is how data will come now let's click so first data will come after five second and one so five four three two one so this is how it got so the highest number was five so the fourth was like you know fourth came third came second came one came and at that last five came but the order would be the way we have described right so this is fine and because we have specified five layer so that's why the problem happened then every data came after five second now let's just return the value itself so first data will come after five one two three four five so basically what actually happen if you will see that first one got like you know the one will be added first because the duration is coming opposite so one will be executed in one second so that's why it was added first then second three and four and fifth if I change this order from one to five then also you will see the data will be the same so data will be one two three four five okay so this is something which flatmap deuce okay flap flatmap actually does this thing and now there's a minor difference between flat map and switch map this will be applied to switch map as well but the only problem is that switch map only takes the last item last item means it will not display all the items so if I just go here then you will see the last item would be five so that's what it will give you so switch map and flatmap is almost the same the only difference is the last item right so we got understanding of this as well this is really nice and now let's say we have two methods fetch hello string and fetch welcome string so let's try this so the good part about you know flutter and dot is that the future can be also converted to stream so I'm just gonna comment this as well and now we will move to let's say fetch hello strings dot as stream and dot we can use something called merge with and merge with take another stream which can be let's say patch welcome string dot add stream ok and then we can listen for them so we can just copy this from here and we can paste it here ok so now if I try to run this then you will see what is merge doing so much is actually merging so first time it will give hello string 1 2 3 4 and the second will be string 1 2 3 4 welcome string so this is how much works but let's say if we want the same did them to be in like you know same like only one time so this is coming in two times what we wanted in one time also it should not depend on the order so what what order means is let's say we are actually fetching hello string first and then we are merging it with welcome string but let's say this hello strings have a delay of 2 seconds but this welcome string has a delay of 1 second what will happen in that case let's try to run this so you will see first we will get this welcome string and then we will get the hello string because hello string will be coming after 2 seconds so that's fine but we don't want that right so in that case we can use something called zip with so zip with takes another or stream which is fine so it will just take another stream and then it will take a and B it will give you a and B which means a and B streams and you can combine them let's say we could say like a plus B but because it is a list of string so let's see if it gives some error or not it will definitely try to add them yes it added them so you can see hello string 1 2 3 4 1 2 3 4 so even if we know that though you know the hello stream taking two seconds and welcome sting is taking one second then also hello was the first to come and then will come so it means that unless both of them are there it will not pay you know give you the data so that is the difference between the ship with and merged with and then you have Kincaid with as well so I'll just leave it to seep with and then I'll just you know comment it and then I will go here with the let's try this another time and Kincaid with will basically connect a to them so let's let's try concrete with and I'll just add this one here in terms of let's say because it takes a night Raible so we have two like this and now if we try to run this then Kincaid will can Kate with will give us hello string first and welcome string second so you you can see that the token Kate with is giving us in two different like you know output but hello string is coming first in case of merged the duration matters a lot so that that's why it gives data in that way and in zip with you can zip them into a single like output so that is that is all about these kind of for you know operators and now let's talk about this stream itself so here basically we have a stream controller and it's a behaviors kind of subject and it is taking list of string and now we are subscribing to this stream controller and we are fetching data and actually in the fetch data we have a stopwatch and which is actually adding string from hello stream so that's what you are seeing here one two three and four right now you might be wondering that in case of flutter what will happen if I want to apply map or I want to transform it right so rather than saying stream controller dot stream we could say stream controller dot transform and we can apply a stream transformer here so let's say we make a stream transformer here so we will say stream transformer okay and we can call it stream transformer transformer okay and then we can use something called stream transformer dot prom handler and this will give us the same thing which we are actually getting so we have to specify the types so we can use this list of string here okay and we can specify the type here okay wait a second it's tough string coma list of string it should be done and similarly we have to do this here as well [Music] yep now it should be good now this handler what we will do so let's say the handle data is there and it will give us data end sync so we will check if let's say let's say if we want sync dot one second guys sync dot add and we want data to the upper case so we can say data dot so because it's actually a list itself so we have to say let's say data dot map and we can say a dot - upper case and then we can apply to list and then we can add it to our sync so now if I say once i refresh it as you can see these are all uppers upper case strings right so you can apply the same operation which you can in which you could apply in this example but the only difference is that we are using a stream transformer here in this case and also guys it's very important to close these streams and there is one difference between a stream controller stream subscription is also there so if you see like something like this stream subscription the only off like advantage of stream subscription is that it can be cancelled so let's say if you cancel this before item number let's say there were item four and five let's say you cancel it before that then these items will not be listen so here we are closing it but sometimes what happens we want to cancel it and we want to subscribe again so that's when you use stream subscription right and that's how transform works and it has like you know handle data and it has handle error if there is an error let's say in the case of error I want to add let's say event or error error data let's say a list of error data error right so now when error will come rather than this handling this data I'll say a sync dot add error this another matter add error and we can just say error and now if you will see then you have you have this error here right so this is the error and this is actually what we are printing so this is error which we got and if you have to handle it then you can add this kind of error or anything like that okay so this is normal thing like you can you want to be needing it in fact you can just like you know use this but in complex application this can be need I hope you understood the different operators which so also I want to tell you you can go to and this rx marbles here we have like you know different kind of operators you can try them here and you can play with them so let me just see if we missed anything so delay is something which I miss so delay is basically after a certain delay the data will be emitted so that's kind of our d bounds but now it's like all of the data will come but in d bounds there is like you know some data of the sequence can be different and all that stuff buffer we already covered switch map flatmap we already covered so those were the important ones which actually I covered now let's talk about the last one which is I actually forgot which is like let's say we have two streams one was this particular so fetch data was adding so you know hello strings and let's say you'd want to add another one which is welcome string okay so welcome strings and now I am gonna remove this transformer for the time being and let's go back here and let's call it stream only dot stream so now what will happen guys so is skin hello string one is there now let's just restart the app and then we will see we have welcome string welcome string to welcome string three and welcome string four because the last event which was added was welcome string not the hello string so in that case you in that case you can use other there are many streams of which are X offers let's say you can combine them using our X you know our X dot combined latest so combined latest to when you want to combine two streams three four five up to so to nine so basically you can combine nine stream so this is a really good hanging handy method so let's say if you want to add you know this particular two streams so first will be hello string so we will add that hello string dot - okay not like this but let's say we have this fetch and what was the name of the method let's say fetch hello string so we will add that here as a screen what's happening okay this is the problem so as a stream we are adding that and then we will add fetch welcome string dot as stream and then we can say a plus B here okay and then once we add that then we will listen for that event and here we can use it to add it to our stream controller so streamed controller dot sync dot add and here we will add the event and now we can remove these two values because we don't need it and why I was using so use this stopwatch if you to check the timing that how much time these things are taking so that's why I added it now if I try to do a hot we start then you will see that we have null wow that is so as you can see now you have Hanoi stirring one two three four and one two three so all of these data are now coming and four is missing why because this is a scrollable list and earlier it was null because at that time when it was fetching data it was actually showing this error string which was null so yeah that's the thing so this is how you can use combined latest two you could use three four if you have three strings and you can just use combined latest if you want to provide all the strings in Anna hi Trevor so yeah that is the thing so this is the most generic idea I could give you about streams and rx start and all this stuff and yeah I hope you enjoyed this and then guys there is like if we didn't use this text field but the purpose was you can add here or something and then you can use a stream transform all do you not listen to this data let's say if let's let's take a look once okay just for the for your understanding let's say because I don't want to skip anything before we complete it so let's say we are using transform here right and we are showing everything in uppercase but let's say there is a text controller and I want to apply something let's say if the text controller let's say X control what is that okay text controller dot text okay is greater than zero or length should be greater than zero then what I want to do I want to check where okay e contains this text so text controller okay one second guys dot text so let's say if I want to apply something like this then as you can see we have hello string one let's try to restart it once and as you can see we have kumkum datacom please and stretching the data what happened I don't know it's showing null okay so if it is not greater than zero then it is not showing that's the problem so if if it's not zero then in the else case we have to do something nice so in the else case what I do in the else case I will add the data as it is so sing dot add data okay now it is good now let's try render write something like let's say two so when you will try to okay it's not working for some reason so sing dot add it should eat contains 2 not all of them contains 2 I don't know why it's not working oh yes so now as you can see if i refresh it then I can see so I have to actually write set state here to see the changes now if I write let's say here in the text field if I write 3 and if i if i refresh it then you will see 3 okay so basically you have to do they are a set state and now if you will just try and write here let's say 4 so 4 okay it's not working for some reason ok that the reason is that you are we are fetching the data of this says state thing but yes we have to like you know append a listener as well for this text controller so this text controller does not have a listener that's why it's not working so yes we have to apply that particular listener so yeah I just wanted to give you the idea all already this video is too long so I hope you enjoyed this video if you did then press the like button subscribe to the channel for the subscriber already also share the video with your friends if someone wants to learn rx start in Florida and someone wants to understand the concept of strings and strings I will publish this code on github as well thank you so much bye-bye take care have fun with Florida attic start
Info
Channel: Codepur
Views: 16,785
Rating: undefined out of 5
Keywords: flutter, flutter sdk, flutter tutorial, flutter tutorials, dart, flutter 1.12
Id: 8fOoF7icyn0
Channel Id: undefined
Length: 46min 29sec (2789 seconds)
Published: Mon Mar 09 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.