logError static method
void
logError(
- dynamic error
Implementation
static void logError(dynamic error) {
String message = '${DateTime.now()} - ${error.toString()}\n';
String path = PWConfig.errorLogPath;
Directory(path).createSync();
File('$path/log.txt').writeAsStringSync(message, mode: FileMode.append);
EasyLoading.showToast('Houston, we have a problem!',
duration: const Duration(seconds: 3));
if (kDebugMode) {
print(message);
}
}