last day (15 days later) » 

7:37 AM
sorry, electricity went out and this mac mini doesn't have battery
 
np !
 
my last message was the debug breakpoint, if there was any other I did not see that sadly
 
7:54 AM
I'm working, I'll give a deeper look at your problem later today.
You're close to the solution though !
One thing you could try to verify that the datas are correctly fetched and updated is to print the list of Recipes in the .then() method of the searchRecipes()

WidgetsBinding.instance.addPostFrameCallback(
(_) => Provider.of<SearchRecipeModel>(context, listen: false)
.searchRecipes()
.then(
(value){
final recipes = Provider.of<SearchRecipeModel>(context, listen: false)
.recipes;
debugPrint("${recipes.length} found");
},
),
);
put a breakpoint on the debugPrint, and check that you got a list correctly filtered in the var "recipes".
If so, it means that your PagingList isn't redrawn correctly : it will help fixing your issue
 
sure, I also have meetings today. I just wanted to reopen the chat :)
I will do this change sson, thanks
*soon
 
Something else you could try is to replace the above bloc with
```
WidgetsBinding.instance.addPostFrameCallback(
(_) =>
Provider.of<SearchRecipeModel>(context, listen: false).refresh()
);
```
From what I read yesterday, the refresh() method looks like a 'dirty' hack to force a full refresh of the datas. It may work with this
 
8:51 AM
wow
with this refresh() it is working
the filtered list is there right after search
also on second search, everything is working :)
if I had more rep. points I would give it to you
 
9:02 AM
haha
So in order for you to understand why it wasn't working with the previous Call
You had a lit of Items
-> Triggering Provider.of<SearchRecipeModel>(context, listen: false)
.searchRecipes()
You had a different list of Items

The way the PagingList works, the two list of Items were the very same
so it wasn't redrawing the new list on the screen
What the refresh() method does, is
You have your list of Items
--> Triggering the refresh()
The refresh() sets the list to null
--> The PagingList re-draws an empty list
The datas are retrieved, your list is updated
--< The PagingList re-draws an up-to-date list
 
oh god, thanks
can you maybe suggest a Flutter/Dart tutorial somewhere with I can learn this? It's no problem if it's not free.
 
Sure !
The developer who has a Youtube Channel "Code With Andrea" made a lot of content (some for free, some other with a payment required)
He covers almost every key subject of Flutter
Your current project isn't really suited for a beginner. There are a lot of abstractions which are hard to catch for someone who didn't practice a lot with the Framework.
Don't be too hard on yourself if there are stuff you can't understand easily on this project
My best advice would be to follow the Google Codelabs
https://docs.flutter.dev/codelabs
 
9:20 AM
most of the abstract levels are familiar for me from the Java world, but sadly the GUI part of Flutter is completly new to me, also the synthax. I have to learn a lot
thanks
will you add this code line to your answer? I will accept it
 
Okay, I'll add it right now
 
9:34 AM
I wrote an answer which is generic : some other people may have the same problem of a Consumed list which isn't refreshed properly
 
9:50 AM
I deleted the project you sent me now that your problem is fixed !
Good luck in your future Mobile projects, I wish you to enjoy this framework as much as I do !
 

last day (15 days later) »