Closed ConProgramming closed 3 months ago
If you want to execute the request in a later time, you can just not call await
on the method. Then you can just call await
when you actually want to execute it.
final request = supabase.from('table').select();
... some time later
final data = await request;
I need to serialize the request to Json to save offline. Saving it to a HiveBloc
@ConProgramming Cool. You can create your own extension method to implement this for your particular use case if you are not doing it already. Unfortunately, we will not add support for these methods on this SDK.
What's the recommended way to do that? I thought I would have to patch SDK
You can read about extension methods here: https://dart.dev/language/extension-methods
Thanks
It seems extension methods won't work, because I cannot override private methods.
Is this possible without updating the sdk?
Right, I missed that.
Is this possible without updating the SDK?
I suppose not. You can fork the repo, add the feature, and add the package to your Flutter app. https://stackoverflow.com/questions/54022704/how-to-add-a-package-from-github-in-flutter
This is very useful for supporting offline mode in apps. Not sure if should be implemented like this, but this works for my use case.