supabase_easy 0.0.2 copy "supabase_easy: ^0.0.2" to clipboard
supabase_easy: ^0.0.2 copied to clipboard

A powerful and lightweight Supabase wrapper for Flutter that reduces boilerplate for Auth, Database CRUD, and Real-time listeners by 60-70%.

Supabase Easy 🚀 #

Reduce Supabase + Flutter boilerplate by 60–70% while keeping type safety, flexibility, and performance.

Features #

  • Simplified Initialization: Initialize Supabase with a single call.
  • EasyAuth: Simplified authentication API for common tasks.
  • EasyRepository: Generic repository for type-safe CRUD operations.
  • Simplified Real-time: Easy-to-use streams for real-time updates.

Note: This plugin is designed to be highly useful for rapid development. We are committed to continuously optimizing the codebase and keeping it updated with the latest Supabase and Flutter features.

Screenshots #

Login & Signup Task Management
[Login] [TodoList]
[Signup] [Add Task]
[Empty State]

Getting Started #

Add supabase_easy to your pubspec.yaml:

dependencies:
  supabase_easy: ^0.0.2

Setup Supabase #

To use this plugin, you need to:

  1. Create a Supabase project at supabase.com.
  2. Create your tables (e.g., todos).
  3. Enable Row Level Security (RLS) on your tables.
  4. Add policies to allow authenticated or public access. For testing, you can use:
    CREATE POLICY "Allow public access" ON todos FOR ALL TO public USING (true) WITH CHECK (true);
    
  5. Get your Project URL and Anon Key from the Supabase Dashboard (Settings > API).

Usage #

1. Initialize #

await SupabaseEasy.initialize(
  url: 'https://your-project.supabase.co',
  anonKey: 'your-anon-key',
);

2. Define your Model #

class Todo extends EasyModel {
  @override
  final String id;
  final String title;

  Todo({required this.id, required this.title});

  @override
  Map<String, dynamic> toJson() => {'id': id, 'title': title};

  factory Todo.fromJson(Map<String, dynamic> json) => Todo(
    id: json['id'],
    title: json['title'],
  );
}

3. Use Repository #

final todoRepo = EasyRepository<Todo>(
  tableName: 'todos',
  fromJson: Todo.fromJson,
);

// Get all
final todos = await todoRepo.getAll();

// Create
await todoRepo.create(Todo(id: '1', title: 'Buy milk'));

// Real-time stream
todoRepo.stream(primaryKey: ['id']).listen((todos) {
  print(todos);
});

4. Simplified Auth #

await EasyAuth.signIn(email: '...', password: '...');
print(EasyAuth.currentUser?.email);

Example #

Check out the example folder for a complete Todo app implementation using this plugin.

License #

This project is licensed under the MIT License - see the LICENSE file for details.

0
likes
160
points
206
downloads

Publisher

unverified uploader

Weekly Downloads

A powerful and lightweight Supabase wrapper for Flutter that reduces boilerplate for Auth, Database CRUD, and Real-time listeners by 60-70%.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter, json_annotation, plugin_platform_interface, supabase_flutter

More

Packages that depend on supabase_easy

Packages that implement supabase_easy