SShortSingh.
Back to feed

Flutter Clean Architecture: Using BLoC to Scale Apps Beyond setState

0
·1 views

The article argues that common Flutter patterns like setState or a single catch-all controller break down in multi-team production apps handling concurrent requests, offline caching, and deep links. It recommends a three-layer design, with a pure Dart domain layer, a data layer that maps remote and local sources to domain entities, and a presentation layer built on BLoCs. Using a food delivery platform as the example, it shows a repository implementation that falls back to cached data when connectivity is lost. It also advises modeling BLoC states as finite state machines using sealed classes rather than one monolithic state with many nullable fields. This structure is presented as a way to avoid race conditions and unnecessary widget rebuilds.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Team Eliminates Support Tickets With AI Bot Trained on Markdown Docs at Zero Cost

A development team describes how they replaced support tickets with an AI bot trained on their Markdown documentation. The article is published on DEV Community and was posted on October 23. The bot was built so that users can get answers from the existing docs without submitting a ticket. The authors state that the setup runs at $0 per month. The source text is brief and provides few further technical details about the implementation.

0
ProgrammingDEV Community ·

Choosing Retry Boundaries for Node.js Worker Pools: SQS, RabbitMQ, or BullMQ

The article argues that the key question for a rate-limited worker pool is who owns a failed delivery and what happens after the final attempt, not which queue is fastest. Amazon SQS suits small teams that want managed operations and a policy-driven dead-letter queue for repeated failures. RabbitMQ offers broker-level control and routing flexibility, but the team must build its own retry and dead-letter logic. BullMQ provides a Node.js-oriented job API with explicit retry and backoff, though it makes Redis part of the reliability boundary. In every option, the author recommends making the worker idempotent to avoid duplicate updates and endless requeue loops.

0
ProgrammingDEV Community ·

Free Offline KDV Calculator PWA Supports 22 Languages and International VAT Rates

A developer built a free Progressive Web App to calculate KDV, Turkey's value-added tax, after finding that many existing calculators produce incorrect results. The tool supports standard Turkish rates of 1%, 8%, and 18% as well as custom rates, and uses the correct formula, such as dividing the gross amount by 1.20 for a 20% rate. It can be installed on iPhone and Android without an app store, works offline, requires no signup, and keeps data on the user's device. The developer also lists VAT rates for Germany, France, and the Netherlands, and the wider app offers more than 25 tools available in 22 languages.

0
ProgrammingDEV Community ·

Why one developer keeps a paper notebook beside the keyboard instead of an app

A developer reports repeatedly trying to swap their paper notebook for a note-taking app, and failing each time. The main obstacle is speed: a useful debugging thought fades in about four seconds, and opening an app takes longer than that. Writing a notebook entry takes only a moment. The author recommends jotting the smallest useful detail, such as the failing command or the expected versus actual value. Those brief notes tend to be quicker to reread than searching again when the same problem returns.