Enforces strict standards for building Flutter Card widgets using the shared styles resources directory, theme-based colors, clean helper-based composition, and explicit usage verification.
This skill defines mandatory rules and patterns for building Card widgets in Flutter.
Its goals are:
Card widget as the main and outer container.Rules:
Container, DecoratedBox, or similar widgets instead of .CardThe card’s appearance must come only from the theme.
Recommended pattern:
Rules:
All widget styling and layout decisions must come from the shared styles resources directory:
lib/core/resources/styles/
The agent must explore and reuse the available resources instead of creating new styles.
Only the following files are relevant when creating and styling widgets:
colors_resources.dart
→ Shared color definitions (when not using theme directly)
font_styles_manager.dart
→ Text styles and typography
sizes_resources.dart
→ Sizes, icon sizes, and layout constants
spaces_resources.dart / spacing_resources.dart
→ Padding, margin, and spacing utilities
border_radius_resources.dart
→ Standardized border radii (when applicable)
shadows_resources.dart
→ Shared shadow definitions (not for Cards unless explicitly allowed)
Theme.of(context).colorScheme.onSurfaceTheme.of(context).colorScheme.onSurfaceVariantIf a non-theme color is required, it must come from colors_resources.dart.
To verify that this skill was used, the agent must add a specific comment at the start of every card widget implementation.
// build-card-widget-skill: applied
CardIf the comment is missing or altered, the skill is considered NOT used.
Any violation makes the card implementation invalid and requires refactoring.