英文:
Flutter / modal_bottom_sheet - constrain width?
问题
我正在审查Flutter的'modal_bottom_sheet'包,并想知道是否有一种方法可以设置模态底部表的最大宽度?
在我的情况下,这是一个Web应用程序,所以我不希望弹出模态框占用整个浏览器的宽度。
英文:
I'm reviewing the Flutter 'modal_bottom_sheet' package, and I'm wondering if there is a way to set the maximum width of a modal bottom sheet?
In my case, this is a web app, so I don't want the popup modal to take the full browser width
答案1
得分: 0
尝试设置约束
    showModalBottomSheet(
      context: context,
      constraints: BoxConstraints(
         maxWidth: 500              
      ),
      builder: 
    )
英文:
Try to set a constraint
showModalBottomSheet(
  context: context,
  constraints: BoxConstraints(
     maxWidth: 500              
  ),
  builder: 
)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论