Тёмный

Dart Defining Constants using 'final' and 'const' keyword. Dart Tutorial for Flutter #3.3 

Smartherd
Подписаться 136 тыс.
Просмотров 102 тыс.
50% 1

Access 7000+ courses for 15 days FREE: pluralsight.px...
Dart flutter tutorial. Explore how to declare Constant values in Dart using final and const keywords and also check out what is the basic difference between final and const keywords. Explore what is compile time constants too.
This video is a part of variables and data types section.
Next Video: • Dart IF ELSE Condition...
Previous Video: • Dart Strings, Literals...
Code Files: bit.ly/2XEcDmC .
.
Please donate and support my work
(If you think my free tutorials are better than paid ones :)
- Patreon: bit.ly/patreon...
- Paypal/Payoneer: sriyank123@gmail.com
- UPI (only for India): smartherd@okaxis
:: If you want to develop a website or a mobile app, email me your requirement at sriyank.siddhartha@gmail.com :: Free demos provided beforehand ::
- Access my premium courses: bit.ly/sriyank...
Free Programming courses:
- Ruby Programming: bit.ly/smyt-r
- Dart Programming: bit.ly/smyt-d
- Kotlin Programming: bit.ly/smyt-k
- Java Programming: bit.ly/smyt-j
- Kotlin Coroutines: bit.ly/smyt-coru
Free Flutter course:
- Flutter App Development: bit.ly/2Rg7EFR
Free Android courses:
- Android using Kotlin: bit.ly/smyt-ka
- Android using Java: bit.ly/smyt-ja
- Android Material Design: bit.ly/2SMJqU6
- Android Jetpack Architecture: bit.ly/yt-j
- Android Multiple Screen Support: bit.ly/smyt-mss
- Android Retrofit: bit.ly/2Ee6GHn
More free programming courses:
- bit.ly/smy-list
Check out my website:
- bit.ly/smartherd
Let's get in touch! [Sriyank Siddhartha]
LinkedIn: bit.ly/sriyank...
Facebook: bit.ly/smarthe...
Instagram: bit.ly/sriyank...
Twitter: bit.ly/sriyank...
Github: bit.ly/smarthe...
--- Thank you for your love and support ---

Опубликовано:

 

