Abhilash-Chandran / number_inc_dec

A flutter widget to accept numeric inputs with button to increment and decrement.
https://pub.dev/packages/number_inc_dec
MIT License
10 stars 7 forks source link

State Management issue #43

Open MedjadderAymen opened 2 years ago

MedjadderAymen commented 2 years ago

hello, I have been working with the library this morning but I faced an error in the package when I use data from a provider. so the scenario is the next: I have a list of items stocked in a provider (cart) every time the user picks a new item I add it to the stack in the provider. each item has a quantity so the user can increment/decrement. I was using your library I found that in case the user delete an item from the stack. the library keeps an old value. ex: (item 1 - q = 50 / item 2 - q10) if I delete item 1, the quantity of item 2 (using the library) change to 50!! I checked my provider, and everything is good. the problem is within the library it keeps a trace of an old stack so it still uses the index of the old library.

hope you fix this.

Abhilash-Chandran commented 2 years ago

HI @MedjadderAymen ,

Thanks for taking time to report an issues. But I am not quite sure if I understood your issue. Could you provide a simple example code where I reproduce this issue.

Cloyd1234 commented 2 years ago

I am also getting this issue when using this package with ListView.builder.

For example. Row 1 Name: Item 1, Qty: 5 Row 2 Name: Item 2, Qty: 10 Row 3 Name: Item 3, Qty: 15

(where Qty is the textfield created by this package incremented)

When I try to delete the Row 2 from my List of Maps using the remove method, the output below appears: Row 1 Name: Item 1, Qty: 5 Row 2 Name: Item 3, Qty: 10