flutter / flutter/flutter

Flutter Chips Do Not Match Material 3 Guidelines

Open
#162,690 4 comments 0 reactions 0 assignees View on GitHub
a: fidelity found in release: 3.27 found in release: 3.29 has reproducible steps p: material_ui P2 package team-design triaged-design
Dominant language
Dart
Stars
179k
Forks
31.1k
PR merge metrics
PR metrics pending

Description

### Steps to reproduce

1. Create two `Chip` widgets in a Flutter app one with no custom `labelStyle` and one with a custom `labelStyle` with a large font size (20px for example).
2. Observe its height and margins on mobile vs. web.

Alternatively you can run the included code sample and observe the height and margins of the chips included there.

### Expected results

- Chips should be **32px tall** across all platforms as per [Material 3 Chips guidelines](https://m3.material.io/components/chips/specs).
- Additional margin should not be applied unless explicitly set by the developer.

### Actual results

- According to the [Material 3 guidelines](https://m3.material.io/components/chips/specs), chips should have a height of **32px**.
- On **mobile (tablet and phone)**, Flutter’s chips are **taller than 32px**.
- Additionally, chips on mobile have **extra margins** due to `materialTapTargetSize` being set to `padded` by default.
- The **added margin varies** depending on chip contents, such as font size.
- This inconsistent margin makes it difficult to follow M3 guidelines, especially the **8px vertical spacing** between chips.
- On **web**, chips are **32px tall** with **no added margins**, aligning more closely with M3 guidelines.

#### Question

Is this behavior intentional per the Material 3 guidelines? If not, should Flutter’s chip implementation be updated to ensure consistent height and spacing across platforms?

### Code sample

Code sample

```dart
import 'package:flutter/material.dart';

void main() {
runApp(const MyApp());
}

class MyApp extends StatelessWidget {
const MyApp({super.key});

@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Material 3 Chip Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const MyHomePage(title: 'Material 3 Chip Demo'),
);
}
}

class MyHomePage extends StatelessWidget {
const MyHomePage({super.key, required this.title});
final String title;

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
RawChip(
labelStyle: TextStyle(
fontSize: 16,
),
label: Text(
'This is a RawChip with large font size',
),
),
RawChip(
label: Text(
'This is a RawChip with default font size',
),
),
],
),
),
);
}
}
```

### Screenshots or Video

Screenshots / Video demonstration

![Image](https://github.com/user-attachments/assets/29bbe4c8-1f09-4951-8cc5-d9e1b3d7a9aa)

![Image](https://github.com/user-attachments/assets/7c31d1fc-d8d3-4ac5-a911-e7abb90f1a64)

### Logs

Logs

```console
[Paste your logs here]
```

### Flutter Doctor output

Doctor output

```console
[✓] Flutter (Channel stable, 3.27.1, on macOS 15.2 24C101 darwin-arm64, locale en-US)
• Flutter version 3.27.1 on channel stable at /Users/ashley.novik/Documents/devkit/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 17025dd882 (7 weeks ago), 2024-12-17 03:23:09 +0900
• Engine revision cb4b5fff73
• Dart version 3.6.0
• DevTools version 2.40.2

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
• Android SDK at /Users/ashley.novik/Library/Android/sdk
• Platform android-35, build-tools 35.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 21.0.3+-79915917-b509.11)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 16C5032a
• CocoaPods version 1.15.2

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 21.0.3+-79915917-b509.11)

[✓] IntelliJ IDEA Ultimate Edition (version 2024.1.1)
• IntelliJ at /Applications/IntelliJ IDEA.app
• Flutter plugin version 79.2.3
• Dart plugin version 241.17502

[✓] VS Code (version 1.96.4)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.102.0

[✓] Connected device (4 available)
• iPad mini (A17 Pro) (mobile) • C28AE52A-E449-4861-A6E1-1D668918AFA3 • ios • com.apple.CoreSimulator.SimRuntime.iOS-18-2 (simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 15.2 24C101 darwin-arm64
• Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 15.2 24C101 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 132.0.6834.160

[✓] Network resources
• All expected network resources are available.

• No issues found!
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.