Kabo
banner
kaboc.bsky.social
Kabo
@kaboc.bsky.social
App Developer
Dart/Flutter, Go, SQL, PocketBase

https://github.com/kaboc
https://kaboc.cc/
An even better/easier way is to use GestureDetector instead of TextSpan + TapGestureRecognizer when there is no specific reason to use TextSpan. This way, you can avoid thinking about how you dispose the recognizer.
April 11, 2025 at 3:30 PM
April 3, 2025 at 2:45 PM
December 25, 2024 at 10:18 AM
IntrinsicHeight sometimes doesn't align the height of children of a Row (dunno why). CustomMultiChildLayout is another option, but cannot be used if the Row height is unbounded. So I created a custom RenderFlex as a last resort. IMO, this should be possible out of the box in #FlutterDev.
December 18, 2024 at 8:31 AM
Flutter automatically flips (most of) the UI horizontally including icons in RTL locales. But is this really correct?
December 4, 2024 at 2:49 PM
Keeping a tooltip open is possible with TooltipTriggerMode.manual + GestureDetector + TooltipState.ensureTooltipVisible() in Flutter, but a tap on the Tooltip child reopens the tooltip instead of closing it.

As a workaround, I had to use Tooltip.dismissAllToolTips() to get the visibility status.
December 2, 2024 at 12:41 PM
Wondering why the current state getter added to go_router several weeks ago returns a nullable type. Neither currentConfiguration, last or buildState() is nullable.
November 25, 2024 at 1:04 PM
For those not familiar with PocketBase, it's an open-source self-hosted BaaS, with the official Dart package!
pub.dev/packages/poc...

You can access the database from a client safely thanks to the API rules (i.e. security rules like RLS).

I personally prefer using it as a Go server framework.
November 25, 2024 at 7:59 AM
This would be much longer code if the language doesn't have pattern matching, collection-for/if and the spread operator. Dart is so powerful these days.
November 21, 2024 at 12:38 PM
T is either non-nullable or nullable, but in this example, `v` of type T is annotated as `T?` because the parameter is optional. It makes v nullable even when you know T is non-nullable, which is inconvenient.

In that case, a getter returning `v as T` removes the necessity of `!` or a null check.
November 20, 2024 at 2:16 PM
Generics in Dart is great (I mean, it's good enough), but it is confusing sometimes.
November 20, 2024 at 2:16 PM
It was not as hard as I was thinking to implement a feature to swipe down to close an image, which can also be zoomed and panned. It was achieved with only a little over 100 LOC.

One of the things I think is nice is a movement by a pull is slowed down if the distance is enough to close the view.
November 11, 2024 at 2:13 PM
Another difficulty (a bug) related to edge-to-edge. The Scrollbar widget for horizontal scrolling is displayed at a wrong position when the device has the unsafe area at the screen bottom and SafeArea is not used. The only solution I found is to use `removePadding(removeBottom: true)`.
November 7, 2024 at 1:38 PM
A bug I always thought was ugly is finally gone in Flutter 3.19!
February 23, 2024 at 10:42 AM
Looks like Dart 3.3 is coming very soon.
February 11, 2024 at 2:01 AM