flutter confirmation box, flutter call

			new AlertDialog(
                      title:  new Text('服务热线', style: new TextStyle(fontSize: 17.0,fontWeight: FontWeight.bold)),
                      content: new SingleChildScrollView(
                        child: new ListBody(
                          children: <Widget>[
                            new Text('确定拨打'+serviceTel+'吗?', style: new TextStyle(fontSize: 15.0)),
                          ],
                        ),
                      ),
                      actions: <Widget>[
                        new FlatButton(
                          child: new Text('取消'),
                          onPressed: (){
    
    
                            Navigator.of(context).pop();//关闭弹框
                          },
                        ),
                        new FlatButton(
                          child: new Text('拨打'),
                          onPressed: (){
    
    
                            new Center(
                              child: new FlatButton(
                                  onPressed: () => launch("tel://14789166666"),//拨打电话
                                  child: new Text("拨打服务热线")),
                            );
                            Navigator.of(context).pop();//关闭弹框
                          },
                        )
                      ],
                    );

Guess you like

Origin blog.csdn.net/m0_43413873/article/details/108078605