Skip to content

Commit 58edb7c

Browse files
committed
fix static analysis issues
1 parent a9f4966 commit 58edb7c

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

lib/src/store.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ class Store {
130130

131131
/// Return an existing SyncClient associated with the store or null if not available.
132132
/// See [Sync.client()] to create one first.
133-
SyncClient syncClient() => SyncClientsStorage[this];
133+
SyncClient syncClient() => syncClientsStorage[this];
134134

135135
/// The low-level pointer to this store.
136136
Pointer<Void> get ptr => _cStore;

lib/src/sync.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class SyncClient {
9999
void close() {
100100
final err = bindings.obx_sync_close(_cSync);
101101
_cSync = nullptr;
102-
SyncClientsStorage.remove(_store);
102+
syncClientsStorage.remove(_store);
103103
StoreCloseObserver.removeListener(_store, this);
104104
syncOrObserversExclusive.unmark(_store);
105105
checkObx(err);
@@ -233,12 +233,12 @@ class Sync {
233233
/// Make sure the SyncClient is not destroyed and thus synchronization can keep running in the background.
234234
static SyncClient client(
235235
Store store, String serverUri, SyncCredentials creds) {
236-
if (SyncClientsStorage.containsKey(store)) {
236+
if (syncClientsStorage.containsKey(store)) {
237237
throw Exception('Only one sync client can be active for a store');
238238
}
239239
syncOrObserversExclusive.mark(store);
240240
final client = SyncClient(store, serverUri, creds);
241-
SyncClientsStorage[store] = client;
241+
syncClientsStorage[store] = client;
242242
StoreCloseObserver.addListener(store, client, client.close);
243243
return client;
244244
}

lib/src/util.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class StoreCloseObserver {
4141
}
4242

4343
/// Global internal storage of sync clients - one client per store.
44-
final Map<Store, SyncClient> SyncClientsStorage = {};
44+
final Map<Store, SyncClient> syncClientsStorage = {};
4545

4646
// Currently, either SyncClient or Observers can be used at the same time.
4747
// TODO: lift this condition after #142 is fixed.

test/sync_test.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void main() {
4141
test('Model Entity has sync enabled', () {
4242
final model = getObjectBoxModel().model;
4343
final entity =
44-
model.entities.firstWhere((ModelEntity e) => e.name == "TestEntity");
44+
model.entities.firstWhere((ModelEntity e) => e.name == 'TestEntity');
4545
expect(entity.hasFlag(OBXEntityFlag.SYNC_ENABLED), isTrue);
4646
});
4747

@@ -70,11 +70,11 @@ void main() {
7070
final error = throwsA(predicate((Exception e) => e.toString().contains(
7171
'Using observers/query streams in combination with SyncClient is currently not supported')));
7272

73-
SyncClient c = createClient(store);
73+
createClient(store);
7474
expect(() => env.box.query().build().findStream(), error);
7575
});
7676
});
77-
77+
7878
test('SyncClient lifecycle', () {
7979
expect(store.syncClient(), isNull);
8080

0 commit comments

Comments
 (0)