void _openModalSheet() async{
return showModalBottomSheet(
context: context,
builder: (BuildContext context){
return Form(
child: Padding(
padding: const EdgeInsets.all(25),
child: Column(
children: [
TextFormField(
decoration: const InputDecoration(
border: OutlineInputBorder()
),
),
const SizedBox(height: 20),
TextFormField(
decoration: const InputDecoration(
border: OutlineInputBorder()
),
)
],
),
),
);
}
);
}
I created this basic function to open a modal bottom sheet and it works fine on device as well as on simulator.
Row(
children: [
Expanded(
flex: 1,
child: Padding(
padding: EdgeInsets.only(left: 5.0,right: 5.0),
child: TextFormField(
controller: commentController,
validator: (String value){
if(value.isEmpty){
// ignore: missing_return
return 'Comment cannot be blank.';
}
},
decoration: InputDecoration(
labelText: "Comment",
labelStyle: TextStyle(
fontFamily: 'Montserrat',
fontWeight: FontWeight.bold,
color: Colors.grey),
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Colors.green))),
),
),
),
],
),