Dart Static Extension Methods - Dart 2.6

preview_player
Показать описание
#tensorprogramming #extensionmethods #learndart

In this video we take a look at the Dart 2.6 extension method syntax. We look at the various concepts behind the syntactic sugar and their purpose.

Good Programming Laptops:

Support the Channel and Join Patreon:

Dontate:
ETH: 0x03247265dd5242605bD2FA3c40fb3b70d9e3D685
Cardano: addr1q9auccwrr9ws8qdyv45f4qwsx76pfmld4zapks89sakq94ay0xmle73y0r8ruwd0zslls4eglf98lghru7ywv56cedysk7ftjt

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

I swear, everytime Tensor publishes a video, I jump up with joy!! :D

cryptopatrick
Автор

Hi Thanks Tensor Flow. I didn't understand the part about toJson/fromJson. What is the advantage of using extension over using factory methods in Person class?

aytunch
Автор

I was really looking forward to this feature (I missed it from C#),
Have you tried running C++ code with dart:ffi?

LUKAS
Автор

Calling them "static extension methods" is greatly misleading as it implies that the method attached to the type would be a _static_ method rather than an _instance_ method. This terminology is probably a carry-over from the C# world where extension methods are defined using the `static` keyword, but Dart has no such requirement so there's no reason to refer to extension methods that add functionality to type instances as "static extensions" and doing so just leads to confusion.
(Implementation-wise, these extensions are probably pre-compiled into static methods themselves, but that's an unimportant distinction for the average developer.)

Abion
Автор

Thanks for explanation! I have some issues though with extensions. I am trying to define some extensions in a separate file within my project. Then when I try to use the extensions in another file, which is even in a separate package, the compiler complains that it can't find the extension... I tried manually importing the file where the extension is located but it doesn't work either, any ideas? THanks!

Автор

You don't have long tutorials bru i mean about flutter and dart . thanks any way. Good facilitator.

katlehomotumi