Code Monkey home page Code Monkey logo

Comments (7)

willlarche avatar willlarche commented on May 26, 2024 4

@mockturtl Hi! So wonderful to see this implementation. Much thanks to everyone working on expanding Material coverage in the community.

We have no issue with that! Go for it!

from backdrop.

daadu avatar daadu commented on May 26, 2024 1

@mockturtl Have you tried stickyFrontLayer and headerHeight arguments of BackdropScaffold, to get desired UI?

from backdrop.

daadu avatar daadu commented on May 26, 2024 1

@mockturtl Ok, got your point. Go ahead with the PR! BTW, what should we name the param? Any idea?

Few of my suggestions:

  • double frontLayerStartFrom: 0
  • double frontLayerTopMargin: 0
  • ??

Also while filing PR can you correct the docs for headerHeight - instead of using "closed" and "open" term (earlier we used them), use phrases like "when backLayer is concealed/revealed", that should avoid the confusion with the usage of `headerHeight.

from backdrop.

daadu avatar daadu commented on May 26, 2024 1

This has landed with v0.5.0 on pub.dev.

from backdrop.

mockturtl avatar mockturtl commented on May 26, 2024
  • Playing with values in example/lib/navigation.dart, my understanding of the stickyFrontLayer behavior is "When closed, the front layer will occupy as much height as possible without occluding the back layer. If the back layer occupies the entire screen height[1], this parameter has no effect."

[1] This is my use case: my back layer is a large menu. Apologies for misrepresenting that in the screenshot above.

  • headerHeight seems to control the height of the front layer in its inactive / closed state (this contradicts my reading of the docs[2]). Additionally, if stickyFrontLayer == true and headerHeight is less than the available space, headerHeight is ignored.

[2] It might be desirable to document the control flow inside the _headerHeight getter and _getPanelAnimation, if it's not too cumbersome to explain.


From what I can tell, the existing constructor args for BackdropScaffold don't allow me to specify "front page A opens to height X, front page B opens to height Y."

@willlarche Does Material have an opinion on a Backdrop with variable-height front layers? I'll double check Crane.

from backdrop.

daadu avatar daadu commented on May 26, 2024

@mockturtl Thanks for pointing out problem in headerHeight docs, will correct it.

Regarding your requirement, as far as I understand(from checking Crane example), you want to have "extra" space under appbar, that is visible even when the backLayer is concealed.

A solution for that would be to set bottom of BackdropAppBar. Check the following code (modified example/main.dart):

MaterialApp(
      title: 'Backdrop Demo',
      home: BackdropScaffold(
        appBar: BackdropAppBar(
          title: Text("Backdrop Example"),
          actions: <Widget>[
            BackdropToggleButton(
              icon: AnimatedIcons.list_view,
            )
          ],
          bottom: PreferredSize(
            child: Column(
              children: [
                Text("Menu 1"),
                Text("Menu 2"),
              ],
            ),
            preferredSize: Size.fromHeight(100),
          ),
        ),
        backLayer: Center(
          child: Text("Back Layer"),
        ),
        subHeader: BackdropSubHeader(
          title: Text("Sub Header"),
        ),
        frontLayer: Center(
          child: Text("Front Layer"),
        ),
      ),
    );

Screenshot for it:
untitled

As far as I understand, the "extra" (always visible stuff) should be part of AppBar and not backLayer (which is revealed and concealed)

from backdrop.

mockturtl avatar mockturtl commented on May 26, 2024

Regarding your requirement, as far as I understand(from checking Crane example), you want to have "extra" space under appbar, that is visible even when the backLayer is concealed

Not really. I want the front layer's height to be configurable for each page. I'm not sure how to explain differently.

I'm happy to submit a PR if you think the idea makes sense.

Back layer and appbar look good

Screenshot from 2021-01-12 15-36-27

Front layer: Current behavior

Screenshot from 2021-01-12 15-36-32

Screenshot from 2021-01-12 15-31-34

Front layer: Desired behavior

Screenshot from 2021-01-12 15-47-03

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.