<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"><channel><title>fluttersmith/tips</title><description>Flutter tips that still compile.</description><link>https://fluttersmith.github.io/</link><item><title>Check ref.mounted after an await in a provider</title><link>https://fluttersmith.github.io/tips/tips/ref-mounted/</link><guid isPermaLink="true">https://fluttersmith.github.io/tips/tips/ref-mounted/</guid><description>A provider can be disposed while a Future is pending. Check ref.mounted after the await before you touch state, or Riverpod 3 throws.</description><pubDate>Thu, 24 Sep 2026 00:00:00 GMT</pubDate><category>riverpod</category><category>async</category></item><item><title>Style an ElevatedButton with styleFrom and themes</title><link>https://fluttersmith.github.io/tips/tips/elevated-button-style/</link><guid isPermaLink="true">https://fluttersmith.github.io/tips/tips/elevated-button-style/</guid><description>Use ElevatedButton.styleFrom for one button, ElevatedButtonThemeData for all of them, and WidgetStateProperty when a style depends on state.</description><pubDate>Wed, 23 Sep 2026 00:00:00 GMT</pubDate><category>buttons</category><category>theming</category></item><item><title>Parse JSON safely with map patterns</title><link>https://fluttersmith.github.io/tips/tips/json-pattern-matching/</link><guid isPermaLink="true">https://fluttersmith.github.io/tips/tips/json-pattern-matching/</guid><description>A switch on a map pattern checks keys and value types in one go, so bad JSON reaches your fallback case instead of a TypeError.</description><pubDate>Tue, 22 Sep 2026 00:00:00 GMT</pubDate><category>json</category><category>patterns</category><category>sealed-classes</category></item><item><title>Migrate a StateNotifier to a Notifier</title><link>https://fluttersmith.github.io/tips/tips/notifier-replaces-state-notifier/</link><guid isPermaLink="true">https://fluttersmith.github.io/tips/tips/notifier-replaces-state-notifier/</guid><description>StateNotifier now lives in legacy.dart. Moving to Notifier takes a few mechanical steps, and one behaviour change is worth knowing about.</description><pubDate>Mon, 21 Sep 2026 00:00:00 GMT</pubDate><category>riverpod</category><category>migration</category></item><item><title>Show real progress with a value on progress indicators</title><link>https://fluttersmith.github.io/tips/tips/determinate-progress/</link><guid isPermaLink="true">https://fluttersmith.github.io/tips/tips/determinate-progress/</guid><description>Give CircularProgressIndicator or LinearProgressIndicator a value from 0.0 to 1.0 and they show how far along you are instead of spinning.</description><pubDate>Sun, 20 Sep 2026 00:00:00 GMT</pubDate><category>progress</category><category>accessibility</category></item><item><title>Initialise async dependencies in main() and use requireValue</title><link>https://fluttersmith.github.io/tips/tips/require-value-async-init/</link><guid isPermaLink="true">https://fluttersmith.github.io/tips/tips/require-value-async-init/</guid><description>Await a FutureProvider once before runApp, then read it synchronously everywhere with requireValue. No loading states for things that are always ready.</description><pubDate>Sat, 19 Sep 2026 00:00:00 GMT</pubDate><category>riverpod</category><category>async</category></item><item><title>firstOrNull instead of try/catch on StateError</title><link>https://fluttersmith.github.io/tips/tips/first-or-null/</link><guid isPermaLink="true">https://fluttersmith.github.io/tips/tips/first-or-null/</guid><description>first, firstWhere and single throw when nothing matches. The OrNull versions return null, and the type system makes you handle it.</description><pubDate>Sat, 19 Sep 2026 00:00:00 GMT</pubDate><category>collections</category><category>null-safety</category></item><item><title>Make text selectable across widgets with SelectionArea</title><link>https://fluttersmith.github.io/tips/tips/selection-area/</link><guid isPermaLink="true">https://fluttersmith.github.io/tips/tips/selection-area/</guid><description>Wrap a subtree in SelectionArea and one selection runs across all its Text widgets. SelectionContainer.disabled carves out the parts to skip.</description><pubDate>Fri, 18 Sep 2026 00:00:00 GMT</pubDate><category>text</category></item><item><title>Pass arguments to a Notifier through its constructor</title><link>https://fluttersmith.github.io/tips/tips/notifier-with-arguments/</link><guid isPermaLink="true">https://fluttersmith.github.io/tips/tips/notifier-with-arguments/</guid><description>In Riverpod 3 a family notifier is a plain Notifier that takes its argument in the constructor, so every method can use it as a field.</description><pubDate>Thu, 17 Sep 2026 00:00:00 GMT</pubDate><category>riverpod</category><category>providers</category></item><item><title>Skip nulls in collection literals with ...? and ?value</title><link>https://fluttersmith.github.io/tips/tips/null-aware-elements/</link><guid isPermaLink="true">https://fluttersmith.github.io/tips/tips/null-aware-elements/</guid><description>The null-aware spread adds nothing for a null list, and a null-aware element leaves out a null entry, so you can drop the if (x != null).</description><pubDate>Wed, 16 Sep 2026 00:00:00 GMT</pubDate><category>collections</category><category>null-safety</category></item><item><title>React to the app going to the background with AppLifecycleListener</title><link>https://fluttersmith.github.io/tips/tips/app-lifecycle-listener/</link><guid isPermaLink="true">https://fluttersmith.github.io/tips/tips/app-lifecycle-listener/</guid><description>AppLifecycleListener gives you one named callback per lifecycle transition. No observer mixin needed, but you must dispose it.</description><pubDate>Tue, 15 Sep 2026 00:00:00 GMT</pubDate><category>lifecycle</category></item><item><title>Extension types vs extension methods</title><link>https://fluttersmith.github.io/tips/tips/extension-types/</link><guid isPermaLink="true">https://fluttersmith.github.io/tips/tips/extension-types/</guid><description>An extension method adds to a type. An extension type wraps it in a new static type, so a UserId can&apos;t be passed where an OrderId belongs.</description><pubDate>Mon, 14 Sep 2026 00:00:00 GMT</pubDate><category>extension-types</category><category>dart3</category><category>types</category></item><item><title>AsyncValue.guard instead of try/catch in notifiers</title><link>https://fluttersmith.github.io/tips/tips/async-value-guard/</link><guid isPermaLink="true">https://fluttersmith.github.io/tips/tips/async-value-guard/</guid><description>AsyncValue.guard runs a Future and hands back AsyncData or AsyncError, so notifier methods need no try/catch.</description><pubDate>Mon, 14 Sep 2026 00:00:00 GMT</pubDate><category>riverpod</category><category>errors</category></item><item><title>Replace Container with the widgets it wraps</title><link>https://fluttersmith.github.io/tips/tips/replace-container/</link><guid isPermaLink="true">https://fluttersmith.github.io/tips/tips/replace-container/</guid><description>Container is a bundle of Padding, ColoredBox, DecoratedBox, Align and SizedBox. Use those directly and the whole subtree can be const.</description><pubDate>Sun, 13 Sep 2026 00:00:00 GMT</pubDate><category>widgets</category><category>layout</category></item><item><title>Await several futures with a record&apos;s .wait</title><link>https://fluttersmith.github.io/tips/tips/future-wait-records/</link><guid isPermaLink="true">https://fluttersmith.github.io/tips/tips/future-wait-records/</guid><description>Future.wait gives you a List of Object. A record of futures with .wait keeps each type and tells you which one failed.</description><pubDate>Sat, 12 Sep 2026 00:00:00 GMT</pubDate><category>async</category><category>records</category><category>errors</category></item><item><title>Give buttons the same width with IntrinsicWidth</title><link>https://fluttersmith.github.io/tips/tips/intrinsic-width/</link><guid isPermaLink="true">https://fluttersmith.github.io/tips/tips/intrinsic-width/</guid><description>Wrap a Column in IntrinsicWidth and stretch its children, and every button matches the widest one, whatever the text size.</description><pubDate>Fri, 11 Sep 2026 00:00:00 GMT</pubDate><category>layout</category></item><item><title>One widget for AsyncValue loading and error states</title><link>https://fluttersmith.github.io/tips/tips/async-value-widget/</link><guid isPermaLink="true">https://fluttersmith.github.io/tips/tips/async-value-widget/</guid><description>Wrap AsyncValue in a small widget with a switch over AsyncData, AsyncError and AsyncLoading, and every async screen writes only its data UI.</description><pubDate>Fri, 11 Sep 2026 00:00:00 GMT</pubDate><category>riverpod</category><category>widgets</category></item><item><title>Destructure lists with list patterns</title><link>https://fluttersmith.github.io/tips/tips/destructure-lists/</link><guid isPermaLink="true">https://fluttersmith.github.io/tips/tips/destructure-lists/</guid><description>List patterns pull values out of a list by position, and a rest element skips or collects whatever sits in the middle.</description><pubDate>Thu, 10 Sep 2026 00:00:00 GMT</pubDate><category>patterns</category><category>collections</category><category>dart3</category></item><item><title>Which Riverpod 3 provider should you use?</title><link>https://fluttersmith.github.io/tips/tips/which-provider/</link><guid isPermaLink="true">https://fluttersmith.github.io/tips/tips/which-provider/</guid><description>Six providers cover almost every job in Riverpod 3. StateProvider, StateNotifierProvider and ChangeNotifierProvider now live in legacy.dart.</description><pubDate>Wed, 09 Sep 2026 00:00:00 GMT</pubDate><category>riverpod</category><category>providers</category><category>migration</category></item><item><title>Return SizedBox.shrink() when there is nothing to show</title><link>https://fluttersmith.github.io/tips/tips/sizedbox-shrink/</link><guid isPermaLink="true">https://fluttersmith.github.io/tips/tips/sizedbox-shrink/</guid><description>A build method must return a widget. For &quot;nothing&quot;, return const SizedBox.shrink(), not an empty Container.</description><pubDate>Wed, 09 Sep 2026 00:00:00 GMT</pubDate><category>widgets</category><category>layout</category></item><item><title>Return multiple values with a record</title><link>https://fluttersmith.github.io/tips/tips/records-multiple-returns/</link><guid isPermaLink="true">https://fluttersmith.github.io/tips/tips/records-multiple-returns/</guid><description>A record returns two or more values without a throwaway class, and destructuring unpacks them in one line at the call site.</description><pubDate>Tue, 08 Sep 2026 00:00:00 GMT</pubDate><category>records</category><category>patterns</category><category>dart3</category><category>types</category></item><item><title>ref.watch, ref.read or ref.listen?</title><link>https://fluttersmith.github.io/tips/tips/ref-watch-read-listen/</link><guid isPermaLink="true">https://fluttersmith.github.io/tips/tips/ref-watch-read-listen/</guid><description>Watch to rebuild, read for a one-off value inside a callback, listen to run side effects like SnackBars.</description><pubDate>Mon, 07 Sep 2026 00:00:00 GMT</pubDate><category>riverpod</category></item><item><title>Switch on a record to match several values at once</title><link>https://fluttersmith.github.io/tips/tips/switch-on-records/</link><guid isPermaLink="true">https://fluttersmith.github.io/tips/tips/switch-on-records/</guid><description>Put two or three values in a record and switch on it. Each case is a row in a table, instead of a tangle of if/else.</description><pubDate>Sun, 06 Sep 2026 00:00:00 GMT</pubDate><category>patterns</category><category>records</category><category>dart3</category></item><item><title>Use MediaQuery.sizeOf instead of MediaQuery.of</title><link>https://fluttersmith.github.io/tips/tips/mediaquery-sizeof/</link><guid isPermaLink="true">https://fluttersmith.github.io/tips/tips/mediaquery-sizeof/</guid><description>MediaQuery.of rebuilds your widget when anything changes. MediaQuery.sizeOf and friends rebuild only when the value you read changes.</description><pubDate>Sun, 06 Sep 2026 00:00:00 GMT</pubDate><category>performance</category><category>layout</category></item><item><title>The parts of a Riverpod 3 provider</title><link>https://fluttersmith.github.io/tips/tips/provider-anatomy/</link><guid isPermaLink="true">https://fluttersmith.github.io/tips/tips/provider-anatomy/</guid><description>A provider is a global variable, a type, a body that gets a Ref, and optional modifiers. Here is what each part does.</description><pubDate>Sat, 05 Sep 2026 00:00:00 GMT</pubDate><category>riverpod</category><category>providers</category></item><item><title>A Result type with a sealed class</title><link>https://fluttersmith.github.io/tips/tips/sealed-class-result/</link><guid isPermaLink="true">https://fluttersmith.github.io/tips/tips/sealed-class-result/</guid><description>Return success or failure instead of throwing, and let an exhaustive switch make sure every caller handles both.</description><pubDate>Fri, 04 Sep 2026 00:00:00 GMT</pubDate><category>sealed-classes</category><category>errors</category><category>patterns</category></item><item><title>Check context.mounted after every await</title><link>https://fluttersmith.github.io/tips/tips/context-mounted-async-gaps/</link><guid isPermaLink="true">https://fluttersmith.github.io/tips/tips/context-mounted-async-gaps/</guid><description>A BuildContext can go stale while you await. Check context.mounted before you use it again, or grab what you need first.</description><pubDate>Fri, 04 Sep 2026 00:00:00 GMT</pubDate><category>context</category><category>async</category></item><item><title>Getting a Future from a FutureProvider</title><link>https://fluttersmith.github.io/tips/tips/future-provider-future/</link><guid isPermaLink="true">https://fluttersmith.github.io/tips/tips/future-provider-future/</guid><description>Watch provider.future to await one async provider inside another, and combine the results with plain async code.</description><pubDate>Thu, 03 Sep 2026 00:00:00 GMT</pubDate><category>riverpod</category><category>providers</category><category>async</category></item><item><title>Column(spacing:) replaces a SizedBox between every child</title><link>https://fluttersmith.github.io/tips/tips/column-row-spacing/</link><guid isPermaLink="true">https://fluttersmith.github.io/tips/tips/column-row-spacing/</guid><description>Row, Column and Flex take a spacing value, so you no longer need a SizedBox or the gap package between children.</description><pubDate>Wed, 02 Sep 2026 00:00:00 GMT</pubDate><category>layout</category><category>widgets</category></item><item><title>Measure execution time with Stopwatch</title><link>https://fluttersmith.github.io/tips/tips/stopwatch-measure-time/</link><guid isPermaLink="true">https://fluttersmith.github.io/tips/tips/stopwatch-measure-time/</guid><description>DateTime.now() reads the wall clock, which can jump. Stopwatch can&apos;t, so use it to time code.</description><pubDate>Tue, 01 Sep 2026 00:00:00 GMT</pubDate><category>performance</category><category>async</category><category>records</category></item></channel></rss>