Skip to content

Latest commit

 

History

History
 
 

firestore_flutter

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Github Actions CI

Introduction

This package enables you to connect database (a vendor-agnostic database API with many adapters) to Google Cloud Firestore.

This package requires Flutter (iOS / Android) because the package relies on cloud_firestore. The package database_adapter_firestore_browser can be used in any browser application.

Links

Getting started

1.Add dependency

dependencies:
  database: any
  database_adapter_firestore_flutter: any

2.Configure the plugin

Follow instructions for cloud_firestore:

3.Configure database

import 'package:database/database.dart';
import 'package:database_adapter_firestore_flutter/database_adapter_firestore_flutter.dart';

Database getDatabase() {
  return FirestoreFlutter().database();
}

Future main() async {
  final database = getDatabase();
  final document = await database.collection('greetings').insert({
    'greeting': 'Hello world!',
  });
}

Read more about database.dart API.