String _prevText =
await Provider.of<FirebaseDataProvider>(context, listen: false)
.getMarquee();
TextEditingController _marqueeController =
TextEditingController(text: _prevText);
return showBarModalBottomSheet(
context: context,
expand: true,
builder: (BuildContext context, ScrollController scrollController) {
return Material(
child: Container(
// height: MediaQuery.of(context).size.height * 0.3,
color: Theme.of(context).colorScheme.primary,
child: Padding(
padding: const EdgeInsets.all(12.0),
child: ListView(
controller: scrollController,
shrinkWrap: true,
children: <Widget>[
AutoSizeText(
title,
style: TextStyle(
color: Theme.of(context).colorScheme.onPrimary),
),
TextField(
decoration: InputDecoration(hintText: 'escribe aquí'),
controller: _marqueeController,
autofocus: true,
),
FlatButton(
color: Colors.green,
child: AutoSizeText(
'OK',
style: TextStyle(color: Colors.white),
),
onPressed: () {
Provider.of<FirebaseDataProvider>(context,
listen: false)
.setMarquee(_marqueeController.text);
Navigator.of(context).pop();
},
),
FlatButton(
color: Colors.red,
child: AutoSizeText(
'Cancelar',
style: TextStyle(color: Colors.white),
),
onPressed: () {
Navigator.of(context).pop();
},
),
],
),
),
),
);
});
}
}
So right now I have to fix the height to mediaquery * 0.6 so that keyboard does not interfere with textfileld inside the modal sheet. But I would really like for the size to change depending on the keyboard size.