Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lohanidamodar/flutter_firebase_helpers
Firebase helper library for flutter
https://github.com/lohanidamodar/flutter_firebase_helpers
Last synced: 18 days ago
JSON representation
Firebase helper library for flutter
- Host: GitHub
- URL: https://github.com/lohanidamodar/flutter_firebase_helpers
- Owner: lohanidamodar
- License: mit
- Created: 2020-03-22T09:49:48.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-08-18T09:50:38.000Z (5 months ago)
- Last Synced: 2024-11-29T20:52:42.145Z (about 1 month ago)
- Language: Dart
- Homepage: https://pub.dev/packages/firebase_helpers
- Size: 52.7 KB
- Stars: 10
- Watchers: 2
- Forks: 8
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# firebase_helpers
A package that provides various Google Firebase related services helpers. Provides helpers to perform queries on firestore, firebase auth etc.
![Publish](https://github.com/lohanidamodar/flutter_firebase_helpers/workflows/Publish/badge.svg)
## Getting Started
### Installation
Add to pubspec.yaml:
```yaml
dependencies:
firebase_helpers: latest
```### Using firestore service
```dart
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 data)
: id = id,
title = data['title'],
description = data['description'],
userId = data['user_id'],
createdAt = data['created_at']?.toDate();
Map toMap() => {
"title": title,
"description": description,
"created_at": createdAt,
"user_id": userId,
};
}DatabaseService notesDb = DatabaseService("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
```