Skip to content

Commit ffec135

Browse files
Revert "format: run formatter" (firebase#6753)
1 parent 8bc5494 commit ffec135

File tree

3 files changed

+3
-26
lines changed

3 files changed

+3
-26
lines changed

packages/firebase_database/firebase_database/example/test_driver/firebase_database_e2e.dart

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -100,28 +100,10 @@ void testsMain() {
100100
.child('ordered/one')
101101
.get();
102102
expect(dataSnapshot, isNot(null));
103-
expect(dataSnapshot.key, 'one');
103+
expect(dataSnapshot!.key, 'one');
104104
expect(dataSnapshot.value['ref'], 'one');
105105
expect(dataSnapshot.value['value'], 23);
106106
});
107-
108-
test('DataSnapshot.exists is false for no data', () async {
109-
final dataSnapshot = await FirebaseDatabase.instance
110-
.reference()
111-
.child('a-non-existing-reference')
112-
.get();
113-
114-
expect(dataSnapshot.exists, false);
115-
});
116-
117-
test('DataSnapshot.exists is true for existing data', () async {
118-
final dataSnapshot = await FirebaseDatabase.instance
119-
.reference()
120-
.child('ordered/one')
121-
.get();
122-
123-
expect(dataSnapshot.exists, true);
124-
});
125107
});
126108
}
127109

packages/firebase_database/firebase_database/lib/src/event.dart

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ class Event {
2929
/// A DataSnapshot contains data from a Firebase Database location.
3030
/// Any time you read Firebase data, you receive the data as a DataSnapshot.
3131
class DataSnapshot {
32-
DataSnapshot._(this.key, this.value) {
33-
exists = value != null;
34-
}
32+
DataSnapshot._(this.key, this.value);
3533

3634
factory DataSnapshot._fromJson(
3735
Map<Object?, Object?> _data,
@@ -57,9 +55,6 @@ class DataSnapshot {
5755

5856
/// Returns the contents of this data snapshot as native types.
5957
final dynamic value;
60-
61-
/// Ascertains whether the value exists at the Firebase Database location.
62-
late bool exists;
6358
}
6459

6560
class MutableData {

packages/firebase_database/firebase_database/lib/src/query.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class Query {
8282
Future<DataSnapshot> once() async => (await onValue.first).snapshot;
8383

8484
/// Gets the most up-to-date result for this query.
85-
Future<DataSnapshot> get() async {
85+
Future<DataSnapshot?> get() async {
8686
final result = await _database._channel.invokeMethod<Map<dynamic, dynamic>>(
8787
'Query#get',
8888
<String, dynamic>{

0 commit comments

Comments
 (0)