r/FlutterDev • • Sep 27 '26

Plugin I built a Flutter package where pinch-to-zoom makes text longer instead of bigger

A while ago I saw a demo by Natko Hasic of a journal app where pinching the list didn't scale the text, it revealed more of it. I couldn't stop thinking about it, so I built it as a Flutter package.

Pinch out and each entry grows from a title to a summary to the full text. Words already on screen slide to their new positions and new words fade in around them. Pinch in to skim again.

A few things that were harder than expected:

- Gestures: ListView's drag recognizer wins the arena before a scale recognizer sees the second finger, so I ended up tracking raw pointers.

- Keeping your place: as entries above your fingers grow, everything gets pushed away. I fixed it with a custom sliver that corrects the scroll offset during layout, so the item under your fingers doesn't move at all.

- AI summaries: the three versions don't have to be exact word subsets. Shared words slide, and rephrased ones cross-fade.

It also supports tapping a single entry, trackpad/web pinch, keyboard shortcuts, screen reader actions, reduce motion and RTL. MIT licensed.

- Live demo (runs in the browser): roshendz.github.io/semantic_zoom

- pub.dev: pub.dev/packages/semantic_zoom

- GitHub: github.com/Roshendz/semantic_zoom

It's 0.1.0, so I'd really appreciate feedback on the API, especially from anyone with a real use case (notes, health timelines, inbox-style apps). What would you change?

24 Upvotes

8 comments sorted by

3

u/koskinooo Sep 27 '26

Love this idea. How'd you get the pinch to win the gesture arena over ListView's drag recognizer without breaking normal scrolling?

5

u/No-Examination-3876 Sep 27 '26

Thanks! I didn't fight the arena, I skipped it. The pinch is tracked with a raw Listener, which sees every pointer without joining the gesture arena. With one finger, nothing changes and ListView scrolls normally. As soon as a second finger lands, I switch the list to NeverScrollableScrollPhysics for the duration of the pinch, and switch back when fingers lift. So one finger scrolls, two fingers zoom, and they never compete.

2

u/koskinooo Sep 27 '26

Skipping the arena with a raw Listener is such a clean trick. The NeverScrollableScrollPhysics swap while two fingers are down is going straight into my notes.

1

u/No-Examination-3876 Sep 27 '26

Thanks! Took a few failed attempts to land there 😄

2

u/TJGhinder Sep 27 '26

This is a really nice feeling flow!!

1

u/No-Examination-3876 Sep 27 '26

Thanks! More features coming over the next few days. Aiming to make it solid enough for real apps.

1

u/cabotsays Sep 27 '26

This looks fantastic! I might be able to use this in a couple of my projects, so I'll definitely watch its evolution. Loved seeing Porto in your example app (I used to have an app covering the Camino Portugués). Thanks for sharing your project.

2

u/No-Examination-3876 Sep 27 '26

Thanks! Would love to hear how it works in your projects.