Enable analysis.Update dependencies.Update README

This commit is contained in:
LollipopKit
2021-10-31 15:21:23 +08:00
parent 702dd86a84
commit 9f3f07388e
5 changed files with 18 additions and 50 deletions

View File

@@ -6,14 +6,7 @@ class Analysis {
static const _url = 'https://countly.xuty.cc';
static const _key = '80372a2a66424b32d0ac8991bfa1ef058bd36b1f';
static bool _enabled = false;
static Future<void> init(bool debug) async {
if (_url.isEmpty || _key.isEmpty) {
return;
}
_enabled = true;
await Countly.setLoggingEnabled(debug);
await Countly.init(_url, _key);
await Countly.start();
@@ -22,12 +15,10 @@ class Analysis {
}
static void recordView(String view) {
if (!_enabled) return;
Countly.recordView(view);
}
static void recordException(Object exception, [bool fatal = false]) {
if (!_enabled) return;
Countly.logException(exception.toString(), !fatal, null);
}
}