Home > Net >  In FlutterFlow site, how can I add TextField in AlertDialog action?
In FlutterFlow site, how can I add TextField in AlertDialog action?

Time:08-11

In FlutterFlow site, how can I add TextField in AlertDialog action?

enter image description here

CodePudding user response:

You can use showDialog like this

 void openPostSaleDialog() {
    FocusScope.of(context).requestFocus(FocusNode());
    showDialog(
      context: context,
      barrierDismissible: false,
      builder: (BuildContext context) => Column(
        children: [
          TextFormField()
        ],
      ),
    );
  }

CodePudding user response:

you can add AlertDialog widget , so you can have more control over the widget

void showAlertDialogBox() {
  showDialog(
     barrierDismissible: true,
     context: context,
     builder: (BuildContext context) {
     return AlertDialog(
           shape: RoundedRectangleBorder(
           borderRadius: BorderRadius.circular(12),
           ),
           contentPadding: EdgeInsets.zero,
           clipBehavior: Clip.antiAlias,
           content: Container(  
                    height: 200,
                    width: 200,
                    child: Column(
                    children: [
                    TextFormField()
                  ]
               )
           )
     });
  }

  • Related