Flutter Textfield Cursor Height Customization | Flutter Tutorial | Flutter For Beginners

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
assalamualaikum hope you're all fine so in this video tutorial we will be seeing how to change the cursor height of flutter text field widget so cursor as you can see here let's tap on it so this is a cursor it shows the control of the text field as you can see here this is the default height of the cursor in Florida text field let's now see how to customize it for that as you can see here we have a text field here and we are dragged it inside padding just to give this text field some space from the phone's powder also we have wrapped it with Center widget to make the center displayed in the center of this phone screen as you can see here we now have a text field let's now see how to change the height of this cursor for that we have a Constructor named cursor height it takes a double decimal value but we can pass integer let's see if that works or not let's give it a value of 2. I think just way too less just give it 10. let's give it 30 I think 30 will work yes as you can see here the height of the custom the cursor is now customized now looks big in our previous example it was looking a bit small so that's why we use this value as you can see here this is how we can customize let's not write something in this um text valency what happens then as you can see here the height of this text field is now set to default again when I will try to write something and let's make it empty and see as you can see here this is the custom height but we don't want it we want this height to just remain the same throughout uh even if we input something or the text field is empty we just want this height to be just like that so for that let's remove it and use a style Constructor of text field and we have to pass textile widget like this and by using its height let's see if it has height Constructor or not yes it has a height Constructor let's see what it takes it takes a double value let's not give it a height of 28. oops it's way too big let's say due to the height of 10. I think 2 will work yeah 2 is working perfectly fine let's now input something in that text field and as you can see here the height e Remains the Same even if we input something in that text field or not so this is what we want if you if you don't want that if you want the height of this cursor to to be set to default whenever you try to write something in it then you can use the cursor height Constructor if not then you can use this style Constructor so these are two ways through which we can customize the cursor height of our Fuller text field widget so if you still have any doubts then you can comment down I have written a detailed article on it as well in which free source code will also be available so the link will be provided in the description so do check that out also do like this video and share it and do subscribe this channel if this video helps you in some way so that's it for this video thank you for watching it
Info
Channel: Let me Flutter
Views: 658
Rating: undefined out of 5
Keywords: flutter, flutter tutorial, flutter tutorial for beginners, flutter textfield, flutter textfield cursor height, flutter textfield cursor size, flutter textfield widget cursor height, cursor height of flutter textfield, cursor height of flutter textfield widget, flutter textfield cursor height customization, how to change flutter textfield cursor height, flutter widgets, flutter app, Flutter Textfield height cursor
Id: TyXWESgFVYk
Channel Id: undefined
Length: 4min 13sec (253 seconds)
Published: Mon Dec 12 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.