alertError method Null safety

  1. @override
void alertError(
  1. dynamic e
)
override

Implementation

@override
void alertError(dynamic e) {
  String title = "Error";
  dynamic message = e;

  print("error = ${e.toString()}");

  if (e is Map && message is Map) {
    title = e["code"] ?? "Error";
    message = e["message"] ?? e;
  }

  Flushbar(
    title: title,
    message: message.toString(),
    duration: Duration(seconds: 3),
    flushbarStyle: FlushbarStyle.GROUNDED,
  )..show(this.buildCtx);
}