papai_cloud_firestore_api 0.0.1 copy "papai_cloud_firestore_api: ^0.0.1" to clipboard
papai_cloud_firestore_api: ^0.0.1 copied to clipboard

Dependency injection pattern

Create firebase cloud firestore instance with either real cloud firestore or mock firestore

Usage #

see/test folder and /example folder.

Use apai_cloud_firestore_api.dart with dependency injection pattern.

First you create a class, than require a class of abstract CloudFireStore

class MyRepository{ const MyRepo({required this.instance}); final CloudFireStore instance;

...
copied to clipboard

}

Now you can use MyRepository class with CloudFirestore instance in your application by calling final myRepo = MyRepository(instance: FireBaseCloudFireStoreAPI());

ANd you can use FakeFirebaseFirestore instance in your unit test by calling final myRepo = MyRepository(instance: FakeFireBaseCloudFireStoreAPI());

0
likes
120
points
24
downloads

Publisher

unverified uploader

Weekly Downloads

2024.07.08 - 2025.01.20

Dependency injection pattern

Documentation

API reference

License

unknown (license)

Dependencies

cloud_firestore, fake_cloud_firestore, flutter

More

Packages that depend on papai_cloud_firestore_api