Added the ability to inject a custom Firestore instance for testing purposes
This commit is contained in:
parent
156af9124c
commit
ee7b5748c0
1 changed files with 3 additions and 2 deletions
|
|
@ -15,9 +15,10 @@ import '../models/task_model.dart';
|
||||||
///
|
///
|
||||||
/// Implempents CRUD operations for users, tasks and events.
|
/// Implempents CRUD operations for users, tasks and events.
|
||||||
class FirestoreProvider {
|
class FirestoreProvider {
|
||||||
final Firestore firestore = Firestore.instance;
|
final Firestore firestore;
|
||||||
|
|
||||||
FirestoreProvider() {
|
FirestoreProvider([Firestore firestore])
|
||||||
|
: this.firestore = firestore ?? Firestore.instance {
|
||||||
firestore.settings(timestampsInSnapshotsEnabled: true);
|
firestore.settings(timestampsInSnapshotsEnabled: true);
|
||||||
}
|
}
|
||||||
//-----------------------User related operations------------------------------
|
//-----------------------User related operations------------------------------
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue