Skip to content

feat(mix): add callable pressable builders across stylers - #1088

Open
leoafarias wants to merge 4 commits into
mainfrom
feat/boxstyler-pressable
Open

leoafarias wants to merge 4 commits into
mainfrom
feat/boxstyler-pressable

Conversation

@leoafarias

@leoafarias leoafarias commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

Related issue

No linked issue.

Description

Make compose → .pressable() → call the standard API for interactive Mix surfaces across Box, Text, Icon, Image, FlexBox, StackBox, WrapBox, and GridBox.

final button = BoxStyler()
    .padding(.all(16))
    .onPressed(.scale(0.96))
    .pressable();
button(onPress: save, child: const Text('Save'));

final heading = TextStyler().fontSize(18).pressable();
heading('Settings', onPress: openSettings);

Changes

  • Add parameterless instance methods through typed private styler mixins and the existing generation hook, plus a direct method on GridBoxStyler. Replace this PR's earlier unreleased extension API.
  • Return immutable callable builders that preserve unresolved styles and create a fresh Pressable with the appropriate styled child. Forward every Pressable option/default, preserve native content arguments, and keep keys on the outer widget. Builders expose no further styling or style override.
  • Cover constructor parity, terminal type errors, generation, forwarding across all eight stylers, token/animation/state resolution, reuse, cancellation, feedback, keyboard and external checkbox/switch semantics.
  • Document the convention in API guidance, examples and canonical skills. Include a source-dependent runnable example and a complete 31-call-site showcase migration audit.

Existing released Pressable, PressableBox, and ordinary styler APIs remain compatible. Layout-only stylers are unchanged. @MixWidget factories still return styles.

Review Checklist

  • Testing: Validation details below.
  • Breaking Changes: No changes to released constructor APIs; replaces only the unreleased extension in this PR.
  • Documentation Updates: README, composition guidance, canonical skill references, local demo and migration audit updated.
  • Website Updates: Separate btwld/mix-docs update is an explicit release follow-up.

Validation and release follow-ups

  • melos run gen:build, melos run ci, and melos run format:check passed. Final CI includes 3,027 core Mix tests, 383 generator tests, and all dependent suites.
  • Resolved analyzer signature/default parity, exact terminal compile errors, and generation-hook tests passed. Focused interaction coverage includes context-dependent tokens, animation, keyboard, feedback, cancellation and semantics.
  • Published-dependency showcase: analysis clean, all 129 tests passed, web build passed. The new local source-dependent example also builds for web.
  • melos run analyze: schema inventory and Dart analysis passed (existing informational notices remain). DCM still reports exactly four pre-existing findings in unchanged files: member ordering and sealed-switch wildcard in style_animation_builder.dart:81,90; argument ordering in decoration_style_mixin.dart:273,359. No new DCM findings remain.
  • Canonical and installed Mix/microinteraction skills validated; code and the complete examples/docs/skills audit independently reviewed.

The hosted showcase deliberately uses published Mix in CI. Keep its current constructors, including standalone DartPad Snacks, until a release includes callable builders. The new source-only example demonstrates the API now; guides/pressable-builders-release-audit.md maps all 22 PressableBox and 9 Pressable call sites and records hit-area, nested-control, keyboard and semantics constraints for migration.

Plan and review records

Both records are committed with this PR. Repository instructions now require plans and relevant review/audit records to be committed and pushed with future PRs.

@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

This branch has not been deployed

No deployments
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.

1 participant