Skip to content

feat(mix): add BoxStyler.pressable() - #1088

Merged
leoafarias merged 10 commits into
mainfrom
feat/boxstyler-pressable
Oct 20, 2026
Merged

leoafarias merged 10 commits into
mainfrom
feat/boxstyler-pressable

Conversation

@leoafarias

@leoafarias leoafarias commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

Related issue

None.

Description

Adds BoxStyler.pressable(...), which returns a PressableBox that uses the style:

final button = BoxStyler()
    .padding(.all(16))
    .color(Colors.blue)
    .onPressed(.color(Colors.indigo));
final label = TextStyler().color(Colors.white).fontWeight(.w600);

button.pressable(onPress: save, child: label('Save'));

It's shorthand for PressableBox(style: button, ...) and takes the same parameters, with the same defaults. Pressable stays outside the Box, so .onHovered, .onPressed, .onFocused and .onDisabled on the style still resolve. This replaces the earlier callable Pressable*Builder design from this branch, which never shipped.

Changes

  • BoxStylerPressable extension in pressable_widget.dart, next to PressableBox.
  • Tests: defaults match const PressableBox(...), every parameter is forwarded, and tap plus onPressed styling work end to end.
  • CHANGELOG entry, a README snippet, a section in guides/api-composition-guidelines.md, and updated Mix skill references and examples.

Review Checklist

  • Testing: flutter test test/src/specs/pressable (69 passed), dart format and dart analyze clean on the touched files.
  • Breaking Changes: None. This is a new extension method.
  • Documentation Updates: CHANGELOG, README, guide and skills.
  • Website Updates: Follow-up in btwld/mix-docs.

@github-actions github-actions Bot added the mix label Oct 3, 2026
@leoafarias
leoafarias marked this pull request as ready for review October 3, 2026 18:22
@leoafarias leoafarias changed the title feat(mix): add BoxStyler pressable builder feat(mix): add callable pressable builders across stylers Oct 3, 2026
@cursor
cursor Bot force-pushed the feat/boxstyler-pressable branch from 0811d72 to 2525770 Compare October 20, 2026 15:35
@cursor cursor Bot changed the title feat(mix): add callable pressable builders across stylers feat(mix): add BoxStyler.pressable() Oct 20, 2026
…m docs

- Move the BoxStylerPressable extension from box_spec.dart into
  pressable_widget.dart, next to the PressableBox constructor it mirrors.
- Remove the one-off packages/mix/example app and its melos entry; it would
  have become mix's pub.dev example.
- Drop the off-topic section in styler-api-policy.md and shorten the
  repeated "forwards every parameter" prose in README, guide and skills.
- Wrap the CHANGELOG entry to match the surrounding style.
@leoafarias
leoafarias added this pull request to stack #1103 October 20, 2026 18:10
@leoafarias
leoafarias merged commit 205c4f8 into main Oct 20, 2026
14 checks passed
@leoafarias
leoafarias deleted the feat/boxstyler-pressable branch October 20, 2026 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants