-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
248 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import 'package:logarte/logarte.dart'; | ||
import 'package:sentry_hive/sentry_hive.dart'; | ||
|
||
import '../constants.dart'; | ||
|
||
_HiveProxyImpl HiveProxy = _HiveProxyImpl(); | ||
List<String> genericBoxes = [settings, notificationBox]; | ||
|
||
class _HiveProxyImpl { | ||
Future<void> put<E>(String box, dynamic key, E value) { | ||
logarte.database( | ||
target: '$key', | ||
value: '$value', | ||
source: box, | ||
); | ||
if (genericBoxes.contains(box)) { | ||
return SentryHive.box(box).put(key, value); | ||
} else { | ||
return SentryHive.box<E>(box).put(key, value); | ||
} | ||
} | ||
|
||
E getOrDefault<E>(String box, dynamic key, {E? defaultValue}) { | ||
if (genericBoxes.contains(box)) { | ||
return SentryHive.box(box).get(key, defaultValue: defaultValue)!; | ||
} else { | ||
return SentryHive.box<E>(box).get(key, defaultValue: defaultValue)!; | ||
} | ||
} | ||
|
||
Future<int> clear<E>(String box) { | ||
if (genericBoxes.contains(box)) { | ||
return SentryHive.box(box).clear(); | ||
} else { | ||
return SentryHive.box<E>(box).clear(); | ||
} | ||
} | ||
|
||
Future<Iterable<int>> addAll<E>(String name, Iterable<E> values) { | ||
return SentryHive.box<E>(name).addAll(values); | ||
} | ||
|
||
Iterable<E> getAll<E>(String name) { | ||
return SentryHive.box<E>(name).values; | ||
} | ||
} | ||
|
||
final Logarte logarte = Logarte( | ||
// Whether to ignore the password | ||
ignorePassword: true, | ||
disableDebugConsoleLogs: true, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.