Skip to main content

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.

Version 1.1

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​

InstallationAdd the BOM or the packages, and choose devtools per build
Quick startA list that pages, with its loading, error and retry states
How it fits togetherThe layers, and why a failure is translated once
ModulesOne page per module: what it holds and how to use it
GuidesTesting, a production setup, and paging with Camouflage

What is in the box​

ModuleFor
ModelsDomain, Remote, Entity, envelopes, Result, ViewState
ExceptionTyped failures with codes, guards, a crash reporter
L10nThe failures' messages in English and Indonesian
PagingPager, PagingState, LoadType
PresentationState and one-time effects, with a view model or a notifier
NetworkAn HTTP client with auth, token refresh, retry and polling
SecurityField encryption and a biometric vault
StoragePreferences and secrets that fail with typed errors
TestingA fake for every interface
CamouflagePaging state for Camouflage's CamoPagedList
DevToolsAn in-app inspector that never reaches production

Every module is released at one version, so any set of them fits together.