Fix event modal position

This commit is contained in:
Michael Thomas 2022-09-03 14:46:24 -04:00
parent 1c7f353e5f
commit 373004f52a
1 changed files with 3 additions and 5 deletions

View File

@ -35,12 +35,12 @@ class _EventModalState extends State<_EventModal> {
void updateMaxHeight() { void updateMaxHeight() {
if (_parentConstraints != null) { if (_parentConstraints != null) {
print(_key.currentContext?.size?.height);
var listHeight = _key.currentContext?.size?.height; var listHeight = _key.currentContext?.size?.height;
var parentHeight = _parentConstraints?.maxHeight; var parentHeight = _parentConstraints?.maxHeight;
if (listHeight != null && parentHeight != null) { if (listHeight != null && parentHeight != null) {
var maxHeight = (listHeight + 50) / parentHeight;
setState(() { setState(() {
_maxChildHeight = (listHeight + 150) / parentHeight; _maxChildHeight = (maxHeight < 0.75) ? maxHeight : 0.75;
}); });
} }
} }
@ -71,8 +71,6 @@ class _EventModalState extends State<_EventModal> {
builder: (_, controller) { builder: (_, controller) {
return Container( return Container(
color: Colors.grey.shade100, color: Colors.grey.shade100,
margin: const EdgeInsets.only(
bottom: kBottomNavigationBarHeight),
child: Column( child: Column(
children: [ children: [
const Align( const Align(
@ -119,7 +117,7 @@ class _EventModalContent extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ListView( return ListView(
shrinkWrap: true, shrinkWrap: true,
padding: const EdgeInsets.symmetric(horizontal: 40), padding: const EdgeInsets.only(left: 40, right: 40, bottom: 40),
controller: controller, controller: controller,
children: <Widget>[ children: <Widget>[
// Title // Title