Equality in Dart | Decoding Flutter

Equality in Dart | Decoding Flutter

Flutter

1 год назад

36,434 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Haseeb Kahn
Haseeb Kahn - 30.08.2023 23:55

What if i don't have final members in a class and i want to modify the objects' properties, what should i do?

Ответить
Mohammad Banisaeid
Mohammad Banisaeid - 16.12.2022 13:50

I love the Decoding Flutter series! 💜
On unrelated question though: What tool do you use to create these cute text animations? I mean the ones you use to show the code block changes in these videos.

Ответить
Jeff Don
Jeff Don - 15.12.2022 07:21

very clean explanation.....
can you show me how to use regex to validate email and password in dart?
thank you

Ответить
Alexandru Terente
Alexandru Terente - 21.10.2022 09:37

Great vid!

Ответить
Tim New
Tim New - 20.10.2022 12:39

🤯🤯🤯🤯
Determine objects equality by comparing hash only, without considering hash collision.

And the equatable library mentioned actually does not determine object equality by comparing hash code as explained in the video, instead it does compare each value of fields.

I’m not being picky, but as a in-depth educational video, I would say this is an unforgivable error!
And this kind of mistake should not be hard to be caught by doing a simple peer review.

Ответить
Davoud Badamchi
Davoud Badamchi - 19.10.2022 09:26

Excellent explanation.💯

Ответить
Jeffrey Cordova Vargas
Jeffrey Cordova Vargas - 13.10.2022 14:38

Perú: Algun ejemplo de como leer codigo de barras mediante PDA o Terminal Android Sunmi L2

Ответить
Logi-App
Logi-App - 13.10.2022 13:08

Hi ! On your Wikipedia page it is mentioned that Flutter supports the Erlang language, I looked through the online documentation and couldn't find anything. How do I integrate Erlang into my Flutter projects? Please kindly help me!

Ответить
Данила Фомин
Данила Фомин - 13.10.2022 07:11

Seriously??? Usin comparing hash codes while equals??? What’s about collisions?

Ответить
Najeeb
Najeeb - 12.10.2022 23:24

Great

Ответить
Pedro Santos
Pedro Santos - 12.10.2022 04:17

AWESOME!

Ответить
Sahil
Sahil - 11.10.2022 18:19

Can someone comment down some good recourses ( including book , courses etc )to learn dart and flutter and how to develop a great app overall
i have no prior experience in app development.
i know about little bit about c and c++

Ответить
Nauval Rizky
Nauval Rizky - 11.10.2022 09:40

equatable is nice package, though it'd be great if there's data class on dart

Ответить
Tornike
Tornike - 10.10.2022 15:45

I still prefer using "Command + n" -> "generate ==() and hashCode", it's way faster

Ответить
Peter
Peter - 09.10.2022 20:15

Isn't this a poor language design? If a library can generate that for you, compiler should also be able to do it?

Ответить
xiwi
xiwi - 09.10.2022 11:30

After 3 years using Flutter I just realised the logo is a F.
omg...

Ответить
Bruno Degan
Bruno Degan - 09.10.2022 08:30

Equatable is a must use package for all flutter projects, it saves lot of time ❤️

Ответить
René Casaña
René Casaña - 08.10.2022 19:08

What if a TextButton wants to identify as a ScrollableList? or an Apache helicopter?

Ответить
Fred Gotpub
Fred Gotpub - 08.10.2022 18:11

Thanks, I see the link between const constructor in Flutter and that Flutter doesn't rebuild those const widget: the default equality must be used.
Though would it be possible to override equality for a subclass of widget to avoid rebuild even with non const constructor?

Ответить
Shiva Kar
Shiva Kar - 08.10.2022 12:51

❄️ Freezed package handles everything under the hood

Ответить
Vinay Baise
Vinay Baise - 08.10.2022 06:33

Also please decode bool vs Future<bool>, and what is the use use of Future<bool> when it can't be used to check condition

Ответить
Code Gambit
Code Gambit - 07.10.2022 22:25

This is so cool. But another issue u run into is if you want your class to extend another class. In Dart, a class can't extend more than one classes so it's impossible to extend Equattable and another class.
A solution for this (if u use VSCode) is to install the Dart class generator extension. This would generate the equality code for u

Ответить
greg lee
greg lee - 07.10.2022 19:01

Great one, ty

Ответить
INDOFIZ
INDOFIZ - 07.10.2022 17:24

Just like JS Brother

Ответить
Pablo Javier García
Pablo Javier García - 07.10.2022 16:26

For once, the software is actually really useful

Ответить
Gax
Gax - 07.10.2022 01:47

Freeeeeeeeeezed

Ответить
mustafa ahmed
mustafa ahmed - 07.10.2022 00:59

really really cool explanation !! keep it up.

Ответить
Hasan Salim
Hasan Salim - 06.10.2022 21:17

Thanks Craig and the Flutter team.

Ответить
Abdullah Aqrabawy
Abdullah Aqrabawy - 06.10.2022 21:15

thank you very much
i have one important question
how did you animate the code like this :)
is there a specific method or tool to do that?

Ответить
Julien Scholz
Julien Scholz - 06.10.2022 20:30

This video contains wrong information: You should NOT use hash code in the equality operator. Two objects that are equal should have the same hash code, but two objects that are not equal can also share the same hash code. Mathematically, this is due to the pigeon hole principle. The Equatable package also does not use hash code in the equality function.

Hash codes exist to speed up hash maps and other data structures. Finding an object in a map is much easier if you can boil it down to a simple integer value.

Ответить
Глобальные изменения
Глобальные изменения - 06.10.2022 19:55

Когда мирроринг будет запилен?

Ответить
aytunch
aytunch - 06.10.2022 19:33

What about deep nested Maps and Lists? Would equatable understand 2 deep nested maps are same? Does it do some recursion under the hood in order to override its hashmap?

Ответить
Marc Tan
Marc Tan - 06.10.2022 19:05

good thing freezed exist!

Ответить
Bozacar
Bozacar - 06.10.2022 17:51

What about hash collisions? If 2 objects have same hash code doesn't mean that they are the same

Ответить
Destiny Ed
Destiny Ed - 06.10.2022 17:43

I love the Flutter T-shirt

Ответить
Rudolf Kuzhugetovich
Rudolf Kuzhugetovich - 06.10.2022 17:20

Very useful. Thanks!

Ответить
Rohith Gilla
Rohith Gilla - 06.10.2022 17:20

Thanks for freezed package 🫡

Ответить
Prasant Kumar
Prasant Kumar - 06.10.2022 17:05

Very clean explanation by Flutter Team. I love it. Thank you.

Ответить
김지운
김지운 - 06.10.2022 16:55

Thanks Flutter team!

Ответить
Alexandre da Silva Cavalcante
Alexandre da Silva Cavalcante - 06.10.2022 16:37

Not sure I'm gonna use it, but it's amazing to know we can override an operator 😂

Ответить
Marco M.
Marco M. - 06.10.2022 16:29

It's odd to see that the newer language Dart even is a greater mess than Java when it comes to such basic concepts.

Ответить
SARAH FORTUNE S
SARAH FORTUNE S - 06.10.2022 16:08

:)

Ответить
Андрей Боталов
Андрей Боталов - 06.10.2022 16:06

Thank u 😊

Ответить