Advertisement · 728 × 90

Posts by

Preview
Concurrent Optimistic Updates in React Query How to build optimistic UI that is resilient to race conditions, even when multiple mutations update the same entity concurrently.

📚 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 😄:

11 months ago 65 7 3 0

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.

1 year ago 11 4 0 0
Post image

Some new Zustand users might not know this, so I'm posting it again. zustand/vanilla is just 23 loc.

1 year ago 43 4 2 1
Preview
Clash of Clans style button web component If you want to make Clash-style buttons on your webpages, use this component!...

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...

1 year ago 49 3 1 0
Preview
Flutter Architecture Simplified Explore Flutter architecture, state management, and design principles for scalable, testable apps with minimal boilerplate code

#flutterdev here comes the final word on Flutter architecture ;-)
blog.burkharts.net/practical-fl...

1 year ago 22 6 1 0

#flutterdev more reasons to check out watch_it, no need for StatefulWidgets just to create controllers and disposal is automatic

1 year ago 5 2 1 0
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);
}

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. 💡

1 year ago 6 1 1 0
Advertisement
A Deep Dive into ValueNotifier
A Deep Dive into ValueNotifier YouTube video by Hungrimind

A Deep Dive on ValueNotifier

youtu.be/_J4siJeIo8I

1 year ago 5 3 0 0
Post image

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...

1 year ago 6 1 1 0
Post image

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

1 year ago 117 15 7 0
Post image

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...

1 year ago 31 11 11 0
Preview
GitHub - rydmike/squircle_study: A Flutter study and comparision of different Squircle ShapeBorder options A Flutter study and comparision of different Squircle ShapeBorder options - rydmike/squircle_study

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...

1 year ago 7 3 2 0
Async Preact Signals How to create an asynchronous Preact signal

New post about how to create Async @preactjs.com signals! 👀

rodydavis.com/posts/async-...

1 year ago 4 1 1 0
Preview
Native interop with Kotlin/Java in Flutter Got quite excited to use jnigen to generate Kotlin/Java bindings for Flutter plugins.

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

1 year ago 15 5 3 0
Video

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.

1 year ago 10 3 0 0
Advertisement
Elite: "The game that couldn't be written"
Elite: "The game that couldn't be written" YouTube video by Alexander the ok

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

1 year ago 5 2 2 0
Preview
React Query - The Bad Parts In this talk, maintainer Dominik will explore the other side—the less favorable aspects of React Query and situations where it may not be the best fit. No library is perfect; every choice involves tra...

📚 The slides and transcript of my @reactdayberlin.gitnation.org talk “React Query - The Bad Parts” are now available on my blog. Enjoy 🎉

1 year ago 85 12 0 1
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,
  ),
)

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! 🔥

1 year ago 32 7 3 1

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.

1 year ago 44 14 10 0
Post image

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

1 year ago 14 4 0 1

"rules" that terminal programs follow jvns.ca/blog/2024/11...

1 year ago 462 62 23 1
Post image

Row and Column spacing is here for everyone! #FlutterDev

1 year ago 49 7 7 4
Advertisement
Preview
Project Miniclient — Testing Testing is often misunderstood as a process of finding bugs. However, in reality…

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...

1 year ago 17 3 1 0
Preview
Next-level frosted glass with backdrop-filter • Josh W. Comeau Glassy headers have become a core part of the “slick startup” UI toolkit, but they’re all missing that final 10% that really makes it shine. In this tutorial, you’ll learn how to create the most reali...

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...

1 year ago 117 10 2 1
// 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

// 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

1 year ago 13 1 3 0
The Epic Programming Principles Cheat Sheet. A summary of all the principles

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 📖

1 year ago 307 66 21 16

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.

1 year ago 12 2 3 1
Post image

SwiftUI Tip💡

Use ViewThatFits to automatically select and display the layout that fits the available space perfectly.

→ learnandcodewithenid.com

1 year ago 7 2 2 0
Post image

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.

1 year ago 22 6 3 1