material_design
1.8.1, released 3 months ago by an unverified publisher
A Material Design 3 contract enforcing design tokens via type-safe Dart APIs.
What it does
Enforces Material Design 3 tokens system-wide by replacing free primitives with type-safe equivalents like M3SpacingValue, M3TypeScale, and M3Shape. It maps spacing, shapes, elevations, colors, and motion directly into type checks so off-scale values cause compile errors.
AI-written summary of version 1.8.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want strict enforcement of Material Design 3 token scales across your entire app.
- You want design parameters like spacing, text sizes, and elevations to be caught at compile-time if they violate guidelines.
Skip it when
- You are building a custom design system that does not follow Material Design 3.
- You prefer using standard Flutter primitives without strict type safety wrappers.
Strengths
- Catches design non-compliance at compile time instead of via code review.
- Zero runtime cost through compile-time extension types.
- Comprehensive coverage of M3 specs including spacing, typography, colors, iconography, and motion springs.
Weaknesses
- Locks your codebase into strict Material Design 3 conventions.
- Requires learning a new vocabulary of custom token widgets and types.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 3
Requires Flutter >=3.27.0 and Dart >=3.6.0. Simply add the package to dependencies and import it.
import 'package:flutter/material.dart';
import 'package:material_design/material_design.dart';
MaterialApp(
theme: M3TextTheme.applyToTheme(
ThemeData(
useMaterial3: true,
colorScheme: ColorScheme.fromSeed(seedColor: const Color(0xFF6750A4)),
),
),
home: const Scaffold(
body: M3Padding(
padding: M3EdgeInsets.all(M3Spacings.s16),
child: Text('Title', style: M3TypeScale.titleMedium),
),
),
);Alternatives
Packages that do the same job and could replace material_design.
- material_ui
If you want standard Material components without strict compile-time design contract constraints.
94Compare
Works with
Packages commonly used together with material_design: ones it builds on, ones built on it, and its own family.