Use Dart’s ‘late’ Keyword for Reliable Lazy Initialization
Learn how Dart’s ‘late’ keyword lets you lazily initialize non‑nullable fields, the pitfalls to watch for, and best‑practice patterns to avoid runtime errors.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Learn how Dart’s ‘late’ keyword lets you lazily initialize non‑nullable fields, the pitfalls to watch for, and best‑practice patterns to avoid runtime errors.
Mixing local and global coordinate spaces is the most common cause of hit-test misses in Flutter custom painters. Here is how to use Rect factories, containment checks, and clipping with explicit coordinate intent.
Dart makes non‑nullable the default and uses ? to opt into nullability. A worked function signature shows how the analyzer forces null checks and promotions, and where migration and interop weaken guarantees.
Super‑parameters in Dart 2.15 let subclasses forward constructor arguments to superclasses with a single keyword, cutting boilerplate and reducing copy‑paste errors. Learn how, when to use them, and what trade‑offs to expect.
Learn how to diagnose and fix the RenderFlex overflowed yellow-and-black striped banners in Flutter using Expanded, Flexible, and Wrap widgets.
When Dart UI blocks on CPU work, isolates provide memory-isolated parallelism via message passing. This architecture note covers the minimal design, data boundaries, operational checks, failure modes and when to change the approach.
Dart's sound null safety makes types non‑nullable by default, catching null‑dereference bugs at compile time. Shows enabling in pubspec.yaml, non‑nullable and late variables, dart migrate usage, and pitfalls like unsafe ! and late init errors.
Sound null safety eliminates silent null dereferences in Dart. This guide walks you through preparing, running the migration tool, handling third‑party packages, a concrete code example, and trade‑offs so you can modernise your Flutter or server‑side Dart code safely.
Migrating a Dart codebase to null safety: step‑by‑step guidance, common pitfalls, and best practices. Learn how to use <code>dart migrate</code>, resolve manual edits, and keep tests green.