본문으로 건너뛰기
cccskills
무료GitHub에 공개

stitch_to_flutter

Instructions for translating Google Stitch designs (HTML/Tailwind) into production-ready Flutter/Dart code.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md5.5 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Stitch to Flutter Skill

This skill documents how to translate UI designs generated by Google Stitch (which come as HTML and Tailwind CSS) into Flutter widgets, ensuring alignment with your Flutter project architecture and design system.

Core Conversion Principles

  1. Structure Mapping:

    • <div> with flex -> Column, Row, or Flex.
    • <div> with max-w-md mx-auto -> Center + ConstrainedBox or Container with maxWidth.
    • padding (p-4, px-6) -> Padding widget or padding property in Container/ListView.
    • space-y-4 -> ListView with gap (if available) or Column with SizedBox between items.
  2. Style Mapping:

    • Colors: Use Theme.of(context).colorScheme for dynamic colors. Map Tailwind custom colors (e.g., primary: "#F97316") to the project's brand colors in lib/core/theme/.
    • Typography: Map Tailwind font weights (font-bold) and sizes (text-3xl) to TextTheme scale tokens.
      • CRITICAL: Never used hardcoded fontSize. Always use Theme.of(context).textTheme.

Typography Mapping Table

Tailwind / StyleM3 Type Scale TokenUsage
text-4xl, text-5xldisplayLarge/Medium/SmallLarge hero text, brand elements
text-2xl, text-3xlheadlineLarge/Medium/SmallHigh-emphasis page headers
text-xl, font-boldtitleLarge/Medium/SmallSection headers, card titles
text-base, text-smbodyLarge/Medium/SmallLong-form reading, descriptions
text-xs, uppercaselabelLarge/Medium/SmallButtons, badges, captions
*   **Shadows**: Map `shadow-lg` to `BoxShadow` in `BoxDecoration`.
*   **Border Radius**: Map `rounded-2xl` to `BorderRadius.circular(16)`.

3. Component Mapping: * button -> ElevatedButton, TextButton, or custom Material + InkWell for complex cards. * header -> SliverAppBar or a custom AppBar. * nav -> BottomNavigationBar or a custom navigation widget. * span.material-icons-round -> Icon(Icons.<icon_name>).

  1. Tailwind Class to Flutter Decoration Table:
Tailwind ClassFlutter Equivalent
bg-whitecolor: Colors.white
rounded-xlborderRadius: BorderRadius.circular(12)
shadow-mdBoxShadow(color: Colors.black12, blurRadius: 4, offset: Offset(0, 2))
borderborder: Border.all(color: Colors.grey[200]!)
flex items-centerRow(crossAxisAlignment: CrossAxisAlignment.center)
flex flex-colColumn()

Implementation Patterns

Complex Action Cards

For cards like "Informar de un animal vulnerable", use:

Material(
  color: color,
  borderRadius: BorderRadius.circular(24),
  child: InkWell(
    onTap: onTap,
    child: Padding(
      padding: const EdgeInsets.all(24),
      // ... content
    ),
  ),
)

Dynamic Theme Usage

Always prioritize using Theme.of(context) to support Dark Mode automatically, as the Stitch designs often include dark: classes.

Atomic Design Mapping

When translating designs, follow the Atomic Design methodology to ensure components are reusable and well-structured:

LevelDefinitionStitch/HTML ExampleFlutter Equivalent
AtomsBasic building blocks.<button>, <input>, <span>, <img>AppButton, AppTextInput, AppBadge, Icon
MoleculesSimple groups functioning together.Labeled input, Icon + Text pair.LabeledInput, StatItem, StatusIndicator
OrganismsComplex UI sections.Personal Data Grid, Header with Avatar & Name.ProfileHeader, FormSection, ActionGrid
TemplatesPage structure without content.Page with Header and Sticky Footer.ProfilePageLayout
PagesCompleted page.Entire screen.ProfilePage

Rules for Components:

  1. Atoms should be generic and stateless. They only import from theme/quarks.
  2. Molecules combine atoms and provide specific layout/logic for those atoms.
  3. Organisms handle layout of multiple molecules and may connect to state/data.
  4. Composition over duplication: If a pattern repeats in Stitch (e.g., an input card), extract it as a Molecule.

Dynamic Color & Branding

When converting designs, always use Theme.of(context).colorScheme tokens. The app uses Brand-Based Dynamic Color, meaning the entire ColorScheme is generated from the Brand Primary seed.

  1. NEVER hardcode hex colors for surfaces, containers, or secondary elements.
  2. Harmonized Colors: For semantic colors like "Warning" or "Success" that come from Stitch, use the harmonized() extension if you need them to feel more integrated with the brand theme.
  3. Semantic Mapping:
    • bg-primary -> colorScheme.primary
    • bg-primary-light -> colorScheme.primaryContainer
    • text-on-primary -> colorScheme.onPrimary
    • bg-surface -> colorScheme.surface

Workflow

  1. Read the .html file from Stitch.
  2. Examine the .png screenshot to understand visual hierarchy and spacing.
  3. Deconstruct into Atoms/Molecules: Identify repeated UI patterns (e.g., the input cards with labels).
  4. Generate the Dart code following the Atomic Design structure.
  5. Verify on Device: Execute the debug launch script to see the new screen in action:
    make dev-mobile-launch
    

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Machine Learning integration for Flutter using TensorFlow Lite and Firebase ML

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

chimeranext/flutter-boilerplate-monorepo-template42026년 10월 13일 업데이트

Google Maps and Mapbox integration for Flutter applications

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

chimeranext/flutter-boilerplate-monorepo-template42026년 10월 13일 업데이트

Payment processing integration with Stripe and PayPal for Flutter

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

chimeranext/flutter-boilerplate-monorepo-template42026년 10월 13일 업데이트

Video and audio processing capabilities for Flutter applications

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

chimeranext/flutter-boilerplate-monorepo-template42026년 10월 13일 업데이트

WebSocket and Socket.io integration for real-time communication in Flutter

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

chimeranext/flutter-boilerplate-monorepo-template42026년 10월 13일 업데이트

chimeranext의 스킬 모두 보기

이 스킬의 문제 신고