Skip to content

🧹 refactor FloatingActionAsyncButton build method and variants - #12

Merged
esenmx merged 3 commits into
mainfrom
refactor-floating-action-async-button-build-18428285029922423034
Aug 23, 2026
Merged

🧹 refactor FloatingActionAsyncButton build method and variants#12
esenmx merged 3 commits into
mainfrom
refactor-floating-action-async-button-build-18428285029922423034

Conversation

@esenmx

@esenmx esenmx commented Aug 22, 2026

Copy link
Copy Markdown
Owner

🎯 What: Refactored FloatingActionAsyncButton.build in lib/src/buttons/floating_action_async_button.dart to split the monolithic build method into cleaner helper methods (_buildButton, _buildStandard, _buildSmall, _buildLarge, and _buildExtended) and a _resolvedHeroTag getter.

💡 Why: Reduces the complexity and length of the build method from over 100 lines down to a concise dispatching method, improving readability, maintainability, and code health while reusing member state without argument repetition.

✅ Verification: Verified with dart format, flutter analyze (0 issues), and flutter test (70/70 passing tests).

✨ Result: Enhanced readability and maintainability of FloatingActionAsyncButton without changing any behavior or API contract.


PR created automatically by Jules for task 18428285029922423034 started by @esenmx

@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

google-labs-jules Bot and others added 3 commits August 23, 2026 19:06
…nt builders

Co-authored-by: esenmx <43244505+esenmx@users.noreply.github.com>
… via tear-off

- Delete _resolvedHeroTag: it returned its input unchanged for every value
  (const sentinel is canonical, != on Object is identity). Keep the
  _defaultHeroTag sentinel, which is load-bearing for duplicate-Hero checks.
- Inline the variant switch into the AsyncButton builder closure, removing
  the pass-through _buildButton hop.
- Replace byte-identical _buildSmall/_buildLarge with _buildSmallOrLarge,
  selecting FloatingActionButton.small/.large by constructor tear-off.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Count-only assertion would pass with a swapped .small/.large mapping.
Small renders 48x48 under the default padded tap target, large 96x96.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@esenmx
esenmx force-pushed the refactor-floating-action-async-button-build-18428285029922423034 branch from 0e0cd39 to 49fd557 Compare August 23, 2026 16:08
@esenmx
esenmx merged commit 5575aff into main Aug 23, 2026
6 checks passed
@esenmx
esenmx deleted the refactor-floating-action-async-button-build-18428285029922423034 branch August 23, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant