toad.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
Mastodon server operated by David Troy, a tech pioneer and investigative journalist addressing threats to democracy. Thoughtful participation and discussion welcome.

Administered by:

Server stats:

291
active users

#riverpod

0 posts0 participants0 posts today
-> @haileys.quest<p><span>More </span><a href="https://infosec.town/tags/dart" rel="nofollow noopener" target="_blank">#dart</a><span> troubles today, this time particularly with </span><a href="https://infosec.town/tags/riverpod" rel="nofollow noopener" target="_blank">#riverpod</a><span>.<br><br>It looks like sometimes, with an unknown cause, setting a StateNotifier-based provider that holds an error message from within a ConsumerWidget (in response to another provider) will fail, because "Providers are not allowed to modify other providers during their initialization."<br><br>The only provider that should be being initialized is the command provider, and I've taken it out of the equation by delaying the set until that is done executing. The behavior hasn't changed at all. Oddly enough, once that error grinds through the debugger, it actually sets the StateNotifier to a resulting error ("At least listener [sic] of the StateNotifier Instance of '_CommandNoteNotifier' threw an exception<br>when the notifier tried to update its state"; the console shows that that error is in response to the "Providers are not allowed" error). I just don't know where exactly that's happening, or why that works. Or how I can get it to work correctly.<br><br>Would it work fine if I took executeCommand (which now-indirectly runs the "set") to not be a Provider and just be a function that takes a ref instead? That's not preferable because then I have to take a WidgetRef outside of a widget, which is "wrong" to do and comes with other issues.</span></p>
Hank G ☑️I've enjoyed using Riverpod for my Dart/Flutter app framework but I have confused myself on some intricacies of lifecycles of Riverpod providers. I decided to do a detailed walk of the topic for myself and post it for my blog. <a href="https://friendica.myportal.social/search?tag=flutter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>flutter</span></a> <a href="https://friendica.myportal.social/search?tag=riverpod" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>riverpod</span></a> <a href="https://friendica.myportal.social/search?tag=DartLang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>DartLang</span></a> <a href="https://friendica.myportal.social/search?tag=programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>programming</span></a> <a href="https://nequalsonelifestyle.com/2024/12/03/riverpod-lifecycles/" rel="nofollow noopener" target="_blank">nequalsonelifestyle.com/2024/1…</a>
GeekMeSpeakStef💙:flutter: :va:<p>2/ This edition comes with new chapters on Advanced <a href="https://fluttercommunity.social/tags/InteractiveWidgets" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>InteractiveWidgets</span></a>, <a href="https://fluttercommunity.social/tags/UnitTesting" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>UnitTesting</span></a>, and <a href="https://fluttercommunity.social/tags/WidgetTesting" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>WidgetTesting</span></a>, along with the <a href="https://fluttercommunity.social/tags/StateManagement" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>StateManagement</span></a> chapter now includes <a href="https://fluttercommunity.social/tags/Riverpod" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Riverpod</span></a>.</p><p>There is a major update to the <a href="https://fluttercommunity.social/tags/Firebase" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Firebase</span></a> <a href="https://fluttercommunity.social/tags/CloudFirestore" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CloudFirestore</span></a> chapter. Instead of separate sections for manually setting up Firestore to work in Android and iOS <a href="https://fluttercommunity.social/tags/Flutter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Flutter</span></a> apps, now one learns how to use <a href="https://fluttercommunity.social/tags/FlutterFire" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>FlutterFire</span></a> CLI to <a href="https://fluttercommunity.social/tags/Firestore" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Firestore</span></a> to work with Android, iOS, macOS, and Web apps.</p>
Hank G ☑️I've been experimenting with Riverpod a lot the last couple weeks and am now ready to try it in a greenfield project I've been meaning to write for some time. In lieu of a good design patterns/best practices book (if one exists I haven't found it anyway) I've been doing as best homework I can with finding videos/blog posts and little side experiments. One thing I discovered earlier this week was nested providers which I was thinking I may want to use to replace another idiom I had been using of having a provider that takes an item ID. Based on this presentation by <span class="h-card"><a href="https://fluttercommunity.social/users/randalschwartz" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>randalschwartz</span></a></span> it sounds like that is not the way to go. In the video he does show how to do various scoping, both literal scope and logical scope, of providers in Riverpod. <a href="https://friendica.myportal.social/search?tag=riverpod" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>riverpod</span></a> <a href="https://friendica.myportal.social/search?tag=flutter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>flutter</span></a> <a href="https://friendica.myportal.social/search?tag=DartLang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>DartLang</span></a><br><a href="https://youtu.be/gHbkIgDnDyg?si=4lZQGbIRRpzEX3tq" rel="nofollow noopener" target="_blank">The Riverpod "Global" Myth</a>
Hank G ☑️I've avoided using stuff like Freezed because the code generation aspects of Dart/Flutter don't integrate seamlessly with the IDE like I had with Java/Kotlin equivalents. Now that I've done a deep dive on trying to learn Riverpod it seems that code generation really helps make Riverpod a lot easier to work with. If I stick with RIverpod maybe that'll be what finally brings me over on using gen tools like Freezed too <a href="https://friendica.myportal.social/search?tag=DartLang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>DartLang</span></a> <a href="https://friendica.myportal.social/search?tag=Flutter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Flutter</span></a> <a href="https://friendica.myportal.social/search?tag=programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>programming</span></a> <a href="https://friendica.myportal.social/search?tag=Riverpod" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Riverpod</span></a>
Hank G ☑️Today's Dart Snake deployment target for the project is Flutter. Because I'm targeting all ranges of Dart/Flutter experience I did spend a lot of time giving high level background on standard things about Flutter concepts, ceremony, etc. as well as showing how the shared business layer Game play is wired into the Flutter presentation layer at just a couple of points thanks to some nice Dart concepts like extension methods and Riverpod's state management help. <a href="https://friendica.myportal.social/search?tag=DartLang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>DartLang</span></a> <a href="https://friendica.myportal.social/search?tag=flutter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>flutter</span></a> <a href="https://friendica.myportal.social/search?tag=riverpod" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>riverpod</span></a> <a href="https://friendica.myportal.social/search?tag=programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>programming</span></a> <a href="https://friendica.myportal.social/search?tag=DartSnake" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>DartSnake</span></a> <br><a href="https://nequalsonelifestyle.com/2023/04/04/dart-snake-for-flutter/" rel="nofollow noopener" target="_blank">dart snake for flutter</a><br>
Hank G ☑️Now for the first Dart Snake deployment target for the project: the CLI using ncurses. I include some highlights of cool Dart language features that I often leverage, like extension methods, enum methods and valuing, how to do keyboard event listening, etc. It ultimately shows how much of the business layer can reside at a lower layer thanks to inherent Dart language features and state management systems like Riverpod. <a href="https://friendica.myportal.social/search?tag=DartLang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>DartLang</span></a> <a href="https://friendica.myportal.social/search?tag=Riverpod" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Riverpod</span></a> <a href="https://friendica.myportal.social/search?tag=ncurses" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ncurses</span></a> <a href="https://friendica.myportal.social/search?tag=programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>programming</span></a> <a href="https://friendica.myportal.social/search?tag=DartSnake" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>DartSnake</span></a> <br><a href="https://nequalsonelifestyle.com/2024/04/03/dart-snake-cli/" rel="nofollow noopener" target="_blank">dart snake for command line</a><br>
RJ<p><span class="h-card"><a href="https://indieweb.social/@abraham" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>abraham</span></a></span> no doubt it’s easy, but I tend to lean towards things with more rules and structure in place, it’s very easy to inadvertently end up with a clunky mess in provider. </p><p>If <a href="https://fosstodon.org/tags/riverpod" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>riverpod</span></a> had not come along I would have stuck with <a href="https://fosstodon.org/tags/BLoC" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>BLoC</span></a> and used <a href="https://fosstodon.org/tags/provider" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>provider</span></a> for global data storage with get_it for access.</p><p>Now I can use Riverpod for all of it, can even easily mock statics from external packages in my unit tests.</p>