<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Frank Milvus</title>
    <description>The latest articles on DEV Community by Frank Milvus (@frankmilvus).</description>
    <link>https://dev.to/frankmilvus</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3933443%2Fecd1a0f7-f9e1-4a34-9344-702addcc858c.png</url>
      <title>DEV Community: Frank Milvus</title>
      <link>https://dev.to/frankmilvus</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/frankmilvus"/>
    <language>en</language>
    <item>
      <title>Flutter reconnect catch-up: the chat that stayed blank</title>
      <dc:creator>Frank Milvus</dc:creator>
      <pubDate>Wed, 25 Nov 2026 12:20:42 +0000</pubDate>
      <link>https://dev.to/frankmilvus/flutter-reconnect-catch-up-the-chat-that-stayed-blank-mm8</link>
      <guid>https://dev.to/frankmilvus/flutter-reconnect-catch-up-the-chat-that-stayed-blank-mm8</guid>
      <description>&lt;p&gt;You tap a message notification on a train, in a lift, in a basement café. The chat opens. The message is not there. The connection comes back, and the message is still not there. You leave the chat and open it again, and the message appears instantly.&lt;/p&gt;

&lt;p&gt;That last sentence is the bug report, and it is also the diagnosis. If re-entering fixes it, then entering was the only thing that ever fetched anything. Reopening a chat triggered a path that the app had no other way to reach. The work behind this fix was not about making the connection better — it was about giving the open chat a reason to ask for its history again. Flutter reconnect catch-up, in one sentence: when the socket says it is back, refetch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two client-side gaps, one symptom
&lt;/h2&gt;

&lt;p&gt;Neither of the two gaps looks like a bug in isolation.&lt;/p&gt;

&lt;p&gt;The first was that history was fetched once. When a chat opened, the controller hydrated from the local cache and then asked the server for the newest page. If that request failed — a timeout on a weak link is the ordinary case — the code fell back to the cache and stopped. That fallback is correct: showing a stale conversation beats showing an empty screen. What was missing was a second attempt. A failed fetch was treated as a final answer.&lt;/p&gt;

&lt;p&gt;The second was subtler. A socket that was already connected would never emit a reconnect event. So if the history request failed while the connection itself stayed up, nothing in the app was scheduled to try again: no reconnect, no retry, no second fetch. The chat sat on an empty cache with a healthy-looking connection indicator, which is the worst combination to debug from a user report.&lt;/p&gt;

&lt;p&gt;Add them together and you get the report exactly. The notification tap opens the chat during the weak spell; the fetch fails; the socket recovers without ever "reconnecting"; the failed fetch stays invisible.&lt;/p&gt;

&lt;h2&gt;
  
  
  "Connected" is not "in sync"
&lt;/h2&gt;

&lt;p&gt;Most realtime clients are built on an implicit assumption that the connection state is a proxy for the data state. It is a good assumption right up until the moment it is not.&lt;/p&gt;

&lt;p&gt;A socket being up tells you that future events can arrive. It says nothing about events that already happened while it was down. Our server does not replay what a client missed, so anything that occurred during the gap is simply absent from the client's view until something fetches it. The reconnect event is a hint that a gap may exist, not proof that it has been closed.&lt;/p&gt;

&lt;p&gt;That is why the fix belongs on the client. Server-side replay buffers are a fine design, but they change the contract for every client and every event type. A catch-up fetch is local, it uses the endpoint that already exists, and it produces the right result whether the gap was two seconds or two hours.&lt;/p&gt;

&lt;h2&gt;
  
  
  Flutter reconnect catch-up: refetch when the socket returns
&lt;/h2&gt;

&lt;p&gt;The controller already listened for connection state changes; it re-sent the signal that tells the server which chat is currently on screen. The change was to do the same thing a user does by re-entering the chat: reload the history.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;_onConnectionStateChanged&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_disposed&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nf"&gt;notifyListeners&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ws&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;connectionState&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="nc"&gt;WsConnectionState&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;connected&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;_isAppInForeground&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// see below&lt;/span&gt;
  &lt;span class="nf"&gt;_sendActiveChat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nf"&gt;unawaited&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;loadMessages&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two guards sit in front of the fetch, and both matter.&lt;/p&gt;

&lt;p&gt;The first is &lt;code&gt;_disposed&lt;/code&gt;. A controller that has been torn down must not start work, and a reconnect can arrive at an awkward moment.&lt;/p&gt;

&lt;p&gt;The second is the foreground check. Registering a chat as open is how the server knows not to send a notification for messages the user is already looking at. Doing that from the background would suppress notifications for a chat nobody is reading — the opposite of the intent. So the catch-up only runs while the chat is actually in front of someone. When the app comes back to the foreground with this chat still on top, the same loader runs again, and that is the case where catch-up matters most.&lt;/p&gt;

&lt;p&gt;The value of routing this through the existing load path is that there is only one loader. Catch-up, first open, a return to the foreground and a scheduled retry all end up in the same function, so a fix to one is a fix to all of them, and a bug in one is at least reproducible in the others.&lt;/p&gt;

&lt;h2&gt;
  
  
  A retry ladder that knows when to stop
&lt;/h2&gt;

&lt;p&gt;The reconnect hook fixes the case where the socket drops and comes back. It does not fix the case that started this: a socket that never drops while the fetch fails.&lt;/p&gt;

&lt;p&gt;So a failed history fetch now schedules a retry: two seconds, then four, eight, fifteen, thirty, and finally sixty. The list is deliberately short. Six attempts, capped at a minute apart, covers a tunnel or a lift ride without turning a broken network into a background poller. After the last delay, the retry stops and the chat stays on its cached content; the next reconnect, resume or manual entry starts the cycle fresh.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;_historyRetryDelaysSeconds&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three reset rules keep the ladder honest:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Success resets the counter.&lt;/strong&gt; A chat that recovers after two attempts and later fails again starts at two seconds, not at sixty.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Background cancels the timer.&lt;/strong&gt; Retrying from the background burns battery on a request the user cannot see, and on some platforms it will not run anyway.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A new attempt cancels the pending timer.&lt;/strong&gt; Any load — reconnect, resume, the user re-entering — makes the scheduled retry redundant, and two overlapping ladders would drift apart.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;dispose()&lt;/code&gt; cancels it too. A timer that outlives the chat is how you get a request for a conversation that no longer exists on screen, and a controller retained by a closure it should not have.&lt;/p&gt;

&lt;p&gt;This retry ladder is separate from the socket's own reconnection backoff. They are two different questions: how fast should the transport re-establish itself, and how fast should the data layer ask again? Coupling them would make one schedule serve two purposes badly.&lt;/p&gt;

&lt;h2&gt;
  
  
  One fetch at a time, three ways in
&lt;/h2&gt;

&lt;p&gt;At this point there are three triggers that can ask for history: a reconnect, a return to the foreground, and a scheduled retry. A user re-entering the chat makes four. Without coordination, a flaky link produces exactly the burst you would expect — several concurrent requests for the same page, each one racing the others into the message list.&lt;/p&gt;

&lt;p&gt;The controller already had an in-flight guard, and it does the work here. If a load is running, a second call does not start another fetch. It records that a follow-up refresh was requested and returns the running operation's future, so every caller waits for the same result instead of racing.&lt;/p&gt;

&lt;p&gt;The follow-up flag matters as much as the guard. "Ignore this call" would drop a legitimate refresh that arrived after the in-flight request had already read its data. "Queue one more" keeps the newest trigger meaningful without opening a second connection to the server.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_loadingMessages&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;_reloadMessagesRequested&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;_loadMessagesCompleter&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;future&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="nc"&gt;Future&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;value&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A detail worth keeping: callers await that future. A first load that returns early while the list is still empty makes the view flash its "no messages yet" state before the data lands, which reads as a different bug entirely.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the tests pin down
&lt;/h2&gt;

&lt;p&gt;Two regressions cover the report directly, both in the initial-load suite:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An offline first load followed by a socket reconnect delivers the history without the user reopening the chat.&lt;/li&gt;
&lt;li&gt;A failed fetch while the socket stays connected is recovered by the bounded retry.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The second test needs the backoff curve to be compressible; waiting real seconds in a widget test is not an option, so the delay function has a test seam that maps the attempts to milliseconds. That seam is the difference between a retry that is tested and a retry that is merely written.&lt;/p&gt;

&lt;p&gt;The first test is the one I care about most, because it encodes the lesson rather than the mechanism: the chat must recover from a reconnect on its own, without the user performing the workaround.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this does not fix
&lt;/h2&gt;

&lt;p&gt;The catch-up fetch assumes the server can answer it. If the server's own view of the conversation is incomplete — events that never reached it, state that is simply behind — refetching will return the same incomplete truth, and no amount of client retrying changes that. Keeping the two cases apart matters: our fix makes the client stop being the reason a message is missing. It does not make the backend perfect.&lt;/p&gt;

&lt;p&gt;It also does not make the local cache smarter. A cache that is behind is still held back instead of being shown as current, and a cache that is ahead simply reflects what arrived while the app was open. The reconnect fetch is what reconciles both.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rules I would keep for any realtime client
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Treat "connected" as permission to fetch, not evidence of freshness.&lt;/strong&gt; The transport knows about the future, not the past.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Give the open screen a catch-up path.&lt;/strong&gt; Reconnect, resume and retry should all funnel into the same loader, so there is one behaviour to reason about.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bound the retries.&lt;/strong&gt; A short ladder with a hard stop looks after the battery and still survives a tunnel.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reset on success, cancel on background, cancel on dispose.&lt;/strong&gt; Three lines that prevent a retry from becoming a poller.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Coalesce the triggers.&lt;/strong&gt; An in-flight guard plus a queued follow-up is enough; concurrent fetches for the same page are never worth it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test the recovery, not the timer.&lt;/strong&gt; The assertion that matters is that the message appears after a reconnect, not that a &lt;code&gt;Timer&lt;/code&gt; was constructed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We wrote about a similar instinct in &lt;a href="https://frankmilvus.github.io/folcadi-articles/articles/2026-10-29-flutter-webrtc-calls-that-never-connected.html" rel="noopener noreferrer"&gt;the post on calls that never connected&lt;/a&gt;: in a realtime feature, the interesting failures are almost never in the happy path, they are in the recovery path that was never exercised.&lt;/p&gt;

&lt;p&gt;The user-visible outcome is small and worth stating plainly: a chat opened from a notification on a bad connection now fills itself in when the connection recovers. No re-entry, no force close, no waiting for the next message to arrive and pull the history with it.&lt;/p&gt;

&lt;p&gt;What is the last bug in your app that a user could "fix" by closing and reopening the screen? That workaround is usually a missing recovery path wearing a disguise.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Get Folcadi&lt;/strong&gt; — a language-exchange messenger with live translation.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Official website:&lt;/strong&gt; &lt;a href="https://folcadi.com" rel="noopener noreferrer"&gt;folcadi.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Android:&lt;/strong&gt; &lt;a href="https://play.google.com/store/apps/details?id=com.folcadi.app" rel="noopener noreferrer"&gt;Google Play&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Windows:&lt;/strong&gt; &lt;a href="https://github.com/FrankMilvus/folcadi-releases/releases/latest" rel="noopener noreferrer"&gt;.zip or installer&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Linux:&lt;/strong&gt; &lt;a href="https://github.com/FrankMilvus/folcadi-releases/releases/latest" rel="noopener noreferrer"&gt;.deb or portable tarball&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Articles:&lt;/strong&gt; &lt;a href="https://frankmilvus.github.io/folcadi-articles/" rel="noopener noreferrer"&gt;write-ups and covers&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Telegram:&lt;/strong&gt; &lt;a href="https://t.me/frank_says" rel="noopener noreferrer"&gt;@frank_says&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Facebook:&lt;/strong&gt; &lt;a href="https://facebook.com/FrankMilvusSays" rel="noopener noreferrer"&gt;facebook.com/FrankMilvusSays&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>showdev</category>
      <category>flutter</category>
      <category>websocket</category>
      <category>reliability</category>
    </item>
    <item>
      <title>The app that never started: a Flutter Wayland deadlock</title>
      <dc:creator>Frank Milvus</dc:creator>
      <pubDate>Tue, 24 Nov 2026 12:21:13 +0000</pubDate>
      <link>https://dev.to/frankmilvus/the-app-that-never-started-a-flutter-wayland-deadlock-36p5</link>
      <guid>https://dev.to/frankmilvus/the-app-that-never-started-a-flutter-wayland-deadlock-36p5</guid>
      <description>&lt;p&gt;Sometimes the app did not start. Not a crash, not an error dialog — nothing. No window, no splash, no log line, no spinner. Clicking the icon again a few seconds later worked, which is exactly what makes this class of bug so easy to misread: it looks like a slow cold start, so you learn to click twice.&lt;/p&gt;

&lt;p&gt;It is not a slow start. It is a deadlock, and the app was never going to appear no matter how long you waited.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a hang looks like from the outside
&lt;/h2&gt;

&lt;p&gt;Three observations eventually lined up:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The launch produced no window at all. Not a white window, not a frozen splash — nothing was ever mapped.&lt;/li&gt;
&lt;li&gt;The process was not idle. A launch that had hung sat at roughly ten percent of one core, for minutes.&lt;/li&gt;
&lt;li&gt;A second launch worked. That is what let it survive in the wild: the workaround is one extra click, and the failure leaves no trace unless you go looking.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The third point is the trap. A bug whose workaround is "try again" gets reported as "sometimes slow", and slow starts do not get debugged.&lt;/p&gt;

&lt;h2&gt;
  
  
  The log tells you nothing; the threads do
&lt;/h2&gt;

&lt;p&gt;The app had no output, because a desktop launch sends stdout and stderr to nowhere by default. There was nothing to read. But the process was still alive, so there was a different source of truth: its threads.&lt;/p&gt;

&lt;p&gt;Two full thread dumps, ten minutes apart, were identical. That is the definition of a hang — a live process that has stopped making progress.&lt;/p&gt;

