bluedev.in hello@bluedev.in

Mobile & Flutter / Flutter Packages / Package Deep Dives

Building a Theme System for Flutter: Notes from cus_theme

A theme should feel like a normal part of the app, not extra ceremony: light and dark modes, a consistent look, and a choice that's remembered between sessions.

1 min read Mobile & Flutter

Every Flutter app ends up needing the same handful of theming decisions: a light and dark palette, a consistent look and feel, spacing that's used the same way everywhere, and a way to switch between light and dark that survives closing the app. We'd rebuilt that from scratch on enough client projects that we packaged it as cus_theme, and a few of the decisions behind it are worth writing down.

Reading a theme value should be effortless

A screen that needs to know whether it's in dark mode, or wants to switch it, shouldn't have to go looking for the answer. cus_theme makes that a direct, one-line call from anywhere in the app, so theming reads like a normal decision instead of a chore.

Remembering the choice isn't optional

A theme toggle that forgets what someone picked the moment the app restarts isn't finished. cus_theme remembers the choice automatically, so switching to dark mode once means it stays that way, not just until the next time the app opens.

Start from something real, not a blank page

Color schemes, typography, spacing and animation are all included as ready presets, not just raw building blocks. A new project gets a working light and dark theme on day one, with individual pieces free to be swapped out later as the design settles.

Catch mistakes before they ship

Theme values in cus_theme are checked before the app even runs, so a typo in a color name gets caught immediately instead of quietly showing up as a missing color three weeks into a project. It's the kind of detail that only matters once, and matters completely when it does.

cus_theme is published as open source on pub.dev. The full install and usage notes are on its package page.

Want to talk about something like this?

We take on new projects across agentic systems, web, mobile and custom software.

Start a project