Coder Social home page Coder Social logo

Comments (2)

edisonywh avatar edisonywh commented on August 16, 2024 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.

jonivesto avatar jonivesto commented on August 16, 2024

@edisonywh I agree, this is a must have feature in a plugin like this. In the meantime, you can use this solution:

  1. Wrap your lowerLayer widget with Stack
  2. Add a Container to your Stack and set it's color to black
  3. Wrap the Container with Opacity
  4. 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)

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.