lc_firestore_batch 0.1.3 copy "lc_firestore_batch: ^0.1.3" to clipboard
lc_firestore_batch: ^0.1.3 copied to clipboard

A util for firebase batch op

What's for this #

This is a util for firebase batch write.

How to use #

// 📦 Package imports:
import 'package:cloud_firestore/cloud_firestore.dart';

// 🌎 Project imports:
import 'package:lc_firestore_batch/lc_firestore_batch.dart';

void main() async {
  // optional
  setupLcFirebaseBatch(
    setting: LcFirebaseBatchSetting(
      getAuthedUserId: () => 'test.uid',
    ),
  );

  final batch = LcFirestoreBatch();

  batch.create(
    collectionPath: 'test',
    currentChanges: {'date': LcFieldValue.serverTimestamp()},
    docId: '1',
  );
  batch.update(
    collectionPath: 'test',
    docId: '1',
    currentChanges: {'name': 'test'},
  );
  batch.delete(collectionPath: 'test', docId: '1');

  await batch.commit();
}

0
likes
130
points
20
downloads

Publisher

unverified uploader

Weekly Downloads

A util for firebase batch op

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

cloud_firestore, firebase_auth, firebase_core, flutter, json_annotation, lc_utils

More

Packages that depend on lc_firestore_batch