GithubHelp home page GithubHelp logo

Comments (8)

darioielardi avatar darioielardi commented on May 23, 2024

I think that's totally possible, but the default behavior should be the current one. I could work on the implementation next week, but PRs are always welcome!

from flutter_speed_dial.

ehhc avatar ehhc commented on May 23, 2024

i fear since you updated your code, it's not as easy possible as before.. the reason is that you're using a AnimatedFloatingButton which cannot have a long-press-handler (because the long press triggers the label..)...
Previously it was possible.. see my commit (i know, it's not a PR, but i was unsure about it at that time..)

Anyway: should i close the issue since its now complicated to implement it? (and it seems, nobody but me wants it anyway :D )?

from flutter_speed_dial.

darioielardi avatar darioielardi commented on May 23, 2024

The AnimatedFloatingButton is actually a custom widget provided by the library itself. It would be totally possible to implement the behavior you need, just add a function parameter to override the press callback and a boolean parameter to toggle the dial on long press.
Let me know if you need help with the implementation, even if you're not sure I can review it and eventually fix it.

from flutter_speed_dial.

ehhc avatar ehhc commented on May 23, 2024

@darioielardi thanks for the encouraging reply. I mentioned the wrong class.. i meant FloatingActionButton instead of AnimatedFloatingButton. In that class, no longPress is intended. Anyway: i noticed, that i can combine it with a gestureListener (even if not intended) to work around that.. You would have a look at my solution? In that case, i'll open an PR :)

Thanks again :)

from flutter_speed_dial.

darioielardi avatar darioielardi commented on May 23, 2024

The GestureDetector looks a pretty valid solution, but I noticed you've also modified the behavior of the BackgroundOverlay, I'm not sure it should act as the main button does when the onPress parameter is defined, it should probably keep the old behavior, long press on the background overlay does not really make sense. Apart from that your implementation is fine, if you fix the overlay behavior ( and please format your code with the dart formatter ) I'd be happy to test it and merge the PR :)

from flutter_speed_dial.

ehhc avatar ehhc commented on May 23, 2024

hi @darioielardi i removed the longPress-stuff in the overlay... it was a leftover from my first try and i forgot to delete it.. furthermore, i formated it with flutter format .

from flutter_speed_dial.

darioielardi avatar darioielardi commented on May 23, 2024

Merged, thank you for the contribution, nice work :)

from flutter_speed_dial.

ehhc avatar ehhc commented on May 23, 2024

Thanks :)

from flutter_speed_dial.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.