Skip to content

ShehanYjoz/firebase_backup_restore

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 56.9%
  • HTML 12.5%
  • Ruby 12.0%
  • Kotlin 9.2%
  • Swift 5.1%
  • Objective-C 4.3%