jaspr_supabase 26.2.19
jaspr_supabase: ^26.2.19 copied to clipboard
A Jaspr package for Supabase, replicating the experience of supabase_flutter.
jaspr_supabase #
A Jaspr package for Supabase, replicating the experience of supabase_flutter.
Installation #
Add jaspr_supabase to your pubspec.yaml:
dependencies:
jaspr_supabase: 26.2.19
Usage #
Initialization #
Initialize Supabase in your main() function:
import 'package:jaspr_supabase/jaspr_supabase.dart';
void main() async {
await Supabase.initialize(
url: 'https://xyz.supabase.co',
anonKey: 'public-anon-key',
);
runApp(App());
}
Auth State Management #
Use the SupabaseAuth mixin in your components to listen to auth state changes:
class App extends StatefulComponent {
@override
State<App> createState() => _AppState();
}
class _AppState extends State<App> with SupabaseAuth<App> {
@override
void onAuthStateChange(event, session) {
// Handle auth state change
print('Auth event: $event');
}
@override
Component build(BuildContext context) {
// ...
}
}
Accessing Client #
Access the SupabaseClient instance anywhere:
final client = Supabase.instance.client;
Donations #
If this project is useful to you, consider making a donation:
| Ko-fi | Litecoin |
|---|---|
| [Ko-fi QR] | [Litecoin] |
| ☕ Ko-fi | Ł Donaciones Litecoin |
License #
This project is licensed under the GPL-3.0+ License - see the LICENSE file for more details.