firebase_utilitas 0.0.3 firebase_utilitas: ^0.0.3 copied to clipboard
A package streamlining Firebase tasks: Firestore CRUD operations, file uploads to Firebase Storage, and Firebase Auth functions including email sign-in, registration, password reset, and email verification
Features #
In your pubspec.yaml
dependencies:
firebase_utilitas: ^latest-version
Usage #
calling first class
final fs = FirebaseUtilitas();
Firestore #
add #
await fs.addDataCollection("collection_name", {
"name": "ucup",
"address": "makassar"
});
get data all future #
await fs.getDataCollection("collection_name");
get data all stream #
StreamBuilder<QuerySnapshot<Map<String, dynamic>>>(
stream: fs.getDataStreamCollection("collection_name"),
builder: (context, snapshot) {
final data = snapshot.data!.docs;
ListView.builder(
shrinkWrap: true,
itemCount: data.length,
itemBuilder: (BuildContext context, int index) {
return Column(
children: [
ListTile(
title: Text(data[index]["name"])),
Divider(),
],
);
update data #
await fs.updateDataAllDoc("collection_name", "id", {
"name": "shamil",
"address": "gowa"
});
delete data #
await fs.deleteDoc("collection_name", "id");
Firebase Auth #
register with email and password #
await fs.registerWithEmailAndPassword("email", "password");
sign in with email and password #
await fs.signInWithEmailAndPassword("email", "password");
sign in with email and password #
await fs.resetPassword("email");