Тёмный

Flutter:Dart copyWith method 

dbestech
Подписаться 124 тыс.
Просмотров 4,1 тыс.
50% 1

Flutter and Dart copyWith method and how it works.
copyWith() method creates immutable object. Which means you can not destroy or edit the object you create. One of the way to understand why it's immutable, you can understand from the constructor modifer const. If you put const modifier, it becomes immutable which means you won't be able to edit it.
Another thing why copyWith() method returns immtuable object is that you see, all of our fields are final. If all the fields are final and constructor has const modifier, the return object must be immutable.
Immutable objects are safe and easy to pass around. If you pass around immutable object, you don't need to worry that, they will be editted.
Because nobody can edit them. So this is very safe for saving or recoding or storing data. That's how our chat state also becomes safe.
Course that uses copy with method extensively
www.dbestech.com/tutorials/on...

Наука

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

 

10 апр 2023

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 13   
@pravinprince3221
@pravinprince3221 Год назад
Thank you for the wonderful video sir it is very helpful for me and my team, Thanks again sir I love your way of teaching sir thank you
@dbestech
@dbestech Год назад
All the best
@leleemagnu6831
@leleemagnu6831 Год назад
Very good explanation. Thank you!
@dbestech
@dbestech Год назад
Most welcome
@adaada8008
@adaada8008 Год назад
Hi, thank you for your video series :) As for continuation of Bloc topics could you enlighten any examples of usage blocWhen vs BlocSelector and if there was covered 'lazy' flag, then maybe 'listen' property aswell? :)
@belostone6623
@belostone6623 Год назад
Macha allah brother thank you
@dbestech
@dbestech Год назад
Thank you too
@FLUTTER_HUB
@FLUTTER_HUB 7 месяцев назад
thanks
@dbestech
@dbestech 7 месяцев назад
Welcome
@kamil_supabase_enjoyer
@kamil_supabase_enjoyer Год назад
@dbestech
@dbestech Год назад
Thanksn
@hellonishant
@hellonishant 3 месяца назад
thanks
@dbestech
@dbestech 3 месяца назад
You're welcome!
Далее
Dart const, final and immutability
9:59
Просмотров 1,6 тыс.
НЕ ДЕЛАЙТЕ УКЛАДКИ В САЛОНАХ
00:43
ThemeExtensions | Decoding Flutter
6:13
Просмотров 54 тыс.
Flutter Bloc Tutorial For Beginners - Package
8:33
Просмотров 115 тыс.
Learn Dart Basics in 30 Mins
30:38
Просмотров 87 тыс.
Top 5 Flutter Tips for Big Projects
5:55
Просмотров 71 тыс.
Backend web development - a complete overview
12:58
Просмотров 1,7 млн
Магниты и S Pen 🖊️
0:37
Просмотров 71 тыс.