Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stationary shadow in NeuButton #38

Merged
merged 4 commits into from
Nov 9, 2023

Conversation

Dotrar
Copy link
Contributor

@Dotrar Dotrar commented Nov 9, 2023

Status

READY / Needs testing (I don't know how to do this other than just making sure example works)

Description

This change does two things:

  1. Refactor:
    a. abstract class NeuButton inwhich NeuTextButton and NeuIconButton derives from.
    b. fix animated builder so that it's not rebuilding every frame (pass in the child)
  2. Add changes to button animation:
    a. change offset during animation so that the shadow looks stationary. this makes the effect that the button is moving relative to is background (previously, it was moving with the shadow.)
    b. Add a curve for bounceInOut so that the button has a greater "pop" effect (subjective and perhaps could be done via a parameter passed to the constructor instead).

Old Button:

old-button

New Button:

new-button

Type of Change

putting "bug fix" because of the moving shadows.

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

@Dotrar
Copy link
Contributor Author

Dotrar commented Nov 9, 2023

Also forgive me for any glaring mistakes because i am very new to dart / flutter, but I want to use NeuBrutalism in one of my projects so I'll try and give back any changes i make :)

Dre Westcook added 3 commits November 9, 2023 14:24
This allows us to change the code in one place to affect all buttons
that instaniate from NeuButton
This change allows the shadow to be stationary
when the position of the button changes, making it look
like the button is moving (relative to its background)
This makes it a more "satisfying" click movement rather than just
a linear change
@Dotrar
Copy link
Contributor Author

Dotrar commented Nov 9, 2023

This also works with different settings / offsets / for both icon and text buttons
ezgif com-video-to-gif

@deepraj02
Copy link
Owner

hey dude, thanks for the contribution.
I'll be merging this PR soon

Copy link
Owner

@deepraj02 deepraj02 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !

@deepraj02 deepraj02 changed the base branch from master to develop November 9, 2023 10:07
@deepraj02 deepraj02 merged commit 18c4cf0 into deepraj02:develop Nov 9, 2023
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.

2 participants