dart-add-unit-test
Write and organize unit tests for functions, methods, and classes using `package:test`. Use when creating new logic or fixing bugs to ensure code remains…
Use `LayoutBuilder`, `MediaQuery`, or `Expanded/Flexible` to create a layout that adapts to different screen sizes. Use when you need the UI to look good on both mobile and tablet/desktop form factors.
$ npx -y skills add flutter/agent-plugins --skill flutter-build-responsive-layout --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/flutter-build-responsive-layoutContext preview
The summary Claude sees to decide when to auto-load this skill.
Use `LayoutBuilder`, `MediaQuery`, or `Expanded/Flexible` to create a layout that adapts to different screen sizes. Use when you need the UI to look good on both mobile and tablet/desktop form factors.
name: flutter-build-responsive-layout description: Use `LayoutBuilder`, `MediaQuery`, or `Expanded/Flexible` to create a layout that adapts to different screen sizes. Use when you need the UI to look good on both mobile and tablet/desktop form factors. metadata: model: models/gemini-3.1-pro-preview last_modified: Tue, 21 Apr 2026 20:17:40 GMT
Determine the available space accurately to ensure layouts adapt to the app window, not just the physical device.
Understand and apply Flutter's core layout rule: **Constraints go down. Sizes go up. Parent sets position.**
Ensure the app behaves correctly across all device form factors and input methods.
Follow this workflow to implement a layout that adapts to the available `BoxConstraints`.
**Task Progress:**
Follow this workflow to prevent UI elements from stretching unnaturally on large displays.
**Task Progress:**
Demonstrates switching between a mobile and desktop layout based on available width.
import 'package:flutter/material.dart';
const double largeScreenMinWidth = 600.0;
class AdaptiveLayout extends StatelessWidget {
const AdaptiveLayout({super.key});
@override
Widget build(BuildContext context) {
return LayoutBuilder(
builder: (context, constraints) {
if (constraints.maxWidth > largeScreenMinWidth) {
return _buildLargeScreenLayout();
} else {
return _buildSmallScreenLayout();
}
},
);
}
Widget _buildLargeScreenLayout() {
return Row(
children: [
const SizedBox(width: 250, child: Placeholder(color: Colors.blue)),
const VerticalDivider(width: 1),
Expanded(child: const Placeholder(color: Colors.green)),
],
);
}
Widget _buildSmallScreenLayout() {
return constAgent plugins for Flutter, maintained by the Flutter team. A collection of plugins designed to extend AI agent capabilities for Flutter development.
Write and organize unit tests for functions, methods, and classes using `package:test`. Use when creating new logic or fixing bugs to ensure code remains…
Architectural patterns, entrypoint structure, exit codes, stream routing, and subprocess spawning for Dart command-line interface (CLI) applications. Use when…
Collect coverage using the coverage packge and create an LCOV report
Uses get_runtime_errors and lsp to fetch an active stack trace, locate the failing line, apply a fix, and verify resolution via hot_reload.
Define and generate mock objects for external dependencies using `package:mockito` and `build_runner`. Use when unit testing classes that depend on complex…
Replace the usage of `expect` and similar functions from `package:matcher` to `package:checks` equivalents.