Search code examples
flutterdartriverpodsupabase

Riverpod's basic provider isn't working while using Supabase SDK


This is the code snippet with Supabase SDK

Code block with Supabase SDK enabled

Code block the Supabase SDK disabled

As you can see from the first picture, only the basic provider is having an error "Provider isn't a function, try to define a method or function with the name Provider" whereas other providers are working fine.

If anyone faced a similar issue or know the reason for the issue, please help with this would be really appreciated.

I wasn't even able to trackdown the actual cause of not working of Provider until hours of random testing, disabling every possible cause.

Thank you.


Solution

  • There is a Provider enum in supabase_flutter. You can hide it to get rid of the error you are seeing.

    import 'package:supabase_flutter/supabase_flutter.dart' hide Provider;