Comments (2)
@jonivesto thanks for the code example! I tried something similar but with addStatusListener, and it worked pretty bad because it's hard to know when the animation starts to drag up/down in order to rebuild. Haven't tried out your example yet but it's probably better than mine :)
For now I've actually just used the built in Flutter one, there was a new update recently to fix the slide up animation so that looks better now!
from rubber.
@edisonywh I agree, this is a must have feature in a plugin like this. In the meantime, you can use this solution:
- Wrap your lowerLayer widget with Stack
- Add a Container to your Stack and set it's color to black
- Wrap the Container with Opacity
- Wrap the Opacity with IgnorePointer
5, Now you can use addListener()
to set states for the Opacity and IgnorePointer like this:
@override
void initState() {
_rubberController = RubberAnimationController(
vsync: this,
duration: Duration(milliseconds: 300),
dismissable: true,
);
_rubberController.addListener((){
setState(() {
_opacity = _rubberController.value;
_ignoring = _rubberController.value<0.5;
});
});
super.initState();
}
from rubber.
Related Issues (20)
- When I try to slide down, it prompts me to overflow the title height HOT 4
- bottom sheet Error on eject
- header and upperLayer The gap between HOT 1
- dragFriction is reversed
- No dismiss callback after user swipe down
- Bottom sheet is at wrong position after orientation change
- Flag to make sheet to not overflow its lower and upper bounds (strictier controller values range) HOT 1
- Slow animation
- [HELP] Is it possible to cover the appbar when the rubber expands?
- context.ancestorStateOfType(...) is deprecated HOT 1
- Support flutter 2.0 HOT 2
- AnimationController.dispose() called more than once HOT 1
- Example app build failed
- Fast fling ignores the first drag events in upperLayer
- Null-Safe rubber 1.0.1 depends on NON-Null-Safe after_layout 1.0.7
- Make listeners work HOT 1
- Cannot collapse sheet with keyboard open
- RubberAnimationController status listener HOT 1
- Disable dragging the sheet
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 rubber.