showError static method

dynamic showError({
  1. dynamic msg,
})

错误提示语

Implementation

static showError({msg}) {
  if (_index > 0 || msg == null) {
    return;
  }

  timerTread(1);
  isLoading = true;

  showDialog(
    context: navGK.currentContext!,
    barrierDismissible: false,
    barrierColor: Colors.transparent,
    builder: (context) {
      return Material(
        type: MaterialType.transparency,
        child: SizedBox(
          width: MediaQuery.of(context).size.width,
          height: MediaQuery.of(context).size.height,
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              new Container(
                decoration: BoxDecoration(
                  borderRadius:
                      new BorderRadius.all(new Radius.circular(4.0)),
                  color: Color.fromRGBO(0, 0, 0, 1),
                ),
                constraints: BoxConstraints(
                  maxWidth: MediaQuery.of(context).size.width - 20,
                ),
                padding: EdgeInsets.symmetric(horizontal: 12, vertical: 10),
                child: new Text(
                  msg,
                  style: TextStyle(color: Colors.white),
                  maxLines: 2,
                ),
              )
            ],
          ),
        ),
      );
    },
  );
}