dartflutterflutter-sliver

Flutter Fixed Button in CustomScrollView


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

How to achieve like the screenshot https://i.sstatic.net/RDCn9.png


Solution

  • 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