Skip to content
pubscout

mix

2.4.0, released 10 days ago by leoafarias.com

A Flutter styling system that separates style definitions from widget code using a fluent API.

WASM-readyRock solid
$ flutter pub add mix
Source repository

What it does

Mix lets you define, compose, and apply visual styles to widgets outside of the build method. It supports conditional variants for hover, dark mode, breakpoints, and more.

AI-written summary of version 2.3.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You want a centralized, type‑safe way to manage design tokens and reusable styles
  • You need conditional styling (hover, dark mode, responsive) without scattering logic in widgets

Skip it when

  • Your app is simple and doesn’t require a separate styling layer
  • You prefer using the built‑in ThemeData approach

Strengths

  • Clear separation of style and UI logic
  • Composable, chainable API reduces duplication
  • Built‑in variant system for interaction and context

Weaknesses

  • Adds an extra abstraction layer to learn
  • May increase widget tree complexity
  • Limited to styling; not a full widget library

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
1
import 'package:mix/mix.dart';

final cardStyle = BoxStyler()
    .size(240, 100)
    .color(Colors.blue)
    .alignment(.center)
    .borderRadius(.circular(12))
    .border(.color(Colors.black).width(1).style(.solid));

Box(style: cardStyle, child: StyledText('Hello Mix', style: TextStyler().color(Colors.white).fontSize(18)),);

Alternatives

Packages that do the same job and could replace mix.

Works with

Packages commonly used together with mix: ones it builds on, ones built on it, and its own family.