logError method

void logError({
  1. required String message,
  2. bool toast = false,
})

Implementation

void logError({
  required final String message,
  final bool toast = false,
}) async {
  await Future.delayed(const Duration(milliseconds: 50));
  if (toast) {
    Fluttertoast.showToast(msg: message);
    return;
  }
  // ignore: use_build_context_synchronously
  Flushbar(
    icon: const Icon(
      Icons.priority_high_rounded,
      color: PeamanColors.white,
    ),
    backgroundColor: PeamanColors.red,
    message: message,
    padding: const EdgeInsets.all(15.0),
    duration: const Duration(seconds: 2),
  ).show(context);
}