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

SDK oficial de Matecito para Flutter (BaaS de alto rendimiento).

🧉 matecitodb_flutter v0.0.1 (Beta) #

SDK oficial de Matecito para Flutter. Lleva tu base de datos en tiempo real al siguiente nivel con una integración nativa, tipado fuerte y manejo de estado sencillo.


🚀 Instalación #

Agrega esto a tu pubspec.yaml:

dependencies:
  matecitodb_flutter: ^0.0.1

⚡ Quick Start (Provider) #

La mejor forma de usarlo es envolviendo tu MaterialApp con el MatecitoDB_Provider:

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  
  final db = MatecitoDB.createClient('https://miapp.matecito.dev');
  await db.auth.initialize(); // Imprescindible para recuperar sesión
  
  runApp(
    MatecitoDB_Provider(
      db: db,
      child: const MyApp(),
    ),
  );
}

Para acceder al cliente en cualquier widget:

final db = MatecitoDB_Provider.of(context);

📡 Realtime con Streams #

Aprovecha el poder de los StreamBuilder nativos de Flutter:

StreamBuilder<RealtimeEvent>(
  stream: db.from('mensajes').subscribe(),
  builder: (context, snapshot) {
    if (!snapshot.hasData) return const CircularProgressIndicator();
    final event = snapshot.data!;
    return Text('${event.action}: ${event.record['texto']}');
  },
)

🔐 Autenticación #

Persistencia automática mediante shared_preferences.

final res = await db.auth.signIn(email: 'juan@matecito.dev', password: '123');

if (res.hasError) {
  print('Error: ${res.error!.message}');
} else {
  print('Bienvenido ${res.data!.user.name}');
}

📁 Manejo de Archivos e Imágenes #

// Obtener un thumbnail para un widget de imagen
Image.network(
  db.storage.getThumb(
    collection: 'recetas', 
    recordId: 'ID', 
    filename: 'mate.jpg', 
    size: '400x300'
  )
)

// Subir un archivo con Multipart
await db.from('posts').insertWithFile(
  data: {'titulo': 'Mi post'},
  files: [
    MatecitoDB_File(
      field: 'imagen', 
      path: '/path/to/image.jpg', 
      mimeType: 'image/jpeg'
    )
  ],
);

🏗️ Requisitos #

  • Flutter >= 3.0
  • Dart >= 3.0

Hecho con ❤️ por Matecito. 🧉 ¡Disfruta el sabor de una base de datos real!

0
likes
130
points
63
downloads

Documentation

API reference

Publisher

verified publishermatecito.dev

Weekly Downloads

SDK oficial de Matecito para Flutter (BaaS de alto rendimiento).

Homepage

License

MIT (license)

Dependencies

flutter, http, provider, shared_preferences, web_socket_channel

More

Packages that depend on matecitodb_flutter