flutter-ui-essentials
БесплатноБез исполняемых скриптовНе проверенEveryday details to get right while writing Flutter UI, such as text fields and forms, dates and numbers, missing values, network images, lists and scrolling…
от kamranbekirovyz★ 139 звёзд на GitHubОб этом скилле
Flutter UI Essentials
Write Flutter UI that follows the rules below.
How it works
- Read the rules below before writing any UI code.
- If the user ran the skill without giving a task, reply with only "Let's Flutter it 🩵" and wait. Do not ask what to build.
- While writing, apply every rule whose case shows up in the code you write.
- Only new code and code you are changing. Leave the rest of the app alone.
- When a rule needs a package, widget, helper or extension, look for one in the app that does the same job and use it. If there is none, add the package or build the piece once, wherever it fits best in the app's structure, then reuse it. When the rule gives the code, use it as is.
- When done, list the rules you applied and anything you added (packages, widgets, helpers, extensions), one line each.
Rules
Lists and scrolling
- Don't wrap a scrollable list with
SafeArea. It makes the content stop above the system bar instead of scrolling under it. AddBottomPaddingas the last item instead, or useBottomPadding.of(context)as the bottom padding.
// As the last item
SingleChildScrollView(
child: Column(
children: [
CategoriesList(),
const BottomPadding(),
],
),
)
// As the bottom padding
ListView(
padding: EdgeInsets.only(
bottom: BottomPadding.of(context),
),
)
// The list already has padding: keep it, pass the same number as minimum
SingleChildScrollView(
padding: const EdgeInsets.all(24).copyWith(
bottom: BottomPadding.of(context, minimum: 24),
),
)
import 'package:flutter/widgets.dart';
class BottomPadding extends StatelessWidget {
const BottomPadding({super.key});
static double of(
BuildContext context, {
double minimum = 16,
}) {
// Get size of the bottom system bar
final double viewPadding = MediaQuery.viewPaddingOf(context).bottom;
// Use the system bar size if it's bigger than the minimum,
// otherwise fall back to the minimum.
final double height = viewPadding > minimum ? viewPadding : minimum;
return height;
}
@override
Widget build(BuildContext context) {
final double height = of(context);
// Return a box of that height.
return SizedBox(height: height);
}
}
- When a page contains a horizontal list, don't put horizontal padding on the page's scroll view. That padding cuts the horizontal list off before the screen edge. Leave the page edge to edge, give each section its own horizontal padding, and put the padding of the horizontal list inside the list itself, so its items scroll all the way to the edge.
SingleChildScrollView(
// no horizontal padding here
child: Column(
children: [
const Padding(
padding: EdgeInsets.symmetric(horizontal: 16),
child: SectionTitle('New arrivals'),
),
SizedBox(
height: 318,
child: ListView.separated(
scrollDirection: Axis.horizontal,
// the list has its own padding
padding: const EdgeInsets.symmetric(horizontal: 16),
itemCount: products.length,
itemBuilder: (_, int index) {
return ProductItem(product: products[index]);
},
separatorBuilder: (_, _) {
return const SizedBox(width: 8);
},
),
),
],
),
)
- Wrap every list or page that scrolls up and down with
Scrollbar. If the list has its ownScrollController, pass it to both. Skip it forPageViewand wheel pickers.
Scrollbar(
controller: controller,
child: ListView.builder(
controller: controller,
...
),
)
- When a page gives its list its own
ScrollController, wrap theScaffoldin aPrimaryScrollControllerwith the same controller. On iOS a tap on the status bar scrolls the page to the top.Scaffolddoes that by itself, but it stops working once the list has its own controller, unless you hand that controller over like this.
PrimaryScrollController(
controller: _scrollController, // pass here
child: Scaffold(
body: ListView(
controller: _scrollController, // and to the list
children: [
// ...
],
),
),
)
Text
- When you show a value that can be missing, never let the user see the word "null" or an empty spot. Use
orPlaceholder()to show "-" instead, orisUsableto hide the widget. A value is missing when it isnull, an empty string, or the text"null"that some backends send.
// Show a placeholder
Text(
user.name.orPlaceholder(),
)
// Hide the widget
if (user.profession.isUsable)
Text(
user.profession!,
)
// Not a String: call toString() first
Text(
order.totalPrice.toString().orPlaceholder(),
)
// Something in the chain can be null: wrap all of it in parentheses
Text(
(state.cartInfo?.totalPrice?.toString()).orPlaceholder(),
)
extension StringX on String? {
bool get isUsable {
return this != null && this!.isNotEmpty &
Установить flutter-ui-essentials в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл flutter-ui-essentials?
Everyday details to get right while writing Flutter UI, such as text fields and forms, dates and numbers, missing values, network images, lists and scrolling, and tap areas. Use before building or changing a Flutter screen, widget, form or list, or when the user invokes /flutter-ui-essentials.
Как установить скилл flutter-ui-essentials?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл flutter-ui-essentials запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic