Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

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от kamranbekirovyz★ 139 звёзд на GitHub

Об этом скилле

Flutter UI Essentials

Write Flutter UI that follows the rules below.

How it works

  1. Read the rules below before writing any UI code.
  2. 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.
  3. While writing, apply every rule whose case shows up in the code you write.
  4. Only new code and code you are changing. Leave the rest of the app alone.
  5. 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.
  6. 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. Add BottomPadding as the last item instead, or use BottomPadding.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 own ScrollController, pass it to both. Skip it for PageView and wheel pickers.
Scrollbar(
  controller: controller,
  child: ListView.builder(
    controller: controller,
    ...
  ),
)
  • When a page gives its list its own ScrollController, wrap the Scaffold in a PrimaryScrollController with the same controller. On iOS a tap on the status bar scrolls the page to the top. Scaffold does 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, or isUsable to hide the widget. A value is missing when it is null, 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 &
Полный SKILL.md на GitHub

Установить 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), без исполняемых скриптов.

Похожие скиллы

Сравнить flutter-ui-essentials с