Hi, I'm a newbie and this series does clarify quite a lot of the questions I was having hard time to address. Many thanks for having created and shared it. Still, I was wondering if it would be possible to comment on a few things I feel I missed. a- I don't reeally see what are the differences between final bar = Bar(); and final Bar bar; In both cases, we define a variable bar of type Bar... but I am surely missing something that is not a subtlety and might also prevent me to understand fully "Foo({Bar? bar}) : _bar = bar ?? Bar();" which is used later.
b- When stating "Our bar property is public, so we can access its methods without using foo explicitly!", I am confused as in main(), I read "foo.bar.doSomething();" which I understand as using foo explicitly, then for sure I misunderstood something but I don't know what...
c1- Regarding "Foo(this.bar);", I'm unclear why we should not use it whereas we could use "Foo({required this.bar});". Is-it because of "required" and/or "" or because there is no ambiguity between a class attribute and a parameter name ?
c2- "You straight-up can’t use named parameters with this approach, and that can be a problem if your class needs to support more dependencies and you want to have a clean API. Just, don’t." There, the comma suggests that the impossibility to use named parameters can be a problem if we want to combine a clean API with class needing to support more dependencies. However, does it refer to having several dependency injections in the same class ? In other words, "Foo(this._bar);" would be OK for a single DI, but it is better to adopt a different approach to acquire some sort of a reflex which could save us from having to solve issues when several DI are associated with a single class ?
I apologize as these questions are likely to look naive, but again I'm a newbie, and I hope it could be possible to clarify these items. In any case, thanks again for this series.