showPopupBasic method

dynamic showPopupBasic(
  1. dynamic context,
  2. Widget w
)

Implementation

showPopupBasic(context, Widget w) {
  myLogAll('showPopupBasic');
  /*Navigator.of(context)
      .pushNamedAndRemoveUntil('/', (Route<dynamic> route) => false);*/
  int backcolor = Colors.white.value;
  showModalBottomSheet(
      context: context,
      builder: (context) {
        final double screenHeight = MediaQuery.of(context).size.height;
        var screenPadding = MediaQuery.of(context).viewPadding;
        final double scrollHeight =
            (screenHeight - screenPadding.top - kToolbarHeight) * 0.7;
        return SafeArea(
          child: Padding(
            padding: const EdgeInsets.all(8.0),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.stretch,
              children: [
//取消按钮
                //添加个点击事件
                InkWell(
                  onTap: () {
                    Navigator.of(context).pop();
                  },
                  child: Center(
                    child: MyLabel(const {
                      gLabel: gClose,
                    }, backcolor),
                  ),
                ),
                const Divider(),
                Container(
                  constraints: BoxConstraints(maxHeight: scrollHeight),
                  child: SingleChildScrollView(
                    physics: const ClampingScrollPhysics(),
                    child: w,
                  ),
                ),
              ],
            ),
          ),
        );
      });
}