frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Building Local-First Flutter Apps with Riverpod, Drift, and PowerSync

https://dinkomarinac.dev/building-local-first-flutter-apps-with-riverpod-drift-and-powersync
31•kobieps•4d ago

Comments

account-5•3d ago
Why not just use sqlite instead of drift?
kobieps•2d ago
Probably easier to ask an LLM, but here goes: drift gives you type-safe queries which lets you catch any errors at compile time instead of runtime (which is the case with sqlite). There are other benefits but that's probably the main one.
taormina•5h ago
It’s still SQLite. Drift as an ORM they are using on top of SQLite.
doawoo•5h ago
As a newer user of Flutter I found Riverpod to be extremely heavy and have a lot more mental overhead than using stateless widgets with Hooks.

Any particular reason you personally prefer Riverpod?

dinko7•3h ago
Hi, author of the article here.

Any state management approach requires you to adapt your way of thinking, whether that be BLoC, Riverpod, Redux or anything you want to use.

Rivepod gained popularity because it's really simple to pick up: create a Notifier, create a Provider for it, and observe, while some other approaches require additional boilerplate, setup, and understanding.

Your approach would work if you are only observing that state from a single widget, which might not always be the case. Additionally, assuming useState is using setState under the hood means it will rebuild the whole widget on change, while with Riverpod, you have the flexibility to wrap any part of a complex widget into a Consumer or listen to only part of the exposed state on the Notifier with .select().

To put it simply: - Notifiers are used for app state - Hooks are used for ephemeral state (local widget state)

Hope this clears it bit for you.

doawoo•3h ago
Great summary, it does indeed! Thanks for taking the time to reply
vin047•2h ago
Riverpod does a lot more than just state management - it also handles dependency injection and reactive caching.

Here’s a great guide on using Riverpod: https://codewithandrea.com/articles/flutter-state-management...

XorNot•33m ago
This was my experience as well. I have however been very happy with get_it <https://pub.dev/packages/get_it> and watch_it <https://pub.dev/packages/watch_it> though, which just totally clicked for me in terms of how it works with the state store (database).
sgt•4h ago
Would this work with Flutter Web as well?
kobieps•4h ago
Yes
sgt•3h ago
Flutter Web used to be pretty slow but I note that it has improved substantially in the last 2 years.
zerr•3h ago
I wonder why Flutter didn't gain traction in US. It seems to be more or less popular in poor countries and even less in Europe. But in US it seems to be quite a no name. Why US is so JavaScript-centric?
dleeftink•2h ago
> poor countries

Ah yes, those fluttering countries and their fluttery ways

vin047•2h ago
There are a lot more JS and Native developers compared to Flutter/Dart developers in the West. Plus fear-mongering around Google dropping development of Flutter.
taormina•37m ago
Uh what? It’s extremely popular in the US? You wanna source that claim?
hosh•1h ago
Let's be clear. This post describes an architecture that is offline-first, not local-first.

