Тёмный
No video :(

Dart Classes - Factory Constructors 

Johan Jurrius
Подписаться 10 тыс.
Просмотров 12 тыс.
50% 1

In this video we look at factory constructors in Dart. Follow the full playlist here: • Introducing Flutter

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

 

11 мар 2021

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 72   
@mostafaahmadi4998
@mostafaahmadi4998 3 года назад
Dart developing team should put all of your videos on their website. The explanation of the factory constructor was amazing. Thank you
@noeljriveropino5906
@noeljriveropino5906 2 года назад
Agree
@kahanx10
@kahanx10 2 года назад
I'm stunned by your comprehensiveness, I could not find so minute details explained about every topic and keyword elsewhere. You're a dart documentation in a human form.
@keithbertschin1213
@keithbertschin1213 Год назад
Thank You so much for giving a real world example of what, to the newbie, is a complex subject. Many videos deal in the abstract that may show you what to do but miss out the why you’d want to do something.
@2mvX
@2mvX 2 года назад
Thanks man! 4 years of coding and now I found the purpose of factory constructor and finally understood this concept. Well explained!
@jimaustin3608
@jimaustin3608 3 года назад
EXCELLENT tutorial; content thoroughly covered by good teacher! Thinking his ‘Flutter Course’ and ‘Dart Basic’ playlists look really good … and very current.
@wabilemotswasele8705
@wabilemotswasele8705 3 года назад
Thank you Johan. For the first time I have a proper understanding of factory constructors in Dart.
@JohanJurrius
@JohanJurrius 3 года назад
Awesome!
@saurabhgaming1531
@saurabhgaming1531 3 года назад
Can you help me how to add null safty in factory constructor plz plz
@venkatakhadri8998
@venkatakhadri8998 2 года назад
Another excellent video tutorial explaining in a very simple way by Johan.
@exconfessor3639
@exconfessor3639 2 года назад
Link from the video: www.learndartprogramming.com/fundamentals/factory-constructor-in-dart/
@billynyk
@billynyk 3 года назад
Finally, watching this episode, I understand what the factory constructor is. Thanks.
@saurabhgaming1531
@saurabhgaming1531 3 года назад
Can you help me how to add null safty in factory constructor plz plz
@alfalarcon
@alfalarcon 3 года назад
Great video!!! It is the best tutorial I have seen of the factory constructor. Thank you very much.
@aaliraza4004
@aaliraza4004 2 года назад
most complete dart tutorials...thanks
@gumdum6764
@gumdum6764 3 года назад
Thanks. It wasnt’ till the end of the tutorial that I understood what returning a sub-class instance of a class instead of the class itself meant. It was a light-bulb moment
@JohanJurrius
@JohanJurrius 3 года назад
Great!
@wheatonrecurrence9525
@wheatonrecurrence9525 3 года назад
Holy moly, this is such a good explanation.
@eldarkurmakaev321
@eldarkurmakaev321 2 года назад
Great video!
@PamelaAnneHolmes
@PamelaAnneHolmes 2 года назад
Thank you!
@eliasyishak203
@eliasyishak203 2 года назад
Very well done tutorial! Thank you!
@obsessed92
@obsessed92 2 года назад
Great example, thank you !
@asxes
@asxes 2 года назад
awesome. thanks
@kholoudkhaled2897
@kholoudkhaled2897 Год назад
First of all thank you for your effort I have a question, why declaring city and object variables out of the if statement but still inside for in loop give me an error
@raohamzanawab191
@raohamzanawab191 2 года назад
what is the method of starting conversion with you
@vgeniirshf8913
@vgeniirshf8913 3 года назад
Thank you very much!
@lynnphoann
@lynnphoann 2 года назад
nice explanation !!
@venkatakhadri8998
@venkatakhadri8998 2 года назад
Johan, I have been watching all your videos on your Dart and trying to practice also. At times, I need to refer back to previous video and code snippets. Is there is a gist or git that I can refer for all the code that was covered in the video tutorials. Thanks a bunch
@JohanJurrius
@JohanJurrius 2 года назад
Hi, sorry. Not really for Dart. I tried to do it for Flutter.
@hiraokii
@hiraokii Год назад
Hi sorry the question, but why the toString runs automatically?
@ParabTarak
@ParabTarak Год назад
print(reading) basically calls toString method of the Reading and it's subclasses. This method returns a string. Since any object inherits Object class, you can override this method to return a custom string, as shown in the video. If you don't override it then it will print 'Instance of Reading' or 'Instance of Temperature' or 'Instance of Pressure' depending on the object type basically 'Instance of ' . tldr: print() method in the last for loop calls toString method of the readings, which prints the strings returned by the overridden toString methods of these readings.
@trapeye3464
@trapeye3464 3 года назад
bro how u not famous.. the video so good lmao
@saurabhgaming1531
@saurabhgaming1531 3 года назад
Can you help me how to add null safty in factory constructor plz plz
@trapeye3464
@trapeye3464 3 года назад
@@saurabhgaming1531 i have similar problem at past.. i can help u.. if i remember the solution.. pm me?
@trapeye3464
@trapeye3464 3 года назад
@@saurabhgaming1531 need to see the code
@trapeye3464
@trapeye3464 3 года назад
@@saurabhgaming1531 wan_hahaha
@saurabhgaming1531
@saurabhgaming1531 3 года назад
@@trapeye3464 bro I am unable to get your I'd plz hel me I cant share link here also it get automatically deleted after 29 sec
@trungledang5225
@trungledang5225 2 года назад
Thanks you sir, resepect!
@homeofcreation
@homeofcreation 3 года назад
fantasic video!
@noeljriveropino5906
@noeljriveropino5906 2 года назад
Hi Johan, maybe I couldn't find in your channel a video for generic classes, did you make one by any chance? Great video this one, by the way.
@JohanJurrius
@JohanJurrius 2 года назад
I dont think so. Good one to add. thanks
@noeljriveropino5906
@noeljriveropino5906 2 года назад
@@JohanJurrius Lots of people will appreciate it, i am 💯 sure
@noeljriveropino5906
@noeljriveropino5906 2 года назад
@@JohanJurrius I will really appreciate it a lot.
@saurabhgaming1531
@saurabhgaming1531 3 года назад
Hello I am creating in latest versions but how to add null safty in factory constructor
@JohanJurrius
@JohanJurrius 3 года назад
Could you give me an example of what you want to do in a gist and I can check if I can help?
@JohanJurrius
@JohanJurrius 3 года назад
I will need to see your code
@JohanJurrius
@JohanJurrius 3 года назад
You can create a gist on github. Really fast.
@saurabhgaming1531
@saurabhgaming1531 3 года назад
I am un able to share link of gist yotube delete my comments plz help me
@yeayeayea7619
@yeayeayea7619 3 месяца назад
Hope this helps someone out: class Reading { double value; Reading({required double value}) : this.value = value; Reading.zero() : value = -999; @override String toString() { return '$value'; } } class Temperature extends Reading { String city; Temperature({required String city, required double reading}) : this.city = city, super(value: reading); Temperature.zero() : city = '', super(value: -999); @override String toString() { return 'Temperature reading: Reading: ${super.toString()} City: $city '; } } class Pressure extends Reading { String objectTested; Pressure({required String objectTested, required double reading}) : this.objectTested = objectTested, super(value: reading); Pressure.zero() : objectTested = '', super(value: -999); @override String toString() { return 'Pressure reading: Reading: ${super.toString()} Object Tested: $objectTested '; } } void main() { var fromServer = [ { 'type': 'temp', 'reading': 20.2, 'city': 'Johannesburg', }, { 'type': 'pressure', 'reading': 100.0, 'object': 'Glass Cylinder', }, { 'type': 'temp', 'reading': 35.2, 'city': 'New York', }, { 'type': 'pressure', 'reading': 300.5, 'object': 'Tire', } ]; }
Далее
Dart Classes - CopyWith() method
17:22
Просмотров 6 тыс.
Dart Async - Futures in Dart
32:22
Просмотров 4,2 тыс.
ROLLING DOWN
00:20
Просмотров 6 млн
Редакция. News: 129-я неделя
49:53
Просмотров 2 млн
Dart Collections - Lists
18:59
Просмотров 12 тыс.
Factory Constructor In Dart - Learn Dart Programming
40:58
Building Fluent Interfaces in TypeScript
16:15
Просмотров 14 тыс.
Flutter State Management - Routes and Provider
34:23
Просмотров 10 тыс.