Code as below example
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
floatingActionButton: FloatingActionButton(
child: Icon(Icons.add),
backgroundColor: Theme.of(context).accentColor,
onPressed: () {
showDialog(
context: context,
builder: (_) => SimpleDialog(
contentPadding:
EdgeInsets.symmetric(horizontal: 25, vertical: 20),
backgroundColor: Colors.grey[800],
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
title: Row(
children: [
Text(
"Add Todo",
style: TextStyle(
fontSize: 20,
color: Colors.white,
),
),
Spacer(),
IconButton(
onPressed: () {
Navigator.pop(context);
},
icon: Icon(
Icons.cancel,
color: Colors.grey,
size: 30,
),
),
],
),
children: [
Divider(),
TextFormField(
style:
TextStyle(fontSize: 18, height: 1.5, color: Colors.white),
autofocus: true,
decoration: InputDecoration(
hintText: "eg. exercise",
hintStyle: TextStyle(
color: Colors.white70,
),
border: InputBorder.none,
),
),
SizedBox(
height: 20,
),
SizedBox(
width: MediaQuery.of(context).size.width,
height: 50,
child: ElevatedButton(
onPressed: () {},
child: Text("Add"),
style: ElevatedButton.styleFrom(
primary: Theme.of(context).primaryColor,
onPrimary: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
),
),
)
],
),
);
},
),
End
⊙^⊙ Thank For Reading | Happy Coding ⊙-⊙
Setapp on Mac invite link flutterkage2k
The referrer gets a free month, up to a maximum of six months, for each friend who creates an account and signs in on their Mac.
If it helps, buy me a cup of coffee.