m3-web-flutter
Material Design 3 — Flutter
Overview
Flutter has built-in M3 support since version 3.16. The material library provides M3 components, dynamic color, and theming. Full M3 Expressive support is being developed as modular packages (m3e_design).
Keywords: Material Design 3, M3, Flutter, Dart, cross-platform, dynamic color, Material You, m3e_design, mobile
When to Use
- Cross-platform mobile, web, and desktop apps using Flutter
- When you want official M3 support from Google
- Projects needing dynamic color (Material You) on Android 12+
Setup
M3 is built into Flutter — no additional packages needed for baseline:
MaterialApp(
theme: ThemeData(
useMaterial3: true,
colorSchemeSeed: const Color(0xFF6750A4),
),
darkTheme: ThemeData(
useMaterial3: true,
brightness: Brightness.dark,
colorSchemeSeed: const Color(0xFF6750A4),
),
home: const MyApp(),
);
Dynamic Color (Material You)
On Android 12+, use the device's wallpaper-based dynamic color:
import 'package:dynamic_color/dynamic_color.dart';
DynamicColorBuilder(
builder: (ColorScheme? lightDynamic, ColorScheme? darkDynamic) {
return MaterialApp(
theme: ThemeData(
colorScheme: lightDynamic ?? ColorScheme.fromSeed(
seedColor: const Color(0xFF6750A4),
),
useMaterial3: true,
),
darkTheme: ThemeData(
colorScheme: darkDynamic ?? ColorScheme.fromSeed(
seedColor: const Color(0xFF6750A4),
brightness: Brightness.dark,
),
useMaterial3: true,
),
);
},
);
Component Examples
Buttons
FilledButton(onPressed: () {}, child: const Text('Filled')),
OutlinedButton(onPressed: () {}, child: const Text('Outlined')),
TextButton(onPressed: () {}, child: const Text('Text')),
FilledButton.tonal(onPressed: () {}, child: const Text('Tonal')),
ElevatedButton(onPressed: () {}, child: const Text('Elevated')),
Cards
Card(
elevation: 1,
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Title', style: Theme.of(context).textTheme.titleMedium),
Text('Content', style: Theme.of(context).textTheme.bodyMedium),
],
),
),
),
Text Fields
TextField(
decoration: const InputDecoration(
labelText: 'Email',
border: OutlineInputBorder(),
),
),
Navigation
NavigationBar(
selectedIndex: currentIndex,
onDestinationSelected: (index) => setState(() => currentIndex = index),
destinations: const [
NavigationDestination(icon: Icon(Icons.home), label: 'Home'),
NavigationDestination(icon: Icon(Icons.search), label: 'Search'),
NavigationDestination(icon: Icon(Icons.settings), label: 'Settings'),
],
),
M3 Expressive Package
# pubspec.yaml
dependencies:
m3e_design: ^latest
M3 Expressive adds enhanced shapes, motion, typography, and new components to Flutter's M3 implementation.
Checklist
-
useMaterial3: trueset inThemeData -
colorSchemeSeedorColorScheme.fromSeedused for color generation - Both light and dark themes defined
- Dynamic color used on Android 12+ where appropriate
- Typography uses
Theme.of(context).textThemefor M3 type scale - Components use Material 3 variants (e.g.,
FilledButton, notRaisedButton)
Resources
- Flutter M3 guide: https://docs.flutter.dev/ui/design/material
- M3 for Flutter: https://m3.material.io/develop/flutter
- Dynamic color package: https://pub.dev/packages/dynamic_color
- M3 Expressive tracking: https://github.com/flutter/flutter/issues/168813
More from shelbeely/shelbeely-agent-skills
material-design-3-guide
Master guide for Material Design 3 — covering the full specification from Material You foundations through M3 Expressive. Explains when to use each Material Design 3 skill subset (color, motion, typography, shape, layout, components, icons). Use this when starting a Material Design 3 project, when you need to understand which M3 skill to apply, or when the user asks about Material Design 3 in general.
28material-design-3-components
Comprehensive guide to Material Design 3 components — from baseline Material You through M3 Expressive. Covers action, containment, communication, navigation, selection, and text input components with specifications, states, and implementation guidelines. Use this when building or styling UI components following Material Design 3 guidelines.
27material-design-3-typography
Applies Material Design 3 Expressive typography principles including variable fonts, type scales, and hierarchy. Use this when working on text styling, type hierarchy, readable interfaces, or when the user asks to apply Material Design 3 typography guidelines.
21material-design-3-layout
Applies Material Design 3 Expressive layout, spacing, and size hierarchy principles including grid systems, responsive design, and elevation. Use this when working on page layouts, spacing, grids, responsive design, or when the user asks to apply Material Design 3 layout guidelines.
20material-design-3-motion
Applies Material Design 3 Expressive motion and animation principles to create natural, intuitive, and engaging user experiences. Use this when implementing animations, transitions, micro-interactions, or when the user asks to apply Material Design 3 motion guidelines.
17material-design-3-color
Applies Material Design 3 Expressive dynamic color and theming principles to user interfaces. Use this when working on color palettes, themes, dynamic color systems, accessibility, or when the user asks to apply Material Design 3 color guidelines to a design or application.
16