Immutability in Dart and Flutter

preview_player
Показать описание
Quick introduction into immutability in Dart/Flutter
by Pascal Welsch - Google Developer Expert for Flutter/Dart

Рекомендации по теме
Комментарии
Автор

I want to thank you a lot, i wasn't aware the factors of immutability during mobile development, if I did not see this video I wouldn't be able to understand what riverpod is and its advantages.

luisalvarenga
Автор

Thanks to Pascal Welsch, I finally understand the importance of immutability

dilshan
Автор

wow only today I learn a lot by watching your videos, I hope you can active making videos again pascal, So many of us are waiting your next videos. Cheers

naxcall
Автор

Finally understood the concept of Immutability, Thank you!

alvin
Автор

we need more please, please come back.

shanglee
Автор

Thanks Pascal, great video, looking forward to more of them!
At 19:20 for
List<Product> get products => _products ?? [];
As a simple alternative, you can also use the Dart spread operator to return a copy of _products so that it can be used however by the receiver without affecting the private _products in the class.
List<Product> get products => [... _products] ?? [];
Works quite well I think, if you do not want to go full blown KtList. I've used it a lot as a simple fix for returning lists that should be sealed inside its class, but that receiver can then mutate and do whatever with. Of course this is not as elegant or complete as using Freezed and KTList, but for the demoed use case here it can also solve the problem.

rydmike
Автор

Great presentation.. Ive seen a few on this topic this is the best one.. From a performance point of view, is copyWith() efficient, especially in a deep copy? is it just creating a new collection object 'in place', and discarding the previous? Looking fwd to see more content from you.. regarding nullable and null safety I saw that it supports assert statements to implement null requirements.

leonelmateus
Автор

This video is more about representing package kt_dart. Why need to remove products from the list when you can filter them in Dart with the 'where()' method, ex:
final featured = products.where((e) => e.featured).toList();
Make it simple and don't need to be dependent on the 'kt_dart' in this case. Dart has very good tools for iterable objects.

_undecided
Автор

Pascal you should launch your channel or make a course. You are very easy to understand

UsamaKarim
Автор

but you can use where instead filter... am i right ?

ananalfred