Introduction to Dart for Beginners - Generics, Factories, Enums and Exceptions - Part Seven

preview_player
Показать описание
In this video we look at Generic Types, Factory Constructors, Enumerated Types, Exceptions, and Singletons.

Support the Channel and Join Patreon:

Dontate:
ETH: 0x03247265dd5242605bD2FA3c40fb3b70d9e3D685
Cardano: addr1q9auccwrr9ws8qdyv45f4qwsx76pfmld4zapks89sakq94ay0xmle73y0r8ruwd0zslls4eglf98lghru7ywv56cedysk7ftjt

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

Packed with so much info! A little unclear about those cascade operators.

Thanks for another great one!

fooked
Автор

Thanks man, came here to understand factory

minutesseries
Автор

Thanks..Tensor. Your tutorials are awesome.

talentoutput
Автор

I didnt get the constructor notation on the subclasses:
Cat(String type) : super._type(type);
Is that a short form and how does the long for look? or what does this statement mean?

techytimo
Автор

6:40 if stopped has index 0, and running has index 1, wouldn't paused have index 2, as opposed to 3?

bertlashes
Автор

9:40 Did u mean it would have an index of 2 instead of 3?

dexterstm
Автор

19:40 no need to cascade in the if statement, you're already reassigning it in the return expression :P

Dorumin
Автор

Great video! One question: why does the toString() method inside the Person class automatically force the print(pub.drinking) expression in the main() function to print the list showing the names of the people, rather than the [Instance of 'Person', Instance of 'Person']? We never actually call this toString() method anywhere, so why does this automatically happen?

jasonnelford
Автор

I have one elementary question, I know by declaring variable static, memory will be allocated separately in the beginning. So how will compiler get to know how much memory to allocate to a item variable when Class itself not defined yet.
Thanks in advance.

varunhegde
Автор

Thank you! Perfectly picked examples for understanding the topic.

The only question I have is: do we actually need to use factory for a singleton?

Why couldn't we just create a private default constructor and a static getInstance() method like in good old Java?

kirill
Автор

Can't you say:
if (status == Status.running)
instead of:
if (status.index == 1)

I think the first one is clearer, and would protect against possible bugs if reordering items in the enum.

WorstDeveloper
Автор

I know it's just an example, but I don't think the checkAge function should throw an exception if the person is underage.
instead it should probably just return true/false.

WorstDeveloper