Closed ceopaludetto closed 5 years ago
Hey, I think I see your bug. You defined _refreshKey
inside of your builder. So, instead of being in the state's scope, you're recreating it each time. Try moving it next your _autoCompleteKey
if you haven't already figured this out days ago.
Thanks @Taormina, I'll try
@Taormina there's documentation in the code stating...
/// Creating the [LiquidPullToRefresh] with a [GlobalKey<LiquidPullToRefreshState>]
/// makes it possible to refer to the [LiquidPullToRefreshState].
However LiquidPullToRefreshState
is private. Using RefreshIndicatorState
throws "The method 'show' was called on null." The workaround I have is to not specify a class like so...
final GlobalKey _refreshIndicatorKey = GlobalKey();
// ...
(_refreshIndicatorKey.currentState as dynamic).show();
@zgosalvez Do you have a larger code snippet you can share from when you were using the RefreshIndicatorState
?
When I use a global key, the currentState is always null.
Even if it were in class scope or inside the BlocBuilder the return is null, would it be a BlocBuilder problem? Or is it my mistake?
Normal RefreshIndicators also do not work.
Thanks for listening.
My reproduction: