Code Monkey home page Code Monkey logo

Comments (5)

daadu avatar daadu commented on June 24, 2024 1

did you tried with frontLayerScrim: Colors.transparent that should remove the scrimColor.

Sadly to enable user interaction (like tap, etc) behavior: HitTestBehavior.opaque, in the following code would not allow it:

Widget _buildInactiveLayer(BuildContext context) {
return Offstage(
offstage: animationController.status == AnimationStatus.completed,
child: FadeTransition(
opacity: Tween<double>(begin: 1, end: 0).animate(animationController),
child: GestureDetector(
onTap: () => fling(),
behavior: HitTestBehavior.opaque,

Suggesting following changes:

  • add HitTestBehavior frontLayerScrimBehaviour [could also add corresponding backLayerScrimBehaviour]
  • rename frontLayerScrim -> frontLayerScrimColor - same for backLayerScrim
  • keep frontLayerScrim and backLayerScrim for backward compatibility - with deprecation warning - can check how we previously deprecated frontLayerBorderRadius for reference.

@WieFel What are your views on it?

from backdrop.

daadu avatar daadu commented on June 24, 2024

@lastmeta Backdrop behaviour in MDG defines that the front layer should be inactive when backLayer is revealed, therefore this is the default(hard-coded) behaviour.

from backdrop.

lastmeta avatar lastmeta commented on June 24, 2024

@lastmeta Backdrop behaviour in MDG defines that the front layer should be inactive when backLayer is revealed, therefore this is the default(hard-coded) behaviour.

thats fine. in our case we want to reveal a portion of the backlayer which provides information and is not interacted with. perhaps MDG would suggest we put that information on the front layer but having it on the back and having the front be interactive gives a clean and clear distinction between info and interact portions of the screen.

I was able to create a workaround (rather than a real solution) this problem in the following way:

...
            if (_hasFrontLayerScrim) _buildInactiveLayer(context),
...
  /// this is not an ideal solution to
  /// https://github.com/fluttercommunity/backdrop/issues/117
  /// because I don't want the backdrop layer to have access to the streams
  /// I'd rather the widget inform the backdrop layer how to behave
  /// However, I tried making the `Offstage` in `_buildInactiveLayer` work
  /// according to a widget variable which was modified in realtime by
  /// `.revealBackLayer(activeFront: true);` but that failed to work, so
  /// though this is not the pure top-down solution I was hoping for, it is
  /// sufficient for now: 
  /// look it up how you should build front layer in real time:
  bool get _hasFrontLayerScrim => streams.app.page.value == 'Home';

from backdrop.

daadu avatar daadu commented on June 24, 2024

I think the scrim can be made optional, therefore re-opening this issue.

Feel free to file PR with changes mentioned above.

from backdrop.

WieFel avatar WieFel commented on June 24, 2024

Suggesting following changes:

* add `HitTestBehavior frontLayerScrimBehaviour` [could also add corresponding `backLayerScrimBehaviour`]

* rename `frontLayerScrim` -> `frontLayerScrimColor` - same for `backLayerScrim`

* keep `frontLayerScrim` and `backLayerScrim` for backward compatibility - with deprecation warning - can check how we previously deprecated `frontLayerBorderRadius` for reference.

@daadu Seems reasonable. LGTM!

from backdrop.

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.