One of the main goals of local-first is so that the user of a local-first application owns their own data. (See Martin Kleppmann's paper on this).

As such, local-first applications don't necessarily have a concept of a central server. `git` is local-first, though most teams synchronize to a hub such as Github or Gitlab. This is a design principle to get away from having to sync to the cloud, making it more difficult to monetize as a SAAS. There seems to be a growing trend of people promoting offline-first applications as local-first, but structuring it to still lock people's data into their SAAS. (If you want to lock them in, then say so -- call it offline-first).

A true local-first mobile app would allow me to collaborate with someone in the same room using Bluetooth, even out somewhere where I don't have wifi, cell service or Starlink

See:

- https://martin.kleppmann.com/papers/local-first.pdf

- https://www.inkandswitch.com/essay/local-first/ (Same, but in html)

Sierpiński Triangle? In My Bitwise and?

https://lcamtuf.substack.com/p/sierpinski-triangle-in-my-bitwise
64•guiambros•2h ago•17 comments

Show HN: Xenolab – Rasp Pi monitor for my pet carnivourus plants

https://github.com/blackrabbit17/xenolab
53•malux85•3h ago•17 comments

US vs. Google amicus curiae brief of Y Combinator in support of plaintiffs [pdf]

https://storage.courtlistener.com/recap/gov.uscourts.dcd.223205/gov.uscourts.dcd.223205.1300.1.pdf
308•dave1629•9h ago•496 comments

Why the Apple II Didn't Support Lowercase Letters (2020)

https://www.vintagecomputing.com/index.php/archives/2833/why-the-apple-ii-didnt-support-lowercase-letters
29•colinbartlett•3h ago•20 comments

Observations from People Watching

https://skincontact.substack.com/p/21-observations-from-people-watching
15•jger15•1h ago•5 comments

A Critical Look at MCP

https://raz.sh/blog/2025-05-02_a_critical_look_at_mcp
299•ablekh•9h ago•178 comments

Show HN: LoopMix128 – Fast C PRNG (.46ns), 2^128 Period, BigCrush/PractRand Pass

https://github.com/danielcota/LoopMix128
24•the_othernet•2h ago•14 comments

For $595, you get what nobody else can give you for twice the price (1982) [pdf]

https://s3data.computerhistory.org/brochures/commodore.commodore64.1982.102646264.pdf
103•indigodaddy•6h ago•67 comments

Reverse engineering the 386 processor's prefetch queue circuitry

http://www.righto.com/2025/05/386-prefetch-circuitry-reverse-engineered.html
103•todsacerdoti•7h ago•29 comments

Pope Leo XIV: "AI poses new challenges re: human dignity, justice and labour"

https://www.vatican.va/content/leo-xiv/en/speeches/2025/may/documents/20250510-collegio-cardinalizio.html
83•90s_dev•4h ago•28 comments

Alan Kay Did Not Invent Objects (2019)

https://www.hillelwayne.com/post/alan-kay/
16•iamwil•3d ago•13 comments

Eagle Hunters of Kyrgyzstan

https://magazine.atavist.com/the-eagle-hunters-of-kyrgyzstan-world-nomad-games/
15•gmays•3d ago•2 comments

Comparison of C/POSIX standard library implementations for Linux

https://www.etalabs.net/compare_libcs.html
81•smartmic•9h ago•27 comments

Adventures in Imbalanced Learning and Class Weight

http://andersource.dev/2025/05/05/imbalanced-learning.html
27•andersource•2d ago•3 comments

Show HN: Code Claude Code

https://github.com/RVCA212/codesys
91•sean_•9h ago•19 comments

Embracer Games Archive is preserving 75000 video games and needs contributions

https://embracergamesarchive.com/
129•draugadrotten•12h ago•61 comments

Microsoft Teams will soon block screen capture during meetings

https://www.bleepingcomputer.com/news/microsoft/microsoft-teams-will-soon-block-screen-capture-during-meetings/
95•josephcsible•4h ago•155 comments

Private Japanese lunar lander enters orbit around moon ahead of a June touchdown

https://phys.org/news/2025-05-private-japanese-lunar-lander-orbit.html
196•pseudolus•3d ago•58 comments

How much information is in DNA?

https://dynomight.substack.com/p/dna
50•crescit_eundo•2d ago•46 comments

Weave (YC W25) is hiring a founding engineer

https://www.ycombinator.com/companies/weave-3/jobs
1•adchurch•7h ago

Email Forwarding for Your Domain

https://mailwip.com
48•codazoda•5h ago•36 comments

The State of SSL Stacks

https://www.haproxy.com/blog/state-of-ssl-stacks
11•zdw•3d ago•0 comments

Gmail to SQLite

https://github.com/marcboeker/gmail-to-sqlite
302•tehlike•19h ago•92 comments

React Three Ecosystem

https://www.react-three.org/
98•bpierre•11h ago•42 comments

Building Local-First Flutter Apps with Riverpod, Drift, and PowerSync

https://dinkomarinac.dev/building-local-first-flutter-apps-with-riverpod-drift-and-powersync
31•kobieps•4d ago•16 comments

Not a three-year-old chimney sweep (2022)

https://fakehistoryhunter.net/2022/07/26/not-a-3-year-old-chimney-sweep/
99•nixass•17h ago•57 comments

Detect and crash Chromium bots

https://blog.castle.io/detect-and-crash-chromium-bots-with-one-weird-trick-bots-hate-it/
123•avastel•3d ago•35 comments

The Deathbed Fallacy (2018)

https://www.hjorthjort.xyz/2018/02/21/the-deathbed-fallacy.html
232•mefengl•14h ago•110 comments

Prolog's Eternal September (2017)

https://storytotell.org/prologs-eternal-september
71•Tomte•2d ago•55 comments

'It cannot provide nuance': UK experts warn AI therapy chatbots are not safe

https://www.theguardian.com/technology/2025/may/07/experts-warn-therapy-ai-chatbots-are-not-safe-to-use
102•distalx•8h ago•112 comments