Ahmed Elsayed

Results 85 comments of Ahmed Elsayed

I think there should be an easy option to allow going into `loading` during `isRefreshing` only when the prev state is `error`. It'd be more helpful to show prev data...

> if a provider rebuilds because of ref.watch Can you elaborate when this can happen?

Current behavior when I'm doing `ref.refresh`: * if state is data: keep showing the latest data * if state is error: keep showing the latest error What I'm looking for...

What do you think about separating `optimistic` into 2 params to allow `skip showing the "loading" when a provider rebuilds` while also `go into loading during isRefreshing` ? somthing like...

It will allow me to do: ``` asyncValue.when( instant: true, optimistic: !asyncValue.hasError, error: ..., data: ..., loading: ..., ) ``` I'll be able to show loading only when refreshing from...

It'll skip loading when the provider rebuilds from `ref.watch`

but how to show loading during a refresh by `ref.refresh` after an error. and to skip loading if a refresh was by `ref.watch`.

I think that snippet will show loading if a provider rebuilds because of both `ref.refresh` or `ref.watch` after an error

My point is this: **Relying on 1 param `optimistic`:** * `default null`: * rebuilds because of ref.watch -> back to loading * rebuilds because of ref.refresh -> showing latest data/error...

I think two flags is simpler. i.e: this will achieve what I was trying to discuss: ``` optimistic: asyncValue is AsyncLoading || !asyncValue.hasError ``` It's tricky and very hard to...