Комментарии:
Clear explanation.. Thank you
ОтветитьWhy can’t instance variable be const, why static const?
ОтветитьThank you very much it help me a lot
ОтветитьWhich video in your playlist is about static?
ОтветитьYou use final instead of const if you don't have an initilal value at compiletime.
for example if you have a user input for a variable which should be never changed after, this you cannot do with const.
import 'dart:io';
void main() {
final name; // we don't have a value yet
stdout.write("Enter your name : ");
name = stdin.readLineSync(); // this initializes the variable and convert it to a "constant"
stdout.write('your name is: ${name}\n');
}
in my opionion is this the main usage of final
Aumsum sir!
ОтветитьNice video thankyou 🙏🏼
ОтветитьFinally found a better explanation for const and final.
ОтветитьAlso if you not sure what values to use after compile time, you use final as these values can be determined during runtime.
Ответитьvery very good bro tq very much from india
ОтветитьNice tutorial for dart...I love it
Ответитьi am having this problem.whenever i declare string name it show no error after that when i declare string message online compiler underline message and says The value of the local variable 'message' isn't used - line 3
ОтветитьPlease use Subtitle CC
ОтветитьThank u so much, u were very helpful !!
ОтветитьDiff between final and const. You made it clear. Thank you !
ОтветитьYou explain very well, my friend. I understand you more than the courses I've seen in my native language. Keep it up! you earned my like and subscription.
Ответитьin my compailer the when i write string S1="double"; is not working on string , so i just put var in place of string then is it work . howwwww??????
ОтветитьNice 👌 Tutorial series ...!
Ответить👍👍👍
ОтветитьI can't wait to finish this awesome course, cheers men your good at explaining stuff straight to the point. I love it <3
Ответитьperfect
ОтветитьWell, you explained how the 'final' keyword works in a way the keyword 'lazy' works in Scala. Just tested that and if you declare a final variable in Dart and initialize it with values that is returned by a call to a function. Dart seem to call the function anyway (see the snippet below) whereas Scala calls the function only if a lazy variable is actually accessed. So is there any other difference?
String toUpper(String name) {
print("toUpper called with name: $name");
return name.toUpperCase();
}
void main() {
final name = toUpper("peter");
//this will actually print out "toUpper called with name: peter"
}
I still don't understand the difference :(((
ОтветитьIn 1m 2sec
Great Tip
Difference between final and const keyword
Thanks for Explaining Dart Programming Easily 👍👍👍👌👌👌
Hey mate.. first of all, thanks for this wonderful series of dart.
ОтветитьNice explanation about final and const.
ОтветитьThanks for excellent explanation.
Ответитьshocked when he said Mumbai ❤️❤️
Ответитьbeautiful explained sir
ОтветитьThe best explanation of the differences between const and final in dart. GOOD JOB!!!
Ответитьis const is method or class?
Ответитьvery good explanation and easy to understand.
ОтветитьAwesome sir..Really need of ppls like u
ОтветитьSir, what do you mean memory will be allocated? What does this mean?
ОтветитьI'm daily watching your dart tutorial video sir. Good to learn dart with your video.
ОтветитьGreat work.
Ответитьhow to get integer or string from user, like enter the number and display it...
ОтветитьThis channel deserves more views, I have seen so called "pros" not being able to properly explain string interpolation in Dart. Good job man. Subscribed.
Ответить