18 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 58   
@eugen3775
@eugen3775 6 лет назад
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.
@PrimaClicks
@PrimaClicks 4 года назад
you are right
@tdothot1
@tdothot1 5 лет назад
The best explanation of the differences between const and final in dart. GOOD JOB!!!
@notanenglishperson9865
@notanenglishperson9865 3 года назад
Yay, Indian guy from RU-vid came to save the day!
@leandroacevedo3339
@leandroacevedo3339 4 года назад
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.
@webemerson101
@webemerson101 4 года назад
I can't wait to finish this awesome course, cheers men your good at explaining stuff straight to the point. I love it
@karthickrajalearn
@karthickrajalearn 5 лет назад
In 1m 2sec Great Tip Difference between final and const keyword Thanks for Explaining Dart Programming Easily 👍👍👍👌👌👌
@dhameliyadevang4771
@dhameliyadevang4771 5 лет назад
Hey mate.. first of all, thanks for this wonderful series of dart.
@lahirudx
@lahirudx 3 года назад
Finally found a better explanation for const and final.
@JustForFun-lz5db
@JustForFun-lz5db 4 года назад
Diff between final and const. You made it clear. Thank you !
@maniamadrid
@maniamadrid 5 лет назад
very good explanation and easy to understand.
@allancabilestoc6235
@allancabilestoc6235 10 месяцев назад
Clear explanation.. Thank you
@krishnakumarramachandran5888
@krishnakumarramachandran5888 5 лет назад
I'm daily watching your dart tutorial video sir. Good to learn dart with your video.
@smartherd
@smartherd 5 лет назад
Keep watching. Hit like on every video to support my work
@krishnakumarramachandran5888
@krishnakumarramachandran5888 5 лет назад
@@smartherd Definitely sir👍
@someshsahu4638
@someshsahu4638 2 года назад
Nice video thankyou 🙏🏼
@ratanupadhyay9497
@ratanupadhyay9497 5 лет назад
Awesome sir..Really need of ppls like u
@TaqiA
@TaqiA 5 лет назад
FYI in 3:06 if you use vscode with dart plugin you wll get early red warning if you re-assign final variable.
@game-yx4ps
@game-yx4ps Год назад
Thank you very much it help me a lot
@adonisrn
@adonisrn 5 лет назад
Nice explanation about final and const.
@SammarpanDasguptaOfficial
@SammarpanDasguptaOfficial 3 года назад
Nice tutorial for dart...I love it
@amircodes
@amircodes 5 лет назад
Thanks for excellent explanation.
@ctky478
@ctky478 3 года назад
Also if you not sure what values to use after compile time, you use final as these values can be determined during runtime.
@kmqwewq
@kmqwewq Год назад
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} '); } in my opionion is this the main usage of final
@Sureshkumar-qi9wg
@Sureshkumar-qi9wg 3 года назад
very very good bro tq very much from india
@anaskhaani
@anaskhaani 5 лет назад
beautiful explained sir
@sanjogbelose943
@sanjogbelose943 4 года назад
Thank u so much, u were very helpful !!
@saisasisai
@saisasisai 4 года назад
Nice 👌 Tutorial series ...!
@shahabedinmohamadi9368
@shahabedinmohamadi9368 Год назад
Which video in your playlist is about static?
@BewkoofCompany
@BewkoofCompany 5 лет назад
shocked when he said Mumbai ❤️❤️
@PrimaClicks
@PrimaClicks 4 года назад
hahahah, learn , borders does not matter
@devashishthakkar6723
@devashishthakkar6723 Год назад
Aumsum sir!
@karimovitche
@karimovitche 6 лет назад
Great work.
@smartherd
@smartherd 6 лет назад
Thanks
@hicnar
@hicnar 4 года назад
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" }
@noelgomile3675
@noelgomile3675 Год назад
3 years ago but to answer, I think if you want the lazy behavior you use the late keyword.
@tanzilzubairbinzaman8711
@tanzilzubairbinzaman8711 5 лет назад
Sir, what do you mean memory will be allocated? What does this mean?
@nasirmehmood_
@nasirmehmood_ 4 года назад
perfect
@labibkhanofficialbd
@labibkhanofficialbd 3 года назад
Please use Subtitle CC
@TheKailash111
@TheKailash111 6 лет назад
how to get integer or string from user, like enter the number and display it...
@lspence812
@lspence812 6 лет назад
Doing it from the command line you do it like below import 'dart:io'; void main() { print("What is your name? "); String name = stdin.readLineSync(); print("How old are you? "); int age = int.parse(stdin.readLineSync()); print("Hello $name, so you are $age years old?"); }
@SachinYadav-wn3fm
@SachinYadav-wn3fm 4 года назад
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??????
@WithStanzin
@WithStanzin 4 года назад
try capital S in String S1="double"; because the value all by itself is variable. whether it is a number or a string.
@raousama6232
@raousama6232 3 года назад
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
@raousama6232
@raousama6232 3 года назад
help me to resolve this error please!!!!!!!!!!
@aroundtheworld4173
@aroundtheworld4173 3 года назад
@@raousama6232 this is the reason: String name = "Mary"; print(" Mary"); You are putting QUOTES to the value in the print function, therefore the error. Try removing the quotation marks; print(Mary);
@k-5773
@k-5773 Год назад
Why can’t instance variable be const, why static const?
@shahruliman5544
@shahruliman5544 4 года назад
👍👍👍
@viralvideos9227
@viralvideos9227 5 лет назад
is const is method or class?
@zarishalam6333
@zarishalam6333 5 лет назад
It's a keyword
@qwerasdfhjkio
@qwerasdfhjkio 5 лет назад
I still don't understand the difference :(((
@skullsolos1299
@skullsolos1299 4 года назад
me tooo
@qwerasdfhjkio
@qwerasdfhjkio 4 года назад
@@skullsolos1299 hey! I don't use dart anymore, BUT it's really easy, look: With const the variable can NEVER change. With a final the variable can change, but the programmer can't do it directly. A really simple example it's a date, the programmer shouldn't change the date, so that should be final :))) Ask me any questions if you have doubts, PLEASE let me know if you are still in doubt
@skullsolos1299
@skullsolos1299 4 года назад
@@qwerasdfhjkio thank you very much. you have proved two things to me, people are good and you thought be about constant and final variable thank you. What language do you use now
@AndyBandi2000
@AndyBandi2000 3 года назад
@@qwerasdfhjkio hi Andry, so based on your date example, the date should be final? because it cannot be changed but it does change indirectly because it's a date..
@qwerasdfhjkio
@qwerasdfhjkio 3 года назад
@@AndyBandi2000 yes exactly!
@restaurantrecipebyhafsa
@restaurantrecipebyhafsa 8 месяцев назад
late keyword??
Далее
БЕЛКА РОЖАЕТ? #cat
00:29
Просмотров 297 тыс.
#57 Final keyword in java
6:15
Просмотров 80 тыс.
Dart const, final and immutability
9:59
Просмотров 1,8 тыс.
Learn Any Programming Language In 3 Hours!
22:37
Просмотров 378 тыс.
how Google writes gorgeous C++
7:40
Просмотров 880 тыс.