firebase_helpers 0.7.0 copy "firebase_helpers: ^0.7.0" to clipboard
firebase_helpers: ^0.7.0 copied to clipboard

A package that provides various Google Firebase related services helpers. Provides helpers to perform queries on firestore, firebase auth etc.

firebase_helpers #

A package that provides various Google Firebase related services helpers. Provides helpers to perform queries on firestore, firebase auth etc.

Publish

Getting Started #

Installation #

Add to pubspec.yaml:

dependencies:
  firebase_helpers: latest

Using firestore service #

import 'package:firebase_helpers/firebase_helpers';

class Note {
  final String title;
  final String id;
  final String description;
  final DateTime createdAt;
  final String userId;
  Note({this.title, this.id, this.description, this.createdAt, this.userId});
  Note.fromDS(String id, Map<String, dynamic> data)
      : id = id,
        title = data['title'],
        description = data['description'],
        userId = data['user_id'],
        createdAt = data['created_at']?.toDate();
  Map<String, dynamic> toMap() => {
        "title": title,
        "description": description,
        "created_at": createdAt,
        "user_id": userId,
      };
}

DatabaseService<Note> notesDb = DatabaseService<Note>("notes",fromDS: (id,data) =>  Note.fromDS(id,data), toMap:(note) => note.toMap() );

Note note = Note(
    title: "Hello Note",
    description: "This is notes description",
);
notesDb.createItem(note); //this function will add our note item to the firestore database
15
likes
140
points
99
downloads

Publisher

verified publisherdlohani.com.np

Weekly Downloads

A package that provides various Google Firebase related services helpers. Provides helpers to perform queries on firestore, firebase auth etc.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

cloud_firestore, firebase_storage, flutter

More

Packages that depend on firebase_helpers