Comments (12)
Just to add to these voices, handleSlideIsOpenChanged still doesn't work. Perhaps this issue should be re-opened.
from flutter_slidable.
Actually the usage instructions don't work neither the ones you provided here nor the slightly more extensive ones in the documentation where it states
final SlidableController slidableController = SlidableController(
onSlideAnimationChanged: handleSlideAnimationChanged,
onSlideIsOpenChanged: handleSlideIsOpenChanged,
);
...
void handleSlideAnimationChanged(Animation<double> slideAnimation) {
setState(() {
_rotationAnimation = slideAnimation;
});
}
void handleSlideIsOpenChanged(bool isOpen) {
setState(() {
_fabColor = isOpen ? Colors.green : Colors.blue;
});
}
the problem is that handleSlideAnimationChanged and handleSlideIsOpenChanged need to be static methods in the SlidableController Initializer and when you make them static of course you cannot use setState() anymore which makes it impossible to update the screen (or any widget)
Please provide working example of this. It would be greatly appreciated as I'm trying to implement it currently but I'm stuck here completely.
from flutter_slidable.
Hi I am looking for a solution to this as well tried to follow the instructions but the code doesn't seem to work.
from flutter_slidable.
There is nothing for this right now, but I can implement something in the controller I think.
from flutter_slidable.
onSlideIsOpenChanged
is being triggered if I provide onSlideAnimationChanged
. So for now as a workaround, I am providing a dummy onSlideAnimationChanged
.
from flutter_slidable.
I can do something great with a callback that takes an animation (look at the FAB):
Do you think it will be good for you?
from flutter_slidable.
@letsar that would be great
Well, I just need a callback event when the slide event init and when it ends.
Something like to fire a callback when translate starts and when it finishes. Like this js lib does https://github.com/mango/slideout#events (example)
The slideout emits translatestart, translate and translateend events only when it is opening/closing via touch events.
from flutter_slidable.
I don't want to add a lot of callbacks, but I added another one to be notified when the active Slidable is open or closed.
I pushed this on this branch: https://github.com/letsar/flutter_slidable/tree/feature/35_slide_callbacks can you tell me if it's ok for you?
To use this, you need to the the onSlideIsOpenChanged
callback on the SlidableController
. This callback can be used like this:
void handleSlideIsOpenChanged(bool isOpen) {
setState(() {
_fabColor = isOpen ? Colors.green : Colors.blue;
});
}
from flutter_slidable.
Published in version 0.4.8
from flutter_slidable.
@letsar , the Slidable
widget is still in an active state if you slide it open and then slide it closed without lifting your finger. Can you update the package to call .close()
when isOpen
(handleSlideIsOpenChanged(bool isOpen)...
is changed to false
?
from flutter_slidable.
@lane-faison The package has completely be rewritten, can you test it in the preview version to see if it's still occurs?
from flutter_slidable.
Hi, what's the status on this?
from flutter_slidable.
Related Issues (20)
- Focus on flutter web HOT 1
- Query: Smooth DismissiblePane Implementation within ActionPane? HOT 1
- Slidable widget not closing properly HOT 1
- If more than two SlidableAction, the lable disappear HOT 3
- How to close other ActionPanels when i tap outside? HOT 1
- This widget has been unmounted, so the State no longer has a context (and should be considered defunct). HOT 3
- Error: A constant constructor can't call a non-constant super constructor. HOT 2
- UI breaks while swiping and on navigation
- Can't create SlidableController according to documentation HOT 3
- Error: The method 'hashValues' isn't defined for the class HOT 9
- slidable action more than 4 item
- When you click to delete, the button covers the entire position, and then click to delete.
- How do I animate a flex change
- adding space between action and tile and renderflex error HOT 1
- Please add the ability to add a image instead of an icon
- Not close when enclosed in an inner ListView.
- Error in latest version flutter 3.24 HOT 2
- The "groupTag" property is not working HOT 2
- Flutter slidable onDismissed error when delete middle item
- When expanding or collapsing the secondary Item of ExpandableListView, the secondary Slidable cannot be automatically closed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter_slidable.