fb_firestore 1.0.0 copy "fb_firestore: ^1.0.0" to clipboard
fb_firestore: ^1.0.0 copied to clipboard

discontinuedreplaced by: cloud_firestore

A Flutter project to use Firebase Cloud Firestore on Mobile and Web

fb_firestore #

Flutter Web, iOS and Android Cloud Firestore Plugin.

This package is now deprecated and was originally created to add firebase on the desktop and web. You can now use the FlutterFire packages to do anything this plugin could.

Getting Started #

For Auth Use: https://pub.dev/packages/fb_auth

Follow Installation Instructions for Web: https://pub.dev/packages/firebase

Update /web/index.html in the body tag.

<!-- The core Firebase JS SDK is always required and must be listed first -->
  <script src="https://www.gstatic.com/firebasejs/6.3.3/firebase-app.js"></script>

  <!-- TODO: Add SDKs for Firebase products that you want to use
      https://firebase.google.com/docs/web/setup#config-web-app -->
  <script src="https://www.gstatic.com/firebasejs//6.3.3/firebase-auth.js"></script>
  <script src="https://www.gstatic.com/firebasejs/6.3.3/firebase-firestore.js"></script>
  <script src="https://www.gstatic.com/firebasejs/6.3.3/firebase-storage.js"></script>
  <script src="https://www.gstatic.com/firebasejs/6.3.3/firebase-functions.js"></script>

  <script>
    // Your web app's Firebase configuration
    var firebaseConfig = {
      apiKey: "API_KEY",
      authDomain: "AUTH_DOMAIN",
      databaseURL: "DATABASE_URL",
      projectId: "PROJECT_ID",
      storageBucket: "STORAGE_BUCKET",
      messagingSenderId: "MESSAGING_SENDER_ID",
      appId: "APP_ID"
    };
    // Initialize Firebase
    firebase.initializeApp(firebaseConfig);
  </script>

Follow Installation Instructions for Mobile: https://pub.dev/packages/cloud_firestore

  • Update ios/Runner and add the GoogleService-Info.plist downloaded from firebase

  • Update android/app and add the google-services.json downloaded from firebase

  • Update android/build.gradle and update the classpath:

    classpath 'com.google.gms:google-services:4.2.0'

API #

Get a list from a collection:

FbFirestore.getDocs('users');

Get a doc from a collection:

FbFirestore.getDoc('users/${userId}');

Edit doc in a collection: (id required)

FbFirestore.editDoc('users/${userId}', {
    "name" : "Flutter"
    },
    update: true // Update Only Specific Fields If Doc Exists
);

Add a new doc to a collection:

FbFirestore.addDoc('users',{
    "name" : "Flutter"
});

Delete a doc from a collection:

FbFirestore.deleteDoc('users/${userId}');
0
likes
40
pub points
0%
popularity

Publisher

unverified uploader

A Flutter project to use Firebase Cloud Firestore on Mobile and Web

Homepage
Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

cloud_firestore, firebase, flutter

More

Packages that depend on fb_firestore