Using Sinew
Sinew is a plug-and-play app architecture for Kotlin Multiplatform and Flutter. It ships the plumbing every app rewrites (response mapping, results, a coded and localized error model, paging, presentation base classes, an HTTP client with token refresh, secure storage and developer tools) as small packages you add one by one. Sinew ships the mechanism; your app ships the configuration.
These docs are for developers using Sinew in an app: adding the packages, wiring them, and building a screen on them. Every sample has a Kotlin and a Dart version; the language switch in the sidebar changes them all.
Sinew 1.1.0 is out (1.0.0 was the first release): the Kotlin modules are on Maven Central (com.srctool.sinew) and the Dart packages are on pub.dev (publisher srctool.com). Every module is released at one version, and the changelog lists what is in it.
Start here
| Installation | Add the BOM or the packages, and choose devtools per build |
| Quick start | A list that pages, with its loading, error and retry states |
| How it fits together | The layers, and why a failure is translated once |
| Modules | One page per module: what it holds and how to use it |
| Guides | Testing, a production setup, and paging with Camouflage |
What is in the box
| Module | For |
|---|---|
| Models | Domain, Remote, Entity, envelopes, Result, ViewState |
| Exception | Typed failures with codes, guards, a crash reporter |
| L10n | The failures' messages in English and Indonesian |
| Paging | Pager, PagingState, LoadType |
| Presentation | State and one-time effects, with a view model or a notifier |
| Network | An HTTP client with auth, token refresh, retry and polling |
| Security | Field encryption and a biometric vault |
| Storage | Preferences and secrets that fail with typed errors |
| Testing | A fake for every interface |
| Camouflage | Paging state for Camouflage's CamoPagedList |
| DevTools | An in-app inspector that never reaches production |
Every module is released at one version, so any set of them fits together.