I want to create a form inside a pop-up with flutter like the image below: popup
Using the rflutter_alert plugin rflutter_alert
You must add the library as a dependency to your project.
dependencies:
rflutter_alert: ^1.0.3
To open a popup, Let’s to be a function and do the following:
_openPopup(context) {
Alert(
context: context,
title: "LOGIN",
content: Column(
children: [
TextField(
decoration: InputDecoration(
icon: Icon(Icons.account_circle),
labelText: 'Username',
),
),
TextField(
obscureText: true,
decoration: InputDecoration(
icon: Icon(Icons.lock),
labelText: 'Password',
),
),
],
),
buttons: [
DialogButton(
onPressed: () => Navigator.pop(context),
child: Text(
"LOGIN",
style: TextStyle(color: Colors.white, fontSize: 20),
),
)
]).show();
}
And call it this way
onPressed: () {
_openPopup(context),
}