show static method

dynamic show({
  1. dynamic msg = "加载中",
})

Implementation

static show({msg = "加载中"}) {
  if (_index > 0) {
    return;
  }

  timerTread();
  isLoading = true;

  showDialog(
      context: navGK.currentContext!,
      barrierDismissible: false,
      barrierColor: Colors.transparent,
      builder: (context) {
        return Material(
          type: MaterialType.transparency,
          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, 0.3),
                ),
                padding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 4),
                width: 90.0,
                height: 90.0,
                alignment: Alignment.center,
                child: new Wrap(
                  crossAxisAlignment: WrapCrossAlignment.center,
                  children: <Widget>[
                    new Container(
                      width: double.infinity,
                      alignment: Alignment.center,
                      child: new Image.asset(icon, package: package),
                    ),
                    new Padding(
                      padding: EdgeInsets.only(top: 10),
                      child: new Center(
                        child: new Text(
                          msg,
                          style: TextStyle(color: Colors.white),
                          maxLines: 3,
                        ),
                      ),
                    ),
                  ],
                ),
              )
            ],
          ),
        );
      });
}