firebase_backup_restore 0.0.2
firebase_backup_restore: ^0.0.2 copied to clipboard

Flutter plugin for backup and restoring documents in cloud firestore

firebase_backup_restore #

A flutter plugin for backup and restoring firebase cloud documents.

Register with firebase #

  • add firebase_core and cloud_firestore dependencies.

  • for android - Add google-services.json to your android/app folder.

  • for ios - Add GoogleService-info.plist to your ios/Runner folder.

  • Initialize firebase

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();
  runApp(MyApp());
}

Installation #

  • Pub get
firebase_backup_restore: ^0.0.1
  • Import
import 'package:firebase_backup_restore/results.dart';
import 'package:firebase_backup_restore/firebase_backup_restore.dart';
  • Initialize firestore collection list
FirebaseBackupRestore().collections = ['posts', 'users',];

Using #

  • Backup All
await FirebaseBackupRestore().backupAll();
  • Restore All
await FirebaseBackupRestore().restoreAll();
  • Backup specific document
await FirebaseBackupRestore().backup(collectionId: "users");
  • Restore specific document
await FirebaseBackupRestore().restore(collectionId: "users");

Authors #

1
likes
110
pub points
0%
popularity

Publisher

Unknown

Flutter plugin for backup and restoring documents in cloud firestore

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

cloud_firestore, firebase_core, flutter, path_provider

More

Packages that depend on firebase_backup_restore