flutter_sticky_header icon indicating copy to clipboard operation
flutter_sticky_header copied to clipboard

scrollPercentage only 0 or 1

Open mwinfomatica opened this issue 5 years ago • 1 comments

My scrollPercentage gets only 0 or 1.

%Cblue class Body extends StatelessWidget {

@override Widget build(BuildContext context) { return Scaffold( body: SafeArea( child: CustomScrollView( slivers: [ SliverStickyHeader.builder( builder: (context, state) => Container( height: 60.0, color: (state.isPinned ? Colors.pink : Colors.lightBlue) .withOpacity(1.0 - state.scrollPercentage), padding: EdgeInsets.symmetric(horizontal: 16.0), alignment: Alignment.centerLeft, child: Text( 'Header #1', style: const TextStyle(color: Colors.white), ), ), sliver: SliverList( delegate: SliverChildBuilderDelegate( (context, i) => ListTile( leading: CircleAvatar( child: Text('0'), ), title: Text('List tile #$i'), ), childCount: 4, ), ), ), ], ), ), ); } }

mwinfomatica avatar Jan 23 '21 01:01 mwinfomatica

If you look at the example, it varies from 0 to 1. Can you provide a complete example I could just copy/paste and run to test?

letsar avatar Jul 13 '22 16:07 letsar