import 'package:flutter/material.dart'; void test(BuildContext context) { final _scrollController = ScrollController(); showModalBottomSheet( context: context, isScrollControlled: true, backgroundColor: Colors.transparent, builder: (sheetContext) { final bottomInset = MediaQuery.of(context).viewInsets.bottom; return Container( constraints: BoxConstraints( maxHeight: MediaQuery.of(context).size.height * 0.92 - bottomInset, ), decoration: const BoxDecoration( color: Colors.white, borderRadius: BorderRadius.vertical(top: Radius.circular(24)), ), child: Column( children: [ Container( margin: const EdgeInsets.only(top: 12), width: 40, height: 4, decoration: BoxDecoration( color: Colors.grey, borderRadius: BorderRadius.circular(4), ), ), Expanded( child: SingleChildScrollView( controller: _scrollController, padding: EdgeInsets.fromLTRB(16, 8, 16, 16 + bottomInset), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ TextField(decoration: InputDecoration(labelText: 'Test 1')), TextField(decoration: InputDecoration(labelText: 'Test 2')), TextField(decoration: InputDecoration(labelText: 'Test 3')), ], ), ), ), ], ), ); }, ); }