&lt;p&gt;The raster thread, the one that submits frames to the GPU:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ppoll
wl_display_dispatch_queue_timeout
wl_display_roundtrip_queue
???  (Mesa EGL, Wayland platform)
driBindContext
eglMakeCurrent
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And the GTK main thread, the one that owns the window:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;syscall  (futex)
g_mutex_lock
???  (Flutter's GTK embedder)
gtk_widget_size_allocate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read together, they describe a cycle. The raster thread is inside a Wayland roundtrip during &lt;code&gt;eglMakeCurrent&lt;/code&gt;, holding the renderer's frame lock. The main thread is inside size allocation, blocked on that same lock. Each is waiting for the other, and neither will let go.&lt;/p&gt;

&lt;p&gt;That also explains something the symptom did not: the native splash could not save us. The window is mapped with that splash before Flutter paints anything — but mapping goes through the same GTK main loop, which is inside the deadlock. Even the runner's fifteen-second "remove the splash anyway" fallback is a timer on that loop. A frozen main loop freezes the safety net with it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The part that made it not our bug
&lt;/h2&gt;

&lt;p&gt;The deadlock is in the Flutter engine's Linux embedder, and it arrived with a specific release. Flutter 3.50 made a new Wayland renderer the default: frames are presented to a child subsurface instead of being copied through GTK. It is a real improvement when it works — but on this release it also introduced two lock cycles, both tracked upstream:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;an intermittent freeze at startup, with exactly the stack above (raster thread spinning in &lt;code&gt;eglMakeCurrent&lt;/code&gt; / &lt;code&gt;wl_display_roundtrip_queue&lt;/code&gt;, main thread in &lt;code&gt;syscall&lt;/code&gt;), reported across several compositors and GPU drivers (&lt;a href="https://github.com/flutter/flutter/issues/196529" rel="noopener noreferrer"&gt;flutter#196529&lt;/a&gt;);&lt;/li&gt;
&lt;li&gt;a deterministic deadlock on the &lt;strong&gt;second&lt;/strong&gt; window resize, reported on niri (&lt;a href="https://github.com/flutter/flutter/issues/196663" rel="noopener noreferrer"&gt;flutter#196663&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The same app on the previous stable release does neither. Once we matched our thread dump to the upstream report line for line, we stopped looking for a bug in our own code.&lt;/p&gt;

&lt;p&gt;It is worth being precise about what that means. There was nothing to fix in our Dart, our plugins, or our startup sequence. Our app was the messenger: it launches a window, and the renderer that arrives with the window can wedge itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why we did not ship a retry
&lt;/h2&gt;

&lt;p&gt;The obvious product answer is a watchdog: if no frame has been presented after N seconds, kill the process and start it again. It is also the wrong answer here, for four reasons.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It is recovery, not a fix.&lt;/strong&gt; Every affected launch still costs the user the full timeout, then a restart. Making the bug survivable is not the same as removing it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The detector lives inside the corpse.&lt;/strong&gt; A Dart timer keeps running while the GTK and raster threads are deadlocked, so a watchdog would fire &lt;em&gt;for this particular cycle&lt;/em&gt;. But it fires only because one specific pair of threads is stuck. A variant that also blocks the UI thread would leave the watchdog silently armed and useless, which is worse than no watchdog: it looks like protection.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The relaunch races the zombie.&lt;/strong&gt; The dead process is still alive, still holding the app's data directory, preferences and session. Starting a second instance before the first is really gone is how you get two writers and a corrupted settings file. Making that safe means a reliable kill and hand-off, plus argv, working directory and environment handling for a bundle executable — a lot of machinery for a temporary upstream bug.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It never leaves.&lt;/strong&gt; When upstream ships the fix, the watchdog has to be removed, or every launch keeps a self-restart mechanism nobody can connect to anything.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we shipped
&lt;/h2&gt;

&lt;p&gt;An environment answer to an environment bug: &lt;strong&gt;start the app on XWayland when the session offers it.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;On a Wayland session that also has an X display, the runner sets &lt;code&gt;GDK_BACKEND=x11&lt;/code&gt; before GTK initializes. That selects the long-stable GTK renderer, which presents frames the way every pre-3.50 build did. The subsurface renderer is never instantiated, so neither the startup lock nor the resize lock exists. The rule is deliberately narrow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;only when the session has both a Wayland display and an X display, so a Wayland-only desktop still starts normally;&lt;/li&gt;
&lt;li&gt;never over a backend the user chose: &lt;code&gt;GDK_BACKEND=wayland&lt;/code&gt; keeps native Wayland, and is the opt-out;&lt;/li&gt;
&lt;li&gt;one log line when it happens, so the decision is visible instead of magic.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Native Wayland is the better renderer, and we want it back. This buys us a working app until the engine fix reaches our Flutter pin, and it is two small changes to delete afterwards.&lt;/p&gt;

&lt;p&gt;There was a second, smaller surprise, and then a third.&lt;/p&gt;

&lt;p&gt;On X11, GTK's template logic gives the window a traditional title bar instead of its own header bar whenever the window manager is not GNOME. That is fine where a window manager draws decorations — and useless on a Wayland compositor whose XWayland layer draws none. The first XWayland build came up with no title bar and no close button at all.&lt;/p&gt;

&lt;p&gt;The obvious patch was to keep GTK's header bar on any XWayland window. It restored the close button and looked wrong: the reason the window had no frame in the first place is a decoration protocol that only Wayland clients negotiate, so the compositor's "no decorations" setting was simply ignored. GTK drew its own title bar and its client-side shadow ring, and with the theme falling back to a stock light Adwaita it read as a white frame around an app that is otherwise black.&lt;/p&gt;

&lt;p&gt;The same session had the other half of the problem. GTK cannot scale fractionally, and on X11 the widget scale factor comes from one environment variable that defaults to 1. The compositor's 1.8 scale reaches X11 only as a DPI value, which GTK applies to font metrics rather than to widgets, so the engine reported a device pixel ratio of 1.0 and laid the UI out at the full physical width: a whole app, drawn about 45 % too small, inside a correctly sized window.&lt;/p&gt;

&lt;p&gt;Both are handled in the runner now. When XWayland has no window manager behind it — a compositor's satellite, which is exactly the decoration-less case — the window stays borderless, so it looks the way it does on native Wayland. And the X11 DPI is rounded to the nearest integer and exported as &lt;code&gt;GDK_SCALE&lt;/code&gt; before GTK starts, so the window scales like any other HiDPI X11 app. At 1.8 that means 2: one step wide, which is the closest an integer-scaled toolkit gets.&lt;/p&gt;

&lt;h2&gt;
  
  
  How we checked it
&lt;/h2&gt;

&lt;p&gt;The fix was verified on the machine it was diagnosed on — a Wayland session on niri with Mesa and an AMD iGPU, which is one of the reported environments:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;repeated launches, each one mapping its window (the failing behaviour was the &lt;em&gt;first&lt;/em&gt; launch of a session);&lt;/li&gt;
&lt;li&gt;the automatic backend switch visible in the log, with no &lt;code&gt;GDK_BACKEND&lt;/code&gt; set by hand;&lt;/li&gt;
&lt;li&gt;the window reaching the app's first screen;&lt;/li&gt;
&lt;li&gt;and, after the scale and decoration follow-up, a borderless window whose widgets match the output scale — the same screen captured at a pixel ratio of 1 and at 2 is the difference between a shrunken app and the intended one.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One honest limit: this bug is intermittent, so a few successful launches are evidence, not proof. What makes the claim stronger is that the deadlocking code path is not merely avoided by timing — the fallback selects a renderer that does not contain the cycle at all.&lt;/p&gt;

&lt;h2&gt;
  
  
  What happens next
&lt;/h2&gt;

&lt;p&gt;The workaround has an exit condition, written down with the code so it does not quietly become permanent:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Upgrade Flutter only to a release that actually contains the upstream fix, and read the notes rather than trusting the version number.&lt;/li&gt;
&lt;li&gt;Rebuild and run with the fallback disabled, on Wayland.&lt;/li&gt;
&lt;li&gt;Launch it many times — the startup failure is intermittent — and then resize the window twice, since the second resize is the deterministic case.&lt;/li&gt;
&lt;li&gt;Only then delete the fallback, the scale derivation and the borderless rule.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Until then, the app starts the reliable way.&lt;/p&gt;

&lt;h2&gt;
  
  
  The lesson that outlives the bug
&lt;/h2&gt;

&lt;p&gt;A process that renders nothing, logs nothing and still burns CPU is not idle. It is doing something, and on Linux you can always ask it what: two thread dumps a few minutes apart will tell you whether it is working or waiting, and on what. In this case the answer — a renderer lock and a compositor roundtrip holding each other — was the entire diagnosis.&lt;/p&gt;

&lt;p&gt;Two thread dumps beat one. And a workaround that names its own exit condition beats a clever one that does not.&lt;/p&gt;

&lt;p&gt;If you are building a Flutter desktop app on Wayland: check which renderer your engine release selects before you blame your own code for a launch that never completes.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Get Folcadi&lt;/strong&gt; — a language-exchange messenger with live translation.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Official website:&lt;/strong&gt; &lt;a href="https://folcadi.com" rel="noopener noreferrer"&gt;folcadi.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Android:&lt;/strong&gt; &lt;a href="https://play.google.com/store/apps/details?id=com.folcadi.app" rel="noopener noreferrer"&gt;Google Play&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Windows:&lt;/strong&gt; &lt;a href="https://github.com/FrankMilvus/folcadi-releases/releases/latest" rel="noopener noreferrer"&gt;.zip or installer&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Linux:&lt;/strong&gt; &lt;a href="https://github.com/FrankMilvus/folcadi-releases/releases/latest" rel="noopener noreferrer"&gt;.deb or portable tarball&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Articles:&lt;/strong&gt; &lt;a href="https://frankmilvus.github.io/folcadi-articles/" rel="noopener noreferrer"&gt;write-ups and covers&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Telegram:&lt;/strong&gt; &lt;a href="https://t.me/frank_says" rel="noopener noreferrer"&gt;@frank_says&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Facebook:&lt;/strong&gt; &lt;a href="https://facebook.com/FrankMilvusSays" rel="noopener noreferrer"&gt;facebook.com/FrankMilvusSays&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>showdev</category>
      <category>flutter</category>
      <category>linux</category>
      <category>wayland</category>
    </item>
    <item>
      <title>AI tutors in chat now</title>
      <dc:creator>Frank Milvus</dc:creator>
      <pubDate>Sun, 22 Nov 2026 13:33:40 +0000</pubDate>
      <link>https://dev.to/frankmilvus/ai-tutors-in-chat-now-5dg2</link>
      <guid>https://dev.to/frankmilvus/ai-tutors-in-chat-now-5dg2</guid>
      <description>&lt;p&gt;AI language tutors are being tested in Folcadi: soon you’ll be able to find one in search and start practising. Clearly marked as AI — more soon.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>learning</category>
      <category>tutorial</category>
      <category>development</category>
    </item>
    <item>
      <title>Folcadi bots: give your chat a small, scriptable assistant</title>
      <dc:creator>Frank Milvus</dc:creator>
      <pubDate>Sat, 21 Nov 2026 11:51:19 +0000</pubDate>
      <link>https://dev.to/frankmilvus/folcadi-bots-give-your-chat-a-small-scriptable-assistant-8o7</link>
      <guid>https://dev.to/frankmilvus/folcadi-bots-give-your-chat-a-small-scriptable-assistant-8o7</guid>
      <description>&lt;p&gt;A bot is a chat participant with its own identity: a name, a handle, and a&lt;br&gt;
small inbox. It does not need a phone, a session, or a screen. You create it&lt;br&gt;
inside Folcadi, copy a token once, and then any script you can run — on a&lt;br&gt;
laptop, a Raspberry Pi, or a server — can read its messages and answer them.&lt;/p&gt;

&lt;p&gt;This is the first release of that feature. It covers private chats and groups,&lt;br&gt;
text messages, and a small HTTP API with long polling. No SDK, no webhook URL,&lt;br&gt;
and no public server required to get started.&lt;/p&gt;
&lt;h2&gt;
  
  
  Create a bot in the app
&lt;/h2&gt;

&lt;p&gt;Open &lt;strong&gt;More → Bots&lt;/strong&gt; and tap &lt;strong&gt;+&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Username&lt;/strong&gt; — lowercase, ends in &lt;code&gt;bot&lt;/code&gt;, for example &lt;code&gt;weatherbot&lt;/code&gt;. This is the
handle people use to find and mention the bot.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Name&lt;/strong&gt; — the display name shown in chats.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Description&lt;/strong&gt; — one or two lines shown on the bot's profile.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The next screen shows the &lt;strong&gt;API token&lt;/strong&gt;. It is displayed exactly once. Copy it&lt;br&gt;
and store it in your script's environment, not in the source code. The token is&lt;br&gt;
the only credential the bot has; the app keeps a prefix so you can recognise it&lt;br&gt;
later, but it can never show the secret again.&lt;/p&gt;

&lt;p&gt;If the token leaks, open the bot and choose &lt;strong&gt;Regenerate token&lt;/strong&gt;. The old one&lt;br&gt;
stops working immediately and a new one is shown once. You can also delete the&lt;br&gt;
bot from the same screen; its token is revoked and its group memberships are&lt;br&gt;
cleaned up.&lt;/p&gt;

&lt;p&gt;From the bot screen you can also start a private chat. A bot cannot open a chat&lt;br&gt;
with a person first — the person has to open it.&lt;/p&gt;
&lt;h2&gt;
  
  
  The API at a glance
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Base URL:  https://api.folcadi.com/v1/bot
Auth:      Authorization: Bearer &amp;lt;token&amp;gt;
Transport: HTTPS, POST, JSON
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Every response uses the same envelope:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"ok"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"result"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and errors look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"ok"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"error_code"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;403&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"bot is not a member of this chat"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first release exposes five methods:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;getMe&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;identity check: id, username, name, description&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;getChats&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;every private chat and group the bot is in&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;getChat&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;one chat, with member count and the bot's role&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;getUpdates&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;long-poll for new messages&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sendMessage&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;send a text message&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Calls are ordinary POSTs with a JSON body. A minimal check:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -sS https://api.folcadi.com/v1/bot/getMe \
  -H &lt;span class="s2"&gt;"Authorization: Bearer &amp;lt;TOKEN&amp;gt;"&lt;/span&gt; \
  -H &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; -d &lt;span class="s1"&gt;'{}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"ok"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"result"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;123&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"username"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"weatherbot"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Weather"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Daily forecasts"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"picture_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Reading messages without a public server
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;getUpdates&lt;/code&gt; is a long poll. You send the cursor you have already processed and&lt;br&gt;
the method waits up to 25 seconds for the next message:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"offset"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"limit"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"timeout"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It returns a page of updates and the cursor for the next call:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"ok"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"result"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"updates"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;"update_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;31804&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nl"&gt;"chat_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;77&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nl"&gt;"chat_type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"private"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nl"&gt;"chat_title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Alice"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nl"&gt;"peer_user_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;41&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nl"&gt;"from_user_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;41&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nl"&gt;"from_name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Alice"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nl"&gt;"message_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;9142&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nl"&gt;"text"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"hello bot"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nl"&gt;"is_command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nl"&gt;"mentions_bot"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nl"&gt;"reply_to_message_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nl"&gt;"reply_to_bot"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nl"&gt;"created_at"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"2026-11-21T10:12:33+00:00"&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"next_offset"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;31805&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two rules keep the cursor correct:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Use &lt;code&gt;next_offset&lt;/code&gt; from this response.&lt;/strong&gt; It advances past the updates you
just received.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Never use a message id from &lt;code&gt;sendMessage&lt;/code&gt; as an offset.&lt;/strong&gt; Update ids and
message ids are different things. A bot that polls, sends a reply, and then
adopts the reply's message id as its cursor can silently skip a user message
that arrived in between.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If there is nothing new, the call waits and then returns an empty list with the&lt;br&gt;
same offset. That is normal. Poll again.&lt;/p&gt;
&lt;h2&gt;
  
  
  Sending a message
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"chat_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;77&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"text"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Sunny tomorrow, light wind from the west."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"reply_to_message_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;9142&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;code&gt;reply_to_message_id&lt;/code&gt; is optional. &lt;code&gt;chat_id&lt;/code&gt; is the conversation id from&lt;br&gt;
&lt;code&gt;getChats&lt;/code&gt; or from an update — for a private chat it is not the same as the&lt;br&gt;
person's user id, so use the ids the API gives you.&lt;/p&gt;

&lt;p&gt;Text is limited to 4096 characters. Messages go through the same delivery path&lt;br&gt;
as a human message, so the recipient gets the normal chat preview, unread count&lt;br&gt;
and notification.&lt;/p&gt;
&lt;h2&gt;
  
  
  A tiny echo bot
&lt;/h2&gt;

&lt;p&gt;This is enough to see the whole loop: read, decide, reply.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;

&lt;span class="no"&gt;BASE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"https://api.folcadi.com/v1/bot"&lt;/span&gt;
&lt;span class="no"&gt;HEADERS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"Authorization"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"Bearer {os.environ['FOLCADI_BOT_TOKEN']}"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"{BASE}/{method}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="no"&gt;HEADERS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;40&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;payload&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"ok"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;RuntimeError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"result"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;


&lt;span class="n"&gt;offset&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;page&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"getUpdates"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;offset&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;offset&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;25&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;update&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"updates"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;update&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="s2"&gt;"message"&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;update&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"text"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;continue&lt;/span&gt;
        &lt;span class="nf"&gt;call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="s2"&gt;"sendMessage"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;chat_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;update&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"chat_id"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"echo: {update['text']}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;offset&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"next_offset"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run it with the token in the environment, open a chat with the bot in the app,&lt;br&gt;
and type. The bot answers. Nothing else is required: no port forwarding, no&lt;br&gt;
public URL, no webhook registration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Groups
&lt;/h2&gt;

&lt;p&gt;A bot can be a member of a group. Open the group's info screen and use the&lt;br&gt;
&lt;strong&gt;robot button&lt;/strong&gt; next to &lt;em&gt;Add members&lt;/em&gt;. Pick one of your bots and choose what it&lt;br&gt;
may read:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Only mentions and commands&lt;/strong&gt; — the bot receives &lt;code&gt;@username&lt;/code&gt; mentions,
&lt;code&gt;/commands&lt;/code&gt;, and replies to its own messages. This is the default.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;All messages&lt;/strong&gt; — the bot receives every human message in the group.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The choice is deliberate, and it is visible in the group. A bot can never read&lt;br&gt;
messages that were sent before it joined, and it never receives another bot's&lt;br&gt;
messages.&lt;/p&gt;

&lt;p&gt;If the group is announce-only, a normal member cannot post — including a bot.&lt;br&gt;
Promote the bot to group admin in the member list, and it can reply. Promotion&lt;br&gt;
also gives the bot full visibility, which is why it is an explicit action.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the first release does not do
&lt;/h2&gt;

&lt;p&gt;It is better to be precise than to promise everything at once:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Text only.&lt;/strong&gt; Images, files and voice messages are not part of this release.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No bot-to-bot messages.&lt;/strong&gt; A bot never receives another bot's output, which
removes the easiest way to build an accidental infinite loop.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No encrypted chats.&lt;/strong&gt; Bots work in ordinary private chats and groups.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No webhooks yet.&lt;/strong&gt; Long polling is the supported delivery mode; it needs no
public endpoint and works from a home network.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A small bot quota per account.&lt;/strong&gt; It is a starter allowance, not a limit on
what one bot can do.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where to find everything
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;In the app:&lt;/strong&gt; &lt;strong&gt;More → Bots&lt;/strong&gt; is the source of truth. It shows your bots,
the token prefix, when the token was last used, and the buttons to regenerate,
delete, or start a chat.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;API base:&lt;/strong&gt; &lt;code&gt;https://api.folcadi.com/v1/bot&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;This article:&lt;/strong&gt; the quick reference for the five methods and the update
shape.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The app is available on Android, Windows and Linux. Create a bot, copy the token&lt;br&gt;
once, and run the echo script. The first message is the hard part; after that it&lt;br&gt;
is just a loop.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Do I need a server?&lt;/strong&gt;&lt;br&gt;
No. Long polling works from any machine that can make outbound HTTPS requests.&lt;br&gt;
A laptop that sleeps will miss polls until it wakes, but nothing is lost — the&lt;br&gt;
next call returns the messages after your cursor.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can the bot message me first?&lt;/strong&gt;&lt;br&gt;
No. A person opens the private chat first. This is the main anti-spam rule.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can I use the same bot in several groups?&lt;/strong&gt;&lt;br&gt;
Yes, within a small per-bot group allowance. Each group has its own privacy&lt;br&gt;
mode.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What happens if I lose the token?&lt;/strong&gt;&lt;br&gt;
Open the bot and regenerate it. The old token dies immediately and the new one&lt;br&gt;
is shown once.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can the bot read messages from before it joined?&lt;/strong&gt;&lt;br&gt;
No. The history cutoff is set when the bot is added.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can a bot own a group?&lt;/strong&gt;&lt;br&gt;
No. A bot can be a member or an admin, never the owner.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can I run two bots in one group?&lt;/strong&gt;&lt;br&gt;
Yes. In the default privacy mode each bot only reacts to its own mentions,&lt;br&gt;
commands and replies, so they do not step on each other.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Get Folcadi&lt;/strong&gt; — a language-exchange messenger with live translation.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Official website:&lt;/strong&gt; &lt;a href="https://folcadi.com" rel="noopener noreferrer"&gt;folcadi.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Android:&lt;/strong&gt; &lt;a href="https://play.google.com/store/apps/details?id=com.folcadi.app" rel="noopener noreferrer"&gt;Google Play&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Windows and Linux:&lt;/strong&gt; &lt;a href="https://github.com/FrankMilvus/folcadi-releases/releases/latest" rel="noopener noreferrer"&gt;desktop downloads&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Articles:&lt;/strong&gt; &lt;a href="https://frankmilvus.github.io/folcadi-articles/" rel="noopener noreferrer"&gt;write-ups and covers&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>showdev</category>
      <category>api</category>
      <category>bots</category>
      <category>python</category>
    </item>
    <item>
      <title>A floating glass dock: a Flutter nav bar that never spans the screen</title>
      <dc:creator>Frank Milvus</dc:creator>
      <pubDate>Fri, 20 Nov 2026 11:18:09 +0000</pubDate>
      <link>https://dev.to/frankmilvus/a-floating-glass-dock-a-flutter-nav-bar-that-never-spans-the-screen-9hc</link>
      <guid>https://dev.to/frankmilvus/a-floating-glass-dock-a-flutter-nav-bar-that-never-spans-the-screen-9hc</guid>
      <description>&lt;p&gt;A floating navigation bar in Flutter is usually a rounded &lt;code&gt;BottomNavigationBar&lt;/code&gt; with a shadow and a bit of padding. Ours is a 420 dp glass pill, lifted off the bottom edge, with a truly transparent background so a &lt;code&gt;BackdropFilter&lt;/code&gt; can frost whatever scrolls underneath it. On a phone it is a compact centred card; on a 1920 dp desktop window it stays exactly the same width instead of stretching into a stock-looking strip.&lt;/p&gt;

&lt;p&gt;The interesting part is not the pill. It is everything the pill drags with it: a safe-area inset that was being counted twice, a border that changed the card's height by one pixel, floating buttons in nested pages that fell behind it, and a scroll reserve that had to collapse when the keyboard appeared.&lt;/p&gt;

&lt;h2&gt;
  
  
  The bar became a dock
&lt;/h2&gt;

&lt;p&gt;The old bar was full width, docked to the edge, with a border on top and square bottom corners. It was the one piece of chrome in the app that ignored the floating-card language used by the chat bars. The replacement keeps the navigation behaviour identical and changes only geometry, which is a good trade: users notice the shape instantly and never notice that nothing else moved.&lt;/p&gt;

&lt;p&gt;Four tokens define it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;kNavDockHeight&lt;/code&gt; is 64 dp: a 56 dp icon row plus 4 dp of padding above and below.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;kNavDockMaxWidth&lt;/code&gt; is 420 dp. The dock is &lt;code&gt;min(windowWidth - 24, 420)&lt;/code&gt; wide and centred.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;kNavDockSideMargin&lt;/code&gt; is 12 dp, the same margin the chat header uses.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;kNavDockGap&lt;/code&gt; is 8 dp above the device's bottom inset.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The inset itself is never painted inside the card. The dock is lifted by &lt;code&gt;inset + gap&lt;/code&gt; as a bottom padding, so the rounded shape always sits on the content rather than being clipped by the home-indicator strip.&lt;/p&gt;

&lt;p&gt;The corner radius reuses the app's configurable card radius, clamped to half the dock's height. A user who sets very round cards gets a stadium; the clamp stops an extreme value from turning the dock into an oval.&lt;/p&gt;

&lt;h2&gt;
  
  
  No fill, no shadow, no elevation
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;GlassSurface&lt;/code&gt; defaults to no fill and no drop shadow. For the dock, that is not a stylistic preference — it is the feature. A fill would hide the content the blur is meant to soften, and a box shadow behind a transparent interior shows through as a grey haze around the buttons.&lt;/p&gt;

&lt;p&gt;So the Material bar underneath is stripped of its own appearance:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="nc"&gt;NavigationBar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;kNavDockIconRowHeight&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;backgroundColor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Colors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;transparent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;indicatorColor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Colors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;transparent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;shadowColor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Colors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;transparent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;elevation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;surfaceTintColor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Colors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;transparent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Everything visible comes from the glass surface, the hairline, the destination buttons and the active orb. That is also why the built-in indicator is transparent: Material's indicator can only paint a flat fill, and the dock wants a soft, glowing orb that can slide between destinations.&lt;/p&gt;

&lt;p&gt;The cost is real and worth stating: a backdrop filter over a 420 × 64 pill forces the backdrop to be saved every frame while the page scrolls. If a low-end Android device shows jank, lower the blur sigma before you consider adding a fill. Adding a fill fixes the jank by removing the effect you wanted.&lt;/p&gt;

&lt;h2&gt;
  
  
  The safe-area inset was being counted twice
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;NavigationBar&lt;/code&gt; wraps itself in a &lt;code&gt;SafeArea&lt;/code&gt;, which adds the bottom inset inside the pill. The dock also adds that inset, as its bottom margin, to keep the card off the home indicator. Left alone, the card grew by the inset a second time and the reserved slot no longer matched the card.&lt;/p&gt;

&lt;p&gt;The fix is to remove the copied padding before the bar sees it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="nc"&gt;MediaQuery&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;removePadding&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;removeLeft&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;removeRight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;removeBottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;child&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;NavigationBar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Left and right go too, for a different reason. The pill is already inset and centred inside the window, so a display cutout's side inset would squeeze the destinations and desynchronise the orb's measured position. The dock owns its horizontal geometry; the system inset should not get a second vote.&lt;/p&gt;

&lt;h2&gt;
  
  
  One clearance for a floating navigation bar in Flutter
&lt;/h2&gt;

&lt;p&gt;There are two places a page can live: inside the four-tab shell, or inside the shell used for pushed pages such as Settings and About. Both now use the same &lt;code&gt;Scaffold&lt;/code&gt;, with &lt;code&gt;extendBody: true&lt;/code&gt;, the same &lt;code&gt;NavDockBody&lt;/code&gt; wrapper and the same dock. That is what makes the dock identical on every screen instead of only on the tabs.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;NavDockBody&lt;/code&gt; raises the body's &lt;code&gt;MediaQuery&lt;/code&gt; bottom padding to the clearance and inserts a &lt;code&gt;NavDockScope&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="nf"&gt;navDockClearance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;BuildContext&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;media&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;MediaQuery&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;of&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;media&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;viewInsets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bottom&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;media&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;viewPadding&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bottom&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;kNavDockGap&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;kNavDockHeight&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It reads &lt;code&gt;viewPadding&lt;/code&gt;, not &lt;code&gt;padding&lt;/code&gt;, because &lt;code&gt;padding&lt;/code&gt; is the value the shell is about to overwrite. Reading the physical inset means the function returns the same number on both sides of the override, which matters for tests and for any page that computes its own spacing.&lt;/p&gt;

&lt;p&gt;The scope is the other half. A page pushed without a shell — a settings page opened directly from a chat, for example — has no dock, so reserving the dock's space would leave a phantom gap at the bottom of its list. &lt;code&gt;NavDockScope&lt;/code&gt; lets those pages ask whether a dock is actually present and reserve nothing when it is not.&lt;/p&gt;

&lt;h2&gt;
  
  
  The border that changed the height by a pixel
&lt;/h2&gt;

&lt;p&gt;This one is small, annoying and easy to ship. A border added as layout decoration grows the box by its width. The dock's reserved slot is computed from the tokens, so a 1 px border made the card 65 dp tall while the clearance still said 64 dp. The result is a one-pixel mismatch between what the shell reserves and what the dock occupies — the kind of thing that turns into a stray scroll offset or a clipped edge.&lt;/p&gt;

&lt;p&gt;Paint the hairline in a foreground decoration instead. It draws over the card without contributing to layout, so the measured height stays exactly the token value. The same rule applies to the chat bars: any hairline that participates in layout will eventually desynchronise a number that someone else computed.&lt;/p&gt;

&lt;p&gt;A widget test now compares the dock's rendered height with &lt;code&gt;navDockClearance&lt;/code&gt; and allows half a pixel of rounding. That test is boring, and it is the reason the bug did not come back.&lt;/p&gt;

&lt;h2&gt;
  
  
  FABs sit in the dock's shadow
&lt;/h2&gt;

&lt;p&gt;Once the shell extends its body behind the dock, a floating action button inside a nested page &lt;code&gt;Scaffold&lt;/code&gt; lands at the bottom of the window — directly behind the dock. The Friends page has a stack of them, the Profile page has an edit button, and the user-management page has its own.&lt;/p&gt;

&lt;p&gt;The obvious fix is to lift each one by the full clearance. That overshoots. &lt;code&gt;Scaffold&lt;/code&gt; already positions a floating button above the system inset, so adding the full clearance lifts the button one inset too high and leaves the list's end spacer short by the same amount. The lift should be the dock's own contribution:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="nf"&gt;navDockFabLift&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;BuildContext&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nc"&gt;NavDockScope&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isPresent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;clearance&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;navDockClearance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;clearance&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;clearance&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nc"&gt;MediaQuery&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;viewPaddingOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bottom&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two off-by-one-inset bugs in one feature is a pattern, not bad luck: whenever a widget and a framework both apply a system inset, one of them has to own it explicitly.&lt;/p&gt;

&lt;h2&gt;
  
  
  MediaQuery padding only reaches lists that ask
&lt;/h2&gt;

&lt;p&gt;The shell's &lt;code&gt;MediaQuery&lt;/code&gt; override is not magic. A &lt;code&gt;ScrollView&lt;/code&gt; with a null &lt;code&gt;padding&lt;/code&gt; reads &lt;code&gt;MediaQuery.padding&lt;/code&gt; and applies it, so those lists clear the dock for free. A list that sets its own padding ignores the inherited value entirely.&lt;/p&gt;

&lt;p&gt;That distinction is easy to miss because most pages in a settings tree set explicit padding. Each one now wraps its padding in a helper:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="n"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;navDockPadding&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nc"&gt;EdgeInsets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The helper adds the clearance to the bottom only when a shell is present. Search was the visible casualty: it kept a &lt;code&gt;SafeArea&lt;/code&gt; that consumed the injected bottom padding, so the scroll viewport ended above the dock and the frosted glass had nothing behind it. It now uses &lt;code&gt;SafeArea(top: false, bottom: false)&lt;/code&gt; and clears the dock through the helper, so results scroll under the glass like every other tab.&lt;/p&gt;

&lt;h2&gt;
  
  
  The clear mode removes things
&lt;/h2&gt;

&lt;p&gt;The dock's setting is called "Transparent navigation bar". It does not add a lighter fill or a softer blur; it removes the &lt;code&gt;BackdropFilter&lt;/code&gt; and the hairline border, leaving only the destination buttons and the orb. Content behind the dock becomes completely sharp, which is what the person asking for the option actually wanted.&lt;/p&gt;

&lt;p&gt;It is also cheaper: no backdrop is saved per frame in that mode. Both states are fill-free, so the switch is between frosted and perfectly clear rather than between two tints.&lt;/p&gt;

&lt;p&gt;The choice is cached locally, read before the first frame so the dock never flashes frosted on launch, and synced to the account so it follows the user to another device. Reset returns it to frosted. If a page ever needs a legibility guarantee while the clear mode is on, tint the parent of the blur rather than putting a fill behind it — a fill is the one change that undoes the whole effect.&lt;/p&gt;

&lt;h2&gt;
  
  
  Buttons that match the rest of the app
&lt;/h2&gt;

&lt;p&gt;The dock used bare Material icons while every other floating control — the Friends button stack, the Profile edit button — was a circular outlined button. It now speaks the same language: Search, Friends and Profile are 44 px circles with a surface fill and a 2 px primary ring, with a 24 px icon inside. Unselected destinations use the ring at reduced alpha; the selected one uses the full-strength ring and the active accent.&lt;/p&gt;

&lt;p&gt;More keeps the bare brand mark, at 48 px. It is slightly larger than the circles so the logo's internal padding still reads level with them, and it deliberately has no ring, because it is the entry point to everything else rather than a peer destination.&lt;/p&gt;

&lt;p&gt;The active orb still slides behind the selected circle, so selection reads as a soft halo around a button. After the preview, the glide moved from 300 ms to 600 ms: next to outlined circles, 300 ms read as a snap rather than a movement. The Motion setting still scales or disables it like every other animation.&lt;/p&gt;

&lt;p&gt;The trade-off is honest: the opaque circle paints above &lt;code&gt;NavigationBar&lt;/code&gt;'s ink layer, so the old tap ripple is no longer visible. Haptics, the orb flight and the small pop-in on the selected icon carry the feedback instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  The follow-ups that mattered
&lt;/h2&gt;

&lt;p&gt;Four defects surfaced after the first version, and all of them were about ownership rather than appearance.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Clearance outside a shell.&lt;/strong&gt; Every page assumed a dock existed. &lt;code&gt;NavDockScope&lt;/code&gt; made the reserve conditional, so pages pushed on plain routes stopped reserving space for something that was not there.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;FAB lifts.&lt;/strong&gt; Subtracting the &lt;code&gt;Scaffold&lt;/code&gt; inset from the lift fixed both the button position and the list's end spacing in one change.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keyboard.&lt;/strong&gt; &lt;code&gt;navDockClearance&lt;/code&gt; returns zero while the software keyboard is up, because the dock is hidden behind it and reserving its height would leave dead scroll area above the IME.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Persistence.&lt;/strong&gt; The transparency choice round-trips through the local cache and the account settings, including a reset path, so the dock does not change appearance between launches or devices.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I would steal next time
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;One geometry file shared by the widget and every shell, so nobody re-derives the height.&lt;/li&gt;
&lt;li&gt;A clearance function that reads &lt;code&gt;viewPadding&lt;/code&gt;, so it is stable on both sides of a &lt;code&gt;MediaQuery&lt;/code&gt; override.&lt;/li&gt;
&lt;li&gt;Foreground hairlines everywhere. A border in layout is a changed size.&lt;/li&gt;
&lt;li&gt;An explicit scope for "is this page hosted by the shell", instead of assuming every route has a dock.&lt;/li&gt;
&lt;li&gt;A clear mode that removes the effect rather than imitating it with a colour.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The shell work pairs well with the &lt;a href="https://frankmilvus.github.io/folcadi-articles/articles/2026-10-19-flutter-tab-shell-keep-pages-alive.html" rel="noopener noreferrer"&gt;tab-shell keep-alive pattern&lt;/a&gt; if you are changing how tabs are hosted, and with the &lt;a href="https://frankmilvus.github.io/folcadi-articles/articles/2026-11-11-hide-status-bar-while-scrolling-flutter.html" rel="noopener noreferrer"&gt;auto-hiding chrome&lt;/a&gt; if your floating bars also need to retract. The pattern is the same in both: measure the chrome once, hand the number to the content, and let the overlay float above it.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Get Folcadi&lt;/strong&gt; — a language-exchange messenger with live translation.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Official website:&lt;/strong&gt; &lt;a href="https://folcadi.com" rel="noopener noreferrer"&gt;folcadi.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Android:&lt;/strong&gt; &lt;a href="https://play.google.com/store/apps/details?id=com.folcadi.app" rel="noopener noreferrer"&gt;Google Play&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Windows:&lt;/strong&gt; &lt;a href="https://github.com/FrankMilvus/folcadi-releases/releases/latest" rel="noopener noreferrer"&gt;.zip or installer&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Linux:&lt;/strong&gt; &lt;a href="https://github.com/FrankMilvus/folcadi-releases/releases/latest" rel="noopener noreferrer"&gt;.deb or portable tarball&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Articles:&lt;/strong&gt; &lt;a href="https://frankmilvus.github.io/folcadi-articles/" rel="noopener noreferrer"&gt;write-ups and covers&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Telegram:&lt;/strong&gt; &lt;a href="https://t.me/frank_says" rel="noopener noreferrer"&gt;@frank_says&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Facebook:&lt;/strong&gt; &lt;a href="https://facebook.com/FrankMilvusSays" rel="noopener noreferrer"&gt;facebook.com/FrankMilvusSays&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>showdev</category>
      <category>flutter</category>
      <category>design</category>
      <category>ux</category>
    </item>
    <item>
      <title>The chat list should move like the chat: animated message previews</title>
      <dc:creator>Frank Milvus</dc:creator>
      <pubDate>Thu, 19 Nov 2026 12:20:48 +0000</pubDate>
      <link>https://dev.to/frankmilvus/the-chat-list-should-move-like-the-chat-animated-message-previews-25n2</link>
      <guid>https://dev.to/frankmilvus/the-chat-list-should-move-like-the-chat-animated-message-previews-25n2</guid>
      <description>&lt;p&gt;Animated chat previews Flutter draws in the chats list are the first thing a person sees after opening the app, yet for a long time ours were plain text. The conversation itself had motion — animated emoji in bubbles — while the list that summarised it stayed completely still. Fixing that turned out to be less about animation and more about parsing, prefixes and two tabs that quietly render the same rows. This is what the second pass taught us, and why the safest implementation is the one that refuses to animate too much.&lt;/p&gt;

&lt;h2&gt;
  
  
  The list was the last static surface
&lt;/h2&gt;

&lt;p&gt;The message bubble is the easy case. A message is either one emoji or it is not, so the bubble can make a single decision and swap one glyph for one animation.&lt;/p&gt;

&lt;p&gt;A preview is different. It is a compressed line of text that must communicate a whole message in the width of a row. It can be a single emoji, an emoji in the middle of a sentence (&lt;code&gt;nice 🔥&lt;/code&gt;), several emoji in a row, a sender prefix, or a draft. If the chat feels alive and the list looks like a database report, the mismatch is noticeable.&lt;/p&gt;

&lt;p&gt;So the new rule is broader: every registered emoji in the preview animates, wherever it appears. Unregistered emoji and ordinary text stay exactly as they were. There is no special casing for the whole-message case, because the preview is not a message bubble and should not pretend to be one.&lt;/p&gt;

&lt;h2&gt;
  
  
  The parsing problem behind animated chat previews Flutter renders
&lt;/h2&gt;

&lt;p&gt;You cannot find emoji by splitting a string into code units. A single visible emoji can be several code points: a base character, a variation selector, a zero-width joiner, or a whole ZWJ sequence. Splitting naively gives you fragments, and fragments produce nonsense.&lt;/p&gt;

&lt;p&gt;Dart's &lt;code&gt;characters&lt;/code&gt; package gives the right unit: a grapheme cluster, which is what a reader perceives as one character. The preview walks the content grapheme by grapheme, buffering ordinary text and flushing it whenever a registered emoji appears:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;grapheme&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;characters&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;asset&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;animatedEmojiAssetFor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;grapheme&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;asset&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;animated&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;maxInlineEmoji&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;grapheme&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nf"&gt;flushText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;spans&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nc"&gt;WidgetSpan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="n"&gt;alignment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;PlaceholderAlignment&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;middle&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;child&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Semantics&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;label&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;grapheme&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;child&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;AnimatedEmoji&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;asset&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;asset&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;18&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;animated&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nf"&gt;flushText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result is a &lt;code&gt;Text.rich&lt;/code&gt; with a mix of &lt;code&gt;TextSpan&lt;/code&gt; and &lt;code&gt;WidgetSpan&lt;/code&gt; children. Text keeps the row's style; an emoji becomes a tiny square animation. If nothing in the content matches the registry, the widget returns the original plain &lt;code&gt;Text&lt;/code&gt; with its one-line ellipsis, so the common case pays no new cost.&lt;/p&gt;

&lt;p&gt;The grapheme walk is also why variation selectors behave. A heart that arrives with U+FE0F and a heart without it both normalise to the same registry entry, and neither leaves a stray invisible character in the text buffer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Four emoji, then stop
&lt;/h2&gt;

&lt;p&gt;A preview is one line, and one line can hold a dozen emoji. Each animated emoji is a separate looping Lottie widget with its own ticker and its own composition. Ten of them in one row is not a richer preview; it is a battery test.&lt;/p&gt;

&lt;p&gt;The cap is four animated emoji per preview. The fifth and later stay as text glyphs, even if they are registered. That is deliberately not "animate the first four and drop the rest": the rest remain visible, just static, so the message still reads correctly.&lt;/p&gt;

&lt;p&gt;Four is a judgment call rather than a measured optimum. It is enough to convey a reaction burst, and low enough that a single row cannot spawn an unbounded number of animations. The important part is that the bound exists in the widget rather than in a comment asking future contributors to be careful.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prefixes are not message content
&lt;/h2&gt;

&lt;p&gt;The preview line often starts with a name. Getting that prefix right is most of the work, because it differs by chat type.&lt;/p&gt;

&lt;p&gt;For a direct message, an incoming message shows the content alone. An outgoing message keeps the localised &lt;code&gt;Me:&lt;/code&gt; prefix, so the list distinguishes "them" from "you" without an avatar label. The prefix stays a plain text span; only the part after it is inspected for emoji. That means a person named &lt;code&gt;Me&lt;/code&gt; cannot accidentally animate, and a prefix ending in an emoji-looking character is still just text.&lt;/p&gt;

&lt;p&gt;Groups are a little more involved. A group preview comes in as &lt;code&gt;Alice: hello&lt;/code&gt;, so the tile splits at the first colon and space. If the last message was mine, the sender name is replaced with the localised "me" label; otherwise the original name is kept. Either way, the prefix is rebuilt as a text span and the content is passed to the animation parser:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;colon&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;preview&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;indexOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;': '&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;colon&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prefix&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;preview&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;prefix&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;isMe&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="s1"&gt;'${l10n.me}: '&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;preview&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;substring&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;colon&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;preview&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;substring&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;colon&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The same widget is used by the friend tile and the group tile, so there is one implementation of this split and one place to fix it.&lt;/p&gt;

&lt;h2&gt;
  
  
  One switch, not two
&lt;/h2&gt;

&lt;p&gt;The obvious next question is whether the preview needs its own setting. It does not.&lt;/p&gt;

&lt;p&gt;The existing switch is called &lt;strong&gt;Animate emoji-only messages&lt;/strong&gt;, and its subtitle now mentions the chat-list preview too. The reasoning is simple: the preview &lt;em&gt;is&lt;/em&gt; the message, compressed. A person who turned animations off because motion bothers them does not want the list to keep moving; a person who likes the effect does not want to discover a second toggle to make the list match the chat.&lt;/p&gt;

&lt;p&gt;The preview also respects the app-wide motion level. If motion is off, the preview renders the plain text path, even if the emoji switch is on. One preference, two surfaces, no contradictory states.&lt;/p&gt;

&lt;h2&gt;
  
  
  The trap: kept-alive tabs
&lt;/h2&gt;

&lt;p&gt;This is the bug worth publishing, because it is invisible in a screenshot and obvious in a profiler.&lt;/p&gt;

&lt;p&gt;The chats screen keeps its tabs alive so that switching between All and Friends does not rebuild the lists or lose scroll position. Keeping them alive means both tabs can hold the same rows at the same time. Each row contains an animated preview. When one tab is hidden, its widgets are still mounted, and mounted Lottie widgets keep ticking unless something stops them.&lt;/p&gt;

&lt;p&gt;The fix is one wrapper around the page body. The tab page already used &lt;code&gt;HeroMode&lt;/code&gt; to disable hero animations on the inactive page; &lt;code&gt;TickerMode&lt;/code&gt; does the same job for every animation ticker:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;active&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;activeId&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;widget&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tabId&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;HeroMode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;enabled&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;active&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;child&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;TickerMode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;enabled&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;active&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;child&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;child&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;TickerMode(enabled: false)&lt;/code&gt; pauses the tickers in that subtree without disposing the widgets. The hidden tab keeps its state, its scroll offset and its parsed spans, but it stops asking for frames. When the tab becomes visible again, the animations resume in place.&lt;/p&gt;

&lt;p&gt;Without this, the list would animate twice for every visible row, and the extra work would be spent on pixels nobody can see. It is the kind of cost that does not show up until a low-end phone gets warm.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keeping the row short
&lt;/h2&gt;

&lt;p&gt;A chat row is a tight horizontal budget: a 48 px avatar, a name, a timestamp, a status icon, an unread badge, and whatever width is left for the preview. The preview must not make the row taller, and the animation must not push the text around.&lt;/p&gt;

&lt;p&gt;Two details handle that. The row height is still driven by the 48 px avatar, so the preview can grow from 14 px text to an 18 px emoji box without changing the tile's height. And the inline &lt;code&gt;WidgetSpan&lt;/code&gt; keeps its intrinsic size inside the &lt;code&gt;Expanded&lt;/code&gt; width. A stretched animation box would make Lottie centre its artwork somewhere in the middle of the row; an intrinsic box keeps the flame aligned with the text around it.&lt;/p&gt;

&lt;p&gt;That second point is pinned by a regression test: an unprefixed emoji at the start of the row must be exactly 18 px wide at x = 0. It is a small assertion, but it protects the visual contract that makes the feature look intentional rather than merely enabled.&lt;/p&gt;

&lt;h2&gt;
  
  
  Accessibility in a 14 px line
&lt;/h2&gt;

&lt;p&gt;Each animated glyph is wrapped in &lt;code&gt;Semantics(label: grapheme)&lt;/code&gt;, for the same reason as in the message bubble: Lottie has no text. A screen reader hears the emoji it would have heard from the plain string, and the visual reader sees motion.&lt;/p&gt;

&lt;p&gt;The preview keeps its single line and ellipsis, and the semantics tree keeps the original characters. Neither the parser nor the animation is allowed to change what the message says.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the tests cover
&lt;/h2&gt;

&lt;p&gt;The preview tests are behaviour tests, not snapshot tests:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a single registered emoji animates, with and without a &lt;code&gt;Me:&lt;/code&gt; prefix;&lt;/li&gt;
&lt;li&gt;a registered emoji animates inside text, and multiple emoji animate in one preview;&lt;/li&gt;
&lt;li&gt;the four-emoji cap holds for a long run;&lt;/li&gt;
&lt;li&gt;the static path is used when the setting is off, when motion is off, and for an unregistered emoji;&lt;/li&gt;
&lt;li&gt;an unprefixed emoji stays 18 px wide at the start of the row.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The group tile gets its own test, because the sender-prefix split is the part most likely to regress. It pumps a real tile with an &lt;code&gt;Alice: 🔥&lt;/code&gt; preview and asserts that the prefix stays text while the fire animates.&lt;/p&gt;

&lt;h2&gt;
  
  
  The takeaway
&lt;/h2&gt;

&lt;p&gt;The preview feature reuses almost everything from the bubble feature: the registry, the lookup, the widget, the setting, the semantics wrapper. What it adds is the part that only a list can teach you.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Parse by grapheme, not by code unit, or Unicode will find the cracks.&lt;/li&gt;
&lt;li&gt;Put a hard cap on how many animations one row can create.&lt;/li&gt;
&lt;li&gt;Treat prefixes as chrome and inspect only the content.&lt;/li&gt;
&lt;li&gt;Reuse the user's existing preference instead of multiplying switches.&lt;/li&gt;
&lt;li&gt;Remember that kept-alive tabs render twice; pause the hidden copy with &lt;code&gt;TickerMode&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Measure the row against its existing height, not against the animation's preferred size.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The chat list now moves like the chat, but the important change is not visual. It is that the list can show motion without becoming a second, hidden battery drain.&lt;/p&gt;

&lt;p&gt;If you want the first half of this story, the write-up on &lt;a href="https://frankmilvus.github.io/folcadi-articles/articles/2026-11-16-animated-emoji-messages-flutter.html" rel="noopener noreferrer"&gt;animating emoji-only messages&lt;/a&gt; covers the registry, the licence registration and the exact-match rule. For another example of motion that follows intent rather than a timer, see &lt;a href="https://frankmilvus.github.io/folcadi-articles/articles/2026-11-11-hide-status-bar-while-scrolling-flutter.html" rel="noopener noreferrer"&gt;hiding the chrome while scrolling&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Why not animate every emoji in a long preview?&lt;/strong&gt; Because each one is a separate looping animation. Four keeps the effect readable and bounds the work per row; the remaining emoji stay visible as static glyphs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does the preview use a different setting from the chat?&lt;/strong&gt; No. It follows &lt;strong&gt;Animate emoji-only messages&lt;/strong&gt; and the app-wide motion level.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What about drafts and typing indicators?&lt;/strong&gt; They keep their existing static text. The parser only sees message content, not the labels around it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does this change the row height?&lt;/strong&gt; No. The 48 px avatar still drives the tile height, and the emoji box is 18 px inside the existing line.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Get Folcadi&lt;/strong&gt; — a language-exchange messenger with live translation.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Official website:&lt;/strong&gt; &lt;a href="https://folcadi.com" rel="noopener noreferrer"&gt;folcadi.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Android:&lt;/strong&gt; &lt;a href="https://play.google.com/store/apps/details?id=com.folcadi.app" rel="noopener noreferrer"&gt;Google Play&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Windows:&lt;/strong&gt; &lt;a href="https://github.com/FrankMilvus/folcadi-releases/releases/latest" rel="noopener noreferrer"&gt;.zip or installer&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Linux:&lt;/strong&gt; &lt;a href="https://github.com/FrankMilvus/folcadi-releases/releases/latest" rel="noopener noreferrer"&gt;.deb or portable tarball&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Articles:&lt;/strong&gt; &lt;a href="https://frankmilvus.github.io/folcadi-articles/" rel="noopener noreferrer"&gt;write-ups and covers&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Telegram:&lt;/strong&gt; &lt;a href="https://t.me/frank_says" rel="noopener noreferrer"&gt;@frank_says&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Facebook:&lt;/strong&gt; &lt;a href="https://facebook.com/FrankMilvusSays" rel="noopener noreferrer"&gt;facebook.com/FrankMilvusSays&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>showdev</category>
      <category>flutter</category>
      <category>animation</category>
      <category>performance</category>
    </item>
    <item>
      <title>Turning dead scroll padding into a little animated fire</title>
      <dc:creator>Frank Milvus</dc:creator>
      <pubDate>Wed, 18 Nov 2026 12:05:21 +0000</pubDate>
      <link>https://dev.to/frankmilvus/turning-dead-scroll-padding-into-a-little-animated-fire-k7d</link>
      <guid>https://dev.to/frankmilvus/turning-dead-scroll-padding-into-a-little-animated-fire-k7d</guid>
      <description>&lt;p&gt;Every chat list ends somewhere, and ours used to end in nothing. The last conversation row sat above a blank strip of screen, and that strip existed for a practical reason: three floating action buttons live in the bottom-right corner, and the last row had to scroll clear of them. The padding was correct. It was also dead space that every user paid for on every short list.&lt;/p&gt;

&lt;p&gt;Now an animated footer emoji sits in that space — a little fire by default. This is the decision record for turning reserved padding into a feature without changing the scroll geometry, and for keeping an animated footer emoji in Flutter cheap enough to leave on.&lt;/p&gt;

&lt;h2&gt;
  
  
  The blank strip we were already paying for
&lt;/h2&gt;

&lt;p&gt;The chats list reserves room for the tallest stack of floating buttons: search, the extra button some accounts get, and contacts. A mini floating button occupies 48 dp vertically, gaps sit between them, and the scaffold adds its own margin above the safe area. The result is roughly 184 px of reserved height at the end of the list.&lt;/p&gt;

&lt;p&gt;That number is not decoration. It is the reason the last row can be tapped instead of sitting under a button. It is also why the empty state and the populated list share the same bottom padding: the geometry should not change just because the content did.&lt;/p&gt;

&lt;p&gt;So the constraint was fixed before the feature existed. We were not looking for space to add; we were looking at space we had already bought and never used.&lt;/p&gt;

&lt;h2&gt;
  
  
  Do not add a footer below the list
&lt;/h2&gt;

&lt;p&gt;The tempting implementation is a column: the list, then a footer underneath it. It looks harmless, and it quietly changes two things.&lt;/p&gt;

&lt;p&gt;First, it adds scroll length. The list now ends later than it used to, so the last row travels further before it settles. Second, it makes the geometry depend on whether the footer is enabled. Turn the decoration off and the list gets shorter; turn it on and it grows. A preference should not resize the conversation list.&lt;/p&gt;

&lt;p&gt;The version we shipped puts the footer inside the scroll view instead, as the last sliver. The list's total extent stays the same whether the emoji is on, off, or replaced by an empty box of the same size.&lt;/p&gt;

&lt;h2&gt;
  
  
  SliverFillRemaining is margin-top: auto
&lt;/h2&gt;

&lt;p&gt;The footer is a &lt;code&gt;SliverFillRemaining&lt;/code&gt; with &lt;code&gt;hasScrollBody: false&lt;/code&gt;. On a list shorter than the viewport, it receives all the leftover height, which pushes its child to the real bottom. In CSS terms it is &lt;code&gt;margin-top: auto&lt;/code&gt;; in a chat list it means a two-row list has one enormous gap between the second row and the emoji, rather than a small decoration floating in the middle of the screen.&lt;/p&gt;

&lt;p&gt;On a long list there is no leftover height, so the sliver falls back to a minimum. That minimum is the height of the button stack, which preserves the original reason the space existed: the last row still clears the buttons.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;SliverFillRemaining&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;hasScrollBody&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;child&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;ConstrainedBox&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;constraints&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;BoxConstraints&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;minHeight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;AppFab&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stackHeight&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;child&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Align&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="n"&gt;alignment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Alignment&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bottomCenter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;child&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;FriendsFooterEmoji&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;scrollController&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;controller&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;Align&lt;/code&gt; matters as much as the sliver. Without it, the emoji would stretch or sit at the top of the expanded area. With it, the unused height lives above the emoji and the decoration stays pinned to the bottom edge.&lt;/p&gt;

&lt;h2&gt;
  
  
  Same geometry with the switch off
&lt;/h2&gt;

&lt;p&gt;When the footer is disabled, the widget still renders a square of its normal size with nothing inside. It does not return &lt;code&gt;SizedBox.shrink()&lt;/code&gt;, because collapsing the box would remove height from the sliver and shorten the list. The switch would then change scroll behaviour as well as appearance.&lt;/p&gt;

&lt;p&gt;That is the rule in one sentence: the setting decides what is painted, never how far the list scrolls.&lt;/p&gt;

&lt;p&gt;It also makes the toggle feel instant. There is no relayout of the rows, no jump in the scroll position, and no re-measure of the viewport: one box goes from containing an animation to containing nothing.&lt;/p&gt;

&lt;h2&gt;
  
  
  An animated footer emoji in Flutter, centred clear of the buttons
&lt;/h2&gt;

&lt;p&gt;The floating buttons are right-aligned, so the footer is centred horizontally. That keeps it visually clear of the stack without needing to know the width of a button or the exact device inset.&lt;/p&gt;

&lt;p&gt;An 8 px gap plus the device's bottom inset separates the emoji from the screen edge. The list's own bottom padding already accounts for the dock and the button stack, so the footer is not compensating for them again; it is only adding breathing room.&lt;/p&gt;

&lt;p&gt;The result is a decoration that looks placed rather than dropped. On a wide desktop window it stays centred while the buttons remain at the far right.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reuse the registry, do not build a second one
&lt;/h2&gt;

&lt;p&gt;The emoji comes from the same 85-emoji bundled animation registry used by emoji-only messages. That gives the picker one set of choices, the renderer one lookup, and the fallback one rule: if the emoji has no bundled animation, draw the glyph.&lt;/p&gt;

&lt;p&gt;The picker only offers emoji that do have an animation, so the chosen footer always moves unless the app-wide motion level is off. A stored value that is not in the registry is ignored rather than rendered as a mystery glyph, which protects against an old or hand-edited setting.&lt;/p&gt;

&lt;p&gt;Reusing the registry also means the footer inherits variation-selector normalisation and the same asset-loading behaviour as the rest of the app. There is no footer-specific asset pipeline to keep alive, and no second list of emoji to drift out of date. The same set also powers &lt;a href="https://frankmilvus.github.io/folcadi-articles/articles/2026-11-17-animated-reactions-flutter.html" rel="noopener noreferrer"&gt;animated reaction chips&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Glyphs in the grid, motion in the preview
&lt;/h2&gt;

&lt;p&gt;The picker shows the full bundled set. Playing all of those Lottie compositions at once would be absurd: the sheet would ask the device to decode and loop dozens of animations for a choice the user has not made yet.&lt;/p&gt;

&lt;p&gt;So the grid renders plain text glyphs. One animated preview at the top shows the current selection. Tapping an emoji updates the preview only; the sheet stays open, and nothing is saved until the user presses Apply.&lt;/p&gt;

&lt;p&gt;That extra step is deliberate. An animation is a poor thing to judge from a still frame, and a footer is something the user will see every day. Previewing first and committing second means the choice is made after seeing the motion.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two settings that follow the account
&lt;/h2&gt;

&lt;p&gt;The feature stores two values: which emoji, and whether the footer is enabled. Both travel through the same settings map as the other appearance options. There is no new endpoint and no new persistence format.&lt;/p&gt;

&lt;p&gt;Because the whole settings map is pushed together, the footer choice follows the account across devices exactly like the theme, the chat background or the animation switches. Sign in on a new device and the same emoji is waiting at the bottom of the list.&lt;/p&gt;

&lt;p&gt;An unknown emoji in the stored settings is ignored. That keeps the renderer's promise simple: the footer either shows something from the registry or shows the default, never a missing asset.&lt;/p&gt;

&lt;h2&gt;
  
  
  The first frame after a restart
&lt;/h2&gt;

&lt;p&gt;Like the other appearance settings, the footer values are cached locally as well as synced. The cache is read at startup, before the profile request returns, so the first frame already has the right emoji and the right switch state.&lt;/p&gt;

&lt;p&gt;Without that, a list could render with the default fire, then swap to the chosen emoji a moment later. On a slow connection the flash could last long enough to notice, and a decoration that flickers on every launch is worse than no decoration at all.&lt;/p&gt;

&lt;p&gt;The cache is a bridge, not a second source of truth. The server value still wins once it arrives.&lt;/p&gt;

&lt;h2&gt;
  
  
  Motion off means a still glyph
&lt;/h2&gt;

&lt;p&gt;The master motion level is respected. When it is off, the footer renders the emoji as text at a proportional size instead of playing the animation. No loop, no ticker, no exception for decoration.&lt;/p&gt;

&lt;p&gt;That mirrors the emoji-message fallback, so the whole app has one answer to "what happens when someone turns motion off": the content stays, the movement does not.&lt;/p&gt;

&lt;h2&gt;
  
  
  Decoration should be silent
&lt;/h2&gt;

&lt;p&gt;The footer is wrapped in &lt;code&gt;ExcludeSemantics&lt;/code&gt;. It carries no information: it is not a button, it does not show a count, and it does not indicate state. A screen reader announcing "fire" at the end of a list of conversations would be noise dressed as content.&lt;/p&gt;

&lt;p&gt;Excluding it also keeps the semantics tree honest. The list ends where the conversations end, and the decoration is invisible to assistive technology in the same way a background pattern is.&lt;/p&gt;

&lt;h2&gt;
  
  
  The ticker budget at the bottom of a long list
&lt;/h2&gt;

&lt;p&gt;A looping animation at the end of a long list is a small but permanent cost. If the user is reading the top of a hundred conversations, the footer is nowhere near the viewport, and its ticker has no reason to run.&lt;/p&gt;

&lt;p&gt;The footer mutes its animation while the list is more than 400 px from the end. Scrolling back towards the bottom re-enables it before it comes into view, so the motion is already running by the time the user sees it. The check also tolerates the brief moment when one controller is attached to two scroll views during a tab or search swap; in that case it animates rather than asserting.&lt;/p&gt;

&lt;p&gt;This is the same principle as the lazy message list: do not pay for what nobody can see.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it costs, and what it buys
&lt;/h2&gt;

&lt;p&gt;The cost is one looping composition, muted when far from the bottom, plus a sliver that already had to reserve space. The scroll length is unchanged, and empty tabs show no footer at all.&lt;/p&gt;

&lt;p&gt;What it buys is harder to measure: a list that feels finished at the bottom instead of stopping in a blank strip. The space was already reserved; the only new decision was to treat it as part of the design.&lt;/p&gt;

&lt;h2&gt;
  
  
  The short version
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The chats list already reserved about 184 px so the floating buttons would not cover the last row.&lt;/li&gt;
&lt;li&gt;Put the footer inside the scroll view as a sliver; do not add a footer below the list.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;SliverFillRemaining&lt;/code&gt; with &lt;code&gt;hasScrollBody: false&lt;/code&gt; so a short list gives all unused height to the footer.&lt;/li&gt;
&lt;li&gt;Keep a minimum height equal to the button stack so a long list still clears the buttons.&lt;/li&gt;
&lt;li&gt;Render an empty box of the same size when the switch is off, so the geometry never changes.&lt;/li&gt;
&lt;li&gt;Reuse the bundled emoji registry and keep the glyph fallback for anything unregistered.&lt;/li&gt;
&lt;li&gt;Show glyphs in the picker grid and animate only the preview; require Apply before saving.&lt;/li&gt;
&lt;li&gt;Sync the emoji and the switch through the existing settings map, with a local first-frame cache.&lt;/li&gt;
&lt;li&gt;Mute the ticker when the footer is far from the viewport, and exclude it from semantics.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Why not put the emoji in the floating button stack?&lt;/strong&gt; Because the stack is interactive and right-aligned. The footer is decoration and belongs in the list's own space, where it can be centred and scrolls with the content.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does the footer appear on empty tabs?&lt;/strong&gt; No. Empty tabs keep their existing centred message and show no footer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What happens if the chosen emoji loses its animation?&lt;/strong&gt; The stored value is validated against the registry when applied and when read from the cache. An unknown value is ignored, and the default remains.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does the footer change the scroll position when it is toggled?&lt;/strong&gt; No. The box keeps its size and the sliver keeps its extent, so only the painted content changes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is this safe in encrypted chats?&lt;/strong&gt; The footer is on the chats list, not inside a conversation. It is presentation only and does not touch message content.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Get Folcadi&lt;/strong&gt; — a language-exchange messenger with live translation.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Official website:&lt;/strong&gt; &lt;a href="https://folcadi.com" rel="noopener noreferrer"&gt;folcadi.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Android:&lt;/strong&gt; &lt;a href="https://play.google.com/store/apps/details?id=com.folcadi.app" rel="noopener noreferrer"&gt;Google Play&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Windows:&lt;/strong&gt; &lt;a href="https://github.com/FrankMilvus/folcadi-releases/releases/latest" rel="noopener noreferrer"&gt;.zip or installer&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Linux:&lt;/strong&gt; &lt;a href="https://github.com/FrankMilvus/folcadi-releases/releases/latest" rel="noopener noreferrer"&gt;.deb or portable tarball&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Articles:&lt;/strong&gt; &lt;a href="https://frankmilvus.github.io/folcadi-articles/" rel="noopener noreferrer"&gt;write-ups and covers&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Telegram:&lt;/strong&gt; &lt;a href="https://t.me/frank_says" rel="noopener noreferrer"&gt;@frank_says&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Facebook:&lt;/strong&gt; &lt;a href="https://facebook.com/FrankMilvusSays" rel="noopener noreferrer"&gt;facebook.com/FrankMilvusSays&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>showdev</category>
      <category>flutter</category>
      <category>ux</category>
      <category>animation</category>
    </item>
    <item>
      <title>Small reactions, real motion: animating reaction chips in Flutter</title>
      <dc:creator>Frank Milvus</dc:creator>
      <pubDate>Tue, 17 Nov 2026 11:39:04 +0000</pubDate>
      <link>https://dev.to/frankmilvus/small-reactions-real-motion-animating-reaction-chips-in-flutter-1428</link>
      <guid>https://dev.to/frankmilvus/small-reactions-real-motion-animating-reaction-chips-in-flutter-1428</guid>
      <description>&lt;p&gt;Animated reaction chips in Flutter look like a small feature until you count them. A reaction is a 14 px glyph, a count and a translucent rounded background, tucked against the edge of a message bubble. Then you scroll a busy group chat and realise one screen can hold dozens of chips at once. Animating that surface is a completely different job from animating one large emoji in the middle of a bubble, and that difference shaped every decision here.&lt;/p&gt;

&lt;p&gt;This is the decision record for making reactions move: why we reused the existing emoji animation registry instead of building a second system, why the chip renders at 18 px rather than the 48 px used for emoji messages, how the lazy message list became the lifetime manager, and what we would measure before enabling motion everywhere.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why animated reaction chips in Flutter are a different problem
&lt;/h2&gt;

&lt;p&gt;An emoji-only message is a single, deliberate, large thing. It sits in the middle of a bubble, the reader's eye goes to it, and one Lottie composition running there is cheap because there is exactly one of it.&lt;/p&gt;

&lt;p&gt;A reaction row is the opposite. It is a small horizontal strip of chips, each one a glyph plus a number. A single busy message can carry six or eight reactions. A screen of messages can carry dozens. On top of that, every chip already has its own small animation: when a reaction is added or removed, the chip pops by scaling from 0.6 to full size with an overshoot curve.&lt;/p&gt;

&lt;p&gt;So the question was never "can Lottie run in a chip". It was "what is the smallest amount of animation that still feels alive, and who owns it when the chip leaves the screen".&lt;/p&gt;

&lt;h2&gt;
  
  
  The obvious approach, and why we skipped it
&lt;/h2&gt;

&lt;p&gt;The obvious approach is a reaction-specific animation system: a controller per chip, a lifecycle tied to the row, maybe an exclusive "only one animates at a time" rule. That means a second set of assets, a second emoji-to-artwork map, and a second fallback to keep in sync when the user turns motion off.&lt;/p&gt;

&lt;p&gt;We already had an 85-entry registry and a widget. Reusing them made the feature a rendering change rather than a new subsystem, and it kept one rule in one place: an emoji either has a bundled animation or it does not.&lt;/p&gt;

&lt;h2&gt;
  
  
  One registry for messages, previews and reactions
&lt;/h2&gt;

&lt;p&gt;The registry is a plain map from emoji to bundled Lottie asset. Lookup goes through a normaliser that trims the string and drops variation selectors, so &lt;code&gt;❤️&lt;/code&gt; and &lt;code&gt;❤&lt;/code&gt; resolve to the same entry instead of one of them silently missing. Adding an emoji is a JSON file plus one line in the map, not a new code path. The same registry also drives the animated emoji in the chats-list footer.&lt;/p&gt;

&lt;p&gt;The lookup returns null for anything unregistered, and null is a valid answer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;asset&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;animatedEmojiAssetFor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;emoji&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;animate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
    &lt;span class="n"&gt;asset&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt;
    &lt;span class="n"&gt;animatedReactionsNotifier&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt;
    &lt;span class="n"&gt;motionLevelNotifier&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="nc"&gt;MotionLevel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;off&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Anyone can send any emoji from the reaction picker, so "no bundled animation" is common rather than exceptional. Those reactions keep the static glyph, the same one they had before. There is no placeholder, no shimmer, and no attempt to substitute a similar animation. A still chip next to a moving one looks intentional; a wrong-but-animated chip does not.&lt;/p&gt;

&lt;h2&gt;
  
  
  18 px is the whole size budget
&lt;/h2&gt;

&lt;p&gt;The static glyph is 14 px. The animated chip renders the same emoji at 18 px, which is large enough to read the motion and small enough that the count still sits beside it without wrapping.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;AnimatedEmoji&lt;/code&gt; keeps a square box and fits the composition inside it, so artwork with a different aspect ratio — the fire, for example — is letterboxed rather than stretched. It also has an &lt;code&gt;errorBuilder&lt;/code&gt; that returns an empty box of the same size. A corrupt or missing asset must not take the message bubble down with it; it should cost one chip's artwork and nothing else.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;Semantics&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;label&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;emoji&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;child&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;AnimatedEmoji&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;asset&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;asset&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;18&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The size is deliberately not a preference. An 18 px glyph keeps the count beside it without wrapping; making it configurable would make the chip's height and the count's baseline user-dependent, for a decoration.&lt;/p&gt;

&lt;h2&gt;
  
  
  The lazy list is the lifetime manager
&lt;/h2&gt;

&lt;p&gt;A chat message list is lazy. It builds bubbles near the viewport and disposes them when they leave its cache extent. That means we did not need a visibility detector, an intersection observer, or a pause/resume policy for every chip. A reaction's animation lives exactly as long as its bubble does.&lt;/p&gt;

&lt;p&gt;This is the single most important reason the feature is affordable. The animation is not "off while off-screen"; the widget that owns it no longer exists. What remains is the ordinary cost of a list item while it is on screen, plus one looping composition per animated chip inside it.&lt;/p&gt;

&lt;p&gt;The caveat is that "off-screen" is not the same as "not built". A list keeps a small band of items alive beyond the viewport, so a few chips can still be animating just above or below the visible area. That is a fine default for a chat, but it is the first thing to check if you are porting this idea to a surface that keeps every row alive.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep the key, keep the pop
&lt;/h2&gt;

&lt;p&gt;Reactions are grouped by emoji, and each chip is keyed by the pair of emoji and count:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;ValueKey&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'${e.key}:${e.value}'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That key predates the animation, and keeping it was a deliberate constraint. When a count changes, the key changes, Flutter treats it as a new widget, and the existing pop replays. If we had keyed by emoji alone, a second person reacting would update the number without any acknowledgement, which is a worse interaction than a still chip.&lt;/p&gt;

&lt;p&gt;The first build of a row disables the pop, so opening a chat does not cascade dozens of chips bouncing at once. Only a count change after that first build animates, and motion level off collapses the pop duration to zero.&lt;/p&gt;

&lt;p&gt;The animated glyph sits inside that same pop wrapper, so the two motions compose instead of fighting. Adding a reaction scales the whole chip, animation included, and the loop continues underneath.&lt;/p&gt;

&lt;h2&gt;
  
  
  Toggling the switch must not restart the row
&lt;/h2&gt;

&lt;p&gt;The row listens to two values: whether reaction animation is on, and the app-wide motion level. Both are read inside one &lt;code&gt;AnimatedBuilder&lt;/code&gt;, so changing either rebuilds the mounted chips in place.&lt;/p&gt;

&lt;p&gt;A naive implementation puts the setting check above the whole row and keys the row by it, so toggling destroys and recreates every chip. Every pop replays, and a settings change looks like a burst of activity in a chat you are not looking at.&lt;/p&gt;

&lt;p&gt;Listening lower down swaps only the glyph widget. The chip keeps its key, its scale animation keeps its state, and the count does not pop. The switch feels like a preference, not an event.&lt;/p&gt;

&lt;h2&gt;
  
  
  An independent switch, synced like the rest
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Animate reaction emoji&lt;/strong&gt; lives in Settings → Appearance → Animated emoji, next to &lt;strong&gt;Animate emoji-only messages&lt;/strong&gt;. The two are independent, and both default to on.&lt;/p&gt;

&lt;p&gt;Independent matters because the costs are different. Emoji messages are rare and large; reaction chips are frequent and small. Someone may like one big animated emoji and find a wall of moving chips distracting, or the reverse. One switch for both would force a choice between two unrelated surfaces.&lt;/p&gt;

&lt;p&gt;The value is stored under its own settings key and travels through the same settings map as every other appearance option, so it follows the account across devices.&lt;/p&gt;

&lt;h2&gt;
  
  
  The first frame after a restart
&lt;/h2&gt;

&lt;p&gt;A synced setting has a first-frame problem. The app can render the chats tab before the profile request returns, and for that moment it does not know whether reactions should animate. If the default is "on" and the stored value is "off", the first frame shows motion and the next frame removes it: a flash on every launch.&lt;/p&gt;

&lt;p&gt;The fix is the same one the other appearance options use. The value is cached locally on change and read at startup, before the profile arrives, so the first frame already matches the last choice. The server sync then confirms or corrects it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Motion off means a still glyph, not a slower loop
&lt;/h2&gt;

&lt;p&gt;The app has a master motion level. When it is off, reaction chips render the static emoji, exactly like emoji messages and the chat-list preview. We do not slow the loop down, shorten it, or run it once. Reduced motion is not a hint to animate more gently; for some people it is the difference between usable and not.&lt;/p&gt;

&lt;p&gt;The same check covers both the glyph and the pop duration, so a motion-off chat has no looping artwork and no overshoot scaling. The feature disappears cleanly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lottie carries no text
&lt;/h2&gt;

&lt;p&gt;An animated composition is pixels. A screen reader gets nothing from it: no emoji name, no indication that the chip is a reaction at all. The count beside it may be the only text announced, which turns "two people reacted with a thumbs up" into "2".&lt;/p&gt;

&lt;p&gt;Wrapping the animated glyph in &lt;code&gt;Semantics(label: emoji)&lt;/code&gt; gives assistive technology the same word the static glyph would have exposed. The label is the emoji character itself, not a description like "thumbs up", because that is what the rest of the interface uses and what the reader expects to hear.&lt;/p&gt;

&lt;p&gt;The static path needs no extra wrapper: a &lt;code&gt;Text&lt;/code&gt; widget already carries its string. Only the animated path has to add meaning back.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would measure before enabling animation everywhere
&lt;/h2&gt;

&lt;p&gt;Reaction chips are a bounded surface: the list decides how many exist, and disposal is automatic. That is why we were comfortable turning them on by default. Before extending the same treatment to a grid, a pinned summary, or any list that keeps its children alive, I would want numbers for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Live tickers.&lt;/strong&gt; How many Lottie animations are running on a reaction-heavy screen, including the cache-extent band above and below the viewport.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Frame time while scrolling.&lt;/strong&gt; Build and raster cost per frame on a mid-range Android device, with the same conversation measured before and after.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Decode cost at entry.&lt;/strong&gt; What happens when a chat opens and a screenful of compositions is decoded at once, rather than one large emoji at a time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory and battery.&lt;/strong&gt; The retained cost of the decoded animations, and what an hour of reading does to the battery.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The principle is simple: animation is affordable when the widget tree bounds the number of animations. When it does not, the number is the feature's real budget, and it should be measured rather than assumed.&lt;/p&gt;

&lt;h2&gt;
  
  
  The short version
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A reaction chip is a different performance problem from one big message emoji: many small loops instead of one large one.&lt;/li&gt;
&lt;li&gt;Reuse the existing emoji registry and &lt;code&gt;AnimatedEmoji&lt;/code&gt;; do not build a second animation system.&lt;/li&gt;
&lt;li&gt;Render at 18 px, keep the count beside it, and leave unregistered emoji static.&lt;/li&gt;
&lt;li&gt;Let the lazy message list own the animation's lifetime. Check the cache-extent band before reusing the idea on a non-lazy surface.&lt;/li&gt;
&lt;li&gt;Keep the &lt;code&gt;emoji:count&lt;/code&gt; key so the existing pop still fires when the count changes.&lt;/li&gt;
&lt;li&gt;Store the switch as its own synced setting, with a local first-frame cache so the row does not flash on launch.&lt;/li&gt;
&lt;li&gt;Motion off means the static glyph, in full.&lt;/li&gt;
&lt;li&gt;Give the animated glyph a &lt;code&gt;Semantics&lt;/code&gt; label; Lottie has no text.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Does this run in encrypted chats?&lt;/strong&gt; Reaction rendering is presentation only. It does not change what is stored or how anything is decrypted.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What happens if an animation asset is missing?&lt;/strong&gt; &lt;code&gt;AnimatedEmoji&lt;/code&gt; returns an empty box of the same size instead of throwing, so the layout holds and only that chip's artwork is missing.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Get Folcadi&lt;/strong&gt; — a language-exchange messenger with live translation.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Official website:&lt;/strong&gt; &lt;a href="https://folcadi.com" rel="noopener noreferrer"&gt;folcadi.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Android:&lt;/strong&gt; &lt;a href="https://play.google.com/store/apps/details?id=com.folcadi.app" rel="noopener noreferrer"&gt;Google Play&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Windows:&lt;/strong&gt; &lt;a href="https://github.com/FrankMilvus/folcadi-releases/releases/latest" rel="noopener noreferrer"&gt;.zip or installer&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Linux:&lt;/strong&gt; &lt;a href="https://github.com/FrankMilvus/folcadi-releases/releases/latest" rel="noopener noreferrer"&gt;.deb or portable tarball&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Articles:&lt;/strong&gt; &lt;a href="https://frankmilvus.github.io/folcadi-articles/" rel="noopener noreferrer"&gt;write-ups and covers&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Telegram:&lt;/strong&gt; &lt;a href="https://t.me/frank_says" rel="noopener noreferrer"&gt;@frank_says&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Facebook:&lt;/strong&gt; &lt;a href="https://facebook.com/FrankMilvusSays" rel="noopener noreferrer"&gt;facebook.com/FrankMilvusSays&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>showdev</category>
      <category>flutter</category>
      <category>animation</category>
      <category>performance</category>
    </item>
    <item>
      <title>Big emoji that move: animating emoji-only messages with Lottie</title>
      <dc:creator>Frank Milvus</dc:creator>
      <pubDate>Mon, 16 Nov 2026 11:00:42 +0000</pubDate>
      <link>https://dev.to/frankmilvus/big-emoji-that-move-animating-emoji-only-messages-with-lottie-2lg0</link>
      <guid>https://dev.to/frankmilvus/big-emoji-that-move-animating-emoji-only-messages-with-lottie-2lg0</guid>
      <description>&lt;p&gt;An animated emoji Flutter feature looks like a one-line change: find the emoji, play a Lottie file. Then you try it and the edge cases arrive. A message that is only emoji already renders as a 48 px glyph in our chat, so the animation has to replace that glyph exactly, not sit beside it. A fire followed by a fire should stay two static glyphs. A heart written with or without a variation selector should still resolve. And a screen reader has to be told what the picture means. This is the story of those constraints, and the small registry that keeps them honest.&lt;/p&gt;

&lt;h2&gt;
  
  
  The rule: one emoji, exactly
&lt;/h2&gt;

&lt;p&gt;Our chat already had a rule for emoji-only messages: if the trimmed text is nothing but emoji, render it as one large glyph instead of ordinary body text. That rule is deliberately strict. A message with a word in it is text. An emoji caption on an image is a caption. A reply with a reaction is a reply.&lt;/p&gt;

&lt;p&gt;The animation slots into that same branch, which is why it stays so contained. The message widget takes an opt-in flag, and only the emoji-only branch passes it. When the flag is on, the widget asks whether the &lt;em&gt;entire&lt;/em&gt; trimmed message matches a registered emoji. &lt;code&gt;🔥&lt;/code&gt; plays. &lt;code&gt;🔥🔥&lt;/code&gt; does not, and neither does &lt;code&gt;🔥 hi&lt;/code&gt; or a photo with a flame caption. Those keep the static enlarged glyph they always had.&lt;/p&gt;

&lt;p&gt;That single decision prevents most of the bugs you would otherwise chase. There is no partial replacement inside a sentence, no animation competing with link spans, and no special case for media. The animation is a presentation swap at the point where the message has already been classified.&lt;/p&gt;

&lt;h2&gt;
  
  
  Designing the animated emoji Flutter registry
&lt;/h2&gt;

&lt;p&gt;The implementation is a constant map from an emoji to an asset path:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;Map&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;String&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;kEmojiAnimations&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="s1"&gt;'👍'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'assets/animations/emoji_thumbs_up.json'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s1"&gt;'❤️'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'assets/animations/emoji_red_heart.json'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s1"&gt;'🔥'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'assets/animations/emoji_fire.json'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s1"&gt;'🎉'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'assets/animations/emoji_party_popper.json'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The real map has 85 entries, grouped by intent: the app's twenty default reactions, common faces, gestures, hearts, and a handful of celebration symbols. The grouping is for humans reading the file; the lookup does not care about categories.&lt;/p&gt;

&lt;p&gt;The important property is that adding an animation is one line plus one JSON file. The assets directory is already declared in &lt;code&gt;pubspec.yaml&lt;/code&gt;, so a new file needs no build configuration. The key must be the emoji exactly as a keyboard would produce it. That sounds obvious until you try to type a keycap sequence or a flag into a source file and discover that editors and input methods disagree about invisible characters.&lt;/p&gt;

&lt;p&gt;There is no database, no network call and no generated code. The registry is data, the lookup is a map access, and the failure mode is a &lt;code&gt;null&lt;/code&gt; that means "keep the glyph". That is the right size of abstraction for a decoration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Normalising what the keyboard actually sends
&lt;/h2&gt;

&lt;p&gt;Unicode gives the same visible emoji more than one byte sequence. A heart can arrive as U+2764 alone or as U+2764 followed by U+FE0F, the variation selector that asks for emoji presentation. Both look like &lt;code&gt;❤️&lt;/code&gt; in most interfaces. A map with one spelling would miss the other.&lt;/p&gt;

&lt;p&gt;So the registry builds a second, normalised map and every lookup runs the same transformation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="nf"&gt;_normalizeEmoji&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
    &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;trim&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replaceAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'\uFE0F'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;''&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replaceAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'\uFE0E'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;''&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="kt"&gt;Map&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;String&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;_kNormalizedEmojiAnimations&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;entry&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;kEmojiAnimations&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;entries&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;_normalizeEmoji&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;entry&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;entry&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kt"&gt;String&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="nf"&gt;animatedEmojiAssetFor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;normalized&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;_normalizeEmoji&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;normalized&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;isEmpty&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;_kNormalizedEmojiAnimations&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;normalized&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Trimming is part of the same step. A message that is "just an emoji" often has a stray space at the end, and a static 48 px glyph tolerates that silently. The animation path should too.&lt;/p&gt;

&lt;p&gt;Two details are worth calling out. The normalisation runs on both the registry keys and the incoming text, so one spelling in the source file covers every spelling a platform produces. And the function returns &lt;code&gt;null&lt;/code&gt; for anything that is not an exact single match after normalisation, which keeps the caller's fallback trivially simple.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fitting Lottie into a text-sized hole
&lt;/h2&gt;

&lt;p&gt;The static glyph is 48 px. The animation is a 72 px square. That is not an accident: the Lottie artwork has its own internal padding, so a box slightly larger than the old glyph gives the motion room without making the bubble jump.&lt;/p&gt;

&lt;p&gt;The widget is small enough to read in one sitting:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;AnimatedEmoji&lt;/span&gt; &lt;span class="k"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;StatelessWidget&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nc"&gt;AnimatedEmoji&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="k"&gt;super&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;required&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;asset&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;72&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;asset&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="nd"&gt;@override&lt;/span&gt;
  &lt;span class="nc"&gt;Widget&lt;/span&gt; &lt;span class="nf"&gt;build&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;BuildContext&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;Lottie&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;asset&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="n"&gt;asset&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;fit&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;BoxFit&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;contain&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;errorBuilder&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stackTrace&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
          &lt;span class="nc"&gt;SizedBox&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;BoxFit.contain&lt;/code&gt; matters because the bundled set is not uniform. Most files are square: the Noto animations are 1024×1024 at 60 fps. The fire animation is 500×690 at 24 fps and loops. If the widget stretched everything to fill a square, the fire would distort; if it cropped, the flame would lose its tip. Containing the composition inside the box preserves both.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;errorBuilder&lt;/code&gt; is the least glamorous line and the one I would keep in any app. A missing or corrupt asset should leave an empty square, not take down the message bubble with a red error box. A decoration must never be able to break the content it decorates.&lt;/p&gt;

&lt;h2&gt;
  
  
  The switch and the fallback
&lt;/h2&gt;

&lt;p&gt;The setting lives under Appearance and is called &lt;strong&gt;Animate emoji-only messages&lt;/strong&gt;. It defaults to on. Turning it off restores the exact static glyph, with no restart.&lt;/p&gt;

&lt;p&gt;Two rules interact here. The first is the user's preference. The second is the app-wide motion level: when motion is set to off, the animation is skipped even if the emoji switch is on. That is the correct precedence. Someone who has asked the whole interface to stop moving should not have to find a second, narrower switch to stop one more thing.&lt;/p&gt;

&lt;p&gt;The choice is stored with the rest of the appearance settings and cached locally, so the first frame after a restart already knows which path to take. Without that cache you get a visible flash: static glyph, then animation. Caching a boolean is cheap; a flashing bubble is not.&lt;/p&gt;

&lt;p&gt;The build listens to both values and re-renders when either changes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;animate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;animatedEmojiNotifier&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt;
    &lt;span class="n"&gt;motionLevelNotifier&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="nc"&gt;MotionLevel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;off&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No animation controller of our own, no timers, no manual lifecycle. Lottie owns the frames; we only decide whether the widget exists.&lt;/p&gt;

&lt;h2&gt;
  
  
  A screen reader cannot watch a Lottie
&lt;/h2&gt;

&lt;p&gt;An animation is pixels. It carries no text node, so without help a screen reader would encounter an unlabelled box where the message used to be. That is a regression disguised as a visual upgrade.&lt;/p&gt;

&lt;p&gt;The fix is one wrapper around the animation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="nc"&gt;Semantics&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;label&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;display&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;child&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;AnimatedEmoji&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;asset&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;animation&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The label is the emoji itself, which is what the static glyph exposed before. A screen-reader user hears the same character they would have heard from the text path, and the visual user sees motion. Neither experience is treated as the lesser one.&lt;/p&gt;

&lt;p&gt;The same wrapper appears wherever the animation is reused, because accessibility is a property of the widget boundary rather than of one call site.&lt;/p&gt;

&lt;h2&gt;
  
  
  Licensing animations that are not a package
&lt;/h2&gt;

&lt;p&gt;Flutter's licence page collects licences from packages automatically. Bundled assets get no such treatment. If you ship an animation set and do nothing, About → Licenses will be silent about it, which is both inaccurate and impolite.&lt;/p&gt;

&lt;p&gt;Our set is 85 animations. 84 are Google's Noto Animated Emoji under the SIL Open Font License 1.1; the remaining fire animation came with the project. The full licence text ships as &lt;code&gt;OFL.txt&lt;/code&gt; beside the JSON files, and the app registers it explicitly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;_registerEmojiAnimationLicense&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nc"&gt;LicenseRegistry&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addLicense&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;license&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;rootBundle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;loadString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'assets/animations/OFL.txt'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;yield&lt;/span&gt; &lt;span class="nc"&gt;LicenseEntryWithLineBreaks&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'Noto Animated Emoji'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;license&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is the entire integration: load the text from the asset bundle, yield it under a readable name, and Flutter folds it into the standard licence page. No package, no plugin, no build step.&lt;/p&gt;

&lt;p&gt;The broader lesson is that "bundled asset" is a licensing category the tooling does not track for you. Fonts, sound effects, sample images and animation sets all need the same deliberate registration if you want the About screen to tell the truth.&lt;/p&gt;

&lt;h2&gt;
  
  
  The five-megabyte question
&lt;/h2&gt;

&lt;p&gt;The full set costs roughly 5.4 MiB of assets. That is real weight in an installer, and it is the kind of number that deserves a sentence rather than a shrug.&lt;/p&gt;

&lt;p&gt;We accepted it because the animations are local, instant and offline. There is no request when a message arrives, no placeholder, no failure path for a flaky connection, and no privacy question about which emoji a person used. The set is also bounded: it is a curated list, not a download-on-demand catalogue that could grow without limit.&lt;/p&gt;

&lt;p&gt;The trade-off is honest: we spent installer size on a decoration. If the set grew much larger, the calculation would change and lazy loading would start to look attractive. For 85 files, bundling keeps the code simple and the behaviour deterministic, which is worth more than a few megabytes on a desktop install.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the tests pin down
&lt;/h2&gt;

&lt;p&gt;The tests split cleanly along the same boundary as the code.&lt;/p&gt;

&lt;p&gt;The registry gets pure unit tests: exact matches, common emoji, variation-selector normalisation, whitespace trimming, and rejection of multi-emoji, mixed text and empty input. The widget gets behaviour tests: it plays when enabled, stays static when the setting is off, stays static when motion is off, and stays static when the caller does not opt in. The settings value also gets a round-trip test, because a preference that does not survive a restart is not really a preference.&lt;/p&gt;

&lt;p&gt;The emoji, settings and message suites all pass. None of that replaces opening the app and looking at a heart, but it does mean the fallback paths are treated as first-class behaviour rather than as leftovers.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would keep
&lt;/h2&gt;

&lt;p&gt;If you are adding motion to a small, well-defined piece of content, the shape of this feature is reusable:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Put the decision in one predicate and make everything else a consumer of it.&lt;/li&gt;
&lt;li&gt;Keep a single source of truth for the mapping, and make the fallback the boring default.&lt;/li&gt;
&lt;li&gt;Normalise the input before you compare it, especially when the input is Unicode.&lt;/li&gt;
&lt;li&gt;Wrap generated visuals in semantics that carry the text they replaced.&lt;/li&gt;
&lt;li&gt;Register licences for assets the same way you would for dependencies.&lt;/li&gt;
&lt;li&gt;Budget the bytes out loud instead of discovering them at release time.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The result is deliberately modest: one emoji, one animation, one switch. But it makes the chat feel a little more alive without making the code less predictable. That trade is usually the right one.&lt;/p&gt;

&lt;p&gt;If you liked the layout side of this, the write-up on &lt;a href="https://frankmilvus.github.io/folcadi-articles/articles/2026-11-11-hide-status-bar-while-scrolling-flutter.html" rel="noopener noreferrer"&gt;hiding chrome while scrolling&lt;/a&gt; covers the same principle from a different angle: motion should respond to what the reader is doing. And the &lt;a href="https://frankmilvus.github.io/folcadi-articles/articles/2026-11-13-floating-glass-chrome-flutter.html" rel="noopener noreferrer"&gt;floating glass chrome&lt;/a&gt; piece shows how the rest of the interface keeps its overlays out of the way.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Does every emoji animate?&lt;/strong&gt; No. Only the 85 in the registry. An unregistered emoji keeps the static glyph, which is the correct default: no animation is better than a broken one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What happens to &lt;code&gt;🔥🔥&lt;/code&gt;?&lt;/strong&gt; It stays static. The feature is an exact single-emoji match, not a per-character replacement. That keeps the bubble predictable and the number of animations bounded.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does this change the message or how it is stored?&lt;/strong&gt; No. It is a client-side presentation swap. The text is unchanged, and the animation is chosen at render time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can I turn it off?&lt;/strong&gt; Yes, with the &lt;strong&gt;Animate emoji-only messages&lt;/strong&gt; switch, or by setting the app-wide motion level to off. Both fall back to the original 48 px glyph.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Get Folcadi&lt;/strong&gt; — a language-exchange messenger with live translation.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Official website:&lt;/strong&gt; &lt;a href="https://folcadi.com" rel="noopener noreferrer"&gt;folcadi.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Android:&lt;/strong&gt; &lt;a href="https://play.google.com/store/apps/details?id=com.folcadi.app" rel="noopener noreferrer"&gt;Google Play&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Windows:&lt;/strong&gt; &lt;a href="https://github.com/FrankMilvus/folcadi-releases/releases/latest" rel="noopener noreferrer"&gt;.zip or installer&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Linux:&lt;/strong&gt; &lt;a href="https://github.com/FrankMilvus/folcadi-releases/releases/latest" rel="noopener noreferrer"&gt;.deb or portable tarball&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Articles:&lt;/strong&gt; &lt;a href="https://frankmilvus.github.io/folcadi-articles/" rel="noopener noreferrer"&gt;write-ups and covers&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Telegram:&lt;/strong&gt; &lt;a href="https://t.me/frank_says" rel="noopener noreferrer"&gt;@frank_says&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Facebook:&lt;/strong&gt; &lt;a href="https://facebook.com/FrankMilvusSays" rel="noopener noreferrer"&gt;facebook.com/FrankMilvusSays&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>showdev</category>
      <category>flutter</category>
      <category>lottie</category>
      <category>ux</category>
    </item>
    <item>
      <title>Google Play’s 14-day closed test for Folcadi: done</title>
      <dc:creator>Frank Milvus</dc:creator>
      <pubDate>Sun, 15 Nov 2026 08:57:14 +0000</pubDate>
      <link>https://dev.to/frankmilvus/google-plays-14-day-closed-test-for-folcadi-done-246k</link>
      <guid>https://dev.to/frankmilvus/google-plays-14-day-closed-test-for-folcadi-done-246k</guid>
      <description>&lt;p&gt;The 12-testers-for-14-days closed test applies to the app you upload — not just to a brand-new developer account. We used our existing Play account and still had to clear it before we could apply for production access.&lt;/p&gt;

&lt;p&gt;Our main testers were our own team and developers — real people using the build every day. To keep the required 12 testers in place for the full window, we also used tester services:&lt;br&gt;
• Closed Test Pro — &lt;a href="https://play.google.com/store/apps/details?id=com.closedtest.pro.closedtest_pro&amp;amp;pcampaignid=web_share" rel="noopener noreferrer"&gt;https://play.google.com/store/apps/details?id=com.closedtest.pro.closedtest_pro&amp;amp;pcampaignid=web_share&lt;/a&gt;&lt;br&gt;
• Testers Community — &lt;a href="https://play.google.com/store/apps/details?id=com.testerscommunity&amp;amp;pcampaignid=web_share" rel="noopener noreferrer"&gt;https://play.google.com/store/apps/details?id=com.testerscommunity&amp;amp;pcampaignid=web_share&lt;/a&gt;&lt;br&gt;
• Another service gave us zero testers in three days, so we stopped using it.&lt;/p&gt;

&lt;p&gt;The trick that helped: don’t start them all on the same day. A Closed Test Pro’s 14-day clock only starts once it has 12 testers, so we started one, then added Closed Test Pro two later. It is a easy way to get 12 testers stable for all period.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Get Folcadi&lt;/strong&gt; — a language-exchange messenger with live translation.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Official website:&lt;/strong&gt; &lt;a href="https://folcadi.com" rel="noopener noreferrer"&gt;folcadi.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Android:&lt;/strong&gt; &lt;a href="https://play.google.com/store/apps/details?id=com.folcadi.app" rel="noopener noreferrer"&gt;Google Play&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Windows:&lt;/strong&gt; &lt;a href="https://github.com/FrankMilvus/folcadi-releases/releases/latest" rel="noopener noreferrer"&gt;.zip or installer&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Linux:&lt;/strong&gt; &lt;a href="https://github.com/FrankMilvus/folcadi-releases/releases/latest" rel="noopener noreferrer"&gt;.deb or portable tarball&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Articles:&lt;/strong&gt; &lt;a href="https://frankmilvus.github.io/folcadi-articles/" rel="noopener noreferrer"&gt;write-ups and covers&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Telegram:&lt;/strong&gt; &lt;a href="https://t.me/frank_says" rel="noopener noreferrer"&gt;@frank_says&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Facebook:&lt;/strong&gt; &lt;a href="https://facebook.com/FrankMilvusSays" rel="noopener noreferrer"&gt;facebook.com/FrankMilvusSays&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>android</category>
      <category>buildinpublic</category>
      <category>startup</category>
      <category>testing</category>
    </item>
    <item>
      <title>Call controls that match the app: one floating-control component</title>
      <dc:creator>Frank Milvus</dc:creator>
      <pubDate>Sun, 15 Nov 2026 01:42:07 +0000</pubDate>
      <link>https://dev.to/frankmilvus/call-controls-that-match-the-app-one-floating-control-component-2pap</link>
      <guid>https://dev.to/frankmilvus/call-controls-that-match-the-app-one-floating-control-component-2pap</guid>
      <description>&lt;p&gt;Floating call controls in Flutter get built twice: once for the call screen, and once more for whatever surface shows the call after the user leaves that screen. Ours had been built three times. The live control row was a set of solid grey discs with a red one at the end, the end card used stock Material filled and outlined buttons, and the top-left collapse button was a semi-transparent black circle with a white arrow. Each was individually reasonable. Together they made an active call look like a different app from the one that had started it.&lt;/p&gt;

&lt;p&gt;The fix was one circular control component with two accents, plus a keyboard problem in the collapsed window that had nothing to do with styling at all.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three surfaces, three dialects
&lt;/h2&gt;

&lt;p&gt;The call screen is the most visually exposed state in the app: it covers everything, it usually sits over live video, and the user is holding the phone one-handed while looking at somebody's face. It is also the state where the buttons must be found without reading.&lt;/p&gt;

&lt;p&gt;The old row was hand-rolled: a circle, a fixed colour, an icon, a gesture detector. That pattern is fine once; copied three times it produces three slightly different measurements and three ideas of what "off" looks like.&lt;/p&gt;

&lt;p&gt;Meanwhile every other floating control — the navigation dock's destinations, the friends list actions, the profile edit button — had settled on a different vocabulary: a surface-filled circle with a two-pixel accent outline. The call screen was written before that vocabulary existed and nobody had a reason to revisit it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Floating call controls in Flutter should not fork
&lt;/h2&gt;

&lt;p&gt;The shared piece is &lt;code&gt;CircleSurface&lt;/code&gt;: a circle filled with the theme's surface colour, outlined at two pixels, with the icon tinted to match. &lt;code&gt;AppCircleButton&lt;/code&gt; wraps it in an &lt;code&gt;IconButton&lt;/code&gt; and splits the visible circle from the tap target around it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="nc"&gt;Container&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;decoration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;BoxDecoration&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;shape&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;BoxShape&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;circle&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;colors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;surface&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Border&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;selected&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;withValues&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;alpha&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.6&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;child&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;IconTheme&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;IconThemeData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;child&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;child&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two properties do the real work. The fill is the theme's surface, so the circle sits on glass, video or a photo rather than vanishing into a translucent overlay. And the outline is drawn at full strength for active controls instead of the muted sixty per cent used by inactive dock items. Over a bright video call, a muted outline is an invisible button.&lt;/p&gt;

&lt;p&gt;The call screen composes &lt;code&gt;CallActionButton&lt;/code&gt;: that circle at a call-specific size, plus a semantics label. The end card uses the same widget. The collapse control uses plain &lt;code&gt;AppCircleButton&lt;/code&gt; at its default size, because it belongs to the top bar rather than the thumb row.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the call row is 72 dp and the dock is 40
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;CallActionButton&lt;/code&gt; defines one number: a 72 dp diameter, circle and tap target together. The app's mini floating button is 40 dp, and it is the right size for a list row you tap while looking at it.&lt;/p&gt;

&lt;p&gt;A call is different. The user is often not looking at the controls at all; they are looking at the person, or at something in the room, and reaching by muscle memory. A 40 dp target over live video is a miss-tap magnet, and a miss-tap on a call row can mean hanging up on someone. Seventy-two is roughly the difference between aiming and hoping.&lt;/p&gt;

&lt;p&gt;The glyph follows the size: 32 px icons inside the 72 dp circle, which keeps the visual weight close to the text-free dock buttons instead of turning them into tiny icons in big rings.&lt;/p&gt;

&lt;p&gt;An audio call gets three controls, not four: mute, speaker, end. The camera switch only exists for video, so hiding it leaves the row evenly spaced rather than gapped where a fourth button would have been.&lt;/p&gt;

&lt;h2&gt;
  
  
  One shape, two accents
&lt;/h2&gt;

&lt;p&gt;The destructive action should be recognisable, and the three usual ways are all worse than colour. A different shape breaks the row's rhythm; a bigger button makes the row unstable; a different material makes it look borrowed from another component library.&lt;/p&gt;

&lt;p&gt;So the end call keeps the exact circle, outline weight and icon size, and changes only the accent: the theme's error colour replaces the primary one. A muted microphone does the same, because "your mic is off" is also a state the user needs to notice at a glance. Everything else stays primary. Shape carries identity; colour carries state.&lt;/p&gt;

&lt;p&gt;This is why the accent is an optional parameter on the shared surface rather than a second widget. The dock, the chat header and the send button use the primary default, so the override touched nothing they rely on.&lt;/p&gt;

&lt;p&gt;Accessibility labels did not change, deliberately. &lt;code&gt;Mute&lt;/code&gt; and &lt;code&gt;Unmute&lt;/code&gt;, &lt;code&gt;Switch camera&lt;/code&gt;, &lt;code&gt;Speaker on&lt;/code&gt; and &lt;code&gt;Speaker off&lt;/code&gt;, &lt;code&gt;End call&lt;/code&gt; — the icons are ambiguous by nature, and the labels are what makes the row usable with a screen reader. A visual refactor that quietly renamed them would be a regression dressed as a redesign.&lt;/p&gt;

&lt;h2&gt;
  
  
  The end card moves to where the thumb already is
&lt;/h2&gt;

&lt;p&gt;The end card placed its two actions mid-column: a filled button and an outlined one under the call summary. Legible, and in the wrong place — the hand that just ended a call is at the bottom of the screen.&lt;/p&gt;

&lt;p&gt;Both actions are now &lt;code&gt;CallActionButton&lt;/code&gt;s in the same bottom row, with the same 24 dp padding and the same &lt;code&gt;spaceEvenly&lt;/code&gt;, so redialling or leaving occupies the coordinates the user's thumb already knows. The icons are a phone and an arrow; the words "Call again" and "Back" survive as semantics labels rather than as visible text.&lt;/p&gt;

&lt;p&gt;One ordering detail matters more than it sounds. The row is painted above the card's dismiss layer, so a press on either button acts immediately. If it sits below that layer, the first tap only dismisses the overlay and the user has to tap twice — a bug that looks like latency.&lt;/p&gt;

&lt;h2&gt;
  
  
  The collapsed window keeps its own smaller pair
&lt;/h2&gt;

&lt;p&gt;The floating window an active call collapses into is a deliberately different surface. It is 132 by 180 logical pixels, it floats over whatever the user is doing, and it holds a peer video, a name, a running duration and two quick actions: mute and hang up.&lt;/p&gt;

&lt;p&gt;A 72 dp circle does not fit in that card, and pretending otherwise would eat the video. So the window keeps two compact 36 dp discs. They use the same red for hang-up and the same semantics labels, and the mute button turns red when muted. It is the one place where the call controls are not the shared component, and that is a size decision rather than a style one.&lt;/p&gt;

&lt;p&gt;The more interesting part of that window is its placement.&lt;/p&gt;

&lt;h2&gt;
  
  
  The keyboard is occupied space
&lt;/h2&gt;

&lt;p&gt;Collapse a call, go back into a chat, and tap the composer. The software keyboard rises — and the floating call window was still where it had been left, sitting under the keyboard with its buttons and the peer's video hidden behind the keys.&lt;/p&gt;

&lt;p&gt;The window lives above the navigator, mounted at the app level so it survives route changes while a call is running. That also means the keyboard never resizes it: the inset belongs to a different subtree, and the window has to notice and move itself.&lt;/p&gt;

&lt;p&gt;The fix starts by treating the keyboard as part of the area that is no longer available:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;padding&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;MediaQuery&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;paddingOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;keyboard&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;MediaQuery&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;viewInsetsOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bottom&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;bottomInset&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;keyboard&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bottom&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;keyboard&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bottom&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That &lt;code&gt;bottomInset&lt;/code&gt; is subtracted from the height the window may occupy, so the top-left corner it is allowed to reach stops where the keyboard begins. Dragging, clamping and edge snapping all keep working against the reduced rectangle.&lt;/p&gt;

&lt;p&gt;The comparison is deliberately &lt;code&gt;max&lt;/code&gt;, not a sum. The keyboard inset already extends down through the system's bottom padding, so adding the two would float the window far higher than the keyboard's actual top edge — technically clear, visually wrong, and worst on phones with a large home-indicator area.&lt;/p&gt;

&lt;p&gt;Because both insets are read as &lt;code&gt;MediaQuery&lt;/code&gt; dependencies, the window rebuilds as the keyboard animates and the safe area changes — no listener to leak, no controller to sync with an animation the system owns.&lt;/p&gt;

&lt;h2&gt;
  
  
  A lift that is not a position
&lt;/h2&gt;

&lt;p&gt;The subtle half of the fix is that the lift must not be remembered.&lt;/p&gt;

&lt;p&gt;The window stores its position as a fraction of the usable area — which side, how far down — and restores it on the next call. If the keyboard-driven lift wrote into that stored value, a user who typed one message mid-call would come back to a window pinned to the middle of the screen forever. The remembered position would be a fossil of a transient layout.&lt;/p&gt;

&lt;p&gt;So the lift is display-only. The stored position is written by exactly one thing: a drag. While the keyboard is up, the window is resolved from its remembered fraction inside the shrunken area, which naturally puts it above the keyboard. When the keyboard closes, the area grows back and the window returns to the side and fraction it remembered.&lt;/p&gt;

&lt;p&gt;Dragging while the keyboard is visible is the deliberate exception. That is a real decision by the user about where the window should live, so it saves the new spot — and it is saved as a fraction of the temporarily smaller area, which means it lands somewhere sensible in both states.&lt;/p&gt;

&lt;p&gt;Because the remembered position is a fraction of the usable area rather than a pixel coordinate, the window lands proportionally: near the bottom of that area it lifts clear of the keyboard, and near the top it barely moves. Edge snapping still happens on release, measured against the reduced width.&lt;/p&gt;

&lt;h2&gt;
  
  
  The test that fakes a 300 px keyboard
&lt;/h2&gt;

&lt;p&gt;Widget tests cannot summon a real keyboard, but they can set the inset that one produces. The test sets the device pixel ratio to one so physical and logical pixels agree, sizes the surface, pumps the overlay the same way the app mounts it, and records the window's rectangle.&lt;/p&gt;

&lt;p&gt;It then asserts the bottom edge at one margin above the safe area in the default bottom-right spot, sets a 300 px bottom inset, and asserts that the window's bottom edge has moved above the keyboard — still one margin clear. Clearing the inset returns it to the original rectangle, which is the part that proves the lift was display-only rather than a new remembered position.&lt;/p&gt;

&lt;p&gt;That last assertion is the one I would keep in any app with a floating surface. "It moves correctly" is easy to get right by accident; "it goes back" is the part that regresses silently.&lt;/p&gt;

&lt;h2&gt;
  
  
  The short version
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;One circle, one outline weight, one icon size: identity comes from shape, state comes from accent.&lt;/li&gt;
&lt;li&gt;Size the row for the hand, not for the grid. 72 dp over live video is a feature; 40 dp is a gamble.&lt;/li&gt;
&lt;li&gt;Keep semantics labels stable through a visual refactor; they are part of the contract.&lt;/li&gt;
&lt;li&gt;Put the post-call actions where the controls were, and paint them above any dismiss layer.&lt;/li&gt;
&lt;li&gt;Treat &lt;code&gt;viewInsets.bottom&lt;/code&gt; as occupied space, and inset by &lt;code&gt;max(bottom padding, keyboard)&lt;/code&gt; rather than their sum.&lt;/li&gt;
&lt;li&gt;Never let a transient layout push write into remembered state; drag is the only author of position.&lt;/li&gt;
&lt;li&gt;Test the return trip, not just the lift.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both halves of this came from the same question: what does this surface need in order to be correct? For the buttons it was a size and a shape. For the window it was a rectangle that shrinks and a position that does not. &lt;a href="https://frankmilvus.github.io/folcadi-articles/articles/2026-11-20-floating-nav-dock-flutter.html" rel="noopener noreferrer"&gt;The floating dock&lt;/a&gt; taught us the same thing about chrome: geometry first, then colour.&lt;/p&gt;

&lt;p&gt;If you have a floating surface that has to survive a keyboard, I would like to hear which half bit you — the inset arithmetic or the remembered position.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Get Folcadi&lt;/strong&gt; — a language-exchange messenger with live translation.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Official website:&lt;/strong&gt; &lt;a href="https://folcadi.com" rel="noopener noreferrer"&gt;folcadi.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Android:&lt;/strong&gt; &lt;a href="https://play.google.com/store/apps/details?id=com.folcadi.app" rel="noopener noreferrer"&gt;Google Play&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Windows:&lt;/strong&gt; &lt;a href="https://github.com/FrankMilvus/folcadi-releases/releases/latest" rel="noopener noreferrer"&gt;.zip or installer&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Linux:&lt;/strong&gt; &lt;a href="https://github.com/FrankMilvus/folcadi-releases/releases/latest" rel="noopener noreferrer"&gt;.deb or portable tarball&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Articles:&lt;/strong&gt; &lt;a href="https://frankmilvus.github.io/folcadi-articles/" rel="noopener noreferrer"&gt;write-ups and covers&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Telegram:&lt;/strong&gt; &lt;a href="https://t.me/frank_says" rel="noopener noreferrer"&gt;@frank_says&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Facebook:&lt;/strong&gt; &lt;a href="https://facebook.com/FrankMilvusSays" rel="noopener noreferrer"&gt;facebook.com/FrankMilvusSays&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>showdev</category>
      <category>flutter</category>
      <category>ux</category>
      <category>webrtc</category>
    </item>
    <item>
      <title>Making an app's map respect dark mode without running a tile server</title>
      <dc:creator>Frank Milvus</dc:creator>
      <pubDate>Sat, 14 Nov 2026 13:46:25 +0000</pubDate>
      <link>https://dev.to/frankmilvus/making-an-apps-map-respect-dark-mode-without-running-a-tile-server-2hc9</link>
      <guid>https://dev.to/frankmilvus/making-an-apps-map-respect-dark-mode-without-running-a-tile-server-2hc9</guid>
      <description>&lt;p&gt;A theme-aware map in Flutter sounds like a styling task: pick a tile URL, invert it in dark mode, move on. It is really an ownership task. Four maps in our app — a search result preview, the fullscreen search map, a profile's city card and the fullscreen city map — each carried their own copy of one hardcoded light tile URL. Every other surface went dark correctly, and those four stayed bright, which made the app look broken exactly where it was trying to show something useful.&lt;/p&gt;

&lt;p&gt;There is now one tile layer: it resolves a style from the app's brightness or the user's choice, asks the basemap provider for that style, carries the credit the map licences require, and sends every request through one shared tile cache.&lt;/p&gt;

&lt;h2&gt;
  
  
  Four maps, four copies of the same URL
&lt;/h2&gt;

&lt;p&gt;The duplication was invisible because the copies were identical. Nothing drifted, so nothing looked wrong until the app got a dark theme and four rectangles did not join in.&lt;/p&gt;

&lt;p&gt;Identical copies are still a maintenance problem, because the cost arrives all at once. Adding a dark style, a cache or attribution is one change per map — and the map that gets skipped is always the one nobody remembers, usually the small preview inside a profile card. A shared widget turns that from a discipline problem into a default.&lt;/p&gt;

&lt;p&gt;The four maps differ in ways that matter: three are interactive and one is a card that accepts no gestures at all, two sit inside a rounded clip on a page and two are fullscreen routes with a floating back button. One shared layer has to work in all four contexts without four sets of options.&lt;/p&gt;

&lt;p&gt;There was a smaller symptom: two maps inherited the library's default light grey background, so opening them in dark mode flashed pale grey until the first tiles painted. That colour is now one helper, &lt;code&gt;mapBackdropColor&lt;/code&gt;, returning the theme's surface colour.&lt;/p&gt;

&lt;h2&gt;
  
  
  A theme-aware map in Flutter needs one owner
&lt;/h2&gt;

&lt;p&gt;Every map now adds the same two widgets: &lt;code&gt;MapTiles&lt;/code&gt; for the basemap and &lt;code&gt;MapAttribution&lt;/code&gt; last, with markers and labels between them.&lt;/p&gt;

&lt;p&gt;The style decision is one pure function. A user choice of Auto, Light or Dark wins; Auto defers to the app's brightness:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="nc"&gt;MapStylePreference&lt;/span&gt; &lt;span class="nf"&gt;resolveMapStyle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;BuildContext&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;switch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mapStylePreferenceNotifier&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;MapStylePreference&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;light&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;MapStylePreference&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;light&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nc"&gt;MapStylePreference&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dark&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;MapStylePreference&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dark&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nc"&gt;MapStylePreference&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;followTheme&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
      &lt;span class="nc"&gt;Theme&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;of&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;brightness&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="nc"&gt;Brightness&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dark&lt;/span&gt;
          &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="nc"&gt;MapStylePreference&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dark&lt;/span&gt;
          &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;MapStylePreference&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;light&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The overrides earn their place: some people read a dark app with a light map because a dark basemap hides the roads they want, and some want the reverse. The preference is stored locally and kept with the account's profile settings, so it travels between devices.&lt;/p&gt;

&lt;p&gt;The tile layer sits inside a value listener on that preference, so switching styles re-requests tiles immediately — no restart, and no need for the parent screen to rebuild.&lt;/p&gt;

&lt;p&gt;The tile provider is created once per map instance, because the layer takes ownership of the provider it was built with. It cannot be hoisted to a global; a provider a disposed map has torn down will break the next one. Shared behaviour belongs in a proxy, not a shared instance.&lt;/p&gt;

&lt;h2&gt;
  
  
  The dark style has to come from the provider
&lt;/h2&gt;

&lt;p&gt;The primary basemap source publishes a light and a dark raster style from the same tile path, high-density variants included. With it configured, dark mode gets a designed dark basemap: dark land, light labels, roads that read as roads.&lt;/p&gt;

&lt;p&gt;The fallback is the public OpenStreetMap tile server, which is light-only, and it exists for two different reasons.&lt;/p&gt;

&lt;p&gt;The first is a build without a basemap identifier. Development builds and anyone compiling from source get the open tiles exactly as before; nothing is required to make a map appear.&lt;/p&gt;

&lt;p&gt;The second is a failing request while the identifier is present. The tile layer accepts a per-tile fallback URL, so a request that errors serves an open tile in that spot instead of leaving a hole. A briefly mixed map is ugly; an empty grid is worse.&lt;/p&gt;

&lt;p&gt;Between those cases sits the honest stopgap. Without the provider's dark style, dark mode would be a dead setting, so the layer applies a per-tile colour filter — invert plus a 180° hue rotation — when, and only when, the style resolves to dark and the open tiles are in use. Labels survive the inversion and stay readable, but the hierarchy flips: roads end up darker than the land they cross, so the map reads as a photographic negative rather than a night map.&lt;/p&gt;

&lt;p&gt;That is fine at 180 dp, where the map anchors a city name and opens a fullscreen view. It would not be fine as the fullscreen look, which is why the dark style exists and why the code calls this a stopgap.&lt;/p&gt;

&lt;p&gt;The filter is applied at paint time, not download time, so cached bytes stay unfiltered and flipping between light and dark re-renders from the same cache. Once the provider's dark style is in use, no filter is applied — including to the open tile that may appear after a failed request.&lt;/p&gt;

&lt;h2&gt;
  
  
  Attribution is a licence term, not polish
&lt;/h2&gt;

&lt;p&gt;Both tile sources require visible credit. That is not a nicety for an about screen, and not a comment in the source: OpenStreetMap's tile policy asks for the credit to stay visible, and the basemap provider's terms say the same.&lt;/p&gt;

&lt;p&gt;So the credit is a widget, &lt;code&gt;MapAttribution&lt;/code&gt;, and it is the last child of every map. It draws a single line of small text — around nine logical pixels, on the theme's surface at a little under full opacity — with a semantics label, and a tap opens the copyright page. Because it lives in the shared layer, a fifth map inherits the wording and the placement by copying two lines, not by remembering a licence.&lt;/p&gt;

&lt;p&gt;Layout is where the copies used to diverge. The default corner is bottom-right, the convention. Two maps cannot use it: the profile city card has a location chip in one bottom corner and an avatar over the other, so its credit is anchored top-left; both fullscreen maps float a back button in the bottom-right, so they pass padding that lifts the label clear. The widget takes an alignment and an inset instead of a boolean, and the awkward cases are handled at the call site without a second copy of the label.&lt;/p&gt;

&lt;p&gt;Two details help it survive real layouts. It is one line, so it never wraps on a narrow card, and it sits inside the preview's rounded clip, so a corner radius cannot shave off half the credit. The wording follows the sources in use: both names when the provider is configured, only the open source when it is not. Crediting a provider that sent no tiles is its own kind of wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  A decoration still costs requests
&lt;/h2&gt;

&lt;p&gt;The profile city card is 180 dp tall, accepts no gestures of its own, and opens a fullscreen map when tapped. It is decoration with a door. It also pulls somewhere around forty to sixty tiles when it renders, and a fullscreen map pulls a similar number — and without a disk cache all of that came back after every restart.&lt;/p&gt;

&lt;p&gt;That is because the library used to keep only an in-memory image cache. Kill the process and the tiles are gone. The version we moved to added a built-in on-disk store that honours HTTP cache headers, which turns "the same profile opened twice" from a network event into a file read.&lt;/p&gt;

&lt;p&gt;Caching matters for two less obvious reasons. The basemap provider counts tile requests against a monthly free allowance, so every cached tile is allowance left for someone exploring the map. And OpenStreetMap's policy asks clients to cache rather than repeatedly hit a donated server.&lt;/p&gt;

&lt;h2&gt;
  
  
  A size cap and a switch the user can find
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;MapTileCache&lt;/code&gt; owns the cache for all four maps. The limit is a setting in Storage and Downloads: off, or 50, 100, 250, 500, 1000, 2000 MB, defaulting to 200 MB. It is persisted locally and kept with the account settings, so a chosen cap survives a reinstall or a device change.&lt;/p&gt;

&lt;p&gt;The library's cache configuration is immutable once the instance exists, which forces an awkward lifecycle: changing the limit means destroying the cache and creating a new one. That raises two real problems.&lt;/p&gt;

&lt;p&gt;The first is ordering. The limit can change from the settings sheet and from a profile-settings sync in the same session, so reconfigurations are queued and a superseded one is skipped. The last requested limit wins, and an older destroy cannot land after a newer create.&lt;/p&gt;

&lt;p&gt;The second is reach. A map already on screen holds the provider it was built with, so replacing the cache instance would never reach it. Instead every map receives the same stable proxy provider, which resolves the active cache per request, so changing the cap affects everything without rebuilding a map.&lt;/p&gt;

&lt;p&gt;Clearing is the same operation with a delete: files are removed and the cache is re-created with the current limit, so maps keep caching instead of quietly falling back to the network forever.&lt;/p&gt;

&lt;p&gt;One policy runs through the class: every read and write failure is swallowed as a cache miss. A torn-down cache, a corrupt entry, a permission problem — each logs a line and lets the network win. A cache that can blank a map is worse than no cache, because the failure looks like the feature.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the cache key must not contain
&lt;/h2&gt;

&lt;p&gt;Keys are built from the tile URL without its query string:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="nf"&gt;_tileKeyGenerator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;uri&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Uri&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tryParse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;stable&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;uri&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'${uri.scheme}://${uri.host}${uri.path}'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;BuiltInMapCachingProvider&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;uuidTileKeyGenerator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;stable&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A tile's identity is its style, zoom, column and row. Credentials are not part of it: keying on them means a rotated client identifier orphans the whole cache, so you pay the full download cost exactly when you changed a configuration value. Keeping the query string out also means a cache entry cannot leak a credential onto disk.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this pattern does not solve
&lt;/h2&gt;

&lt;p&gt;The dark style is only designed when the provider is configured; everything else is the inverted stopgap, which the product should say out loud.&lt;/p&gt;

&lt;p&gt;Caching helps repeated views, not the first paint. The first open of a fullscreen map still fetches tiles, and the backdrop colour is what stops that from reading as a failure.&lt;/p&gt;

&lt;p&gt;Marker avatars were out of scope. The style resolution and the "should this tile set be darkened" predicate are unit-tested because they are pure functions; the rest is visual and needs a device pass in light, dark and an AMOLED theme, plus a deliberately failing provider.&lt;/p&gt;

&lt;h2&gt;
  
  
  The short version
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Resolve the map style once, from an explicit preference that falls back to the app's brightness.&lt;/li&gt;
&lt;li&gt;Prefer a basemap style published by the provider; treat an inverted light map as a stopgap, and say so.&lt;/li&gt;
&lt;li&gt;Fall back per request, not per map: a failing tile should degrade to another source, not to a hole.&lt;/li&gt;
&lt;li&gt;Make attribution a widget in the shared layer. Reposition it, never remove it, and let its wording follow the sources in use.&lt;/li&gt;
&lt;li&gt;Bound the cache, expose the limit, and make clearing it a real operation.&lt;/li&gt;
&lt;li&gt;Key cached tiles by what the tile is, never by what the request carried.&lt;/li&gt;
&lt;li&gt;Set the backdrop to the theme's surface so the first frame is not a grey flash.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The same lesson showed up in our &lt;a href="https://frankmilvus.github.io/folcadi-articles/articles/2026-11-13-floating-glass-chrome-flutter.html" rel="noopener noreferrer"&gt;floating glass header work&lt;/a&gt;: once one widget owns the appearance, the screens stop disagreeing. A map is just a surface that happens to come from somewhere else.&lt;/p&gt;

&lt;p&gt;If you have shipped a map inside a dark app, I would like to know which corner your attribution lives in — the honest answer for us was "not always bottom-right".&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Get Folcadi&lt;/strong&gt; — a language-exchange messenger with live translation.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Official website:&lt;/strong&gt; &lt;a href="https://folcadi.com" rel="noopener noreferrer"&gt;folcadi.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Android:&lt;/strong&gt; &lt;a href="https://play.google.com/store/apps/details?id=com.folcadi.app" rel="noopener noreferrer"&gt;Google Play&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Windows:&lt;/strong&gt; &lt;a href="https://github.com/FrankMilvus/folcadi-releases/releases/latest" rel="noopener noreferrer"&gt;.zip or installer&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Linux:&lt;/strong&gt; &lt;a href="https://github.com/FrankMilvus/folcadi-releases/releases/latest" rel="noopener noreferrer"&gt;.deb or portable tarball&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Articles:&lt;/strong&gt; &lt;a href="https://frankmilvus.github.io/folcadi-articles/" rel="noopener noreferrer"&gt;write-ups and covers&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Telegram:&lt;/strong&gt; &lt;a href="https://t.me/frank_says" rel="noopener noreferrer"&gt;@frank_says&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Facebook:&lt;/strong&gt; &lt;a href="https://facebook.com/FrankMilvusSays" rel="noopener noreferrer"&gt;facebook.com/FrankMilvusSays&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>showdev</category>
      <category>flutter</category>
      <category>maps</category>
      <category>ux</category>
    </item>
  </channel>
</rss>
