Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scrollPercentage only 0 or 1 #56

Open
mwinfomatica opened this issue Jan 23, 2021 · 1 comment
Open

scrollPercentage only 0 or 1 #56

mwinfomatica opened this issue Jan 23, 2021 · 1 comment

Comments

@mwinfomatica
Copy link

mwinfomatica commented Jan 23, 2021

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,
),
),
),
],
),
),
);
}
}

@letsar
Copy link
Owner

letsar commented Jul 13, 2022

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants