Giter Site home page Giter Site logo

Comments (8)

vip20 avatar vip20 commented on June 15, 2024 1

There's a pull request dated 16th Apr 2020 by dave-k. I pulled it and added separately in my code and it worked.

from flutter_tindercard.

singhayush1403 avatar singhayush1403 commented on June 15, 2024

There's a pull request dated 16th Apr 2020 by dave-k. I pulled it and added separately in my code and it worked.

Are you sure this is working? I put a dynamic number in totalNum and used a button to change it, but the number of cards remains the same.

from flutter_tindercard.

elias97850 avatar elias97850 commented on June 15, 2024

There's a pull request dated 16th Apr 2020 by dave-k. I pulled it and added separately in my code and it worked.

That example doesn't really make it async, it just inserts in the List instead of adding. You already need to have a list with a predetermined size.

If I'm going to fetch data from a database and then add it to the list, it doesn't work. Once you give the totalNum a certain int, it doesn't change anymore.

from flutter_tindercard.

elias97850 avatar elias97850 commented on June 15, 2024

What I did, and recommend you guys to do it too, is to make a FutureBuilder that can fetch all the data that you need and create the list (of widgets, string, or whatever it is) in a LoadingPage, then store that list in a file (like "userProfiles.dart") and then in the page that you want to use this package, in the totalNum, you can use the list.length, and in the cardBuilder the list[index].

from flutter_tindercard.

singhayush1403 avatar singhayush1403 commented on June 15, 2024

I changed the library code and put a setstate inside the didUpdateWidget method, and it works with a dynamically updating list.

from flutter_tindercard.

shbm avatar shbm commented on June 15, 2024

@singhayush1403 What exactly did you do? Can you please share the snippet?

from flutter_tindercard.

amercobra avatar amercobra commented on June 15, 2024

I think @vip20 is talking about this Pull Request. I used it, and yes I can re-add/load more cards by adding more items to my list.

However what I was unable to do with this package at all is to NOT to reset the index after loading the list. I don't want to display all the list again when I load it, because when user swipes a card (left or right), this means that that card is already used and I don't want to display it again.

I even tried to remove the swiped card from my list, however the card displayed to user won't be keep the same after loading new cards, it will move to another one (where the index pointer is). Yet you can't control the index.

It'd be a great help of anyone let us know how to do that.

from flutter_tindercard.

BRTZL avatar BRTZL commented on June 15, 2024

I was able to add to list and not to reset index after rebuild. Actually its resets but im removing items after I swipe them and send new stream to builder. #50 I created pr you can check that out.

from flutter_tindercard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.