Flutter Fixed Button in CustomScrollView

essayoub picture essayoub · Jan 9, 2019 · Viewed 17.3k times · Source

How to make a button Fixed "Sticky" in bottom of CustomScrollView

How to achieve like the screenshot https://i.stack.imgur.com/RDCn9.png

Answer

anmol.majhail picture anmol.majhail · Jan 9, 2019

One Way of Doing it - using - BottomNavigationBar

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: CustomScrollView(
        slivers: <Widget>\[
          SliverAppBar(
            title: Text('Sliver App Bar'),
            expandedHeight: 125.0,
          ),
          SliverList(
              delegate: SliverChildBuilderDelegate((context, int) {
            return Text('Boo');
          }, childCount: 65)),
          SliverFillRemaining(
            child: Text('Foo Text'),
          ),
        \],
      ),
      bottomNavigationBar: Padding(
        padding: EdgeInsets.all(8.0),
        child: RaisedButton(
          onPressed: () {},
          color: Colors.blue,
          textColor: Colors.white,
          child: Text('Fixed Button'),
        ),
      ),
    );
  }][1]][1]

OutPut:

enter image description here