Комментарии:
please, next time make zoom into the code to see it better, i tried to see the video on my phone and it was a bad desicion
ОтветитьDude, I need to get a new pair of eyes after this video.
ОтветитьVelocityx package implements the same functionality in simplier form and the bioler plate code is also less , but it is also good to know the behind the scenes
ОтветитьGreat video if you want to build a package that needs state without introducing a dependency on another state management package like provider or riverpod.
ОтветитьExtremely wanted this workshop, thankyou Flutter 💜
ОтветитьAwesome
ОтветитьPlease explain the reason for using two dots in "_itemsInCart..add(id)" within _handleAddToCart(String id).
The same question applies to "_itemsInCart..remove(id)" within _handleRemoveFromCart(String id).
Using only one dot causes an error: A value of type 'bool' can't be assigned to a variable of type 'Set<String>'
Fine, but WHAT, exactly and precisely, is the meaning of the two dots in this context?
Is this a shortcut for some kind of a cast?
Obvioously, there's something VERY meaningful going on here. Unfortunately, searching the Dart documentation doesn't produce any meaningful information for "two dots" (which are used in cascades with this Note: Strictly speaking, the “double dot” notation for cascades isn’t an operator. It’s just part of the Dart syntax.)
So, the “double dot” notation for cascades inhabits a different context than the context of your _handleAddToCart(String id) and _handleRemoveFromCart(String id).
Please clarify.
Thanks.
To be specific: My previous comment applies to your initial code (Step 1), where you use "_itemsInCart..add(id)" within _handleAddToCart(String id).
By the time you get to Step 9 at the end of your workshop, you use the familiar single dot: "AppStateWidget.of(context).addToCart(id);"
So, my question about your “double dot” notation refers to the syntax that you use in Step 1.
Thank you very much for having written this excellent workshop. In addition to your nice code, you did a great job with the visual design.
Such a valuable topic, and an excellent example-walkthrough. Thank you!
ОтветитьWhat I don't understand is that why need first build an app the way it is not practical. But thank you :)
ОтветитьIs InheritedNotifier more efficient with the same pattern? Create a custom valueNotifier around the data class and without the StatefulWidget that exposes the APIs. That would be my guess I'm not sure yet, though..
ОтветитьI really hope the dartpad code sample could be updated with more intuitive comments and walk through to decoupled the excercise from this video.
ОтветитьHow does this compare to using Riverpod, advantages and disadvantages?
Ответитьmore Inherited widgets codelabs!
Ответитьit will be very cool and important to have comments // for each line so even a new comer can read and follow through
ОтветитьEasy to understand and well structured workshop. Thanks a lot for these valuable insights on state management in Flutter!
Ответитьпереводчик яндекс браузера его НЕ ПОНИМАЕТ ! УВОЛЬТЕ ЕГО
Ответитьdelete((
ОтветитьHow can i access the source code of this exercise? Please help me.
ОтветитьThank you for putting this together. Something I noticed while developing my flutter application alongside this video was that your "updateShouldNotify" methond on AppStateScope has backwards logic. Rather than using "==" I think it should have been "!=". I wasn't getting updates to my subtree so I had to hunt down what was happening.
Ответить