Flutter中的“列”内的“警报对话框”

时间:2020-08-16 07:42:56

标签: flutter dart

enter image description here,在我的应用程序中,用户必须提交其政府ID以进行验证,才能继续使用该应用程序。根据条件“ isIDverified”,它显示文本“ Verified”,或者如果它正在审核中,则显示“ Under Review”。在经过验证的条件内,我想弹出一个窗口,显示“您的帐户正在审核中”以及此绿色空白区域周围的文字。

我的代码:

    if (isIDVerified) {
      return Row(
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          Text(
            'Verified',
            style: kAppBarTitleTextStyle.copyWith(color: primaryColor),
          ),
          SizedBox(
            width: _screenUtil.setWidth(10),
          ),
          Icon(
            Icons.verified_user,
            size: kPreferredIconSize,
            color: Colors.green,
          ),
        ],
      );
    } else if (isIDUnderReview) {
      return
        Text(
        'ID Under Review',
        style: kAppBarTitleTextStyle.copyWith(color: primaryColor),
        
      );

1 个答案:

答案 0 :(得分:0)

据我了解您的问题,我想回答一下。
要显示弹出窗口,可以使用AlertDialogs。
你可以做这样的事情。

void informUser() {
    
    showDialog(
      context: context,
      builder: (BuildContext context) {
          return AlertDialog(
             title: new Text("Under Review"),
             content: Column(
                 children: [ LIST OF WIDGETS ]
             ),
             actions: <Widget>[
               new FlatButton(
                  child: new Text("Close"),
                  onPressed: () {
                         Navigator.of(context).pop();
                  },
                ),
             ],
          );
        },
     );

  }

您可以将小部件放在Column的{​​{1}}的{​​{1}}小部件中。