ariedov / flutter_snaplist Goto Github PK
View Code? Open in Web Editor NEWA small library for creating snapping lists.
License: MIT License
A small library for creating snapping lists.
License: MIT License
Probably should explicitly provide duration and curve.
I tried to use this package but i do not understand how padding works. In example with horizontal padding there is only padding.left property used. If i remove padding property - snap list item have 0 lef padding, but still it is centered vertical, so i assume it has vertical padding. How can i remoe all paddins or set my own?
This could be circumvented by either using the snaplist or using other widgets, but if it is easy to accomplish it would be great to pass a parameter during build that can disable the ability to scroll for scenarios where the items in the snaplist are smaller than the space allotted and are more of a static list than a scroll widget. Is that something you guys would consider implementing?
Including the library and perfomre the "Showcase" example does not work. Nothing happens. The examples also didn't work. You have to copy the example code and create new files then import them. Anyways, how to get to work the "showcase" example?
You're welcome to PR on awesome-flutter
https://github.com/Solido/awesome-flutter
Thank you!
In my code, the data.center is not showing the correct indexes, sometimes it's even showing the same center index for different pages.
SnapList(
padding: EdgeInsets.only(
left: (screenSize.width - cardSize.width) / 2),
sizeProvider: (index, data) => cardSize,
separatorProvider: (index, data) => Size(10.0, 10.0),
positionUpdate: (int index) {
print("Current Index: ${index}/${pageCards.length}");
if (index == pageCards.length - 1) {
// loadMore();
}
},
builder: (context, index, data) {
print("###########################");
print("Index: ${index}");
print("Center: ${data.center}");
print("Next: ${data.next}");
print("Progress: ${data.progress}");
return ProfileCard(pageCards[index], image1, offset,
() {}, dismissCard);
},
count: pageCards.length,
)
When changing a parameter on the Snaplist itself the app has to be restarted to apply changes.
It would be great if the "next" property was documented on the main readme page.
@ariedov Hi,
how did you get the pop effect of the card in the vertical scroll list. I am referring to the screenshot you have with list of diff movies.
I am able to get the scroll but can't figure out the pop of effect of the card when it comes to the center.
Thanks
Hi,
Thanks for this great plugin. But I am facing one issue in this.
Once you bind the SnapList on page it is not updating when data changed.
I tried this with streambuilder, futurebuilder & async data list.
In FutureBuilder & StreamBuilder, its loading the data & list count is changed but SnapList items are not changing. Also it keep firing positionUpdate callback after list refresh.
In async data list, one the page load I am getting the data from server & when I call setState its showing first item. No gesture is working & positionUpdate callback fires with index as "-1".
I am trying now with this project's branch. Will let you know if I found something.
I want to use it in my flutter project. I know how to import it, but the main question is that if I have widget which has an image in it, I want that to be shown in the view, but don't know how to implement it. I just want the view same the horizontal view of the example. If you could show me the code of your example, I will get it somehow. But right now I'm clueless on how to use it in my project. Any help would be appreciated.
Hello Sir
I have been trying to use your package for a while now and I am not able to Re-size your widget dynamically
(actually i can, but the current snapped object goes off the view) and I am not able to maintain the current object in view(it goes off left).
HERE is a link to a small video showcasing the issue :
and here is the code of the SliverPersistentHeaderDelegate I attempted to do :
CodePile code.
I also mailed you on your email ID
Ps: SizeConfig is nothing more than just
((MeDiaQuery.of(context).size.[widthORheight])/100) = percentage of the screen in blocs
Probable solution is to forcefully wrap every child to a fixed size Container
or SizedBox
.
Migration to null saftey
I try to using setPosition. The functional working well except it doesn't have animation. It just jumps directly to the position. I try to set snipDuration
but not effect. Can anyone help me?. Thanks
First, thank you for this awesome plugin. Looking forward to using it.
Because there is no controller accepted as a parameter to the SnapList constructor, there is no way to facilitate starting at an initial index, or scrolling to a particular index. It would be wonderful if such functionality could be added.
When changing the locale to RTL languages, the vertical scroll remains its direction.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.