I'm following this whole Dart tutorial Series from the beginning and You're a good teacher (No Doubt). I also want you to add some extra information like why we need this particular thing? For example In this video you taught 'How to use Getter and Setter' but What you missed is Why we need to use Getter and Setter while we can assign the values directly. Yes! We can google it, But these extra information that is also with real life example will make your videos/lectures Stand Out. Thank you for Such informative and easily understandable videos :)
@smartherd6 жыл бұрын
noted. such feedback really helps thanks
@thegreenboxindia35794 жыл бұрын
@@smartherd Actually even i would roco that, you teach well at a steady pace, just the above point might help you more. Even i googled a lot of stuff on y, how i got it from u. But good work.
@se7en20214 жыл бұрын
Exactly i was thinking the same, why should we use ???
@tevinmorake89244 жыл бұрын
Well done! I think everyone here can agree that you deserve more recognition for the awesome tutorial series you've given us. Thanks
@smartherd4 жыл бұрын
Thanks man :: Also, check out my personal KZbin Vlog channel: bit.ly/sriyank-vlog
@denizgur4 жыл бұрын
OK this video was much better than the Dart tutorial I've purchased. Now I understand getters and setters. Thank you.
@dennisrodriguez92024 жыл бұрын
Thanks bro my native language isn't English but I came here cuz I was watching a Spanish video and I had understood nothing, but ur video yas! love u!
@leandroacevedo33394 жыл бұрын
Same thing happened to me! irónico, no?
@marufhassan6342 жыл бұрын
How your channel still doesn't have a million subscriber is beyond my understanding.
@vinimaykaul5 жыл бұрын
By far the most explanatory video tutorial series. Excellent Job Guys.
@LearnWithYK2 жыл бұрын
Thanks and Congratulations for creating this wonderful series. You are, no doubt, an excellent teacher.
@Nepermath6 жыл бұрын
First of all I already subscribed to your very good channel. to solve the division problem (marksecured ~ / 500) * 100 without having to change the type of variable to Double, simply change the order of execution of the calculation to (marksecured * 100) ~ / 500
@md.soleymankhan65504 жыл бұрын
Best dart tutorial ever.
@taiwo7634 жыл бұрын
i had to subscribe cos of this tutorial. For the first time, it actually made sense
@香烤麻糬球5 жыл бұрын
In best practice: 1. It should be `set int someField`, not `void set int someField`. 2. You should not create a field to change another field, in your case `percentage -> percent`.
@TheRizse5 жыл бұрын
Hi sir, can you kindly help me explain the point no 2 that you mention. What is creating another field to change another field?
@香烤麻糬球5 жыл бұрын
@@TheRizse The idea is that every field has built-in getter & setter, so no need to recreate the wheel. From official docs: dart.dev/guides/language/effective-dart/usage#dont-wrap-a-field-in-a-getter-and-setter-unnecessarily See also: [Language Tour - Methods - Getters and setters]: dart.dev/guides/language/language-tour#methods
bro you should make a seperate video for why we need getter and setter?thanks for ur efforts though
@noelxxiv93824 жыл бұрын
Exactly, i think it is used to do a computation of percentage in this case. as constructors cannot return any values. **This is my real lay understanding . First language I m learning is dart.
@ranya62662 жыл бұрын
Thank you so much for making it sooooo EASY really appreciate your efforts :)
@mohamednizam52984 жыл бұрын
A very good tut on dart as an intro to flutter . just further clarification on getter and setter as to the actual use of it. Still cant understand its purpose. thanks again on this tut.
@iplayguitar10003 жыл бұрын
Thanks man. Better than the docs.
@dexterousdivya9 ай бұрын
Here is the latest code for Dart 3 // OBJECTIVES // 1. Default Getter and Setter // 2. Custom Getter and Setter // 3. Private Instance Variable void main() { var s1 = Student(); s1.name = "Peter"; // Calling default Setter to set value print(s1.name); // Calling defailt Getter to get value s1.percentage = 438.0; // Calling Custom Setter to set value print(s1.percentage); //Calling Custom Getter to get value } class Student { String? name; // Instance variable with default getter and setter late double _percent; // Private Instance variable for its own library // Instance variable with Custom Setter void set percentage(double marksSecured) => _percent = (marksSecured / 500) * 100; // Instance variable with Custom Getter double get percentage => _percent; }
@thevoidyouseek7 ай бұрын
thank you
@masrursakib65284 жыл бұрын
Awesome video, helped me with what I was looking for.
@whitehawk46712 жыл бұрын
in case you forgot how to write getter and setter, go to Code(only for intellij) and the click on generate, to generate getter and setter you can also use alt+insert to get it directly....
@user-or7ji5hv8y3 жыл бұрын
always very well explained
@mizanur_sajid3 жыл бұрын
- 2:28 if you face any error with the (String name) then just make it like this >> (String? name)
@kishansindhi69633 жыл бұрын
What about double get percentage => return percent; can you please help me with it?
@keithbacalso94333 жыл бұрын
awsome tutorial keep it up!
@adamtak31285 жыл бұрын
You explained the syntax but not what getters and setters are for. What's the purpose or having private variables and setter/getter? Can't that exact thing just be done with a method instead?
@md.soleymankhan65504 жыл бұрын
You will get the point during firebase anon authentication.
@FlutterShipp2 жыл бұрын
Great video
@muhammadjunaid36842 жыл бұрын
Well, I have a question. If setters can alter the members/fields of a class. Then why do we use setters in the first place instead of regular (public) fields. Because, in both scenarios we can change/modify the fields and we are losing control over the data. Aren't we?? Thanks in advance.
@QUniversity4 жыл бұрын
Great explanation.
@shrikantakalantri17873 жыл бұрын
nice explanation
@mockingbird38095 жыл бұрын
Thank you so much for this amazing video
@jajasaria5 жыл бұрын
love your videos. May i know where did you get the reference of all of your lesson? I like the objectives part, you nailed the difference of each type.
@4funrc115 жыл бұрын
Lost in trying to determine which exact video that is supposedly linked to using => (fat arrow) in this video's description.
@mainulhoque88164 жыл бұрын
4FunRC here you go - kzbin.info/www/bejne/fGWVmoCMlrN0gqM
@tGoldenPhoenix3 ай бұрын
Thank you!
@rahulmullick73164 жыл бұрын
sir mein bahat baar pada hu yea privet public protected but mujhe yea samajh abhi tak nehi aya why these are came into action...cause every local variable have not accessed out side function or class...then why....????
@TouhidSunny4 жыл бұрын
your example is like a stateless widget. but in flutter if i use stateful widget then i cant access the percentage method from main. if i declare it in widget then ok. but in state i cant access it. please tell me the reason.
@pratik18532 жыл бұрын
use late keyword before such as late String name; to print in new dartpad
@pratik18532 жыл бұрын
or assign values such as String name='abc';
@voodoo71835 жыл бұрын
Avoid the use of return types in setters such as in your example "void set percentage"
@pratyakshpandey22483 жыл бұрын
Just want to ask what is difference between getter, setter and constructor? I mean, we could have just made a function percentage of datatype double and then directly return the value of percentage. So, I want to know the real difference between getter, setter and dart!
@NikhilSharma-wx7kb2 жыл бұрын
I was wondering the same thing.
@z-medianetwork4086 жыл бұрын
I made an app in android studio. When I run on real device from pc, it installs apk & run well with splash screen. But when I run it again from the real device icon, it doesn't show the splash screen but displays white screen. Why? Please help. Thanks.
@noelxxiv93824 жыл бұрын
Can anyone explain what is the difference between a constructor and getter/setter?
@DholaSain2 жыл бұрын
thanks bro
@pawan26475 жыл бұрын
bro cant we use normal functions to get and set the value, plus arent there any concept of private data members which are private to the class only.
@syntaxerror10445 жыл бұрын
Hello...While trying to understand Getter and Setter, I stumbled upon this piece of code from an article from 2012. I pasted the same code into my editor but it gave me error and i was wondering if this code is using old syntax as it is from 2012. Anyone?? void main() { var obj = new GetnSetMet(); obj.firstName="Google"; obj.lastName="Dart!"; print(obj.FullName); } class GetnSetMet{ String f_name,l_name; String get firstName() => f_name; set firstName(String value) => f_name = value; String get lastName() => l_name; set lastName(String value) => l_name = value; String get FullName() => firstName.concat(lastName); }
@ahmdmnsor4 жыл бұрын
what is the library it will be private to ?
@unknown.breakdown5 жыл бұрын
I don't like fat arrow syntax. It saves a few lines of code, but looses readability.
@zuhaib40304 жыл бұрын
plz help me its isnt working trying tooo hard but its isn t can you help me out
@SagarSagar-ro3fj5 жыл бұрын
If there is no private then y getter setters are used .?
@noreplay64184 жыл бұрын
why i get this warning when i try to create a getter and setter for private variable Avoid wrapping fields in getters and setters just to be "safe".
@leandroacevedo33393 жыл бұрын
Bravo
@atefehmohammadpoor91774 жыл бұрын
thannnnks
@shumailasami67656 жыл бұрын
what about method overloading?
@smartherd6 жыл бұрын
In dart, method overloading not allowed
@snapshuttre Жыл бұрын
i am getting errors one after another. I guess I am in the new version dart. I have came here by completing all the previous videos before of this course, but this made me sad, your course is not completely valid with the latest dart sdks.
@suleman41835 жыл бұрын
You putting great effort, but beginner just cannot understand these tutorials you're using too much jargon and you're not explaining enough a why certain thing do this or do that.
@mahmudizukri4 жыл бұрын
Subtitle please
@mashakozlova94254 жыл бұрын
"methods" man "methods". not "methord" and why do you talk about yourself as "we"?