Flutter-渲染模态后,在showModalBottomSheet上更改enableDrag和isDismissible

时间:2020-05-14 14:31:19

标签: flutter dart flutter-showmodalbottomsheet

我想更改showModalBottomSheet所处的状态。特别是在true / false之间更改enableDrag和isDismissible,而不显示新的模式或替换已经呈现的模式。目前有可能吗?

bool allowDismiss = false; // change this variable after render

showModalBottomSheet(
          context: context,
          isScrollControlled: true,
          isDismissible: allowDismiss, 
          enableDrag: allowDismiss,
          shape: RoundedRectangleBorder(
            borderRadius:
                BorderRadius.only(topLeft: Radius.circular(30), topRight: Radius.circular(30)),
          ),
          builder: (context) => Container(height: 400),
        )

0 个答案:

没有答案