Code Monkey home page Code Monkey logo

Comments (9)

WieFel avatar WieFel commented on May 26, 2024

This is implemented by the property stickyFrontLayer which defaults to false. You can set it to true and it will adapt to the back layer's height.

BackdropScaffold(
    appBar: BackdropAppBar(
        title: Text("Backdrop Example"),
        actions: <Widget>[
        BackdropToggleButton(
            icon: AnimatedIcons.list_view,
        )
        ],
    ),
    backLayer: Container(
        height: 200.0,
        child: Center(child: Text("Back Layer")),
    ),
    frontLayer: Center(
        child: Text("Front Layer"),
    ),
    stickyFrontLayer: true,
)

from backdrop.

daadu avatar daadu commented on May 26, 2024

@heath3n This only works if the height of the back layer widget is bounded. If you are using ListView or something similar set shrinkWrap to true

from backdrop.

PembaTamang avatar PembaTamang commented on May 26, 2024

@daadu using a ListView and shrinkWrap did not work for me. What else can I do?

from backdrop.

daadu avatar daadu commented on May 26, 2024

@PembaTamang Please provide us with minimum code that can reproduce the issue. We will look into it.

from backdrop.

amanv8060 avatar amanv8060 commented on May 26, 2024
class BackLayer extends StatefulWidget {
  @override
  _BackLayerState createState() => _BackLayerState();
}

class _BackLayerState extends State<BackLayer> {
  @override
  Widget build(BuildContext context) {
    return  ListView(
        shrinkWrap: true,
        children:  <Widget>[
ListTile(title:Text("hey")),
ListTile(title:Text("hey")),
ListTile(title:Text("hey")),
ListTile(title:Text("hey")),
         
        ],
 
    );
  }
}

use this as Your Backlayer
and dont give header height

from backdrop.

WieFel avatar WieFel commented on May 26, 2024

I could not reproduce the problem. For me it works fine using your BackLayer and stickyFrontLayer: true.
Maybe take a look at

return ListView.separated(
shrinkWrap: true,
itemCount: items.length,
itemBuilder: (context, position) => InkWell(
child: items[position],
onTap: () {
// fling backdrop
Backdrop.of(context).fling();
// call onTap function and pass new selected index
onTap?.call(position);
},
),
separatorBuilder:
separatorBuilder ?? (builder, position) => separator ?? Container(),
);
which implements basically the same thing.

Which flutter channel are you using and do you use the newest version of it?

from backdrop.

daadu avatar daadu commented on May 26, 2024

@amanv8060 Just to confirm, did you set stickyFrontLayer to true for BackdropScaffold?

from backdrop.

amanv8060 avatar amanv8060 commented on May 26, 2024

@amanv8060 Just to confirm, did you set stickyFrontLayer to true for BackdropScaffold?

this was causing issue . Close this , if the issue author has no problem

from backdrop.

Ravimgr avatar Ravimgr commented on May 26, 2024

i want to show some part of the backlayer while opening frontlayer is this possible?

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.