Record Flutter's solution to the problem that the input box in the pop-up box is blocked

Directly upload the code, copy and paste is available

showModalBottomSheet(
  context: context,
  isScrollControlled: true,
  isDismissible: false, //点击其他位置是否能关闭弹框
  builder: (BuildContext context) {
    return new Container(
      padding: EdgeInsets.only(
          top: 10.0,
          left: 10.0,
          right: 10.0,
          bottom: MediaQuery.of(context).viewInsets.bottom),
      child: SingleChildScrollView(
          child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
Container(
  padding: EdgeInsets.only(top: 15.0,right:10.0,bottom: 20.0,left: 10.0),
  child: Column(
    crossAxisAlignment: CrossAxisAlignment.start,
    children: [
      Text('Amount of fees (yuan):'),
      Container(
        child: TextField(
          controller: moneyController,
          keyboardType: TextInputType.number,
          textAlign: TextAlign.start,
          style: TextStyle(fontSize: 13 ),
          decoration: InputDecoration(
            hintText: 'Please enter the amount',
          ),
        ),
      ),
     
    ],
  ),
)
),
  ),
);

Key codes are marked in red

Guess you like

Origin blog.csdn.net/wxx314165038/article/details/120973891