📚 Wrote a piece about how optimistic updates are hard because of edge cases, especially when updates happen concurrently, and how to address them in React Query. It’s mostly one line of code to add, but knowing which one that is is the hard part 😄:
Posts by
Over the last 6 years I have observed mistakes that also easy to avoid in #Flutter and #dart
I have written top 15 of them in a very comprehensive blog post.
Some new Zustand users might not know this, so I'm posting it again. zustand/vanilla is just 23 loc.
I've been going deep on @clashofclans.bsky.social lately and recreated their buttons (to the best of my ability) in CSS with a fun lil web component on @codepen.io!
codepen.io/cassidoo/pen...
#flutterdev here comes the final word on Flutter architecture ;-)
blog.burkharts.net/practical-fl...
#flutterdev more reasons to check out watch_it, no need for StatefulWidgets just to create controllers and disposal is automatic
By registering a ValueNotifier listener, you can: - Update a ScrollController, PageController, AnimationController, etc. - Show a dialog - Navigate to another route // Example code using PageController: // Declare this somewhere and change its value when desired final pageIndexNotifier = ValueNotifier<int>(0); // Inside a State<T> subclass final pageController = PageController(); // Inside initState pageIndexNotifier.addListener(_onPageIndexChanged); // Inside dispose pageIndexNotifier.removeListener(_onPageIndexChanged); pageController.dispose(); void _onPageIndexChanged() { pageController.jumpToPage(pageIndexNotifier.value); }
Did you know?
By registering a ValueNotifier listener, you can perform various side effects such as:
✅ Updating a ScrollController, PageController, AnimationController, etc.
✅ Showing a dialog
✅ Navigating to another route
Note: This works with ChangeNotifier, too. 💡
A Deep Dive on ValueNotifier
youtu.be/_J4siJeIo8I
One of my favorite things about Signals in @flutter.dev is you can build however you want.
Here is an example of using just signal primitives to render everything starting at runApp.
dartpad.dev?id=f5a9c7151...
Subtle things to make your shaders better:
1) Anti-aliasing - Real life is not limited to pixels so unless you're specifically going for a pixelated style, you should be anti-aliasing everything!
mini.gmshaders.com/p/antialiasing
Flutter network gist has been growing!
Looking for more active #FlutterDev content creators Please comment here or in the gist.
gist.github.com/TahaTesser/e...
Work is being done to finally bring this to #FlutterDev. Current pkgs all have issues, also they can cause performance issues, a GPU using version is needed. Have not tried the Cupertino_rrect, if I have time I will check it out and add it to this study and comparison github.com/rydmike/squi...
Something that I've finally got time to play with was jnigen. I heard about it from @youse.fi last year and wanted to see if I can migrate one of the plugins and skip method channels.
It worked pretty well so I wrote about it occasionalflutter.substack.com/p/native-int...
#Flutter #FlutterDev
If you didn’t know, you can navigate to a file in #VSCode using just the initials.
For example:
Open the Command Palette and type "ibt" to open the icon_button_test.dart file.
Highly recommend video for any developer not having grown up in the 8 Bit area. It will enhance your understanding of how computers work a lot.
youtu.be/lC4YLMLar5I?...
@benhyneck.bsky.social got side tracked by this
📚 The slides and transcript of my @reactdayberlin.gitnation.org talk “React Query - The Bad Parts” are now available on my blog. Enjoy 🎉
Text( currentTimeFormatted, style: const TextStyle( // Set this font feature to ensure all digits are rendered with a fixed width (monospace) // Useful when showing numbers or dates that update in realtime fontFeatures: [FontFeature.tabularFigures()], fontFamily: "Roboto", fontSize: 48, fontWeight: FontWeight.w700, ), )
Did you know?
If you want to render fixed width (monospaced) digits, set FontFeature.tabularFigures() inside your TextStyle. 🎯
This works great when showing numbers and dates that should align vertically or update in realtime! 🔥
here we go again (I will now do this every 2 months on ~16th): reply to this tweet to AMA about @dart.dev or complain about anything @dart.dev related.
I will do my best to reply.
There's a super easy way to see old versions of a file in VS Code
1. Open the Explorer
2. Toggle on the "Timeline"
3. Select the version you want to see
"rules" that terminal programs follow jvns.ca/blog/2024/11...
Row and Column spacing is here for everyone! #FlutterDev
Testing is often misunderstood as primarily finding bugs, but validating requirements is far more important for developing quality products 🧪
Explore different testing approaches and how they impact your #Flutter app development in my latest article 👇
medium.com/tide-enginee...
Thorough and very informative explanation of how to create a more realistic frosted glass effect using #CSS filters, by @joshwcomeau.com
www.joshwcomeau.com/css/backdrop...
// package:my_package/src/classes.dart abstract class Base {} class A extends Base {} class B extends Base {} // package:my_package/my_package.dart export 'src/classes.dart' show A, B; // We don't export "Base" // Inside apps: import 'package:my_package/my_package.dart'; final list = [A(), B()]; // List is typed as List<Base>. // So even though the class isn't exported, users ended-up having access to it
Fun fact: Public classes that are not exported may still be indirectly usable by users
Here's one example
The Epic Programming Principles Cheat Sheet. A summary of all the principles
The Epic Programming Principles: the guide I use to make decisions as a software engineer.
Transcending specific tools or frameworks, these principles will help you guide your career, craft, and technical choices.
See details and examples for each principle here: www.epicweb.dev/principles 📖
Oh yeah, I can rustle up some examples. I’ve always thought, Widget is configuration, Element is instance, RenderObject makes it so (lays out and paints).
As far as custom Elements, I think a common case is when the RenderObject needs send up information to the Widget, a delegate or some such.
SwiftUI Tip💡
Use ViewThatFits to automatically select and display the layout that fits the available space perfectly.
→ learnandcodewithenid.com
I'm going to share a few macOS Terminal tips I learned recently that others might find helpful.
1/ Ever find yourself with a long command and you just want to change one thing? Don't just hold down the left arrow button, instead Option+Click and the cursor will move to that location.