Flutter 弹窗

1、showDialog
showDialog:半透明背景弹窗

showDialog(
                                context: context,
                                barrierDismissible: false,
                                builder: (BuildContext context) {
                                  return xxxxx;
                                });

打电话弹窗:
AlertDialog:alert内容
BaseDialog:自定义的

void _showCallPhoneDialog(String phone){
    showDialog(
        context: context,
        barrierDismissible: false,
        builder: (BuildContext context) {
          return AlertDialog(
            title: Text('提示'),
            content: Text('是否拨打:$phone ?'),
            actions: <Widget>[
              FlatButton(
                onPressed: () => NavigatorUtils.goBack(context),
                child: Text('取消'),
              ),
              FlatButton(
                onPressed: (){
                  Utils.launchTelURL(phone);
                  NavigatorUtils.goBack(context);
                },
                textColor: Colours.text_red,
                child: Text('拨打'),
              ),
            ],
          );
        });
  }
打电话

2、showPopupWindow

showPopupWindow(
      context: context,
      fullWidth: false,
      isShowBg: true,
      position: position,
      elevation: 0.0,
      child:xxxx
);

Simulator Screen Shot - iPhone Xʀ - 2019-06-24 at 21.19.17.png

3、底部弹出弹窗

showModalBottomSheet(
      context: context,
      builder: (BuildContext context) {
        return xxxx;
      },
    );
Simulator Screen Shot - iPhone Xʀ - 2019-06-24 at 21.21.21.png
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • ¥开启¥ 【iAPP实现进入界面执行逐一显】 〖2017-08-25 15:22:14〗 《//首先开一个线程,因...
    小菜c阅读 6,684评论 0 17
  • 知道这些后,再也不会“滥用”弹窗了 弹窗的类型有非常多种,所以在使用时很容易被滥用,这样不仅会对用户带来困扰,也会...
    Katie_44bb阅读 1,171评论 0 6
  • 我已经不明白自己,在受伤的时候是希望伤口不再疼,还是希望有人能帮我包扎。 在朋友眼里,我是属于那种经常“失恋”的...
    又坤阅读 324评论 0 4
  • 朋友冯春芳, 要成功,我们首先要做对事。要有一定的精神,有一定的精神就可以帮助到我们,使我们梦想成真。我也认识到,...
    江宏祥阅读 387评论 0 0
  • 《白鹿原》,盛名久闻,一直未读。近日方得阅读,不忍释卷,一气呵成,心绪难平,与诸君分享。 《白鹿原》是中国当代著名...
    悦书明智阅读 192评论 0 1