This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
layrz_theme is a Flutter widget library (published on pub.dev) that implements the Layrz design standard following Material Design 3 guidelines. It provides inputs, layout systems, tables, theme generators, maps, and more. SDK constraints: Dart >=3.10.0, Flutter >=3.38.1.
flutter pub get # Install dependencies
flutter analyze # Lint (this is what CI runs on PRs)
flutter test # Run all tests
flutter test test/color_test.dart # Run a single test fileExample app:
cd example && flutter pub get && flutter runThe library is organized as a set of sub-libraries under lib/src/. Each module directory contains a barrel file (e.g., inputs.dart, layout.dart) that uses Dart's library + part directives to compose its implementation files. The top-level lib/layrz_theme.dart re-exports all sub-libraries.
To add a new widget to an existing module: create the implementation file in the appropriate subdirectory, then add a part directive in the module's barrel file.
| Module | Purpose |
|---|---|
inputs/ |
Form inputs (text, number, select, pickers, code editor, etc.) — largest module (~95 part files) |
layout/ |
App shell with multiple navigation styles (sidebar, dual bar, mini, bottom nav), breadcrumbs, AppBar |
theme/ |
Light/dark Material 3 theme generation, color constants, font config via Google Fonts |
table2/ |
Advanced data table with sorting, filtering, multi-select, infinite scroll, controller pattern |
extensions/ |
Extension methods on Color, DateTime, Widget, String |
helpers/ |
Utilities for shadows, avatars, colors, file handling |
map/ |
Flutter Map integration with toolbar and controls |
colorblindness/ |
Color blindness simulation filters (6 modes with adjustable strength) |
- Responsive breakpoints:
kExtraSmallGrid(600),kSmallGrid(960),kMediumGrid(1264),kLargeGrid(1904) — used withLayoutBuilderthroughout. - Theme colors:
kPrimaryColor(#001e60),kAccentColor(#FF8200). - State management: Uses
layrz_statepackage. Example app hasAppStorefor theme/colorblind mode. - Platform-conditional imports: File handling uses
if (dart.library.js_interop)for web vs native. - Input pattern: Widgets accept optional external
FocusNode/TextEditingController; only internally-created controllers are disposed. - Enum-based styling: Components use style enums (e.g.,
ThemedButtonStyle,ThemedInputStyle) for variant selection.
- Formatter: 120-char page width, trailing commas preserved (
analysis_options.yaml) - Linter:
flutter_lintspackage - Use modern Dart dot shorthand syntax
- PRs to
main,next,developmentrunflutter analyzeandflutter test(Flutter 3.38.8 stable) - Test results published as check run + PR comment with summary
- Version tags (
v*.*.*) trigger publish to pub.dev and deploy example to GitHub Pages