feat: make sentry logging optional.

This commit is contained in:
Aunali321
2022-10-15 01:52:10 +05:30
parent f1261398e9
commit 6d35c47b6b
6 changed files with 74 additions and 3 deletions

View File

@ -82,6 +82,15 @@ class ManagerAPI {
await _prefs.setBool('useDarkTheme', value);
}
bool isSentryEnabled() {
return _prefs.getBool('sentryEnabled') ?? true;
}
Future<void> setSentryStatus(bool value) async {
await _prefs.setBool('sentryEnabled', value);
print('Sentry status: $value');
}
List<PatchedApplication> getPatchedApps() {
List<String> apps = _prefs.getStringList('patchedApps') ?? [];
return apps.map((a) => PatchedApplication.fromJson(jsonDecode(a))).toList();

View File

@ -20,4 +20,15 @@ class Toast {
gravity: t.ToastGravity.CENTER,
);
}
void showBottom(String text) {
t.Fluttertoast.showToast(
msg: FlutterI18n.translate(
_fToast.context!,
text,
),
toastLength: t.Toast.LENGTH_LONG,
gravity: t.ToastGravity.BOTTOM,
);
}
}