-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdb_service_if.dart
68 lines (52 loc) · 1.53 KB
/
db_service_if.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_core/firebase_core.dart';
abstract class DBRef
{
Future<void> set(Map<String, dynamic> map, {String? path});
Future<void> update(Map<String, dynamic> map, {String? path});
DBRef getChild(String? path);
DBSubscription subscribe(Function onUpdate);
String get id;
}
abstract class DBDataSnapshot
{
DBDataSnapshot(Future<QuerySnapshot<Map<String, dynamic>>> future);
set isNotEmpty(bool val);
bool get isNotEmpty;
List<Map<String, dynamic>> get data;
List<DBRef> get references;
}
abstract class DBQuery{
Future<DBDataSnapshot> result();
DBRef resultRef();
}
abstract class DBSubscription
{
Future<void> unsubscribe();
}
abstract class DBField
{
}
abstract class DBService
{
void Init(FirebaseApp app) ;
DBRef GetRef(String path);
DBRef GetChild(DBRef ref, String child);
dynamic Read(dynamic ref);
DBSubscription Subscribe(DBRef ref, Function onUpdate);
DBQuery query(DBRef ref, Object field, {
Object? isEqualTo,
Object? isNotEqualTo,
Object? isLessThan,
Object? isLessThanOrEqualTo,
Object? isGreaterThan,
Object? isGreaterThanOrEqualTo,
Object? arrayContains,
List<Object?>? arrayContainsAny,
List<Object?>? whereIn,
List<Object?>? whereNotIn,
bool? isNull,
}) ;
dynamic arrayCombine(List<dynamic> vals, {List<dynamic>? current});
Future<void> set(DBRef ref, Map<String, dynamic> map);
}